mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-10 19:52:53 +00:00
39 lines
948 B
TypeScript
39 lines
948 B
TypeScript
import {Component, Input} from '@angular/core';
|
|
import {PAIAFee} from '../../../types';
|
|
import {SCArticle, SCBook, SCPeriodical} from '@openstapps/core';
|
|
import {LibraryAccountService} from '../../library-account.service';
|
|
|
|
@Component({
|
|
selector: 'stapps-fee-item',
|
|
templateUrl: './fee-item.html',
|
|
styleUrls: ['./fee-item.scss'],
|
|
})
|
|
export class FeeItemComponent {
|
|
_fee: PAIAFee;
|
|
|
|
book?: SCBook | SCPeriodical | SCArticle;
|
|
|
|
hasEdition = false;
|
|
|
|
@Input()
|
|
set fee(fee: PAIAFee) {
|
|
this.hasEdition = !fee.edition?.includes('null');
|
|
this._fee = fee;
|
|
if (this.hasEdition) {
|
|
this.libraryAccountService
|
|
.getDocumentFromHDS(fee.edition as string)
|
|
.then(book => {
|
|
this.book = book;
|
|
});
|
|
}
|
|
}
|
|
|
|
get fee() {
|
|
return this._fee;
|
|
}
|
|
|
|
propertiesToShow: (keyof PAIAFee)[] = ['about', 'date', 'amount'];
|
|
|
|
constructor(private readonly libraryAccountService: LibraryAccountService) {}
|
|
}
|