@bisondesk/core-sdk 1.0.553 → 1.0.554

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.
Files changed (91) hide show
  1. package/lib/constants.d.ts +1 -0
  2. package/lib/constants.d.ts.map +1 -1
  3. package/lib/constants.js +1 -0
  4. package/lib/constants.js.map +1 -1
  5. package/lib/types/offers.d.ts +16 -4
  6. package/lib/types/offers.d.ts.map +1 -1
  7. package/lib/types/offers.js +12 -3
  8. package/lib/types/offers.js.map +1 -1
  9. package/lib/types/vehicles.d.ts +6 -1
  10. package/lib/types/vehicles.d.ts.map +1 -1
  11. package/lib/types/vehicles.js.map +1 -1
  12. package/lib/utils/leasing.d.ts +4 -0
  13. package/lib/utils/leasing.d.ts.map +1 -1
  14. package/lib/utils/leasing.js +28 -0
  15. package/lib/utils/leasing.js.map +1 -1
  16. package/package.json +1 -1
  17. package/src/constants.ts +1 -0
  18. package/src/types/activities.js +13 -0
  19. package/src/types/activities.js.map +1 -0
  20. package/src/types/comparables.js +2 -0
  21. package/src/types/comparables.js.map +1 -0
  22. package/src/types/crm.js +58 -0
  23. package/src/types/crm.js.map +1 -0
  24. package/src/types/dashboard.js +2 -0
  25. package/src/types/dashboard.js.map +1 -0
  26. package/src/types/definitions.js +2 -0
  27. package/src/types/definitions.js.map +1 -0
  28. package/src/types/fields.js +2 -0
  29. package/src/types/fields.js.map +1 -0
  30. package/src/types/insights.js +2 -0
  31. package/src/types/insights.js.map +1 -0
  32. package/src/types/interests.js +6 -0
  33. package/src/types/interests.js.map +1 -0
  34. package/src/types/internal-events.js +18 -0
  35. package/src/types/internal-events.js.map +1 -0
  36. package/src/types/internet-opportunities.js +2 -0
  37. package/src/types/internet-opportunities.js.map +1 -0
  38. package/src/types/internet-vehicles.js +2 -0
  39. package/src/types/internet-vehicles.js.map +1 -0
  40. package/src/types/leasing-administration.js +2 -0
  41. package/src/types/leasing-administration.js.map +1 -0
  42. package/src/types/leasing-debtors.js +2 -0
  43. package/src/types/leasing-debtors.js.map +1 -0
  44. package/src/types/leasing-search.js +2 -0
  45. package/src/types/leasing-search.js.map +1 -0
  46. package/src/types/leasing-settings.js +7 -0
  47. package/src/types/leasing-settings.js.map +1 -0
  48. package/src/types/leasing.js +38 -0
  49. package/src/types/leasing.js.map +1 -0
  50. package/src/types/marketing.js +35 -0
  51. package/src/types/marketing.js.map +1 -0
  52. package/src/types/offers.js +56 -0
  53. package/src/types/offers.ts +24 -5
  54. package/src/types/opportunities.js +107 -0
  55. package/src/types/opportunities.js.map +1 -0
  56. package/src/types/payments.js +7 -0
  57. package/src/types/picklists.js +2 -0
  58. package/src/types/picklists.js.map +1 -0
  59. package/src/types/quotes.js +42 -0
  60. package/src/types/recently-viewed.js +2 -0
  61. package/src/types/recently-viewed.js.map +1 -0
  62. package/src/types/reservations.js +5 -0
  63. package/src/types/reservations.js.map +1 -0
  64. package/src/types/roi-ratings.js +5 -0
  65. package/src/types/roi-ratings.js.map +1 -0
  66. package/src/types/saved-filters.js +9 -0
  67. package/src/types/saved-filters.js.map +1 -0
  68. package/src/types/search.js +2 -0
  69. package/src/types/search.js.map +1 -0
  70. package/src/types/settings.js +2 -0
  71. package/src/types/settings.js.map +1 -0
  72. package/src/types/templates.js +2 -0
  73. package/src/types/templates.js.map +1 -0
  74. package/src/types/tenants.js +21 -0
  75. package/src/types/tenants.js.map +1 -0
  76. package/src/types/user-performance.js +7 -0
  77. package/src/types/user-performance.js.map +1 -0
  78. package/src/types/utils.js +2 -0
  79. package/src/types/validation.js +2 -0
  80. package/src/types/validation.js.map +1 -0
  81. package/src/types/vehicle-sales.js +6 -0
  82. package/src/types/vehicle-sales.js.map +1 -0
  83. package/src/types/vehicles.js +98 -0
  84. package/src/types/vehicles.js.map +1 -0
  85. package/src/types/vehicles.ts +7 -1
  86. package/src/utils/leasing.js +6 -0
  87. package/src/utils/leasing.js.map +1 -0
  88. package/src/utils/leasing.ts +33 -0
  89. package/src/utils/opportunities.js +48 -0
  90. package/src/utils/opportunities.js.map +1 -0
  91. package/tsconfig.tsbuildinfo +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"vehicles.js","sourceRoot":"/","sources":["types/vehicles.ts"],"names":[],"mappings":"AAiBA,MAAM,CAAN,IAAY,YAOX;AAPD,WAAY,YAAY;IACtB,6BAAa,CAAA;IACb,mCAAmB,CAAA;IACnB,iCAAiB,CAAA;IACjB,+BAAe,CAAA;IACf,mCAAmB,CAAA;IACnB,6CAA6B,CAAA;AAC/B,CAAC,EAPW,YAAY,KAAZ,YAAY,QAOvB;AAED,MAAM,CAAN,IAAY,eAoBX;AApBD,WAAY,eAAe;IACzB,oCAAiB,CAAA;IACjB,oCAAiB,CAAA;IACjB,8BAAW,CAAA;IACX,oCAAiB,CAAA;IACjB,wCAAqB,CAAA;IACrB,8BAAW,CAAA;IACX,wCAAqB,CAAA;IACrB,6CAA0B,CAAA;IAC1B,2CAAwB,CAAA;IACxB,8BAAW,CAAA;IACX,gCAAa,CAAA;IACb,4CAAyB,CAAA;IACzB,4CAAyB,CAAA;IACzB,kDAA+B,CAAA;IAC/B,kDAA+B,CAAA;IAC/B,sDAAmC,CAAA;IACnC,sDAAmC,CAAA;IACnC,oCAAiB,CAAA;IACjB,kCAAe,CAAA;AACjB,CAAC,EApBW,eAAe,KAAf,eAAe,QAoB1B;AAED,MAAM,CAAN,IAAY,iBAKX;AALD,WAAY,iBAAiB;IAC3B,sCAAiB,CAAA;IACjB,wCAAmB,CAAA;IACnB,kDAA6B,CAAA;IAC7B,kDAA6B,CAAA;AAC/B,CAAC,EALW,iBAAiB,KAAjB,iBAAiB,QAK5B;AAiLD,MAAM,CAAN,IAAY,2BAIX;AAJD,WAAY,2BAA2B;IACrC,mDAAoB,CAAA;IACpB,oDAAqB,CAAA;IACrB,4CAAa,CAAA;AACf,CAAC,EAJW,2BAA2B,KAA3B,2BAA2B,QAItC;AA8YD,MAAM,CAAN,IAAY,yBAQX;AARD,WAAY,yBAAyB;IACnC,oDAAuB,CAAA;IACvB,uEAA0C,CAAA;IAC1C,+DAAkC,CAAA;IAClC,0EAA6C,CAAA;IAC7C,oEAAuC,CAAA;IACvC,wEAA2C,CAAA;IAC3C,kEAAqC,CAAA;AACvC,CAAC,EARW,yBAAyB,KAAzB,yBAAyB,QAQpC;AAED,MAAM,CAAN,IAAY,8BAIX;AAJD,WAAY,8BAA8B;IACxC,wDAAsB,CAAA;IACtB,qDAAmB,CAAA;IACnB,0DAAwB,CAAA;AAC1B,CAAC,EAJW,8BAA8B,KAA9B,8BAA8B,QAIzC;AAED,MAAM,CAAN,IAAY,2BAGX;AAHD,WAAY,2BAA2B;IACrC,iDAAkB,CAAA;IAClB,mDAAoB,CAAA;AACtB,CAAC,EAHW,2BAA2B,KAA3B,2BAA2B,QAGtC;AA0GD,MAAM,CAAN,IAAY,cAiBX;AAjBD,WAAY,cAAc;IACxB,mDAAiC,CAAA;IACjC,+DAA6C,CAAA;IAC7C,kDAAgC,CAAA;IAChC,0CAAwB,CAAA;IACxB,gDAA8B,CAAA;IAC9B,4CAA0B,CAAA;IAC1B,yDAAuC,CAAA;IACvC,mEAAiD,CAAA;IACjD,0CAAwB,CAAA;IACxB,4CAA0B,CAAA;IAC1B,0CAAwB,CAAA;IACxB,iEAA+C,CAAA;IAC/C,2DAAyC,CAAA;IACzC,gDAA8B,CAAA;IAC9B,yDAAuC,CAAA;IACvC,kDAAgC,CAAA;AAClC,CAAC,EAjBW,cAAc,KAAd,cAAc,QAiBzB;AAED,MAAM,CAAN,IAAY,eAYX;AAZD,WAAY,eAAe;IACzB,yCAAsB,CAAA;IACtB,0EAAuD,CAAA;IACvD,+CAA4B,CAAA;IAC5B,0DAAuC,CAAA;IACvC,4DAAyC,CAAA;IACzC,8DAA2C,CAAA;IAC3C,kEAA+C,CAAA;IAC/C,6CAA0B,CAAA;IAC1B,+CAA4B,CAAA;IAC5B,wDAAqC,CAAA;IACrC,6CAA0B,CAAA;AAC5B,CAAC,EAZW,eAAe,KAAf,eAAe,QAY1B;AAED,MAAM,CAAN,IAAY,8BAEX;AAFD,WAAY,8BAA8B;IACxC,iEAA+B,CAAA;AACjC,CAAC,EAFW,8BAA8B,KAA9B,8BAA8B,QAEzC","sourcesContent":["import {\n AttachmentValue,\n Document,\n LocationValue,\n MultiLangValue,\n PaginatedRequest,\n SearchPermissions,\n ShareEmailRequest,\n ShareWhatsappRequest,\n} from '@bisondesk/commons-sdk/types';\nimport { BaseEvent } from './internal-events.js';\nimport { VehicleSaleLogisticsStatus } from './opportunities.js';\nimport { OpportunityReservation } from './reservations.js';\nimport { DataRecord } from './utils.js';\nimport { VehicleBusinessOverviewXL } from './vehicle-performance.js';\nimport { VehicleSaleInfo } from './vehicle-sales.js';\n\nexport enum VehicleRoles {\n SALE = 'SALE',\n OWN_USE = 'OWN_USE',\n RENTAL = 'RENTAL',\n BUILD = 'BUILD',\n UNKNOWN = 'UNKNOWN',\n BANK_FINANCE = 'BANK_FINANCE',\n}\n\nexport enum VehicleFuelType {\n Petrol = 'PETROL',\n Diesel = 'DIESEL',\n LPG = 'LPG',\n LPG_G3 = 'LPG_G3',\n Electric = 'ELECTRIC',\n CNG = 'CNG',\n Hydrogen = 'HYDROGEN',\n BioEthanol = 'BIO_ETHANOL',\n BioDiesel = 'BIO_DIESEL',\n E85 = 'E85',\n HCNG = 'HCNG',\n LPG_Petrol = 'LPG_PETROL',\n LPG_Diesel = 'LPG_DIESEL',\n LPG_G3_Petrol = 'LPG_G3_PETROL',\n LPG_G3_Diesel = 'LPG_G3_DIESEL',\n Electric_Diesel = 'ELECTRIC_DIESEL',\n Electric_Petrol = 'ELECTRIC_PETROL',\n Hybrid = 'HYBRID',\n Other = 'OTHER',\n}\n\nexport enum VehicleTachoTypes {\n Analog = 'ANALOG',\n Digital = 'DIGITAL',\n SmartTacho1 = 'SMART_TACHO_1',\n SmartTacho2 = 'SMART_TACHO_2',\n}\n\ntype BaseVehicleEvent = BaseEvent & {\n id: string;\n actionAt: string;\n userId: string;\n tenantId: string;\n};\n\ntype VehicleSuperstructure = {\n carCapacity?: number;\n compartmentCount?: number;\n counter?: boolean;\n crane?: {\n make?: string;\n model?: string;\n position?: 'Behind the cabin' | 'Rear';\n present?: boolean;\n year?: number;\n };\n dimensions?: {\n height?: number;\n length?: number;\n width?: number;\n extended?: string; // L1, L2, ...\n heightened?: string; // H1, H2, ...\n };\n baseVehicle?: SuperstructureBaseVehicle;\n extendable?: boolean;\n highPressurePump?: boolean;\n loadingPlatformHeight?: number;\n pump?: boolean;\n slidingRoof?: boolean;\n tailgate?: {\n capacity?: number;\n make?: string;\n model?: string;\n present?: boolean;\n type?: 'slider_lift' | 'cantilever' | 'column_lift';\n };\n tank?: {\n capacity: number; //litters\n volume?: number; //m3\n };\n temperatureControl?: {\n engineType?: 'diesel' | 'electric' | 'diesel+electric' | 'engine';\n make?: string;\n runningHours?: {\n diesel?: number;\n electric?: number;\n };\n };\n tipper?: {\n tipsBack?: boolean;\n tipsLeft?: boolean;\n tipsRight?: boolean;\n };\n};\n\nexport type NewVehicleRequest = {\n branch: string;\n count: number;\n specs: VehicleExternalInfo;\n description: {\n remarks?: string;\n technicalRemarks?: string;\n };\n salesConditions?: {\n marginScheme?: boolean;\n manufacturerWarranty?: {\n remarks?: string;\n available?: boolean;\n };\n };\n logistics: {\n parking?: string;\n deliveryType?: VehiclePurchaseDeliveryType;\n pickupAddress?: LocationValue;\n status: VehiclePurchaseLogisticsStatus;\n };\n prices: {\n minimum?: string;\n premium?: string;\n internet?: string;\n };\n media: {\n internalPictures: AttachmentValue[];\n pictures: AttachmentValue[];\n videos: AttachmentValue[];\n docs: Document[];\n engineeringDocs: Document[];\n };\n vinList?: string;\n deal: {\n offerId?: string;\n stockNumber?: string;\n contactId: string;\n orgId: string;\n purchasedBy: string;\n purchaseAssistedBy?: string;\n readyToDeliver?: boolean;\n dealStatus: VehiclePurchaseDealStatus;\n costs: {\n purchase: string;\n purchaseVatPercentage: string;\n commission?: string;\n externalTransport?: string;\n internalTransport?: string;\n externalGarage?: string;\n internalGarage?: string;\n other?: string;\n bonus?: string;\n };\n logistics: {\n availableDate: string;\n vehicleRole: VehicleRoles;\n };\n };\n};\n\nexport type VehicleCreateEvent = BaseVehicleEvent & {\n action: 'create';\n vehicle: Vehicle;\n previousVehicle?: undefined;\n};\n\nexport type VehicleUpdateEvent = BaseVehicleEvent & {\n action: 'update';\n vehicle: Vehicle;\n previousVehicle: Vehicle;\n};\n\nexport type VehicleDeleteEvent = BaseVehicleEvent & {\n action: 'delete';\n vehicle?: undefined;\n previousVehicle: Vehicle;\n};\n\nexport type VehicleEvent = VehicleCreateEvent | VehicleUpdateEvent | VehicleDeleteEvent;\n\ntype BaseVehiclePurchaseEvent = {\n actionAt: string;\n userId: string;\n tenantId: string;\n branchId: string;\n vehicleId: string;\n};\n\nexport type VehiclePurchaseCreateEvent = BaseVehiclePurchaseEvent & {\n action: 'create';\n data: VehiclePurchase;\n previousData?: undefined;\n};\n\nexport type VehiclePurchaseUpdateEvent = BaseVehiclePurchaseEvent & {\n action: 'update';\n data: VehiclePurchase;\n previousData: VehiclePurchase;\n};\n\nexport type VehiclePurchaseEvent = BaseEvent &\n (VehiclePurchaseCreateEvent | VehiclePurchaseUpdateEvent);\n\nexport type UpdateVehiclesPricesEvent = {\n id: string;\n actionAt: string;\n userId: string;\n tenantId: string;\n priceList: AttachmentValue;\n};\n\nexport type PublicVehicle = Pick<Vehicle, 'external' | 'id'>;\n\nexport type PublicSearchVehicle = {\n vehicle: PublicVehicle;\n};\n\nexport enum SearchVehicleSaleDealStatus {\n NotSold = 'NOT_SOLD',\n Reserved = 'RESERVED',\n Sold = 'SOLD',\n}\n\nexport type SearchVehicle = {\n custom: {\n features: string[];\n sold: boolean;\n isReserved: boolean;\n hasPayments: boolean;\n publishedOnWebsiteAt?: string;\n originalBranchId: string;\n };\n customSortableFields: {\n priceChangedAt?: string;\n checkedInAt?: string;\n saleAgreementAt?: string;\n };\n purchase?: {\n supplierStockNumber?: string;\n readyToDeliver: boolean;\n dealStatus?: VehiclePurchaseDealStatus;\n logisticsStatus?: VehiclePurchaseLogisticsStatus;\n purchasedBy?: string;\n parkingName?: string;\n organizationId: string;\n organizationExternalId?: number;\n fullPaymentSentAt?: string;\n marketingStartedAt?: string;\n arrivedAt?: string;\n };\n reservation?: Pick<OpportunityReservation, 'expiresAt' | 'opportunityId' | 'createdBy'>;\n vehicle: Vehicle;\n sale: {\n opportunityId?: string;\n externalSaleId?: string;\n soldAt?: string;\n soldBy?: string;\n sellers?: string[]; // opportunity account manager [+ assistant]\n dealStatus: SearchVehicleSaleDealStatus;\n logisticStatus?: VehicleSaleLogisticsStatus;\n };\n};\n\nexport type InputSearchVehicle = SearchVehicle & {\n permissions?: SearchPermissions;\n};\n\nexport type PriceChangeEvent = BaseEvent & {\n tenantId: string;\n userId: string;\n vehicleId: string;\n input: {\n previousPrices: VehiclePricingHistoryInput;\n currentPrices: VehiclePricingHistoryInput;\n };\n};\n\nexport type VehiclePricingHistory = {\n pricing: VehiclePricingHistoryInput;\n createdAt: string;\n createdBy: string;\n};\n\nexport type VehiclePricingHistoryInput = VehiclePricing & { internet?: string };\n\nexport type VehiclePricing = {\n premium?: string;\n minimum?: string;\n currency?: string;\n};\n\nexport type RelatedVehicle = {\n vehicleId: string;\n description: string;\n stockNumber: string;\n};\n\nexport type VehicleInternalInfo = {\n createdAt: string;\n description: {\n title: string;\n remarks?: string;\n technicalRemarks?: string;\n };\n identification: {\n administrativeNumber?: string;\n stockNumber: string;\n branch: string;\n\n offerId?: string;\n licensePlateHistory?: {\n licensePlate: string;\n changedAt: string;\n }[];\n\n /**\n * This ID is used to link different vehicle objects that represent the same real world asset.\n * Ideally the chassis number could be used, but in some cases it is not available yet.\n */\n metaId: string;\n };\n documents: Document[];\n pictures: AttachmentValue[];\n engineeringDocs: Document[];\n pricing: VehiclePricing;\n role: VehicleRoles;\n status: VehicleStatus;\n updatedAt: string;\n /* use this property to store additional terms that you want the vehicle to be found with when doing a full text search */\n keywords?: string[];\n relatedVehicles: RelatedVehicle[];\n};\n\nexport type VehicleOriginalInfo = {\n tenantId: string;\n identification: {\n id: string;\n branchId: string;\n stockNumber: string;\n metaId?: string;\n };\n salesConditions: {\n leasing?: boolean;\n price?: string;\n currency?: string;\n marginScheme?: boolean;\n manufacturerWarranty?: {\n remarks?: string;\n available?: boolean;\n };\n };\n};\n\nexport type VehicleAxlesInfo = {\n details?: VehicleAxle[];\n configuration?: string;\n count?: number;\n poweredAxlesCount?: number;\n wheelbase?: number;\n suspension?: 'Air' | 'Air/Steel' | 'Steel';\n loadCapacity?: number;\n};\n\nexport type SuperstructureBaseVehicle = {\n category: string;\n make: string;\n model?: string;\n type?: string;\n axlesConfiguration?: string;\n emissionsClass?: string;\n transmissionType?: 'Automatic' | 'Manual' | 'Semi-Automatic';\n vin?: string;\n currentRegistration?: {\n country?: string;\n };\n suspension?: 'Air' | 'Air/Steel' | 'Steel';\n constructionYear?: number;\n firstRegistration?: string;\n odometerKm?: number;\n powerHp?: number;\n bodystyle?: string;\n accessories: VehicleExternalInfo['accessories'];\n superstructure?: Pick<VehicleSuperstructure, 'crane' | 'tailgate'>;\n};\n\n// mostly inspired by the Hexon data model\nexport type VehicleExternalInfo = {\n body?: {\n cabin?: {\n type: 'Day' | 'Sleep / Small' | 'Sleep / Medium' | 'Sleep / Large';\n model?: string;\n };\n colour?: string;\n dimensions?: {\n height?: number;\n length?: number;\n width?: number;\n };\n doorCount?: number;\n interior?: {\n bedCount?: number;\n seatCount?: number;\n };\n internalDimensions?: {\n //for Trailers/Semi-trailers of type reefers, box, curtainsides\n height?: number;\n length?: number;\n width?: number;\n };\n kingpin?: {\n //for Trailers/Semi-trailers\n size?: number; // in inches\n capacity?: number; // in kg\n };\n fifthWheelHeight?: number; //for new trailers in mm\n };\n mainPicture?: AttachmentValue;\n pictures?: AttachmentValue[];\n videos?: AttachmentValue[];\n condition?: {\n damaged?: boolean;\n odometer?: {\n km?: number;\n };\n used?: boolean;\n };\n general: {\n bodystyle?: string;\n category: string;\n make?: string;\n model?: string;\n modelName?: string;\n type?: string;\n typeName?: string;\n tacho?: VehicleTachoTypes;\n color?: {\n mainColorHex?: string; //Hex color code\n chassisColorReferenceCode?: string; //Maker reference code. For now, mainly relevant for new trailers\n upperStructureColorReferenceCode?: string; //Maker reference code. For now, mainly relevant for new trailers\n };\n };\n history?: {\n advertisingYear?: number;\n constructionYear?: number;\n currentRegistration?: {\n country?: string;\n technicalInspectionEndDate?: string;\n carpassUrl?: string;\n carpassAvailable?: boolean;\n };\n firstRegistration?: string;\n cocPvg?: string;\n };\n identification: {\n licensePlate?: string;\n stockNumber?: string;\n vin?: string;\n buildStockNumber?: string;\n engineNumber?: string;\n };\n trailers?: {\n cooler?: {\n hasCooler?: boolean;\n make?: string;\n };\n };\n powertrain?: {\n axles?: VehicleAxlesInfo;\n emissions?: {\n class?: string;\n subclass?: string;\n };\n engine?: {\n cylinderCount?: number;\n energy?: { type?: VehicleFuelType };\n power?: {\n hp?: number;\n };\n displacement?: number;\n };\n transmission?: {\n gearCount?: number;\n make?: string;\n model?: string;\n type?: 'Automatic' | 'Manual' | 'Semi-Automatic';\n };\n };\n salesConditions: {\n leasing?: boolean;\n price?: string | undefined;\n currency?: string | undefined;\n marginScheme?: boolean;\n manufacturerWarranty?: {\n remarks?: string;\n available?: boolean;\n };\n };\n superstructure?: VehicleSuperstructure;\n weights?: {\n gvw?: number;\n massEmpty?: number;\n };\n accessories: {\n abs?: boolean;\n jumbo?: boolean;\n adr?: boolean;\n airco?: boolean;\n alloyWheels?: boolean;\n aluminiumFuelTank?: boolean;\n cdPlayer?: boolean;\n coil?: boolean;\n centralLocking?: boolean;\n centralLubrication?: boolean;\n cruiseControl?: boolean;\n electricDoorMirrors?: boolean;\n electricWindows?: boolean;\n engineBrake?: boolean;\n forklift?: boolean;\n navigationSystem?: boolean;\n hydraulicTipperKit?: boolean;\n lowDeck?: boolean;\n lowNoise?: boolean;\n parkingHeater?: boolean;\n particleFilter?: boolean;\n powerTakeOff?: boolean;\n refrigerator?: boolean;\n retarderIntarder?: boolean;\n reversingCamera?: boolean;\n roofSpoiler?: boolean;\n sideSkirts?: boolean;\n spareKey?: boolean;\n spareWheel?: boolean;\n speedLimiter?: boolean;\n spoilers?: boolean;\n spotlights?: boolean;\n stabilityControl?: boolean;\n standardAirco?: boolean;\n television?: boolean;\n toolbox?: boolean;\n trailerCoupling?: boolean;\n twinFuelTank?: boolean;\n visor?: boolean;\n xenonLights?: boolean;\n };\n publicLink?: string;\n};\n\ntype BaseVehicle<I = VehicleInternalInfo, E = VehicleExternalInfo> = {\n internal: I;\n external: E;\n original?: VehicleOriginalInfo;\n};\n\nexport type NewVehicle<I = VehicleInternalInfo, E = VehicleExternalInfo> = BaseVehicle<I, E> & {\n id?: undefined;\n};\n\nexport type Vehicle<I = VehicleInternalInfo, E = VehicleExternalInfo> = BaseVehicle<I, E> & {\n id: string;\n};\n\nexport type VehicleBffMetadata = {\n openOpportunities: number;\n};\n\nexport type VehicleBff = {\n vehicle: DataRecord<Vehicle, VehicleBffMetadata>;\n sale?: VehicleSaleInfo;\n purchase?: VehiclePurchase;\n overview?: VehicleBusinessOverviewXL;\n marketing?: {\n titles?: MultiLangValue;\n listed: boolean;\n sharable: boolean;\n publishedOnWebsiteAt?: string;\n numPlatformsPublished: number;\n };\n};\n\nexport type VehiclesByChassisNumberRequest = {\n tenantIds: string[];\n chassisNumber: string;\n};\n\nexport type VehiclesByMetaIdRequest = {\n tenantIds: string[];\n metaId: string;\n};\n\nexport type VehicleAxle = {\n make?: string;\n alloyWheels?: boolean;\n brakes?: 'Disc' | 'Drum';\n differentialLock?: boolean;\n liftAxle?: boolean;\n maxLoad?: number;\n nr: number;\n position?: string;\n powered?: boolean;\n reduction?: string;\n steering?: boolean;\n suspension?: 'Steel' | 'Air' | 'Hydraulic';\n twinWheels?: boolean;\n tyreSize?: string;\n tyreConditionType?: 'mm' | '%';\n\n tyreConditionMmLeftInside?: number;\n tyreConditionMmLeftOutside?: number;\n tyreConditionMmRightInside?: number;\n tyreConditionMmRightOutside?: number;\n\n tyreConditionPercLeftInside?: number;\n tyreConditionPercLeftOutside?: number;\n tyreConditionPercRightInside?: number;\n tyreConditionPercRightOutside?: number;\n\n steeringType?: 'fixed' | 'self_steering' | 'hydraulic';\n};\n\nexport enum VehiclePurchaseDealStatus {\n Marketing = 'MARKETING',\n PurchaseEvaluation = 'PURCHASE_EVALUATION', // used for vehicle consignation\n PurchaseAgreed = 'PURCHASE_AGREED',\n FirstPaymentAllowed = 'FIRST_PAYMENT_ALLOWED',\n FirstPaymentSent = 'FIRST_PAYMENT_SENT',\n FullPaymentAllowed = 'FULL_PAYMENT_ALLOWED',\n FullPaymentSent = 'FULL_PAYMENT_SENT',\n}\n\nexport enum VehiclePurchaseLogisticsStatus {\n AtOrigin = 'AT_ORIGIN',\n Arrived = 'ARRIVED',\n CheckedIn = 'CHECKED_IN',\n}\n\nexport enum VehiclePurchaseDeliveryType {\n PickUp = 'PICK_UP',\n DropOff = 'DROP_OFF',\n}\n\nexport type VehicleStatus = {\n deleted?: boolean;\n};\n\nexport type VehiclePriceList = {\n uploadedAt: string;\n uploadedBy: string;\n priceList: AttachmentValue;\n id: string;\n};\n\nexport type UpdateVehiclesPricesRequest = {\n priceList: AttachmentValue;\n};\n\nexport type VehiclePriceListLine = {\n reference: string;\n internet?: string;\n premium?: string;\n minimum?: string;\n};\n\nexport type VehiclePriceUpdateError = {\n data: VehiclePriceListLine;\n line: number;\n error: {\n fieldId: keyof VehiclePriceListLine;\n msg: string;\n };\n};\n\nexport type VehiclePriceUpdateResponse =\n | {\n success: true;\n }\n | {\n success: false;\n errors: VehiclePriceUpdateError[];\n };\n\nexport type VehiclePurchase = {\n organizationId: string;\n contactId: string;\n supplierStockNumber?: string;\n purchasedBy: string;\n purchaseAssistedBy?: string;\n\n log: {\n // computed automatically by the backend\n marketingStartedAt?: string;\n marketingStartedBy?: string;\n\n evaluationStartedAt?: string;\n evaluationStartedBy?: string;\n\n purchaseAgreedAt?: string;\n purchaseAgreedBy?: string;\n\n firstPaymentAllowedAt?: string;\n firstPaymentAllowedBy?: string;\n firstPaymentSentAt?: string;\n firstPaymentSentBy?: string;\n\n fullPaymentAllowedAt?: string;\n fullPaymentAllowedBy?: string;\n fullPaymentSentAt?: string;\n fullPaymentSentBy?: string;\n\n arrivedAt?: string;\n arrivedBy?: string;\n\n checkedInAt?: string;\n checkedInBy?: string;\n };\n\n deal: {\n status: VehiclePurchaseDealStatus; // partially set by the user, if there are payments then it is set automatically by the backend\n readyToDeliver?: boolean;\n\n purchaseVatRate?: string;\n purchase?: string; // exclusive VAT\n\n bonus?: string; // sometimes manufacturers pay us a bonus when we reach a target\n\n // estimated costs, real costs come from actual invoices\n commission?: string;\n externalTransport?: string;\n internalTransport?: string;\n externalGarage?: string;\n internalGarage?: string;\n other?: string;\n\n totalCosts?: string; // exclusive VAT\n };\n\n logistics: {\n parkingName?: string;\n status: VehiclePurchaseLogisticsStatus; // manually set by the user\n deliveryType?: VehiclePurchaseDeliveryType;\n pickupAddress?: LocationValue;\n availableWeek?: string; // ISOWEEK, e.g. 2016-W02\n };\n};\n\nexport enum VehicleActions {\n EditAdminDocs = 'edit_admin_docs',\n EditEngineeringDocs = 'edit_engineering_docs',\n EditMarketing = 'edit_marketing',\n EditMedia = 'edit_media',\n EditPictures = 'edit_pictures',\n EditPrices = 'edit_prices',\n EditPurchaseDeal = 'edit_purchase_deal',\n EditPurchaseLogistics = 'edit_purchase_logistics',\n EditSpecs = 'edit_specs',\n EditVideos = 'edit_videos',\n ViewLeads = 'view_leads',\n ViewBusinessOverview = 'view_business_overview',\n ViewSimilarOnline = 'view_similar_online',\n ViewPurchase = 'view_purchase',\n ViewPriceHistory = 'view_price_history',\n DeleteVehicle = 'delete_vehicle',\n}\n\nexport enum PurchaseActions {\n ViewDeal = 'view_deal',\n ViewSupplierOrganization = 'view_supplier_organization',\n ViewContact = 'view_contact',\n ViewLegalAddress = 'view_legal_address',\n ViewPickupAddress = 'view_pickup_address',\n ViewEstimatedCosts = 'view_estimated_costs',\n ViewFinanceDocuments = 'view_finance_documents',\n AddPayment = 'add_payment',\n EditPayment = 'edit_payment',\n MarkPaymentDone = 'mark_payment_done',\n AddRemarks = 'add_remarks',\n}\n\nexport enum VehicleBusinessOverviewActions {\n View = 'view_business_overview',\n}\n\nexport type VehicleShareEmailRequest = ShareEmailRequest & {\n pictures: AttachmentValue[];\n};\n\nexport type VehicleShareData = {\n title: string;\n mainPicture?: string;\n pictures: {\n picture: string;\n }[];\n message: string;\n specs: {\n name: string;\n value: string;\n }[];\n features: {\n name: string;\n }[];\n stockNumber: string;\n price?: string;\n description?: string;\n publicLink?: string;\n};\n\nexport type MarketingEmailData = {\n message: string;\n vehicles: VehicleShareData[];\n vehiclePairs: { first: VehicleShareData; second?: VehicleShareData }[];\n lastVehicle?: VehicleShareData;\n};\n\nexport type VehicleReservationCreateEvent = BaseVehicleEvent & {\n action: 'create';\n reservation: OpportunityReservation;\n previousReservation?: undefined;\n};\n\nexport type VehicleReservationUpdateEvent = BaseVehicleEvent & {\n action: 'update';\n reservation: OpportunityReservation;\n previousReservation: OpportunityReservation;\n};\n\nexport type VehicleReservationDeleteEvent = BaseVehicleEvent & {\n action: 'delete';\n reservation?: undefined;\n previousReservation: OpportunityReservation;\n};\n\nexport type VehicleReservationEvent =\n | VehicleReservationCreateEvent\n | VehicleReservationUpdateEvent\n | VehicleReservationDeleteEvent;\n\nexport type ShareVehicleViaWahtsappRequest = {\n data: ShareWhatsappRequest;\n vehicleId: string;\n};\n\ntype RecordChange = {\n modifiedAt: string;\n modifiedBy: string;\n};\n\nexport type VehicleChange = RecordChange & {\n vehicle: Vehicle;\n};\n\nexport type PurchaseChange = RecordChange & {\n purchase: VehiclePurchase;\n};\n\nexport type RecordChangeRequest = PaginatedRequest & {\n fieldPath?: string;\n};\n"]}
