{"version":3,"sources":["webpack:///./node_modules/@abaco/agreements-module/src/modules/new-agreements/api/MovementApi.ts"],"names":["MovementApi","http","rootPath","sitiInfoPath","this","agreement_type_id","get","res","data","agreement_id","records","rule_id","workflow_id","url","post","movement_id"],"mappings":"uMAGqBA,G,+BAKjB,WAAYC,EAAkBC,EAAkBC,GAAoB,uBAChEC,KAAKH,KAAOA,EACZG,KAAKF,SAAWA,EAChBE,KAAKD,aAAeA,E,6GAGxB,WAAoBE,GAApB,uGACsBD,KAAKH,KAAKK,IAAV,UAAiBF,KAAKF,SAAtB,kDAAwEG,EAAxE,gBADtB,cACUE,EADV,yBAEWA,EAAIC,MAFf,gD,sJAMA,WAA4BC,GAA5B,uGACsBL,KAAKH,KAAKK,IAAV,UAAiBF,KAAKF,SAAtB,kCAAwDO,EAAxD,eADtB,cACUF,EADV,yBAEWA,EAAIC,KAAKE,SAFpB,gD,wIAMA,WAAcC,GAAd,uGACsBP,KAAKH,KAAKK,IAAV,2DAAkEK,IADxF,cACUJ,EADV,yBAEWA,EAAIC,MAFf,gD,+IAMA,WAAqBC,EAAsBG,GAA3C,gGACUC,EADV,UACmBT,KAAKF,SADxB,kCAC0DO,EAD1D,sBACoFG,GADpF,SAEsBR,KAAKH,KAAKa,KAAKD,GAFrC,cAEUN,EAFV,yBAGWA,EAAIC,MAHf,gD,gJAOA,WAAoBC,EAAsBM,GAA1C,uGACsBX,KAAKH,KAAKK,IAAV,UAAiBF,KAAKF,SAAtB,iCAAuDO,EAAvD,YAAuEM,IAD7F,cACUR,EADV,yBAEWA,EAAIC,MAFf,gD","file":"js/chunk-2d208caa.29bb5c5a.js","sourcesContent":["import { HTTPClient } from '@abaco/web-common/src/HTTP';\nimport { Status, Movement, Rule, Transition, TransitionResult } from '../models/MovementModel';\n\nexport default class MovementApi {\n private http: HTTPClient;\n private rootPath: string;\n private sitiInfoPath: string;\n\n constructor(http: HTTPClient, rootPath: string, sitiInfoPath: string) {\n this.http = http;\n this.rootPath = rootPath;\n this.sitiInfoPath = sitiInfoPath;\n }\n\n async getStatusList(agreement_type_id: number): Promise {\n const res = await this.http.get(`${this.rootPath}/agreements/dictionary/agreement_types/${agreement_type_id}/statuslist`);\n return res.data;\n }\n\n // API that returns the movements that can be carried out in the agreement. Movements necessary to make him change state\n async getAgreementMovements(agreement_id: number): Promise {\n const res = await this.http.get(`${this.rootPath}/agreements/agreements/${agreement_id}/movements`);\n return res.data.records as Movement[];\n }\n\n //API that returns the checks to be carried out for the single rule\n async getRule(rule_id: number): Promise {\n const res = await this.http.get(`/sitiInfoRestApi/api_basic/v1/applications/rules/${rule_id}`);\n return res.data;\n }\n\n //API that save transition from a state to another\n async saveTransition(agreement_id: number, workflow_id: number): Promise {\n const url = `${this.rootPath}/agreements/agreements/${agreement_id}/movements/${workflow_id}`\n const res = await this.http.post(url);\n return res.data;\n }\n\n //check rule\n async getRuleResult(agreement_id: number, movement_id: number): Promise {\n const res = await this.http.get(`${this.rootPath}/agreements/rules_log/${agreement_id}|${movement_id}`);\n return res.data as Rule;\n }\n //chiamata per presentare l'esito della regola\n //sitiagri-rest-api/api_sso/v1/agreements/rules_log/|\n\n\n\n\n}\n"],"sourceRoot":""}