{ "version": 3, "sources": ["src/app/vessel-call/model/order/vessel-call/vessel-call-status.ts", "src/app/shared/services/order-data.service.ts"], "sourcesContent": ["export enum VesselCallJobStatus {\n Draft = 'Draft',\n Pending = 'Pending',\n Acknowledged = 'Acknowledged',\n Quoted = 'Quoted',\n Active = 'Active',\n Closed = 'Closed',\n Cancelled = 'Cancelled',\n Rejected = 'Rejected'\n}\n\nexport type VesselCallJobStatusDescriptions = 'Draft' | 'Pending' | 'Acknowledged' | 'Quoted' | 'Active' | 'Closed' | 'Cancelled' | 'Rejected';\nexport const VesselCallJobStatusLookup: Record = {\n Draft: VesselCallJobStatus.Draft,\n Pending: VesselCallJobStatus.Pending,\n Acknowledged: VesselCallJobStatus.Acknowledged,\n Quoted: VesselCallJobStatus.Quoted,\n Active: VesselCallJobStatus.Active,\n Closed: VesselCallJobStatus.Closed,\n Cancelled: VesselCallJobStatus.Cancelled,\n Rejected: VesselCallJobStatus.Rejected,\n};\n\nexport const VesselCallJobStatusOrderLookup: Record = {\n Draft: 1,\n Pending: 2,\n Acknowledged: 3,\n Quoted: 4,\n Active: 5,\n Closed: 6,\n Cancelled: 7,\n Rejected: 8,\n};\n\nexport const VesselCallJobStatusLookupList = (Object.keys(VesselCallJobStatusLookup) as Array);\n", "import { HttpClient, HttpHeaders } from '@angular/common/http';\nimport { Injectable } from '@angular/core';\nimport { Observable } from 'rxjs';\nimport { catchError } from 'rxjs/operators';\nimport { IOrder } from 'src/app/shared/model/order/order.interface';\nimport { IDaTotalPerStageAndCurrencyDto } from 'src/app/vessel-call/model/da-total-per-stage-and-currency.dto';\nimport { DaApprovalQuotationDto } from 'src/app/vessel-call/model/da/da-approval-quotation.dto';\nimport { IOrderServicePortCallDto } from 'src/app/vessel-call/model/order-service-port-call.dto';\nimport { DraftVesselCallRequestDto } from 'src/app/vessel-call/model/order/draft-vessel-call-request.dto';\nimport { IVesselCallRequestIndex } from 'src/app/vessel-call/model/order/vessel-call-request-index.dto';\nimport { IVesselCallRequest } from 'src/app/vessel-call/model/order/vessel-call-request.dto';\nimport { VesselCallJobStatus } from 'src/app/vessel-call/model/order/vessel-call/vessel-call-status';\nimport { environment } from 'src/environments/environment';\nimport { IPostResponseDto } from '../model/post-response.dto';\nimport { DaApprovalCostSummaryDto } from './../../vessel-call/model/da/da-approval-cost-summary.dto';\nimport { PageResponseDto } from './../model/page-response.dto';\nimport { IFdaDashboardTimelineData } from '@models/order/fda-dashboard-timeline-data.dto';\n\nconst orderServiceUrl = environment.orderServiceApiUrl;\n\n@Injectable({\n providedIn: 'root'\n})\nexport class OrderDataService {\n\n constructor(private httpClient: HttpClient) { }\n\n approveQuotation(requestDto: DaApprovalQuotationDto): Observable> {\n return this.httpClient.post>(`${orderServiceUrl}/orders/pdaapproval`, requestDto);\n }\n\n cancelRequest(orderId: string): Observable> {\n return this.httpClient.post>(`${orderServiceUrl}/orders/cancelrequest?orderId=${orderId}`, {});\n }\n\n //TO BE UPDATED TO SUPPORT GROUP CODE\n rejectQuotation(refereceNumber: string): Observable {\n return this.httpClient.post(`${orderServiceUrl}/quotation/rejectquotation?orderNo=${refereceNumber}`, {});\n }\n\n approveCostSummary(costSummaryDto: DaApprovalCostSummaryDto, isGroupCustomer: boolean): Observable> {\n const headers = new HttpHeaders({\n 'Prt-Is-Group-Customer': `${isGroupCustomer}`\n });\n return this.httpClient.post>(`${orderServiceUrl}/orders/costsummaryapproval`, costSummaryDto, { headers: headers });\n }\n\n getVesselCallDetails(id: string, isGroupCustomer: boolean = false): Observable {\n const headers = new HttpHeaders({\n 'Prt-Is-Group-Customer': `${isGroupCustomer}`\n });\n return this.httpClient.get(`${orderServiceUrl}/orders/getrequestdetails?orderId=${id}`, { headers: headers });\n }\n\n getVesselCalls(pageSize: number, orderStatuses: string[] = [], isGroupCustomer: boolean = false, continuationToken: string | null = null): Observable> {\n const headers = new HttpHeaders({\n 'Prt-Is-Group-Customer': `${isGroupCustomer}`\n });\n return this.httpClient.post>(`${orderServiceUrl}/orders/getvesselcallrequests`,\n {\n orderStatuses,\n pageSize,\n continuationToken\n },\n { headers: headers }\n );\n }\n\n getDraftVesselCalls(size: number, pageNumber: number, orderStatuses: string[] = []): Observable {\n return this.httpClient.get(`${orderServiceUrl}/orders/getvesselcallrequests?orderStatuses=${VesselCallJobStatus.Draft}&pageSize=${size}&pageNumber=${pageNumber}`);\n }\n\n saveOrderDraft(order: DraftVesselCallRequestDto): Observable {\n return this.httpClient.post(`${orderServiceUrl}/orders/savedraftrequest`, order);\n }\n\n submitOrder(orderId: string): Observable {\n return this.httpClient.post(`${orderServiceUrl}/orders/submitrequest?orderId=${orderId}&timeStamp=${new Date().toISOString()}`, {});\n }\n\n getOrderIdByJobNumber(jobNumber: string): Observable {\n return this.httpClient.get(`${orderServiceUrl}/orders/getorderidforjob?jobNumber=${jobNumber}`);\n }\n\n generateMRDocument(mrNumber: number, cityCode: string, poNumber: string, poGroupCustomerCode: string) {\n return this.httpClient.get(`${orderServiceUrl}/cargo/generatemrdocument?mrNumber=${mrNumber}&cityCode=${cityCode}&poNumber=${poNumber}&poGroupCustomerCode=${poGroupCustomerCode}`,\n {\n responseType: 'blob'\n }\n ).pipe(\n catchError((error: any) => {\n throw new Error('There was a problem generating the document. Please try again later.');\n })\n );\n }\n\n getActivePortCallVessels(isGroupCustomer: boolean): Observable {\n const headers = new HttpHeaders({\n 'Prt-Is-Group-Customer': `${isGroupCustomer}`\n });\n return this.httpClient.get(`${orderServiceUrl}/orders/getactiveportcallvessels`, { headers: headers });\n }\n\n getPortCallsByImo(imo: string | number, isGroupCustomer: boolean): Observable {\n const headers = new HttpHeaders({\n 'Prt-Is-Group-Customer': `${isGroupCustomer}`\n });\n return this.httpClient.get(`${orderServiceUrl}/orders/getportcallsbyimo?imo=${imo}`, { headers: headers });\n }\n getPortCallsByImoList(imo: string[] | number[], isGroupCustomer: boolean): Observable {\n const headers = new HttpHeaders({\n 'Prt-Is-Group-Customer': `${isGroupCustomer}`\n });\n return this.httpClient.post(`${orderServiceUrl}/orders/getportcallsbyimolist`, imo, { headers: headers });\n }\n\n getDaSummaryReportForPortal(isGroupCustomer: boolean): Observable {\n const headers = new HttpHeaders({\n 'Prt-Is-Group-Customer': `${isGroupCustomer}`\n });\n return this.httpClient.get(`${orderServiceUrl}/orders/getdasummaryreportforportal`, { headers: headers });\n }\n\n getFdaDashboardData(): Observable {\n return this.httpClient.get(`${orderServiceUrl}/orders/getfdadashboarddata`);\n }\n\n getPortCodesForActiveJobs(customerCode: string): Observable {\n const headers = new HttpHeaders({\n 'Prt-Comp-Code': `${customerCode}`\n });\n return this.httpClient.get(`${orderServiceUrl}/orders/getportcodesforjobs`, { headers: headers });\n }\n}\n"], "mappings": ";;;;;;;;;;AAAA,IAAY;CAAZ,SAAYA,sBAAmB;AAC7B,EAAAA,qBAAA,OAAA,IAAA;AACA,EAAAA,qBAAA,SAAA,IAAA;AACA,EAAAA,qBAAA,cAAA,IAAA;AACA,EAAAA,qBAAA,QAAA,IAAA;AACA,EAAAA,qBAAA,QAAA,IAAA;AACA,EAAAA,qBAAA,QAAA,IAAA;AACA,EAAAA,qBAAA,WAAA,IAAA;AACA,EAAAA,qBAAA,UAAA,IAAA;AACF,GATY,wBAAA,sBAAmB,CAAA,EAAA;AAYxB,IAAM,4BAA0F;EACrG,OAAO,oBAAoB;EAC3B,SAAS,oBAAoB;EAC7B,cAAc,oBAAoB;EAClC,QAAQ,oBAAoB;EAC5B,QAAQ,oBAAoB;EAC5B,QAAQ,oBAAoB;EAC5B,WAAW,oBAAoB;EAC/B,UAAU,oBAAoB;;AAGzB,IAAM,iCAAkF;EAC7F,OAAO;EACP,SAAS;EACT,cAAc;EACd,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,WAAW;EACX,UAAU;;AAGL,IAAM,gCAAiC,OAAO,KAAK,yBAAyB;;;AChBnF,IAAM,kBAAkB,YAAY;AAK9B,IAAO,mBAAP,MAAO,kBAAgB;EAE3B,YAAoB,YAAsB;AAAtB,SAAA,aAAA;EAA0B;EAE9C,i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