1
+ {"version":3,"file":"vehicles.js","sourceRoot":"/","sources":["types/vehicles.ts"],"names":[],"mappings":"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","sourcesContent":["import {\n AttachmentValue,\n Document,\n LocationValue,\n MultiLangValue,\n PaginatedRequest,\n SearchPermissions,\n ShareEmailRequest,\n ShareWhatsappRequest,\n} from '@bisondesk/commons-sdk/types';\nimport { BaseEvent } from './internal-events.js';\nimport { VehicleSaleLogisticsStatus } from './opportunities.js';\nimport { OpportunityReservation } from './reservations.js';\nimport { DataRecord, ReferenceData } from './utils.js';\nimport { VehicleBusinessOverviewXL } from './vehicle-performance.js';\nimport { VehicleSaleInfo } from './vehicle-sales.js';\n\nexport enum VehicleRoles {\n SALE = 'SALE',\n OWN_USE = 'OWN_USE',\n RENTAL = 'RENTAL',\n BUILD = 'BUILD',\n UNKNOWN = 'UNKNOWN',\n BANK_FINANCE = 'BANK_FINANCE',\n}\n\nexport enum VehicleFuelType {\n Petrol = 'PETROL',\n Diesel = 'DIESEL',\n LPG = 'LPG',\n LPG_G3 = 'LPG_G3',\n Electric = 'ELECTRIC',\n CNG = 'CNG',\n Hydrogen = 'HYDROGEN',\n BioEthanol = 'BIO_ETHANOL',\n BioDiesel = 'BIO_DIESEL',\n E85 = 'E85',\n HCNG = 'HCNG',\n LPG_Petrol = 'LPG_PETROL',\n LPG_Diesel = 'LPG_DIESEL',\n LPG_G3_Petrol = 'LPG_G3_PETROL',\n LPG_G3_Diesel = 'LPG_G3_DIESEL',\n Electric_Diesel = 'ELECTRIC_DIESEL',\n Electric_Petrol = 'ELECTRIC_PETROL',\n Hybrid = 'HYBRID',\n Other = 'OTHER',\n}\n\nexport enum VehicleTachoTypes {\n Analog = 'ANALOG',\n Digital = 'DIGITAL',\n SmartTacho1 = 'SMART_TACHO_1',\n SmartTacho2 = 'SMART_TACHO_2',\n}\n\ntype BaseVehicleEvent = BaseEvent & {\n id: string;\n actionAt: string;\n userId: string;\n tenantId: string;\n};\n\ntype VehicleSuperstructure = {\n carCapacity?: number;\n compartmentCount?: number;\n counter?: boolean;\n crane?: {\n make?: string;\n model?: string;\n position?: 'Behind the cabin' | 'Rear';\n present?: boolean;\n year?: number;\n };\n dimensions?: {\n height?: number;\n length?: number;\n width?: number;\n extended?: string; // L1, L2, ...\n heightened?: string; // H1, H2, ...\n };\n baseVehicle?: SuperstructureBaseVehicle;\n extendable?: boolean;\n highPressurePump?: boolean;\n loadingPlatformHeight?: number;\n pump?: boolean;\n slidingRoof?: boolean;\n tailgate?: {\n capacity?: number;\n make?: string;\n model?: string;\n present?: boolean;\n type?: 'slider_lift' | 'cantilever' | 'column_lift';\n };\n tank?: {\n capacity: number; //litters\n volume?: number; //m3\n };\n temperatureControl?: {\n engineType?: 'diesel' | 'electric' | 'diesel+electric' | 'engine';\n make?: string;\n runningHours?: {\n diesel?: number;\n electric?: number;\n };\n };\n tipper?: {\n tipsBack?: boolean;\n tipsLeft?: boolean;\n tipsRight?: boolean;\n };\n};\n\nexport type NewVehicleRequest = {\n branch: string;\n count: number;\n specs: VehicleExternalInfo;\n description: {\n remarks?: string;\n technicalRemarks?: string;\n };\n salesConditions?: {\n marginScheme?: boolean;\n manufacturerWarranty?: {\n remarks?: string;\n available?: boolean;\n };\n };\n logistics: {\n parking?: string;\n deliveryType?: VehiclePurchaseDeliveryType;\n pickupAddress?: LocationValue;\n status: VehiclePurchaseLogisticsStatus;\n };\n prices: {\n minimum?: string;\n premium?: string;\n internet?: string;\n };\n media: {\n internalPictures: AttachmentValue[];\n pictures: AttachmentValue[];\n videos: AttachmentValue[];\n docs: Document[];\n engineeringDocs: Document[];\n };\n vinList?: string;\n deal: {\n offerId?: string;\n stockNumber?: string;\n contactId: string;\n orgId: string;\n purchasedBy: string;\n purchaseAssistedBy?: string;\n readyToDeliver?: boolean;\n dealStatus: VehiclePurchaseDealStatus;\n costs: {\n purchase: string;\n purchaseVatPercentage: string;\n commission?: string;\n externalTransport?: string;\n internalTransport?: string;\n externalGarage?: string;\n internalGarage?: string;\n other?: string;\n bonus?: string;\n };\n logistics: {\n availableDate: string;\n vehicleRole: VehicleRoles;\n };\n };\n};\n\nexport type VehicleCreateEvent = BaseVehicleEvent & {\n action: 'create';\n vehicle: Vehicle;\n previousVehicle?: undefined;\n};\n\nexport type VehicleUpdateEvent = BaseVehicleEvent & {\n action: 'update';\n vehicle: Vehicle;\n previousVehicle: Vehicle;\n};\n\nexport type VehicleDeleteEvent = BaseVehicleEvent & {\n action: 'delete';\n vehicle?: undefined;\n previousVehicle: Vehicle;\n};\n\nexport type VehicleEvent = VehicleCreateEvent | VehicleUpdateEvent | VehicleDeleteEvent;\n\ntype BaseVehiclePurchaseEvent = {\n actionAt: string;\n userId: string;\n tenantId: string;\n branchId: string;\n vehicleId: string;\n};\n\nexport type VehiclePurchaseCreateEvent = BaseVehiclePurchaseEvent & {\n action: 'create';\n data: VehiclePurchase;\n previousData?: undefined;\n};\n\nexport type VehiclePurchaseUpdateEvent = BaseVehiclePurchaseEvent & {\n action: 'update';\n data: VehiclePurchase;\n previousData: VehiclePurchase;\n};\n\nexport type VehiclePurchaseEvent = BaseEvent &\n (VehiclePurchaseCreateEvent | VehiclePurchaseUpdateEvent);\n\nexport type UpdateVehiclesPricesEvent = {\n id: string;\n actionAt: string;\n userId: string;\n tenantId: string;\n priceList: AttachmentValue;\n};\n\nexport type PublicVehicle = Pick<Vehicle, 'external' | 'id'>;\n\nexport type PublicSearchVehicle = {\n vehicle: PublicVehicle;\n};\n\nexport enum SearchVehicleSaleDealStatus {\n NotSold = 'NOT_SOLD',\n Reserved = 'RESERVED',\n Sold = 'SOLD',\n}\n\nexport type SearchVehicle = {\n custom: {\n features: string[];\n sold: boolean;\n isReserved: boolean;\n hasPayments: boolean;\n publishedOnWebsiteAt?: string;\n originalBranchId: string;\n };\n customSortableFields: {\n priceChangedAt?: string;\n checkedInAt?: string;\n saleAgreementAt?: string;\n };\n purchase?: {\n supplierStockNumber?: string;\n readyToDeliver: boolean;\n dealStatus?: VehiclePurchaseDealStatus;\n logisticsStatus?: VehiclePurchaseLogisticsStatus;\n purchasedBy?: string;\n parkingName?: string;\n organizationId: string;\n organizationExternalId?: number;\n fullPaymentSentAt?: string;\n marketingStartedAt?: string;\n arrivedAt?: string;\n };\n reservation?: Pick<OpportunityReservation, 'expiresAt' | 'opportunityId' | 'createdBy'>;\n vehicle: Vehicle;\n sale: {\n opportunityId?: string;\n externalSaleId?: string;\n soldAt?: string;\n soldBy?: string;\n sellers?: string[]; // opportunity account manager [+ assistant]\n dealStatus: SearchVehicleSaleDealStatus;\n logisticStatus?: VehicleSaleLogisticsStatus;\n };\n};\n\nexport type InputSearchVehicle = SearchVehicle & {\n permissions?: SearchPermissions;\n};\n\nexport type VehicleSearchMeta = ReferenceData & {\n matchingOffers?: {\n count: number;\n };\n};\n\nexport type PriceChangeEvent = BaseEvent & {\n tenantId: string;\n userId: string;\n vehicleId: string;\n input: {\n previousPrices: VehiclePricingHistoryInput;\n currentPrices: VehiclePricingHistoryInput;\n };\n};\n\nexport type VehiclePricingHistory = {\n pricing: VehiclePricingHistoryInput;\n createdAt: string;\n createdBy: string;\n};\n\nexport type VehiclePricingHistoryInput = VehiclePricing & { internet?: string };\n\nexport type VehiclePricing = {\n premium?: string;\n minimum?: string;\n currency?: string;\n};\n\nexport type RelatedVehicle = {\n vehicleId: string;\n description: string;\n stockNumber: string;\n};\n\nexport type VehicleInternalInfo = {\n createdAt: string;\n description: {\n title: string;\n remarks?: string;\n technicalRemarks?: string;\n };\n identification: {\n administrativeNumber?: string;\n stockNumber: string;\n branch: string;\n\n offerId?: string;\n licensePlateHistory?: {\n licensePlate: string;\n changedAt: string;\n }[];\n\n /**\n * This ID is used to link different vehicle objects that represent the same real world asset.\n * Ideally the chassis number could be used, but in some cases it is not available yet.\n */\n metaId: string;\n };\n documents: Document[];\n pictures: AttachmentValue[];\n engineeringDocs: Document[];\n pricing: VehiclePricing;\n role: VehicleRoles;\n status: VehicleStatus;\n updatedAt: string;\n /* use this property to store additional terms that you want the vehicle to be found with when doing a full text search */\n keywords?: string[];\n relatedVehicles: RelatedVehicle[];\n};\n\nexport type VehicleOriginalInfo = {\n tenantId: string;\n identification: {\n id: string;\n branchId: string;\n stockNumber: string;\n metaId?: string;\n };\n salesConditions: {\n leasing?: boolean;\n price?: string;\n currency?: string;\n marginScheme?: boolean;\n manufacturerWarranty?: {\n remarks?: string;\n available?: boolean;\n };\n };\n};\n\nexport type VehicleAxlesInfo = {\n details?: VehicleAxle[];\n configuration?: string;\n count?: number;\n poweredAxlesCount?: number;\n wheelbase?: number;\n suspension?: 'Air' | 'Air/Steel' | 'Steel';\n loadCapacity?: number;\n};\n\nexport type SuperstructureBaseVehicle = {\n category: string;\n make: string;\n model?: string;\n type?: string;\n axlesConfiguration?: string;\n emissionsClass?: string;\n transmissionType?: 'Automatic' | 'Manual' | 'Semi-Automatic';\n vin?: string;\n currentRegistration?: {\n country?: string;\n };\n suspension?: 'Air' | 'Air/Steel' | 'Steel';\n constructionYear?: number;\n firstRegistration?: string;\n odometerKm?: number;\n powerHp?: number;\n bodystyle?: string;\n accessories: VehicleExternalInfo['accessories'];\n superstructure?: Pick<VehicleSuperstructure, 'crane' | 'tailgate'>;\n};\n\n// mostly inspired by the Hexon data model\nexport type VehicleExternalInfo = {\n body?: {\n cabin?: {\n type: 'Day' | 'Sleep / Small' | 'Sleep / Medium' | 'Sleep / Large';\n model?: string;\n };\n colour?: string;\n dimensions?: {\n height?: number;\n length?: number;\n width?: number;\n };\n doorCount?: number;\n interior?: {\n bedCount?: number;\n seatCount?: number;\n };\n internalDimensions?: {\n //for Trailers/Semi-trailers of type reefers, box, curtainsides\n height?: number;\n length?: number;\n width?: number;\n };\n kingpin?: {\n //for Trailers/Semi-trailers\n size?: number; // in inches\n capacity?: number; // in kg\n };\n fifthWheelHeight?: number; //for new trailers in mm\n };\n mainPicture?: AttachmentValue;\n pictures?: AttachmentValue[];\n videos?: AttachmentValue[];\n condition?: {\n damaged?: boolean;\n odometer?: {\n km?: number;\n };\n used?: boolean;\n };\n general: {\n bodystyle?: string;\n category: string;\n make?: string;\n model?: string;\n modelName?: string;\n type?: string;\n typeName?: string;\n tacho?: VehicleTachoTypes;\n color?: {\n mainColorHex?: string; //Hex color code\n chassisColorReferenceCode?: string; //Maker reference code. For now, mainly relevant for new trailers\n upperStructureColorReferenceCode?: string; //Maker reference code. For now, mainly relevant for new trailers\n };\n };\n history?: {\n advertisingYear?: number;\n constructionYear?: number;\n currentRegistration?: {\n country?: string;\n technicalInspectionEndDate?: string;\n carpassUrl?: string;\n carpassAvailable?: boolean;\n };\n firstRegistration?: string;\n cocPvg?: string;\n };\n identification: {\n licensePlate?: string;\n stockNumber?: string;\n vin?: string;\n buildStockNumber?: string;\n engineNumber?: string;\n };\n trailers?: {\n cooler?: {\n hasCooler?: boolean;\n make?: string;\n };\n };\n powertrain?: {\n axles?: VehicleAxlesInfo;\n emissions?: {\n class?: string;\n subclass?: string;\n };\n engine?: {\n cylinderCount?: number;\n energy?: { type?: VehicleFuelType };\n power?: {\n hp?: number;\n };\n displacement?: number;\n };\n transmission?: {\n gearCount?: number;\n make?: string;\n model?: string;\n type?: 'Automatic' | 'Manual' | 'Semi-Automatic';\n };\n };\n salesConditions: {\n leasing?: boolean;\n price?: string | undefined;\n currency?: string | undefined;\n marginScheme?: boolean;\n manufacturerWarranty?: {\n remarks?: string;\n available?: boolean;\n };\n };\n superstructure?: VehicleSuperstructure;\n weights?: {\n gvw?: number;\n massEmpty?: number;\n };\n accessories: {\n abs?: boolean;\n jumbo?: boolean;\n adr?: boolean;\n airco?: boolean;\n alloyWheels?: boolean;\n aluminiumFuelTank?: boolean;\n cdPlayer?: boolean;\n coil?: boolean;\n centralLocking?: boolean;\n centralLubrication?: boolean;\n cruiseControl?: boolean;\n electricDoorMirrors?: boolean;\n electricWindows?: boolean;\n engineBrake?: boolean;\n forklift?: boolean;\n navigationSystem?: boolean;\n hydraulicTipperKit?: boolean;\n lowDeck?: boolean;\n lowNoise?: boolean;\n parkingHeater?: boolean;\n particleFilter?: boolean;\n powerTakeOff?: boolean;\n refrigerator?: boolean;\n retarderIntarder?: boolean;\n reversingCamera?: boolean;\n roofSpoiler?: boolean;\n sideSkirts?: boolean;\n spareKey?: boolean;\n spareWheel?: boolean;\n speedLimiter?: boolean;\n spoilers?: boolean;\n spotlights?: boolean;\n stabilityControl?: boolean;\n standardAirco?: boolean;\n television?: boolean;\n toolbox?: boolean;\n trailerCoupling?: boolean;\n twinFuelTank?: boolean;\n visor?: boolean;\n xenonLights?: boolean;\n };\n publicLink?: string;\n};\n\ntype BaseVehicle<I = VehicleInternalInfo, E = VehicleExternalInfo> = {\n internal: I;\n external: E;\n original?: VehicleOriginalInfo;\n};\n\nexport type NewVehicle<I = VehicleInternalInfo, E = VehicleExternalInfo> = BaseVehicle<I, E> & {\n id?: undefined;\n};\n\nexport type Vehicle<I = VehicleInternalInfo, E = VehicleExternalInfo> = BaseVehicle<I, E> & {\n id: string;\n};\n\nexport type VehicleBffMetadata = {\n openOpportunities: number;\n};\n\nexport type VehicleBff = {\n vehicle: DataRecord<Vehicle, VehicleBffMetadata>;\n sale?: VehicleSaleInfo;\n purchase?: VehiclePurchase;\n overview?: VehicleBusinessOverviewXL;\n marketing?: {\n titles?: MultiLangValue;\n listed: boolean;\n sharable: boolean;\n publishedOnWebsiteAt?: string;\n numPlatformsPublished: number;\n };\n};\n\nexport type VehiclesByChassisNumberRequest = {\n tenantIds: string[];\n chassisNumber: string;\n};\n\nexport type VehiclesByMetaIdRequest = {\n tenantIds: string[];\n metaId: string;\n};\n\nexport type VehicleAxle = {\n make?: string;\n alloyWheels?: boolean;\n brakes?: 'Disc' | 'Drum';\n differentialLock?: boolean;\n liftAxle?: boolean;\n maxLoad?: number;\n nr: number;\n position?: string;\n powered?: boolean;\n reduction?: string;\n steering?: boolean;\n suspension?: 'Steel' | 'Air' | 'Hydraulic';\n twinWheels?: boolean;\n tyreSize?: string;\n tyreConditionType?: 'mm' | '%';\n\n tyreConditionMmLeftInside?: number;\n tyreConditionMmLeftOutside?: number;\n tyreConditionMmRightInside?: number;\n tyreConditionMmRightOutside?: number;\n\n tyreConditionPercLeftInside?: number;\n tyreConditionPercLeftOutside?: number;\n tyreConditionPercRightInside?: number;\n tyreConditionPercRightOutside?: number;\n\n steeringType?: 'fixed' | 'self_steering' | 'hydraulic';\n};\n\nexport enum VehiclePurchaseDealStatus {\n Marketing = 'MARKETING',\n PurchaseEvaluation = 'PURCHASE_EVALUATION', // used for vehicle consignation\n PurchaseAgreed = 'PURCHASE_AGREED',\n FirstPaymentAllowed = 'FIRST_PAYMENT_ALLOWED',\n FirstPaymentSent = 'FIRST_PAYMENT_SENT',\n FullPaymentAllowed = 'FULL_PAYMENT_ALLOWED',\n FullPaymentSent = 'FULL_PAYMENT_SENT',\n}\n\nexport enum VehiclePurchaseLogisticsStatus {\n AtOrigin = 'AT_ORIGIN',\n Arrived = 'ARRIVED',\n CheckedIn = 'CHECKED_IN',\n}\n\nexport enum VehiclePurchaseDeliveryType {\n PickUp = 'PICK_UP',\n DropOff = 'DROP_OFF',\n}\n\nexport type VehicleStatus = {\n deleted?: boolean;\n};\n\nexport type VehiclePriceList = {\n uploadedAt: string;\n uploadedBy: string;\n priceList: AttachmentValue;\n id: string;\n};\n\nexport type UpdateVehiclesPricesRequest = {\n priceList: AttachmentValue;\n};\n\nexport type VehiclePriceListLine = {\n reference: string;\n internet?: string;\n premium?: string;\n minimum?: string;\n};\n\nexport type VehiclePriceUpdateError = {\n data: VehiclePriceListLine;\n line: number;\n error: {\n fieldId: keyof VehiclePriceListLine;\n msg: string;\n };\n};\n\nexport type VehiclePriceUpdateResponse =\n | {\n success: true;\n }\n | {\n success: false;\n errors: VehiclePriceUpdateError[];\n };\n\nexport type VehiclePurchase = {\n organizationId: string;\n contactId: string;\n supplierStockNumber?: string;\n purchasedBy: string;\n purchaseAssistedBy?: string;\n\n log: {\n // computed automatically by the backend\n marketingStartedAt?: string;\n marketingStartedBy?: string;\n\n evaluationStartedAt?: string;\n evaluationStartedBy?: string;\n\n purchaseAgreedAt?: string;\n purchaseAgreedBy?: string;\n\n firstPaymentAllowedAt?: string;\n firstPaymentAllowedBy?: string;\n firstPaymentSentAt?: string;\n firstPaymentSentBy?: string;\n\n fullPaymentAllowedAt?: string;\n fullPaymentAllowedBy?: string;\n fullPaymentSentAt?: string;\n fullPaymentSentBy?: string;\n\n arrivedAt?: string;\n arrivedBy?: string;\n\n checkedInAt?: string;\n checkedInBy?: string;\n };\n\n deal: {\n status: VehiclePurchaseDealStatus; // partially set by the user, if there are payments then it is set automatically by the backend\n readyToDeliver?: boolean;\n\n purchaseVatRate?: string;\n purchase?: string; // exclusive VAT\n\n bonus?: string; // sometimes manufacturers pay us a bonus when we reach a target\n\n // estimated costs, real costs come from actual invoices\n commission?: string;\n externalTransport?: string;\n internalTransport?: string;\n externalGarage?: string;\n internalGarage?: string;\n other?: string;\n\n totalCosts?: string; // exclusive VAT\n };\n\n logistics: {\n parkingName?: string;\n status: VehiclePurchaseLogisticsStatus; // manually set by the user\n deliveryType?: VehiclePurchaseDeliveryType;\n pickupAddress?: LocationValue;\n availableWeek?: string; // ISOWEEK, e.g. 2016-W02\n };\n};\n\nexport enum VehicleActions {\n EditAdminDocs = 'edit_admin_docs',\n EditEngineeringDocs = 'edit_engineering_docs',\n EditMarketing = 'edit_marketing',\n EditMedia = 'edit_media',\n EditPictures = 'edit_pictures',\n EditPrices = 'edit_prices',\n EditPurchaseDeal = 'edit_purchase_deal',\n EditPurchaseLogistics = 'edit_purchase_logistics',\n EditSpecs = 'edit_specs',\n EditVideos = 'edit_videos',\n ViewLeads = 'view_leads',\n ViewBusinessOverview = 'view_business_overview',\n ViewSimilarOnline = 'view_similar_online',\n ViewPurchase = 'view_purchase',\n ViewPriceHistory = 'view_price_history',\n DeleteVehicle = 'delete_vehicle',\n}\n\nexport enum PurchaseActions {\n ViewDeal = 'view_deal',\n ViewSupplierOrganization = 'view_supplier_organization',\n ViewContact = 'view_contact',\n ViewLegalAddress = 'view_legal_address',\n ViewPickupAddress = 'view_pickup_address',\n ViewEstimatedCosts = 'view_estimated_costs',\n ViewFinanceDocuments = 'view_finance_documents',\n AddPayment = 'add_payment',\n EditPayment = 'edit_payment',\n MarkPaymentDone = 'mark_payment_done',\n AddRemarks = 'add_remarks',\n}\n\nexport enum VehicleBusinessOverviewActions {\n View = 'view_business_overview',\n}\n\nexport type VehicleShareEmailRequest = ShareEmailRequest & {\n pictures: AttachmentValue[];\n};\n\nexport type VehicleShareData = {\n title: string;\n mainPicture?: string;\n pictures: {\n picture: string;\n }[];\n message: string;\n specs: {\n name: string;\n value: string;\n }[];\n features: {\n name: string;\n }[];\n stockNumber: string;\n price?: string;\n description?: string;\n publicLink?: string;\n};\n\nexport type MarketingEmailData = {\n message: string;\n vehicles: VehicleShareData[];\n vehiclePairs: { first: VehicleShareData; second?: VehicleShareData }[];\n lastVehicle?: VehicleShareData;\n};\n\nexport type VehicleReservationCreateEvent = BaseVehicleEvent & {\n action: 'create';\n reservation: OpportunityReservation;\n previousReservation?: undefined;\n};\n\nexport type VehicleReservationUpdateEvent = BaseVehicleEvent & {\n action: 'update';\n reservation: OpportunityReservation;\n previousReservation: OpportunityReservation;\n};\n\nexport type VehicleReservationDeleteEvent = BaseVehicleEvent & {\n action: 'delete';\n reservation?: undefined;\n previousReservation: OpportunityReservation;\n};\n\nexport type VehicleReservationEvent =\n | VehicleReservationCreateEvent\n | VehicleReservationUpdateEvent\n | VehicleReservationDeleteEvent;\n\nexport type ShareVehicleViaWahtsappRequest = {\n data: ShareWhatsappRequest;\n vehicleId: string;\n};\n\ntype RecordChange = {\n modifiedAt: string;\n modifiedBy: string;\n};\n\nexport type VehicleChange = RecordChange & {\n vehicle: Vehicle;\n};\n\nexport type PurchaseChange = RecordChange & {\n purchase: VehiclePurchase;\n};\n\nexport type RecordChangeRequest = PaginatedRequest & {\n fieldPath?: string;\n};\n"]}
@@ -1,4 +1,8 @@
1
+ import { Decimal } from 'decimal.js';
2
+ import { CustomLeasingQuoteExtraInput, LeasingItemsPaymentSplit } from '../types/leasing-settings.js';
1
3
  import { ConditionsRef, LeasingContract, LeasingContractClient, OpportunityRef } from '../types/leasing.js';
