label: string;
}
+export interface HoldingsSummary {
+ org_unit: number;
+ depth: number;
+ unshadow: number;
+ count: number;
+ available: number;
+ transcendant: number;
+}
+
export class BibRecordSummary {
id: number; // == record.id() for convenience
metabibId: number; // If present, this is a metabib summary
record: IdlObject;
display: any;
attributes: any;
- holdingsSummary: any;
+ holdingsSummary: HoldingsSummary[];
+ prefOuHoldingsSummary: HoldingsSummary[];
holdCount: number;
bibCallNumber: string;
+ firstCallNumber: string;
net: NetService;
displayHighlights: {[name: string]: string | string[]} = {};
eResourceUrls: EResourceUrl[] = [];
+ copies: any[];
constructor(record: IdlObject, orgId: number, orgDepth?: number) {
this.id = Number(record.id());
return this.getBibSummaries([id], orgId, isStaff);
}
- getBibSummaries(bibIds: number[],
- orgId?: number, isStaff?: boolean): Observable<BibRecordSummary> {
+ getBibSummaries(bibIds: number[], orgId?: number,
+ isStaff?: boolean, options?: any): Observable<BibRecordSummary> {
if (bibIds.length === 0) { return from([]); }
if (!orgId) { orgId = this.org.root().id(); }
let method = 'open-ils.search.biblio.record.catalog_summary';
if (isStaff) { method += '.staff'; }
- return this.net.request('open-ils.search', method, orgId, bibIds)
+ return this.net.request('open-ils.search', method, orgId, bibIds, options)
.pipe(map(bibSummary => {
const summary = new BibRecordSummary(bibSummary.record, orgId);
summary.net = this.net; // inject
summary.holdCount = bibSummary.hold_count;
summary.holdingsSummary = bibSummary.copy_counts;
summary.eResourceUrls = bibSummary.urls;
+ summary.copies = bibSummary.copies;
+ summary.firstCallNumber = bibSummary.first_call_number;
+ summary.prefOuHoldingsSummary = bibSummary.pref_ou_copy_counts;
+
return summary;
}));
}
getMetabibSummaries(metabibIds: number[],
- orgId?: number, isStaff?: boolean): Observable<BibRecordSummary> {
+ orgId?: number, isStaff?: boolean, options?: any): Observable<BibRecordSummary> {
if (metabibIds.length === 0) { return from([]); }
if (!orgId) { orgId = this.org.root().id(); }
let method = 'open-ils.search.biblio.metabib.catalog_summary';
if (isStaff) { method += '.staff'; }
- return this.net.request('open-ils.search', method, orgId, metabibIds)
+ return this.net.request('open-ils.search', method, orgId, metabibIds, options)
.pipe(map(metabibSummary => {
const summary = new BibRecordSummary(metabibSummary.record, orgId);
summary.net = this.net; // inject
summary.attributes = metabibSummary.attributes;
summary.holdCount = metabibSummary.hold_count;
summary.holdingsSummary = metabibSummary.copy_counts;
+ summary.copies = metabibSummary.copies;
+ summary.firstCallNumber = metabibSummary.first_call_number;
+ summary.prefOuHoldingsSummary = metabibSummary.pref_ou_copy_counts;
+
return summary;
}));
}