Skip to content

Commit

Permalink
customer item reporting (#230)
Browse files Browse the repository at this point in the history
* feat(customer-item.service): add generate report method

* 0.20.7

* feat(customer-item.service): add creationTime filtering

* 0.20.8

* feat(customer-item-reports): remove handout argument

* 0.20.9

* feat(customer-item-reports): update api

* 0.20.10
  • Loading branch information
AdrianAndersen authored Jul 2, 2024
1 parent cf48729 commit 1a2cf7b
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@boklisten/bl-connect",
"version": "0.20.6",
"version": "0.20.10",
"license": "MIT",
"scripts": {
"dev": "yarn serve",
Expand Down
27 changes: 21 additions & 6 deletions src/app/document-services/customer-item/customer-item.service.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,32 @@
import { Injectable } from "@angular/core";
import { CustomerItem } from "@boklisten/bl-model";
import { ApiService } from "../../api/api.service";
import { BL_CONFIG } from "../../bl-connect/bl-config";
import {
CachedDocumentService,
CachedDocumentServiceOptions,
} from "../../document/cached-document.service";
import { CachedDocumentService } from "../../document/cached-document.service";
import { BlDocumentService } from "../../document/bl-document.service";
import { ApiService } from "../../api/api.service";

@Injectable()
export class CustomerItemService extends BlDocumentService<CustomerItem> {
constructor(private cachedDocumentService: CachedDocumentService) {
constructor(
private cachedDocumentService: CachedDocumentService,
private _apiService: ApiService
) {
super(cachedDocumentService);
this.setCollection(BL_CONFIG.collection.customerItem);
}

public async generateCustomerItemReport(options: {
branchFilter?: string[];
createdAfter?: Date;
createdBefore?: Date;
returned: boolean;
buyout: boolean;
}): Promise<unknown[]> {
return (
await this._apiService.add(
BL_CONFIG.collection.customerItem + "/generate-report",
options
)
).data;
}
}

0 comments on commit 1a2cf7b

Please sign in to comment.