2
4
  export declare const sortContractClients: (clients: LeasingContractClient[]) => LeasingContractClient[];
3
5
  export declare const getDealRef: ({ conditions, opportunities, }: Pick<LeasingContract, "conditions" | "opportunities">) => ConditionsRef | OpportunityRef;
6
+ export declare const getItemClientPercentage: (value: LeasingItemsPaymentSplit) => Decimal;
7
+ export declare const getLeasingExtrasTotal: (extras: CustomLeasingQuoteExtraInput[]) => Decimal;
4
8
  //# sourceMappingURL=leasing.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"leasing.d.ts","sourceRoot":"/","sources":["utils/leasing.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,aAAa,EACb,eAAe,EACf,qBAAqB,EACrB,cAAc,EACf,MAAM,qBAAqB,CAAC;AAG7B,eAAO,MAAM,mBAAmB,GAAI,SAAS,qBAAqB,EAAE,KAAG,qBAAqB,EAQzF,CAAC;AAEJ,eAAO,MAAM,UAAU,GAAI,gCAGxB,IAAI,CAAC,eAAe,EAAE,YAAY,GAAG,eAAe,CAAC,KAAG,aAAa,GAAG,cACjC,CAAC"}
1
+ {"version":3,"file":"leasing.d.ts","sourceRoot":"/","sources":["utils/leasing.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC,OAAO,EACL,4BAA4B,EAC5B,wBAAwB,EACzB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,aAAa,EACb,eAAe,EACf,qBAAqB,EACrB,cAAc,EACf,MAAM,qBAAqB,CAAC;AAG7B,eAAO,MAAM,mBAAmB,GAAI,SAAS,qBAAqB,EAAE,KAAG,qBAAqB,EAQzF,CAAC;AAEJ,eAAO,MAAM,UAAU,GAAI,gCAGxB,IAAI,CAAC,eAAe,EAAE,YAAY,GAAG,eAAe,CAAC,KAAG,aAAa,GAAG,cACjC,CAAC;AAE3C,eAAO,MAAM,uBAAuB,GAAI,OAAO,wBAAwB,KAAG,OAUzE,CAAC;AAEF,eAAO,MAAM,qBAAqB,GAAI,QAAQ,4BAA4B,EAAE,YAc3E,CAAC"}
@@ -1,6 +1,34 @@
1
1
  import { UTCDate } from '@date-fns/utc';
2
2
  import { format } from 'date-fns';
3
+ import { Decimal } from 'decimal.js';
3
4
  import { last, map, sortBy, uniqBy } from 'lodash-es';
5
+ import { LeasingItemsPaymentSplit, } from '../types/leasing-settings.js';
4
6
  export const sortContractClients = (clients) => sortBy(map(uniqBy(clients, (c) => c.takeoverId), (c) => ({ ...c, since: format(new UTCDate(c.since), 'yyyy-MM-dd') })), (cli) => cli.since, (cli) => (cli.takeoverId ? parseInt(cli.takeoverId.replace(/[^0-9]/g, '')) : 0));
5
7
  export const getDealRef = ({ conditions, opportunities, }) => last(conditions) ?? last(opportunities);
8
+ export const getItemClientPercentage = (value) => {
9
+ switch (value) {
10
+ case LeasingItemsPaymentSplit.Company:
11
+ return new Decimal(0);
12
+ case LeasingItemsPaymentSplit.Split:
13
+ return new Decimal(50);
14
+ case LeasingItemsPaymentSplit.Customer:
15
+ default:
16
+ return new Decimal(100);
17
+ }
18
+ };
19
+ export const getLeasingExtrasTotal = (extras) => {
20
+ let total = new Decimal(0);
21
+ for (const extra of extras) {
22
+ if (new Decimal(extra.leasingPercentage).lt(100)) {
23
+ const leasingRatio = new Decimal(1).sub(new Decimal(extra.leasingPercentage).div(100));
24
+ const paymentSplitRatio = getItemClientPercentage(extra.paymentSplit).div(100);
25
+ const extraAgreedPrice = new Decimal(extra.agreedPrice)
26
+ .mul(extra.quantity)
27
+ .mul(paymentSplitRatio)
28
+ .mul(leasingRatio);
29
+ total = total.add(extraAgreedPrice);
30
+ }
31
+ }
32
+ return total;
33
+ };
6
34
  //# sourceMappingURL=leasing.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"leasing.js","sourceRoot":"/","sources":["utils/leasing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAStD,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,OAAgC,EAA2B,EAAE,CAC/F,MAAM,CACJ,GAAG,CACD,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,EACpC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,IAAI,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,YAAY,CAAC,EAAE,CAAC,CACrE,EACD,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,KAAK,EAClB,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,UAAU,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAChF,CAAC;AAEJ,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,EACzB,UAAU,EACV,aAAa,GACyC,EAAkC,EAAE,CAC1F,IAAI,CAAC,UAAU,CAAC,IAAI,IAAI,CAAC,aAAa,CAAE,CAAC","sourcesContent":["import { UTCDate } from '@date-fns/utc';\nimport { format } from 'date-fns';\nimport { last, map, sortBy, uniqBy } from 'lodash-es';\nimport {\n ConditionsRef,\n LeasingContract,\n LeasingContractClient,\n OpportunityRef,\n} from '../types/leasing.js';\n\n/* sort from oldest to most recent client */\nexport const sortContractClients = (clients: LeasingContractClient[]): LeasingContractClient[] =>\n sortBy(\n map(\n uniqBy(clients, (c) => c.takeoverId),\n (c) => ({ ...c, since: format(new UTCDate(c.since), 'yyyy-MM-dd') }) // doing a map to also fix legacy data\n ),\n (cli) => cli.since,\n (cli) => (cli.takeoverId ? parseInt(cli.takeoverId.replace(/[^0-9]/g, '')) : 0)\n );\n\nexport const getDealRef = ({\n conditions,\n opportunities,\n}: Pick<LeasingContract, 'conditions' | 'opportunities'>): ConditionsRef | OpportunityRef =>\n last(conditions) ?? last(opportunities)!;\n"]}
1
+ {"version":3,"file":"leasing.js","sourceRoot":"/","sources":["utils/leasing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACtD,OAAO,EAEL,wBAAwB,GACzB,MAAM,8BAA8B,CAAC;AAStC,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,OAAgC,EAA2B,EAAE,CAC/F,MAAM,CACJ,GAAG,CACD,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,EACpC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,IAAI,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,YAAY,CAAC,EAAE,CAAC,CACrE,EACD,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,KAAK,EAClB,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,UAAU,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAChF,CAAC;AAEJ,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,EACzB,UAAU,EACV,aAAa,GACyC,EAAkC,EAAE,CAC1F,IAAI,CAAC,UAAU,CAAC,IAAI,IAAI,CAAC,aAAa,CAAE,CAAC;AAE3C,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,KAA+B,EAAW,EAAE;IAClF,QAAQ,KAAK,EAAE,CAAC;QACd,KAAK,wBAAwB,CAAC,OAAO;YACnC,OAAO,IAAI,OAAO,CAAC,CAAC,CAAC,CAAC;QACxB,KAAK,wBAAwB,CAAC,KAAK;YACjC,OAAO,IAAI,OAAO,CAAC,EAAE,CAAC,CAAC;QACzB,KAAK,wBAAwB,CAAC,QAAQ,CAAC;QACvC;YACE,OAAO,IAAI,OAAO,CAAC,GAAG,CAAC,CAAC;IAC5B,CAAC;AACH,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,MAAsC,EAAE,EAAE;IAC9E,IAAI,KAAK,GAAG,IAAI,OAAO,CAAC,CAAC,CAAC,CAAC;IAC3B,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,IAAI,IAAI,OAAO,CAAC,KAAM,CAAC,iBAAiB,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC;YAClD,MAAM,YAAY,GAAG,IAAI,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,OAAO,CAAC,KAAM,CAAC,iBAAiB,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;YACxF,MAAM,iBAAiB,GAAG,uBAAuB,CAAC,KAAM,CAAC,YAAY,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YAChF,MAAM,gBAAgB,GAAG,IAAI,OAAO,CAAC,KAAM,CAAC,WAAW,CAAC;iBACrD,GAAG,CAAC,KAAM,CAAC,QAAQ,CAAC;iBACpB,GAAG,CAAC,iBAAiB,CAAC;iBACtB,GAAG,CAAC,YAAY,CAAC,CAAC;YACrB,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;QACtC,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC,CAAC","sourcesContent":["import { UTCDate } from '@date-fns/utc';\nimport { format } from 'date-fns';\nimport { Decimal } from 'decimal.js';\nimport { last, map, sortBy, uniqBy } from 'lodash-es';\nimport {\n CustomLeasingQuoteExtraInput,\n LeasingItemsPaymentSplit,\n} from '../types/leasing-settings.js';\nimport {\n ConditionsRef,\n LeasingContract,\n LeasingContractClient,\n OpportunityRef,\n} from '../types/leasing.js';\n\n/* sort from oldest to most recent client */\nexport const sortContractClients = (clients: LeasingContractClient[]): LeasingContractClient[] =>\n sortBy(\n map(\n uniqBy(clients, (c) => c.takeoverId),\n (c) => ({ ...c, since: format(new UTCDate(c.since), 'yyyy-MM-dd') }) // doing a map to also fix legacy data\n ),\n (cli) => cli.since,\n (cli) => (cli.takeoverId ? parseInt(cli.takeoverId.replace(/[^0-9]/g, '')) : 0)\n );\n\nexport const getDealRef = ({\n conditions,\n opportunities,\n}: Pick<LeasingContract, 'conditions' | 'opportunities'>): ConditionsRef | OpportunityRef =>\n last(conditions) ?? last(opportunities)!;\n\nexport const getItemClientPercentage = (value: LeasingItemsPaymentSplit): Decimal => {\n switch (value) {\n case LeasingItemsPaymentSplit.Company:\n return new Decimal(0);\n case LeasingItemsPaymentSplit.Split:\n return new Decimal(50);\n case LeasingItemsPaymentSplit.Customer:\n default:\n return new Decimal(100);\n }\n};\n\nexport const getLeasingExtrasTotal = (extras: CustomLeasingQuoteExtraInput[]) => {\n let total = new Decimal(0);\n for (const extra of extras) {\n if (new Decimal(extra!.leasingPercentage).lt(100)) {\n const leasingRatio = new Decimal(1).sub(new Decimal(extra!.leasingPercentage).div(100));\n const paymentSplitRatio = getItemClientPercentage(extra!.paymentSplit).div(100);\n const extraAgreedPrice = new Decimal(extra!.agreedPrice)\n .mul(extra!.quantity)\n .mul(paymentSplitRatio)\n .mul(leasingRatio);\n total = total.add(extraAgreedPrice);\n }\n }\n return total;\n};\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bisondesk/core-sdk",
3
- "version": "1.0.553",
3
+ "version": "1.0.554",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "scripts": {
package/src/constants.ts CHANGED
@@ -22,6 +22,7 @@ export const VEHICLE_ROLES_PICKLIST_ID = 'vehicleRoles';
22
22
  export const MARKETING_PLATFORMS_PICKLIST_ID = 'marketingPlatforms';
23
23
  export const OFFER_STATUS_PICKLIST_ID = 'offerStatus';
24
24
  export const OFFER_SOURCE_PICKLIST_ID = 'offerSource';
25
+ export const OFFER_PRIORITY_PICKLIST_ID = 'offerPriority';
25
26
  export const OPPORTUNITY_STATUS_PICKLIST_ID = 'opportunityStatus';
26
27
  export const OPPORTUNITY_PAYMENT_STATUS_PICKLIST_ID = 'opportunityPaymentStatus';
27
28
  export const OPPORTUNITY_SOURCE_PICKLIST_ID = 'opportunity_source';
@@ -0,0 +1,13 @@
1
+ export var ActivityType;
2
+ (function (ActivityType) {
3
+ ActivityType["CALL"] = "call";
4
+ ActivityType["MEETING"] = "meeting";
5
+ ActivityType["EMAIL"] = "email";
6
+ ActivityType["CHAT"] = "chat";
7
+ })(ActivityType || (ActivityType = {}));
8
+ export var ActivityActions;
9
+ (function (ActivityActions) {
10
+ ActivityActions["DELETE"] = "delete";
11
+ ActivityActions["EDIT"] = "edit";
12
+ })(ActivityActions || (ActivityActions = {}));
13
+ //# sourceMappingURL=activities.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"activities.js","sourceRoot":"","sources":["activities.ts"],"names":[],"mappings":"AAGA,MAAM,CAAN,IAAY,YAKX;AALD,WAAY,YAAY;IACtB,6BAAa,CAAA;IACb,mCAAmB,CAAA;IACnB,+BAAe,CAAA;IACf,6BAAa,CAAA;AACf,CAAC,EALW,YAAY,KAAZ,YAAY,QAKvB;AAED,MAAM,CAAN,IAAY,eAGX;AAHD,WAAY,eAAe;IACzB,oCAAiB,CAAA;IACjB,gCAAa,CAAA;AACf,CAAC,EAHW,eAAe,KAAf,eAAe,QAG1B"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=comparables.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"comparables.js","sourceRoot":"","sources":["comparables.ts"],"names":[],"mappings":""}
@@ -0,0 +1,58 @@
1
+ export var OrganizatioRiskTags;
2
+ (function (OrganizatioRiskTags) {
3
+ OrganizatioRiskTags["BAD_FINANCIAL_INFO"] = "BAD_FINANCIAL_INFO";
4
+ OrganizatioRiskTags["VAT_NUMBER_INVALID"] = "VAT_NUMBER_INVALID";
5
+ OrganizatioRiskTags["INSTINCT"] = "INSTINCT";
6
+ OrganizatioRiskTags["NEW_CUSTOMER"] = "NEW_CUSTOMER";
7
+ OrganizatioRiskTags["BANK_ACCOUNT_BLOCKED"] = "BANK_ACCOUNT_BLOCKED";
8
+ OrganizatioRiskTags["NO_GPS"] = "NO_GPS";
9
+ })(OrganizatioRiskTags || (OrganizatioRiskTags = {}));
10
+ export var ContactActions;
11
+ (function (ContactActions) {
12
+ ContactActions["UPSERT"] = "upsert";
13
+ ContactActions["DELETE"] = "delete";
14
+ })(ContactActions || (ContactActions = {}));
15
+ export var OrganizationActions;
16
+ (function (OrganizationActions) {
17
+ OrganizationActions["ADD_ACTIVITY"] = "add_activity";
18
+ OrganizationActions["UPSERT"] = "upsert";
19
+ OrganizationActions["DELETE"] = "delete";
20
+ OrganizationActions["SELL_TO_ORGANIZATION"] = "sell_to_organization";
21
+ })(OrganizationActions || (OrganizationActions = {}));
22
+ export var MarketingChannel;
23
+ (function (MarketingChannel) {
24
+ MarketingChannel["Email"] = "email";
25
+ MarketingChannel["Whatsapp"] = "whatsapp";
26
+ MarketingChannel["Sms"] = "sms";
27
+ MarketingChannel["Phone"] = "phone";
28
+ })(MarketingChannel || (MarketingChannel = {}));
29
+ export var PartnerLevel;
30
+ (function (PartnerLevel) {
31
+ PartnerLevel["Internal"] = "05-internal";
32
+ PartnerLevel["Gold"] = "10-gold";
33
+ PartnerLevel["Silver"] = "20-silver";
34
+ PartnerLevel["Bronze"] = "30-bronze";
35
+ })(PartnerLevel || (PartnerLevel = {}));
36
+ export var SaveContactResolution;
37
+ (function (SaveContactResolution) {
38
+ SaveContactResolution["IgnoreDuplicates"] = "IGNORE_DUPLICATES";
39
+ SaveContactResolution["BlockDuplicates"] = "BLOCK_DUPLICATES";
40
+ })(SaveContactResolution || (SaveContactResolution = {}));
41
+ export var SaveOrgResolution;
42
+ (function (SaveOrgResolution) {
43
+ SaveOrgResolution["IgnoreDuplicates"] = "IGNORE_DUPLICATES";
44
+ SaveOrgResolution["BlockDuplicates"] = "BLOCK_DUPLICATES";
45
+ })(SaveOrgResolution || (SaveOrgResolution = {}));
46
+ export var CrmSearchScope;
47
+ (function (CrmSearchScope) {
48
+ CrmSearchScope["Tenant"] = "tenant";
49
+ CrmSearchScope["Conglomerate"] = "conglomerate";
50
+ })(CrmSearchScope || (CrmSearchScope = {}));
51
+ export var OrgEngagementType;
52
+ (function (OrgEngagementType) {
53
+ OrgEngagementType["offers"] = "offers";
54
+ OrgEngagementType["purchases"] = "purchases";
55
+ OrgEngagementType["opportunities"] = "opportunities";
56
+ OrgEngagementType["sales"] = "sales";
57
+ })(OrgEngagementType || (OrgEngagementType = {}));
58
+ //# sourceMappingURL=crm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"crm.js","sourceRoot":"","sources":["crm.ts"],"names":[],"mappings":"AAUA,MAAM,CAAN,IAAY,mBAOX;AAPD,WAAY,mBAAmB;IAC7B,gEAAyC,CAAA;IACzC,gEAAyC,CAAA;IACzC,4CAAqB,CAAA;IACrB,oDAA6B,CAAA;IAC7B,oEAA6C,CAAA;IAC7C,wCAAiB,CAAA;AACnB,CAAC,EAPW,mBAAmB,KAAnB,mBAAmB,QAO9B;AAED,MAAM,CAAN,IAAY,cAGX;AAHD,WAAY,cAAc;IACxB,mCAAiB,CAAA;IACjB,mCAAiB,CAAA;AACnB,CAAC,EAHW,cAAc,KAAd,cAAc,QAGzB;AAED,MAAM,CAAN,IAAY,mBAKX;AALD,WAAY,mBAAmB;IAC7B,oDAA6B,CAAA;IAC7B,wCAAiB,CAAA;IACjB,wCAAiB,CAAA;IACjB,oEAA6C,CAAA;AAC/C,CAAC,EALW,mBAAmB,KAAnB,mBAAmB,QAK9B;AAgKD,MAAM,CAAN,IAAY,gBAKX;AALD,WAAY,gBAAgB;IAC1B,mCAAe,CAAA;IACf,yCAAqB,CAAA;IACrB,+BAAW,CAAA;IACX,mCAAe,CAAA;AACjB,CAAC,EALW,gBAAgB,KAAhB,gBAAgB,QAK3B;AAWD,MAAM,CAAN,IAAY,YAKX;AALD,WAAY,YAAY;IACtB,wCAAwB,CAAA;IACxB,gCAAgB,CAAA;IAChB,oCAAoB,CAAA;IACpB,oCAAoB,CAAA;AACtB,CAAC,EALW,YAAY,KAAZ,YAAY,QAKvB;AA6CD,MAAM,CAAN,IAAY,qBAGX;AAHD,WAAY,qBAAqB;IAC/B,+DAAsC,CAAA;IACtC,6DAAoC,CAAA;AACtC,CAAC,EAHW,qBAAqB,KAArB,qBAAqB,QAGhC;AAED,MAAM,CAAN,IAAY,iBAGX;AAHD,WAAY,iBAAiB;IAC3B,2DAAsC,CAAA;IACtC,yDAAoC,CAAA;AACtC,CAAC,EAHW,iBAAiB,KAAjB,iBAAiB,QAG5B;AAED,MAAM,CAAN,IAAY,cAGX;AAHD,WAAY,cAAc;IACxB,mCAAiB,CAAA;IACjB,+CAA6B,CAAA;AAC/B,CAAC,EAHW,cAAc,KAAd,cAAc,QAGzB;AAED,MAAM,CAAN,IAAY,iBAKX;AALD,WAAY,iBAAiB;IAC3B,sCAAiB,CAAA;IACjB,4CAAuB,CAAA;IACvB,oDAA+B,CAAA;IAC/B,oCAAe,CAAA;AACjB,CAAC,EALW,iBAAiB,KAAjB,iBAAiB,QAK5B"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=dashboard.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dashboard.js","sourceRoot":"","sources":["dashboard.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export * from '@bisondesk/commons-sdk/definitions';
2
+ //# sourceMappingURL=definitions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"definitions.js","sourceRoot":"","sources":["definitions.ts"],"names":[],"mappings":"AAAA,cAAc,oCAAoC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from '@bisondesk/commons-sdk/fields';
2
+ //# sourceMappingURL=fields.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fields.js","sourceRoot":"","sources":["fields.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=insights.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"insights.js","sourceRoot":"","sources":["insights.ts"],"names":[],"mappings":""}
@@ -0,0 +1,6 @@
1
+ export var InterestActions;
2
+ (function (InterestActions) {
3
+ InterestActions["SET_INTEREST"] = "set_interest";
4
+ })(InterestActions || (InterestActions = {}));
5
+ export const isOpportunityInterest = (interest) => 'opportunityId' in interest;
6
+ //# sourceMappingURL=interests.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interests.js","sourceRoot":"","sources":["interests.ts"],"names":[],"mappings":"AAGA,MAAM,CAAN,IAAY,eAEX;AAFD,WAAY,eAAe;IACzB,gDAA6B,CAAA;AAC/B,CAAC,EAFW,eAAe,KAAf,eAAe,QAE1B;AAwBD,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,QAAkB,EAAmC,EAAE,CAC3F,eAAe,IAAI,QAAQ,CAAC"}
@@ -0,0 +1,18 @@
1
+ export var InternalEventTypes;
2
+ (function (InternalEventTypes) {
3
+ InternalEventTypes["VEHICLE_PURCHASE"] = "vehicle-purchases";
4
+ InternalEventTypes["ORGANIZATION"] = "organizations";
5
+ InternalEventTypes["CONTACT"] = "contacts";
6
+ InternalEventTypes["FINANCE_DOCUMENT"] = "finance-documents";
7
+ InternalEventTypes["OPPORTUNITY"] = "opportunities";
8
+ InternalEventTypes["VEHICLE"] = "vehicles";
9
+ InternalEventTypes["SALE_PAYMENT"] = "sale-payments";
10
+ InternalEventTypes["PURCHASE_PAYMENT"] = "vehicle-purchase-payments";
11
+ InternalEventTypes["OFFER"] = "offers";
12
+ })(InternalEventTypes || (InternalEventTypes = {}));
13
+ export var InternalNotificationChannels;
14
+ (function (InternalNotificationChannels) {
15
+ InternalNotificationChannels["APP"] = "app";
16
+ InternalNotificationChannels["EMAIL"] = "email";
17
+ })(InternalNotificationChannels || (InternalNotificationChannels = {}));
18
+ //# sourceMappingURL=internal-events.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"internal-events.js","sourceRoot":"","sources":["internal-events.ts"],"names":[],"mappings":"AASA,MAAM,CAAN,IAAY,kBAUX;AAVD,WAAY,kBAAkB;IAC5B,4DAAsC,CAAA;IACtC,oDAA8B,CAAA;IAC9B,0CAAoB,CAAA;IACpB,4DAAsC,CAAA;IACtC,mDAA6B,CAAA;IAC7B,0CAAoB,CAAA;IACpB,oDAA8B,CAAA;IAC9B,oEAA8C,CAAA;IAC9C,sCAAgB,CAAA;AAClB,CAAC,EAVW,kBAAkB,KAAlB,kBAAkB,QAU7B;AAED,MAAM,CAAN,IAAY,4BAGX;AAHD,WAAY,4BAA4B;IACtC,2CAAW,CAAA;IACX,+CAAe,CAAA;AACjB,CAAC,EAHW,4BAA4B,KAA5B,4BAA4B,QAGvC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=internet-opportunities.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"internet-opportunities.js","sourceRoot":"","sources":["internet-opportunities.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=internet-vehicles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"internet-vehicles.js","sourceRoot":"","sources":["internet-vehicles.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=leasing-administration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"leasing-administration.js","sourceRoot":"","sources":["leasing-administration.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=leasing-debtors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"leasing-debtors.js","sourceRoot":"","sources":["leasing-debtors.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=leasing-search.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"leasing-search.js","sourceRoot":"","sources":["leasing-search.ts"],"names":[],"mappings":""}
@@ -0,0 +1,7 @@
1
+ export var LeasingItemsPaymentSplit;
2
+ (function (LeasingItemsPaymentSplit) {
3
+ LeasingItemsPaymentSplit["Customer"] = "customer";
4
+ LeasingItemsPaymentSplit["Split"] = "split";
5
+ LeasingItemsPaymentSplit["Company"] = "company";
6
+ })(LeasingItemsPaymentSplit || (LeasingItemsPaymentSplit = {}));
7
+ //# sourceMappingURL=leasing-settings.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"leasing-settings.js","sourceRoot":"","sources":["leasing-settings.ts"],"names":[],"mappings":"AAwCA,MAAM,CAAN,IAAY,wBAIX;AAJD,WAAY,wBAAwB;IAClC,iDAAqB,CAAA;IACrB,2CAAe,CAAA;IACf,+CAAmB,CAAA;AACrB,CAAC,EAJW,wBAAwB,KAAxB,wBAAwB,QAInC"}
@@ -0,0 +1,38 @@
1
+ export var LeasingContractActions;
2
+ (function (LeasingContractActions) {
3
+ LeasingContractActions["CREATE_FINANCE_DOCUMENT"] = "create_finance_document";
4
+ LeasingContractActions["START_RETAKE_VEHICLE"] = "start_retake_vehicle";
5
+ LeasingContractActions["END_RETAKE_VEHICLE"] = "end_retake_vehicle";
6
+ LeasingContractActions["START_CONTRACT_END"] = "start_contract_end";
7
+ LeasingContractActions["END_CONTRACT"] = "end_contract";
8
+ LeasingContractActions["CANCEL_RETAKE_VEHICLE"] = "cancel_retake_vehicle";
9
+ })(LeasingContractActions || (LeasingContractActions = {}));
10
+ export var LeasingContractSource;
11
+ (function (LeasingContractSource) {
12
+ LeasingContractSource["HYPERPORTAL"] = "hyperportal";
13
+ LeasingContractSource["BISONDESK"] = "bisondesk";
14
+ })(LeasingContractSource || (LeasingContractSource = {}));
15
+ export var LeasingContractStatus;
16
+ (function (LeasingContractStatus) {
17
+ LeasingContractStatus["DRAFT"] = "draft";
18
+ LeasingContractStatus["DISCARDED"] = "discarded";
19
+ LeasingContractStatus["PAUSED"] = "paused";
20
+ LeasingContractStatus["ACTIVE"] = "active";
21
+ LeasingContractStatus["LEASING_RETURN"] = "leasing_return";
22
+ LeasingContractStatus["RECOVERED"] = "recovered";
23
+ LeasingContractStatus["ENDING"] = "ending";
24
+ LeasingContractStatus["ENDED"] = "ended";
25
+ })(LeasingContractStatus || (LeasingContractStatus = {}));
26
+ export var LeasingRemindersSortableColumns;
27
+ (function (LeasingRemindersSortableColumns) {
28
+ LeasingRemindersSortableColumns["NextActionAt"] = "next_action_at";
29
+ LeasingRemindersSortableColumns["OrganizationName"] = "organization_name";
30
+ LeasingRemindersSortableColumns["RemindersCount"] = "reminders_count";
31
+ LeasingRemindersSortableColumns["Status"] = "status";
32
+ })(LeasingRemindersSortableColumns || (LeasingRemindersSortableColumns = {}));
33
+ export var LEASING_EXPORT_TYPES;
34
+ (function (LEASING_EXPORT_TYPES) {
35
+ LEASING_EXPORT_TYPES["RENTAL_SOLUTIONS"] = "rental-solutions";
36
+ LEASING_EXPORT_TYPES["DEFAULT"] = "default";
37
+ })(LEASING_EXPORT_TYPES || (LEASING_EXPORT_TYPES = {}));
38
+ //# sourceMappingURL=leasing.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"leasing.js","sourceRoot":"","sources":["leasing.ts"],"names":[],"mappings":"AAKA,MAAM,CAAN,IAAY,sBAOX;AAPD,WAAY,sBAAsB;IAChC,6EAAmD,CAAA;IACnD,uEAA6C,CAAA;IAC7C,mEAAyC,CAAA;IACzC,mEAAyC,CAAA;IACzC,uDAA6B,CAAA;IAC7B,yEAA+C,CAAA;AACjD,CAAC,EAPW,sBAAsB,KAAtB,sBAAsB,QAOjC;AA8DD,MAAM,CAAN,IAAY,qBAGX;AAHD,WAAY,qBAAqB;IAC/B,oDAA2B,CAAA;IAC3B,gDAAuB,CAAA;AACzB,CAAC,EAHW,qBAAqB,KAArB,qBAAqB,QAGhC;AAED,MAAM,CAAN,IAAY,qBASX;AATD,WAAY,qBAAqB;IAC/B,wCAAe,CAAA;IACf,gDAAuB,CAAA;IACvB,0CAAiB,CAAA;IACjB,0CAAiB,CAAA;IACjB,0DAAiC,CAAA;IACjC,gDAAuB,CAAA;IACvB,0CAAiB,CAAA;IACjB,wCAAe,CAAA;AACjB,CAAC,EATW,qBAAqB,KAArB,qBAAqB,QAShC;AAuQD,MAAM,CAAN,IAAY,+BAKX;AALD,WAAY,+BAA+B;IACzC,kEAA+B,CAAA;IAC/B,yEAAsC,CAAA;IACtC,qEAAkC,CAAA;IAClC,oDAAiB,CAAA;AACnB,CAAC,EALW,+BAA+B,KAA/B,+BAA+B,QAK1C;AAgGD,MAAM,CAAN,IAAY,oBAGX;AAHD,WAAY,oBAAoB;IAC9B,6DAAqC,CAAA;IACrC,2CAAmB,CAAA;AACrB,CAAC,EAHW,oBAAoB,KAApB,oBAAoB,QAG/B"}
@@ -0,0 +1,35 @@
1
+ export var MarketingPlatform;
2
+ (function (MarketingPlatform) {
3
+ MarketingPlatform["autoscout24"] = "autoscout24";
4
+ MarketingPlatform["autoline"] = "autoline";
5
+ MarketingPlatform["exportseller"] = "exportseller";
6
+ MarketingPlatform["machineryplanet"] = "machineryplanet";
7
+ MarketingPlatform["machinetrack"] = "machinetrack";
8
+ MarketingPlatform["marktnet"] = "marktnet";
9
+ MarketingPlatform["mobile"] = "mobile";
10
+ MarketingPlatform["truck1st"] = "truck1st";
11
+ MarketingPlatform["trucks"] = "trucks";
12
+ MarketingPlatform["truckscout"] = "truckscout24";
13
+ MarketingPlatform["tweedehandsbe"] = "2ehandsbe";
14
+ MarketingPlatform["viamobilis"] = "planettrucks";
15
+ MarketingPlatform["youtube"] = "youtube";
16
+ })(MarketingPlatform || (MarketingPlatform = {}));
17
+ export var MarketingEventStatus;
18
+ (function (MarketingEventStatus) {
19
+ MarketingEventStatus["Scheduled"] = "scheduled";
20
+ MarketingEventStatus["Processing"] = "processing";
21
+ MarketingEventStatus["Skipped"] = "skipped";
22
+ MarketingEventStatus["Error"] = "error";
23
+ MarketingEventStatus["Sent"] = "processed";
24
+ })(MarketingEventStatus || (MarketingEventStatus = {}));
25
+ export var MarketingEventType;
26
+ (function (MarketingEventType) {
27
+ MarketingEventType["PriceDrop"] = "price-drop";
28
+ MarketingEventType["PartnerOffer"] = "partner-offer";
29
+ })(MarketingEventType || (MarketingEventType = {}));
30
+ export var MarketingMessageChannelType;
31
+ (function (MarketingMessageChannelType) {
32
+ MarketingMessageChannelType["Whatsapp"] = "whatsapp";
33
+ MarketingMessageChannelType["Email"] = "email";
34
+ })(MarketingMessageChannelType || (MarketingMessageChannelType = {}));
35
+ //# sourceMappingURL=marketing.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"marketing.js","sourceRoot":"","sources":["marketing.ts"],"names":[],"mappings":"AAEA,MAAM,CAAN,IAAY,iBAcX;AAdD,WAAY,iBAAiB;IAC3B,gDAA2B,CAAA;IAC3B,0CAAqB,CAAA;IACrB,kDAA6B,CAAA;IAC7B,wDAAmC,CAAA;IACnC,kDAA6B,CAAA;IAC7B,0CAAqB,CAAA;IACrB,sCAAiB,CAAA;IACjB,0CAAqB,CAAA;IACrB,sCAAiB,CAAA;IACjB,gDAA2B,CAAA;IAC3B,gDAA2B,CAAA;IAC3B,gDAA2B,CAAA;IAC3B,wCAAmB,CAAA;AACrB,CAAC,EAdW,iBAAiB,KAAjB,iBAAiB,QAc5B;AA8DD,MAAM,CAAN,IAAY,oBAMX;AAND,WAAY,oBAAoB;IAC9B,+CAAuB,CAAA;IACvB,iDAAyB,CAAA;IACzB,2CAAmB,CAAA;IACnB,uCAAe,CAAA;IACf,0CAAkB,CAAA;AACpB,CAAC,EANW,oBAAoB,KAApB,oBAAoB,QAM/B;AAED,MAAM,CAAN,IAAY,kBAGX;AAHD,WAAY,kBAAkB;IAC5B,8CAAwB,CAAA;IACxB,oDAA8B,CAAA;AAChC,CAAC,EAHW,kBAAkB,KAAlB,kBAAkB,QAG7B;AAED,MAAM,CAAN,IAAY,2BAGX;AAHD,WAAY,2BAA2B;IACrC,oDAAqB,CAAA;IACrB,8CAAe,CAAA;AACjB,CAAC,EAHW,2BAA2B,KAA3B,2BAA2B,QAGtC"}
@@ -0,0 +1,56 @@
1
+ export var OfferActions;
2
+ (function (OfferActions) {
3
+ OfferActions["CREATE_BID"] = "create_bid";
4
+ OfferActions["SET_FINAL_VALUATION"] = "set_final_valuation";
5
+ OfferActions["LOSE"] = "lose";
6
+ OfferActions["REOPEN"] = "reopen";
7
+ OfferActions["SET_DOCUMENTS"] = "set_documents";
8
+ OfferActions["SET_METADATA"] = "set_metadata";
9
+ OfferActions["SEE_SUPPLIER"] = "see_supplier";
10
+ OfferActions["SEE_INSIGHTS"] = "see_insights";
11
+ OfferActions["VIEW_BIDS"] = "view_bids";
12
+ OfferActions["DELETE_FINAL_VALUATION"] = "delete_final_valuation";
13
+ OfferActions["SEE_ASKING_PRICE"] = "see_asking_price";
14
+ OfferActions["ACCEPT_NEGOTIATION"] = "accept_negotiation";
15
+ OfferActions["UNDO_ACCEPT_NEGOTIATION"] = "undo_accept_negotiation";
16
+ OfferActions["SET_SUPPLIER_VEHICLE"] = "set_supplier_vehicle";
17
+ OfferActions["CAN_PURCHASE"] = "can_purchase";
18
+ })(OfferActions || (OfferActions = {}));
19
+ export var OfferBidActions;
20
+ (function (OfferBidActions) {
21
+ OfferBidActions["EDIT_BID"] = "create_bid";
22
+ OfferBidActions["DELETE_BID"] = "delete_bid";
23
+ })(OfferBidActions || (OfferBidActions = {}));
24
+ export var OfferStatus;
25
+ (function (OfferStatus) {
26
+ OfferStatus["PROSPECTION"] = "prospection";
27
+ OfferStatus["VALUATION"] = "valuation";
28
+ OfferStatus["NEGOTIATION"] = "negotiation";
29
+ })(OfferStatus || (OfferStatus = {}));
30
+ export var OfferLostReasonValues;
31
+ (function (OfferLostReasonValues) {
32
+ OfferLostReasonValues["Expensive"] = "expensive";
33
+ OfferLostReasonValues["NoMarket"] = "no_market";
34
+ OfferLostReasonValues["BadExperience"] = "bad_experience";
35
+ OfferLostReasonValues["NoAnswer"] = "supplier_mia";
36
+ OfferLostReasonValues["Other"] = "other";
37
+ OfferLostReasonValues["Automatic"] = "automatic";
38
+ })(OfferLostReasonValues || (OfferLostReasonValues = {}));
39
+ export var OfferBidType;
40
+ (function (OfferBidType) {
41
+ OfferBidType["INTERNAL"] = "internal";
42
+ OfferBidType["EXTERNAL"] = "external";
43
+ })(OfferBidType || (OfferBidType = {}));
44
+ export var OfferWarningsCode;
45
+ (function (OfferWarningsCode) {
46
+ OfferWarningsCode["NO_SUPPLIER"] = "no_supplier";
47
+ })(OfferWarningsCode || (OfferWarningsCode = {}));
48
+ export const OfferStatusOrder = [
49
+ OfferStatus.PROSPECTION,
50
+ OfferStatus.VALUATION,
51
+ OfferStatus.NEGOTIATION,
52
+ ];
53
+ export const OfferWonColumnId = 'closed_won';
54
+ export const OfferKanbanColumns = [...OfferStatusOrder, OfferWonColumnId];
55
+ export const OfferKanbanEndColumns = [OfferWonColumnId];
56
+ //# sourceMappingURL=offers.js.map