{"version":3,"sources":["webpack:///./node_modules/@abaco/activities-module/src/modules/activities-module/api/DeliveryApi.ts"],"names":["DeliveryApi","http","rootPath","this","pkcuaa","campaign","filter","searchBy","get","params","offset","count","toUpperCase","undefined","res","data","paging","executionId","records"],"mappings":"uMAKqBA,G,+BAKjB,WAAYC,EAAkBC,GAAgB,uBAC1CC,KAAKF,KAAOA,EACZE,KAAKD,SAAWA,E,sHAGb,WAA6BE,EAAgBC,EAAkBC,EAAuBC,GAAtF,uGACeJ,KAAKF,KAAKO,IAAV,UAAiBL,KAAKD,SAAtB,mCAAyDE,EAAzD,YAAmEC,EAAnE,kCAA6G,CAC3HI,OAAQ,CACJC,OAAQ,EACRC,MAAO,IACPL,OAAQA,EAAS,yBAAH,OAA4BA,EAAOM,oBAAkBC,KALxE,cACGC,EADH,yBAQIA,EAAIC,MARR,gD,8JAWA,WAA8BX,EAAgBC,EAAkBW,EAAsBV,EAAuBC,GAA7G,uGACeJ,KAAKF,KAAKO,IAAV,UAAiBL,KAAKD,SAAtB,mCAAyDE,EAAzD,YAAmEC,EAAnE,yDAAoI,CAClJI,OAAQ,CACJC,OAAQM,EAAON,OACfC,MAAOK,EAAOL,MACdL,OAAQA,EAAS,sBAAH,OAAyBA,EAAOM,oBAAkBC,KALrE,cACGC,EADH,yBAQIA,EAAIC,MARR,gD,qKAUA,WAAmCX,EAAgBC,EAAkBY,GAArE,uGACed,KAAKF,KAAKO,IAAV,UAAiBL,KAAKD,SAAtB,mCAAyDE,EAAzD,YAAmEC,EAAnE,8DAAiIY,GAAe,CAC9JR,OAAQ,CACJC,OAAQ,EACRC,MAAO,OAJZ,cACGG,EADH,yBAOIA,EAAIC,KAAKG,QAAQ,IAPrB,gD","file":"js/chunk-2d2297fa.951cc6e0.js","sourcesContent":["import { HTTPClient } from '@abaco/web-common/src/HTTP';\nimport { PagedResults, PagingParams } from '@abaco/web-common/src/Paging';\nimport { DeliveryActionToOut, DeliveryActionTo, DeliveryExecution, DeliverySubject } from '../models/Delivery';\nimport { toHA } from '../models/Utils';\n\nexport default class DeliveryApi {\n\n private http: HTTPClient;\n private rootPath: string;\n\n constructor(http: HTTPClient, rootPath: string) {\n this.http = http;\n this.rootPath = rootPath\n }\n\n public async getSupplyChainSubjects(pkcuaa: number, campaign: number, filter: string | null, searchBy?: string): Promise {\n const res = await this.http.get(`${this.rootPath}/v1/deliveries/subjects/${pkcuaa}/${campaign}/delivery_dictionary_receivers`, {\n params: {\n offset: 0,\n count: 300,\n filter: filter ? `^owner_full_name like ${filter.toUpperCase()}` : undefined\n }\n })\n return res.data;\n }\n\n public async getDeliveryExecutionsIn(pkcuaa: number, campaign: number, paging: PagingParams, filter: string | null, searchBy?: string): Promise> {\n const res = await this.http.get(`${this.rootPath}/v1/deliveries/subjects/${pkcuaa}/${campaign}/deliveries_in?actions=false&filter=fg_processed eq 0`, {\n params: {\n offset: paging.offset,\n count: paging.count,\n filter: filter ? `^delivered_by like ${filter.toUpperCase()}` : undefined\n }\n })\n return res.data;\n }\n public async getDeliveryExecutionInDetail(pkcuaa: number, campaign: number, executionId: number): Promise {\n const res = await this.http.get(`${this.rootPath}/v1/deliveries/subjects/${pkcuaa}/${campaign}/deliveries_in?actions=true&filter=execution_id eq ${executionId}`, {\n params: {\n offset: 0,\n count: 300,\n }\n })\n return res.data.records[0];\n }\n\n // public async getDeliveryNotes(pkcuaa: number, campaign: number, executionId: number, isIn: boolean): Promise {\n // const subUrl = isIn ? 'deliveries_in' : 'deliveries_out';\n // const res = await this.http.get(`${this.rootPath}/v1/deliveries/subjects/${pkcuaa}/${campaign}/${subUrl}/${executionId}`)\n // return isIn ? res.data.action_in.products : res.data.action_out.products;\n // }\n\n}\n"],"sourceRoot":""}