@bisondesk/core-sdk 1.0.443 → 1.0.445
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/constants.d.ts +3 -1
- package/lib/constants.d.ts.map +1 -1
- package/lib/constants.js +2 -0
- package/lib/constants.js.map +1 -1
- package/lib/types/opportunities.d.ts +5 -35
- package/lib/types/opportunities.d.ts.map +1 -1
- package/lib/types/opportunities.js.map +1 -1
- package/lib/types/quotes.d.ts +10 -0
- package/lib/types/quotes.d.ts.map +1 -1
- package/lib/types/quotes.js.map +1 -1
- package/package.json +1 -1
- package/src/constants.ts +2 -0
- package/src/types/opportunities.ts +5 -36
- package/src/types/quotes.ts +12 -0
- package/tsconfig.tsbuildinfo +1 -1
package/lib/types/quotes.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"quotes.js","sourceRoot":"/","sources":["types/quotes.ts"],"names":[],"mappings":"AAYA,MAAM,CAAN,IAAY,YAKX;AALD,WAAY,YAAY;IACtB,iCAAiB,CAAA;IACjB,qCAAqB,CAAA;IACrB,+CAA+B,CAAA;IAC/B,iCAAiB,CAAA;AACnB,CAAC,EALW,YAAY,KAAZ,YAAY,QAKvB;AAED,MAAM,CAAN,IAAY,WASX;AATD,WAAY,WAAW;IACrB,kCAAmB,CAAA;IACnB,sCAAuB,CAAA;IACvB,0CAA2B,CAAA;IAC3B,oCAAqB,CAAA;IACrB,oCAAqB,CAAA;IACrB,sCAAuB,CAAA;IACvB,mDAAoC,CAAA;IACpC,mDAAoC,CAAA;AACtC,CAAC,EATW,WAAW,KAAX,WAAW,QAStB;AAED,MAAM,CAAN,IAAY,iBAIX;AAJD,WAAY,iBAAiB;IAC3B,sCAAiB,CAAA;IACjB,wCAAmB,CAAA;IACnB,kCAAa,CAAA;AACf,CAAC,EAJW,iBAAiB,KAAjB,iBAAiB,QAI5B;AACD,MAAM,CAAN,IAAY,aAIX;AAJD,WAAY,aAAa;IACvB,mCAAkB,CAAA;IAClB,oCAAmB,CAAA;IACnB,8BAAa,CAAA;AACf,CAAC,EAJW,aAAa,KAAb,aAAa,QAIxB;AAED,MAAM,CAAN,IAAY,WAIX;AAJD,WAAY,WAAW;IACrB,8BAAe,CAAA;IACf,kCAAmB,CAAA;IACnB,qCAAsB,CAAA;AACxB,CAAC,EAJW,WAAW,KAAX,WAAW,QAItB;AAED,MAAM,CAAN,IAAY,kBAGX;AAHD,WAAY,kBAAkB;IAC5B,wCAAkB,CAAA;IAClB,6CAAuB,CAAA;AACzB,CAAC,EAHW,kBAAkB,KAAlB,kBAAkB,QAG7B","sourcesContent":["import { AttachmentValue, LocationValue } from '@bisondesk/commons-sdk/types';\nimport { OpportunityType } from '../constants.js';\nimport {\n CustomLeasingQuoteExtraInput,\n CustomSalesQuoteExtraInput,\n LeasingDeliveryPackageInput,\n LeasingQuoteExtraInput,\n SalesQuoteExtraInput,\n} from './leasing-settings.js';\nimport { MatchingRuleValue } from './roi-ratings.js';\nimport { PricePercentageMode } from './utils.js';\n\nexport enum QuoteActions {\n ACCEPT = 'accept',\n VALIDATE = 'validate',\n DONWLOAD_PDFS = 'download-pdfs',\n CANCEL = 'cancel',\n}\n\nexport enum QuoteStatus {\n CREATED = 'created',\n VALIDATED = 'validated',\n INVALIDATED = 'invalidated',\n ACCEPTED = 'accepted',\n REJECTED = 'rejected',\n CANCELLED = 'cancelled',\n MANAGER_REJECTED = 'managerRejected',\n MANAGER_ACCEPTED = 'managerAccepted',\n}\n\nexport enum QuoteMetricsScore {\n DANGER = 'danger',\n NEUTRAL = 'neutral',\n GOOD = 'good',\n}\nexport enum DeliveryTypes {\n PICK_UP = 'pickUp',\n ADDRESS = 'address',\n PORT = 'port',\n}\n\nexport enum SpoilerInfo {\n MOUNT = 'mount',\n UNMOUNT = 'unmount',\n NO_ACTION = 'noAction',\n}\n\nexport enum TransportationMode {\n BY_ROAD = 'byRoad',\n ON_LOW_BED = 'onLowBed',\n}\n\ntype BaseQuoteCalculatorInput = {\n branchId: string;\n branchCountry: string;\n customerCountry: string;\n customerVatNumber?: string;\n currency: string;\n vehicle: {\n id: string;\n category: string;\n bodywork?: string;\n agreedPriceExclVat: string;\n technicalNotes?: string;\n };\n\n allRisksCost?: string;\n};\n\n// Sent by the Frontend to bootstrap the calculator\nexport type LeasingCalculatorDefaultInput = BaseQuoteCalculatorInput & {\n deliveryPackage?: LeasingQuoteExtraInput;\n};\n\nexport type LeasingCalculatorInput = BaseQuoteCalculatorInput & {\n localLicensePlate: boolean;\n vanCourier: boolean;\n vehicle: BaseQuoteCalculatorInput['vehicle'] & {\n purchasePriceExclVat: string;\n agreedPrice: string;\n purchasePrice: string;\n };\n leasing: {\n deposit: string;\n depositMode: PricePercentageMode;\n depositPercentage: string;\n residual: string;\n residualMode: PricePercentageMode;\n residualPercentage: string;\n startupFee: string;\n startupFeeMode: PricePercentageMode;\n startupFeePercentage: string;\n interestRate: string;\n duration: number;\n contractStartDate: string;\n };\n bank: {\n interestRate: string;\n deposit: string;\n depositMode: PricePercentageMode;\n depositPercentage: string;\n residual: string;\n residualMode: PricePercentageMode;\n residualPercentage: string;\n duration: number;\n salesPrice: string;\n } & (\n | { selfFinancing: true; financing?: undefined }\n | { selfFinancing: false; financing?: { bankAccountOrganizationId: string; amount: string } }\n );\n taxes: {\n yearlyRoadTax: boolean;\n oneTimeRoadTax: boolean;\n margin: string; //Non Editable, copies the value insurance > margin\n };\n insurance: {\n margin: string;\n civilLiabilities: boolean;\n allRisks: boolean;\n specialTechnicalInsurance: boolean;\n roadAssistance: boolean;\n initialFractionPercentage: string;\n };\n deliveryPackage?: LeasingDeliveryPackageInput;\n extras: LeasingQuoteExtraInput[];\n customRequests: CustomLeasingQuoteExtraInput[];\n};\n\ntype BaseDeliveryType = {\n agreedPrice: string;\n spoiler?: SpoilerInfo;\n stackingVehicleNeeded?: boolean;\n detailsStacking?: string;\n};\n\nexport type PickUpDeliveryType = BaseDeliveryType & {\n type: DeliveryTypes.PICK_UP;\n urgent: boolean;\n transportationMode?: TransportationMode;\n detailsBorderCrossing?: string;\n technicalControlNeeded: boolean;\n insuranceNeeded: boolean;\n transitPlateBelgiumNeeded: boolean;\n transitPlateAustriaNeeded: boolean;\n licensePlateNeeded: boolean;\n dateOfPickUpByCustomer?: string;\n};\n\nexport type AddressDeliveryType = BaseDeliveryType & {\n type: DeliveryTypes.ADDRESS;\n address: LocationValue;\n distanceKm: string;\n technicalControlNeeded: boolean;\n};\n\nexport type PortDeliverytype = BaseDeliveryType & {\n type: DeliveryTypes.PORT;\n portOriginId: string;\n portDestination?: string;\n shippingCompany?: string;\n portToPortCostPrice: string;\n portToPortMargin: string;\n};\n\n// Sent by the Frontend to bootstrap the calculator\nexport type SalesCalculatorDefaultInput = BaseQuoteCalculatorInput & {\n extras: SalesQuoteExtraInput[];\n customRequests: CustomSalesQuoteExtraInput[];\n};\n\nexport type SalesCalculatorInput = BaseQuoteCalculatorInput & {\n vehicle: BaseQuoteCalculatorInput['vehicle'] & {\n purchasePrice: string;\n purchasePriceExclVat: string;\n agreedPrice: string;\n premiumPrice?: string;\n vatRate: string;\n minimumPrice: string;\n internetPrice?: string;\n comissionCost: string;\n };\n delivery?: PickUpDeliveryType | AddressDeliveryType | PortDeliverytype;\n extras: SalesQuoteExtraInput[];\n customRequests: CustomSalesQuoteExtraInput[];\n};\n\nexport type SalesQuoteRuleInput = {\n minimumPrice: number;\n internetPrice: number;\n agreedPrice: number;\n premiumPrice: number;\n stockAge: number;\n};\n\nexport type LeasingCalculatorOutput = {\n vatApplicable: boolean;\n installment: string;\n installmentPrintable: string;\n totalMonthlyAmount: string;\n monthlyTaxesInsurance: string;\n beforeDeliveryExclVat: string;\n beforeDelivery: string;\n financingAmount: string;\n settingId: string;\n totalRetailAmountExclVat: string;\n totalRetailAmount: string;\n finalSalesPrice: string;\n roi: {\n value: string;\n target: string;\n perYear: string;\n difference: string;\n score?: QuoteMetricsScore;\n };\n cashflow: {\n deficit: string;\n balanced: boolean;\n score: QuoteMetricsScore;\n };\n profitability: {\n leasing: string;\n vehicle: string;\n total: string;\n score: QuoteMetricsScore;\n };\n taxes: {\n yearlyRetailPrice: string;\n monthlyRetailPrice: string;\n yearlyRoadTax: string;\n oneTimeRoadTax: string;\n profit: string;\n };\n insurance: {\n beforeDelivery: string;\n yearlyRetailPrice: string;\n monthlyRetailPrice: string;\n civilLiabilities: string;\n allRisks: string;\n specialTechnicalInsurance: string;\n roadAssistance: string;\n profit: string;\n };\n trackAndTrace: {\n beforeDelivery: string;\n monthlyCost: string;\n installationCost: string; // currently this cost is being included as part of monthlyCost. In future, this will be a separate cost\n deviceCost: string; // same as above\n profit: string;\n };\n costs: {\n financingAmount: string;\n finalCostPrice: string;\n monhtly: string;\n };\n};\n\nexport type SalesCalculatorOutput = {\n totalRetailAmount: string;\n totalRetailAmountExclVat: string;\n retailAmounts: {\n vehicle: string;\n delivery: string;\n extras: string;\n };\n roi: { value: string; score?: QuoteMetricsScore };\n profit: {\n value: string;\n score: QuoteMetricsScore;\n };\n profitOverMin: {\n value: string;\n percentage: string;\n score: QuoteMetricsScore;\n };\n delivery: {\n retailPrice?: string;\n costPrice?: string;\n cleaningNeeded: boolean;\n cleaningNeededRetailPrice: string;\n transportationToPortRetailPrice?: string;\n };\n costs: {\n finalCostPrice: string;\n extras: string;\n delivery: string;\n };\n};\n\ntype BaseQuote = {\n opportunityId: string;\n preferredLanguage: string;\n clientNotes?: string;\n publicNotes?: string;\n} & (\n | {\n type: OpportunityType.LEASING;\n calculatorInput: LeasingCalculatorInput;\n calculatorOutput: LeasingCalculatorOutput;\n rating?: MatchingRuleValue;\n }\n | {\n type: OpportunityType.SALES;\n calculatorInput: SalesCalculatorInput;\n calculatorOutput: SalesCalculatorOutput;\n rating?: MatchingRuleValue;\n }\n);\n\nexport type NewQuote = BaseQuote & {\n id?: undefined;\n createdAt?: undefined;\n createdBy?: undefined;\n modifiedAt?: undefined;\n modifiedBy?: undefined;\n active: true;\n};\n\nexport type Quote = BaseQuote & {\n id: string;\n createdAt: string;\n createdBy: string;\n modifiedAt: string;\n modifiedBy: string;\n validationBy?: string;\n validationAt?: string;\n cancelledBy?: string;\n cancelledAt?: string;\n customerFeedbackAt?: string;\n customerFeedbackBy?: string;\n managerFeedbackAt?: string;\n managerFeedbackBy?: string;\n version: number;\n status: QuoteStatus;\n proformaPdf?: AttachmentValue;\n quotePdf?: AttachmentValue;\n salesAgreementPdf?: AttachmentValue;\n active: boolean;\n contactId: string;\n vehicleId: string;\n organizationId: string;\n technicalNotesUpdated: boolean;\n technicalNotesValidated: boolean;\n technicalNotesValidatedAt?: string;\n technicalNotesValidatedBy?: string;\n};\n\nexport type QuoteUpdate = {\n status?: QuoteStatus;\n active?: boolean;\n technicalNotesValidated?: boolean;\n};\n\nexport type CalculatorLeasingIO = {\n output: LeasingCalculatorOutput;\n input: LeasingCalculatorInput;\n rating?: MatchingRuleValue;\n};\nexport type CalculatorSalesIO = {\n output: SalesCalculatorOutput;\n input: SalesCalculatorInput;\n rating?: MatchingRuleValue;\n};\nexport type CalculatorQuoteIO = CalculatorLeasingIO | CalculatorSalesIO;\n\nexport type DeliveryLocationValue = Omit<LocationValue, 'addressLine1' | 'city'> & {\n addressLine1: string;\n city: string;\n};\n\nexport type DeliveryRoutesRequest = {\n origin: DeliveryLocationValue;\n destination: DeliveryLocationValue;\n};\n\ntype BaseCommission = {\n opportunityId: string;\n\n estimatedAmount: string;\n estimatedPaidAt: string;\n paidAmount?: string;\n paidAt?: string;\n\n notes?: string;\n};\n\nexport type NewCommission = BaseCommission & {};\n\nexport type Commission = BaseCommission & {\n stockNumber: string;\n vehicleId: string;\n\n branchId: string;\n currency: string;\n\n modifiedAt: string;\n modifiedBy: string;\n};\n\nexport type NewQuoteValidator = {\n userId: string;\n countryCode: string;\n type: OpportunityType;\n canValidateOwn?: boolean;\n};\n\nexport type QuoteValidator = NewQuoteValidator & {\n createdAt: string;\n};\n\nexport type QuoteValidatorUpdate = {\n canValidateOwn: boolean;\n};\n"]}
|
|
1
|
+
{"version":3,"file":"quotes.js","sourceRoot":"/","sources":["types/quotes.ts"],"names":[],"mappings":"AAYA,MAAM,CAAN,IAAY,YAKX;AALD,WAAY,YAAY;IACtB,iCAAiB,CAAA;IACjB,qCAAqB,CAAA;IACrB,+CAA+B,CAAA;IAC/B,iCAAiB,CAAA;AACnB,CAAC,EALW,YAAY,KAAZ,YAAY,QAKvB;AAED,MAAM,CAAN,IAAY,WASX;AATD,WAAY,WAAW;IACrB,kCAAmB,CAAA;IACnB,sCAAuB,CAAA;IACvB,0CAA2B,CAAA;IAC3B,oCAAqB,CAAA;IACrB,oCAAqB,CAAA;IACrB,sCAAuB,CAAA;IACvB,mDAAoC,CAAA;IACpC,mDAAoC,CAAA;AACtC,CAAC,EATW,WAAW,KAAX,WAAW,QAStB;AAED,MAAM,CAAN,IAAY,iBAIX;AAJD,WAAY,iBAAiB;IAC3B,sCAAiB,CAAA;IACjB,wCAAmB,CAAA;IACnB,kCAAa,CAAA;AACf,CAAC,EAJW,iBAAiB,KAAjB,iBAAiB,QAI5B;AACD,MAAM,CAAN,IAAY,aAIX;AAJD,WAAY,aAAa;IACvB,mCAAkB,CAAA;IAClB,oCAAmB,CAAA;IACnB,8BAAa,CAAA;AACf,CAAC,EAJW,aAAa,KAAb,aAAa,QAIxB;AAED,MAAM,CAAN,IAAY,WAIX;AAJD,WAAY,WAAW;IACrB,8BAAe,CAAA;IACf,kCAAmB,CAAA;IACnB,qCAAsB,CAAA;AACxB,CAAC,EAJW,WAAW,KAAX,WAAW,QAItB;AAED,MAAM,CAAN,IAAY,kBAGX;AAHD,WAAY,kBAAkB;IAC5B,wCAAkB,CAAA;IAClB,6CAAuB,CAAA;AACzB,CAAC,EAHW,kBAAkB,KAAlB,kBAAkB,QAG7B","sourcesContent":["import { AttachmentValue, LocationValue } from '@bisondesk/commons-sdk/types';\nimport { OpportunityType } from '../constants.js';\nimport {\n CustomLeasingQuoteExtraInput,\n CustomSalesQuoteExtraInput,\n LeasingDeliveryPackageInput,\n LeasingQuoteExtraInput,\n SalesQuoteExtraInput,\n} from './leasing-settings.js';\nimport { MatchingRuleValue } from './roi-ratings.js';\nimport { PricePercentageMode } from './utils.js';\n\nexport enum QuoteActions {\n ACCEPT = 'accept',\n VALIDATE = 'validate',\n DONWLOAD_PDFS = 'download-pdfs',\n CANCEL = 'cancel',\n}\n\nexport enum QuoteStatus {\n CREATED = 'created',\n VALIDATED = 'validated',\n INVALIDATED = 'invalidated',\n ACCEPTED = 'accepted',\n REJECTED = 'rejected',\n CANCELLED = 'cancelled',\n MANAGER_REJECTED = 'managerRejected',\n MANAGER_ACCEPTED = 'managerAccepted',\n}\n\nexport enum QuoteMetricsScore {\n DANGER = 'danger',\n NEUTRAL = 'neutral',\n GOOD = 'good',\n}\nexport enum DeliveryTypes {\n PICK_UP = 'pickUp',\n ADDRESS = 'address',\n PORT = 'port',\n}\n\nexport enum SpoilerInfo {\n MOUNT = 'mount',\n UNMOUNT = 'unmount',\n NO_ACTION = 'noAction',\n}\n\nexport enum TransportationMode {\n BY_ROAD = 'byRoad',\n ON_LOW_BED = 'onLowBed',\n}\n\ntype BaseQuoteCalculatorInput = {\n branchId: string;\n branchCountry: string;\n customerCountry: string;\n customerVatNumber?: string;\n currency: string;\n vehicle: {\n id: string;\n category: string;\n bodywork?: string;\n agreedPriceExclVat: string;\n technicalNotes?: string;\n };\n\n allRisksCost?: string;\n};\n\n// Sent by the Frontend to bootstrap the calculator\nexport type LeasingCalculatorDefaultInput = BaseQuoteCalculatorInput & {\n deliveryPackage?: LeasingQuoteExtraInput;\n};\n\nexport type LeasingCalculatorInput = BaseQuoteCalculatorInput & {\n localLicensePlate: boolean;\n vanCourier: boolean;\n vehicle: BaseQuoteCalculatorInput['vehicle'] & {\n purchasePriceExclVat: string;\n agreedPrice: string;\n purchasePrice: string;\n };\n leasing: {\n deposit: string;\n depositMode: PricePercentageMode;\n depositPercentage: string;\n residual: string;\n residualMode: PricePercentageMode;\n residualPercentage: string;\n startupFee: string;\n startupFeeMode: PricePercentageMode;\n startupFeePercentage: string;\n interestRate: string;\n duration: number;\n contractStartDate: string;\n };\n bank: {\n interestRate: string;\n deposit: string;\n depositMode: PricePercentageMode;\n depositPercentage: string;\n residual: string;\n residualMode: PricePercentageMode;\n residualPercentage: string;\n duration: number;\n salesPrice: string;\n } & (\n | { selfFinancing: true; financing?: undefined }\n | { selfFinancing: false; financing?: { bankAccountOrganizationId: string; amount: string } }\n );\n taxes: {\n yearlyRoadTax: boolean;\n oneTimeRoadTax: boolean;\n margin: string; //Non Editable, copies the value insurance > margin\n };\n insurance: {\n margin: string;\n civilLiabilities: boolean;\n allRisks: boolean;\n specialTechnicalInsurance: boolean;\n roadAssistance: boolean;\n initialFractionPercentage: string;\n };\n deliveryPackage?: LeasingDeliveryPackageInput;\n extras: LeasingQuoteExtraInput[];\n customRequests: CustomLeasingQuoteExtraInput[];\n};\n\ntype BaseDeliveryType = {\n agreedPrice: string;\n spoiler?: SpoilerInfo;\n stackingVehicleNeeded?: boolean;\n detailsStacking?: string;\n};\n\nexport type PickUpDeliveryType = BaseDeliveryType & {\n type: DeliveryTypes.PICK_UP;\n urgent: boolean;\n transportationMode?: TransportationMode;\n detailsBorderCrossing?: string;\n technicalControlNeeded: boolean;\n insuranceNeeded: boolean;\n transitPlateBelgiumNeeded: boolean;\n transitPlateAustriaNeeded: boolean;\n licensePlateNeeded: boolean;\n dateOfPickUpByCustomer?: string;\n};\n\nexport type AddressDeliveryType = BaseDeliveryType & {\n type: DeliveryTypes.ADDRESS;\n address: LocationValue;\n distanceKm: string;\n technicalControlNeeded: boolean;\n};\n\nexport type PortDeliverytype = BaseDeliveryType & {\n type: DeliveryTypes.PORT;\n portOriginId: string;\n portDestination?: string;\n shippingCompany?: string;\n portToPortCostPrice: string;\n portToPortMargin: string;\n};\n\n// Sent by the Frontend to bootstrap the calculator\nexport type SalesCalculatorDefaultInput = BaseQuoteCalculatorInput & {\n extras: SalesQuoteExtraInput[];\n customRequests: CustomSalesQuoteExtraInput[];\n};\n\nexport type SalesCalculatorInput = BaseQuoteCalculatorInput & {\n vehicle: BaseQuoteCalculatorInput['vehicle'] & {\n purchasePrice: string;\n purchasePriceExclVat: string;\n agreedPrice: string;\n premiumPrice?: string;\n vatRate: string;\n minimumPrice: string;\n internetPrice?: string;\n comissionCost: string;\n };\n delivery?: PickUpDeliveryType | AddressDeliveryType | PortDeliverytype;\n extras: SalesQuoteExtraInput[];\n customRequests: CustomSalesQuoteExtraInput[];\n};\n\nexport type SalesQuoteRuleInput = {\n minimumPrice: number;\n internetPrice: number;\n agreedPrice: number;\n premiumPrice: number;\n stockAge: number;\n};\n\nexport type LeasingCalculatorOutput = {\n vatApplicable: boolean;\n installment: string;\n installmentPrintable: string;\n totalMonthlyAmount: string;\n monthlyTaxesInsurance: string;\n beforeDeliveryExclVat: string;\n beforeDelivery: string;\n financingAmount: string;\n settingId: string;\n totalRetailAmountExclVat: string;\n totalRetailAmount: string;\n finalSalesPrice: string;\n roi: {\n value: string;\n target: string;\n perYear: string;\n difference: string;\n score?: QuoteMetricsScore;\n };\n cashflow: {\n deficit: string;\n balanced: boolean;\n score: QuoteMetricsScore;\n };\n profitability: {\n leasing: string;\n vehicle: string;\n total: string;\n score: QuoteMetricsScore;\n };\n taxes: {\n yearlyRetailPrice: string;\n monthlyRetailPrice: string;\n yearlyRoadTax: string;\n oneTimeRoadTax: string;\n profit: string;\n };\n insurance: {\n beforeDelivery: string;\n yearlyRetailPrice: string;\n monthlyRetailPrice: string;\n civilLiabilities: string;\n allRisks: string;\n specialTechnicalInsurance: string;\n roadAssistance: string;\n profit: string;\n };\n trackAndTrace: {\n beforeDelivery: string;\n monthlyCost: string;\n installationCost: string; // currently this cost is being included as part of monthlyCost. In future, this will be a separate cost\n deviceCost: string; // same as above\n profit: string;\n };\n costs: {\n financingAmount: string;\n finalCostPrice: string;\n monhtly: string;\n };\n};\n\nexport type SalesCalculatorOutput = {\n totalRetailAmount: string;\n totalRetailAmountExclVat: string;\n retailAmounts: {\n vehicle: string;\n delivery: string;\n extras: string;\n };\n roi: { value: string; score?: QuoteMetricsScore };\n profit: {\n value: string;\n score: QuoteMetricsScore;\n };\n profitOverMin: {\n value: string;\n percentage: string;\n score: QuoteMetricsScore;\n };\n delivery: {\n retailPrice?: string;\n costPrice?: string;\n cleaningNeeded: boolean;\n cleaningNeededRetailPrice: string;\n transportationToPortRetailPrice?: string;\n };\n costs: {\n finalCostPrice: string;\n extras: string;\n delivery: string;\n };\n};\n\ntype BaseQuote = {\n opportunityId: string;\n preferredLanguage: string;\n clientNotes?: string;\n publicNotes?: string;\n} & (\n | {\n type: OpportunityType.LEASING;\n calculatorInput: LeasingCalculatorInput;\n calculatorOutput: LeasingCalculatorOutput;\n rating?: MatchingRuleValue;\n }\n | {\n type: OpportunityType.SALES;\n calculatorInput: SalesCalculatorInput;\n calculatorOutput: SalesCalculatorOutput;\n rating?: MatchingRuleValue;\n }\n | {\n type: OpportunityType.NEW_TRAILER;\n calculatorInput: SalesCalculatorInput;\n calculatorOutput: SalesCalculatorOutput;\n rating?: MatchingRuleValue;\n }\n | {\n type: OpportunityType.USED_TRAILER;\n calculatorInput: SalesCalculatorInput;\n calculatorOutput: SalesCalculatorOutput;\n rating?: MatchingRuleValue;\n }\n);\n\nexport type NewQuote = BaseQuote & {\n id?: undefined;\n createdAt?: undefined;\n createdBy?: undefined;\n modifiedAt?: undefined;\n modifiedBy?: undefined;\n active: true;\n};\n\nexport type Quote = BaseQuote & {\n id: string;\n createdAt: string;\n createdBy: string;\n modifiedAt: string;\n modifiedBy: string;\n validationBy?: string;\n validationAt?: string;\n cancelledBy?: string;\n cancelledAt?: string;\n customerFeedbackAt?: string;\n customerFeedbackBy?: string;\n managerFeedbackAt?: string;\n managerFeedbackBy?: string;\n version: number;\n status: QuoteStatus;\n proformaPdf?: AttachmentValue;\n quotePdf?: AttachmentValue;\n salesAgreementPdf?: AttachmentValue;\n active: boolean;\n contactId: string;\n vehicleId: string;\n organizationId: string;\n technicalNotesUpdated: boolean;\n technicalNotesValidated: boolean;\n technicalNotesValidatedAt?: string;\n technicalNotesValidatedBy?: string;\n};\n\nexport type QuoteUpdate = {\n status?: QuoteStatus;\n active?: boolean;\n technicalNotesValidated?: boolean;\n};\n\nexport type CalculatorLeasingIO = {\n output: LeasingCalculatorOutput;\n input: LeasingCalculatorInput;\n rating?: MatchingRuleValue;\n};\nexport type CalculatorSalesIO = {\n output: SalesCalculatorOutput;\n input: SalesCalculatorInput;\n rating?: MatchingRuleValue;\n};\nexport type CalculatorQuoteIO = CalculatorLeasingIO | CalculatorSalesIO;\n\nexport type DeliveryLocationValue = Omit<LocationValue, 'addressLine1' | 'city'> & {\n addressLine1: string;\n city: string;\n};\n\nexport type DeliveryRoutesRequest = {\n origin: DeliveryLocationValue;\n destination: DeliveryLocationValue;\n};\n\ntype BaseCommission = {\n opportunityId: string;\n\n estimatedAmount: string;\n estimatedPaidAt: string;\n paidAmount?: string;\n paidAt?: string;\n\n notes?: string;\n};\n\nexport type NewCommission = BaseCommission & {};\n\nexport type Commission = BaseCommission & {\n stockNumber: string;\n vehicleId: string;\n\n branchId: string;\n currency: string;\n\n modifiedAt: string;\n modifiedBy: string;\n};\n\nexport type NewQuoteValidator = {\n userId: string;\n countryCode: string;\n type: OpportunityType;\n canValidateOwn?: boolean;\n};\n\nexport type QuoteValidator = NewQuoteValidator & {\n createdAt: string;\n};\n\nexport type QuoteValidatorUpdate = {\n canValidateOwn: boolean;\n};\n"]}
|
package/package.json
CHANGED
package/src/constants.ts
CHANGED
|
@@ -308,6 +308,7 @@ export type SearchOpportunity = {
|
|
|
308
308
|
vehicle?: Vehicle;
|
|
309
309
|
quote?: QuoteInfo;
|
|
310
310
|
custom: {
|
|
311
|
+
web2Lead: boolean;
|
|
311
312
|
payment: { status: OpportunityPaymentStatus; percentagePaid: string };
|
|
312
313
|
unassigned: boolean;
|
|
313
314
|
lost: boolean;
|
|
@@ -444,7 +445,7 @@ export type LeasingProformaTemplateData = {
|
|
|
444
445
|
};
|
|
445
446
|
};
|
|
446
447
|
|
|
447
|
-
export type
|
|
448
|
+
export type SalesTemplateData = {
|
|
448
449
|
opportunity: {
|
|
449
450
|
id: string;
|
|
450
451
|
offerNumber: string;
|
|
@@ -467,6 +468,8 @@ export type SalesProformaTemplateData = {
|
|
|
467
468
|
type?: string;
|
|
468
469
|
km: string | number;
|
|
469
470
|
vin: string;
|
|
471
|
+
year: string;
|
|
472
|
+
parkingLocation: string;
|
|
470
473
|
};
|
|
471
474
|
c: {
|
|
472
475
|
organizationId?: string;
|
|
@@ -479,41 +482,7 @@ export type SalesProformaTemplateData = {
|
|
|
479
482
|
address?: string;
|
|
480
483
|
country: string;
|
|
481
484
|
};
|
|
482
|
-
|
|
483
|
-
t: {
|
|
484
|
-
totalExclVat: string;
|
|
485
|
-
vatAmount: string;
|
|
486
|
-
total: string;
|
|
487
|
-
};
|
|
488
|
-
};
|
|
489
|
-
|
|
490
|
-
export type SalesAgreementTemplateData = {
|
|
491
|
-
opportunity: {
|
|
492
|
-
id: string;
|
|
493
|
-
offerNumber: string;
|
|
494
|
-
};
|
|
495
|
-
currentDate: string;
|
|
496
|
-
accountManager: {
|
|
497
|
-
fullName: string;
|
|
498
|
-
email: string;
|
|
499
|
-
phone: string;
|
|
500
|
-
};
|
|
501
|
-
vehicle: {
|
|
502
|
-
line1: string;
|
|
503
|
-
line2: string;
|
|
504
|
-
stockNumber: string;
|
|
505
|
-
};
|
|
506
|
-
c: {
|
|
507
|
-
organizationId?: string;
|
|
508
|
-
clientId: string;
|
|
509
|
-
company: string;
|
|
510
|
-
fullName: string;
|
|
511
|
-
vatNumber?: string;
|
|
512
|
-
email?: string;
|
|
513
|
-
phone?: string;
|
|
514
|
-
address?: string;
|
|
515
|
-
country: string;
|
|
516
|
-
};
|
|
485
|
+
iExtended: LineItemPdfTemplate[];
|
|
517
486
|
i: LineItemPdfTemplate[];
|
|
518
487
|
t: {
|
|
519
488
|
totalExclVat: string;
|
package/src/types/quotes.ts
CHANGED
|
@@ -304,6 +304,18 @@ type BaseQuote = {
|
|
|
304
304
|
calculatorOutput: SalesCalculatorOutput;
|
|
305
305
|
rating?: MatchingRuleValue;
|
|
306
306
|
}
|
|
307
|
+
| {
|
|
308
|
+
type: OpportunityType.NEW_TRAILER;
|
|
309
|
+
calculatorInput: SalesCalculatorInput;
|
|
310
|
+
calculatorOutput: SalesCalculatorOutput;
|
|
311
|
+
rating?: MatchingRuleValue;
|
|
312
|
+
}
|
|
313
|
+
| {
|
|
314
|
+
type: OpportunityType.USED_TRAILER;
|
|
315
|
+
calculatorInput: SalesCalculatorInput;
|
|
316
|
+
calculatorOutput: SalesCalculatorOutput;
|
|
317
|
+
rating?: MatchingRuleValue;
|
|
318
|
+
}
|
|
307
319
|
);
|
|
308
320
|
|
|
309
321
|
export type NewQuote = BaseQuote & {
|