diff --git a/package.json b/package.json index 5b50f55..9937e38 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@boklisten/bl-connect", - "version": "0.19.21", + "version": "0.20.6", "license": "MIT", "scripts": { "dev": "yarn serve", diff --git a/public_api.ts b/public_api.ts index ff3401f..e247ce7 100644 --- a/public_api.ts +++ b/public_api.ts @@ -28,7 +28,7 @@ export * from "./src/app/document-services/user-detail/user-detail.service"; export * from "./src/app/document-services/company/company.service"; -export * from "./src/app/document-services/match/match.service"; +export * from "./src/app/matches/match.service"; export * from "./src/app/document-services/unique-item/unique-item.service"; diff --git a/src/app/bl-connect/bl-connect.module.ts b/src/app/bl-connect/bl-connect.module.ts index e679bbc..75b6b6c 100644 --- a/src/app/bl-connect/bl-connect.module.ts +++ b/src/app/bl-connect/bl-connect.module.ts @@ -32,10 +32,10 @@ import { OrderPdfService } from "../order-pdf/order-pdf.service"; import { MessageService } from "../document-services/message/message.service"; import { InvoiceService } from "../document-services/invoice/invoice.service"; import { CompanyService } from "../document-services/company/company.service"; -import { MatchService } from "../document-services/match/match.service"; import { BookingService } from "../document-services/booking/booking.service"; import { UniqueItemService } from "../document-services/unique-item/unique-item.service"; import { SignatureService } from "../document-services/signature/signature.service"; +import { MatchService } from "../matches/match.service"; export function tokenGetter() { return localStorage.getItem(BL_CONFIG.token.accessToken); diff --git a/src/app/document-services/match/match.service.ts b/src/app/document-services/match/match.service.ts deleted file mode 100644 index c23e53f..0000000 --- a/src/app/document-services/match/match.service.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { Injectable } from "@angular/core"; -import { Match } 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 { BlDocumentService } from "../../document/bl-document.service"; - -@Injectable() -export class MatchService extends BlDocumentService { - constructor(private cachedDocumentService: CachedDocumentService) { - super(cachedDocumentService); - this.setCollection(BL_CONFIG.collection.match); - } -} diff --git a/src/app/matches/match.service.ts b/src/app/matches/match.service.ts new file mode 100644 index 0000000..fc6b0a9 --- /dev/null +++ b/src/app/matches/match.service.ts @@ -0,0 +1,30 @@ +import { Injectable } from "@angular/core"; +import { ApiService } from "../api/api.service"; +import { BL_CONFIG } from "../bl-connect/bl-config"; +import { ApiResponse } from "../api/api-response"; +import { BlDocumentService } from "../document/bl-document.service"; +import { Match } from "@boklisten/bl-model"; +import { CachedDocumentService } from "../document/cached-document.service"; + +@Injectable({ + providedIn: "root", +}) +export class MatchService extends BlDocumentService { + constructor( + private cachedDocumentService: CachedDocumentService, + private _apiService: ApiService + ) { + super(cachedDocumentService); + this.setCollection(BL_CONFIG.collection.match); + } + + public updateLocksForCustomer( + customerId: string, + userMatchesLocked: boolean + ): Promise { + return this._apiService.add(BL_CONFIG.collection.match + "/lock", { + customerId, + userMatchesLocked, + }); + } +}