@bisondesk/core-sdk 1.0.263 → 1.0.265

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 (146) hide show
  1. package/lib/apis/crm.js +198 -0
  2. package/lib/apis/crm.js.map +1 -0
  3. package/lib/apis/documents.js +54 -0
  4. package/lib/apis/documents.js.map +1 -0
  5. package/lib/apis/internet-vehicles.js +24 -0
  6. package/lib/apis/internet-vehicles.js.map +1 -0
  7. package/lib/apis/leasing-administration.js +46 -0
  8. package/lib/apis/leasing-administration.js.map +1 -0
  9. package/lib/apis/leasing.js +181 -0
  10. package/lib/apis/leasing.js.map +1 -0
  11. package/lib/apis/opportunities.js +66 -0
  12. package/lib/apis/opportunities.js.map +1 -0
  13. package/lib/apis/picklists.js +41 -0
  14. package/lib/apis/picklists.js.map +1 -0
  15. package/lib/apis/tenants.js +77 -0
  16. package/lib/apis/tenants.js.map +1 -0
  17. package/lib/apis/users.js +23 -0
  18. package/lib/apis/users.js.map +1 -0
  19. package/lib/apis/utils.js +23 -0
  20. package/lib/apis/utils.js.map +1 -0
  21. package/lib/apis/vehicles.js +183 -0
  22. package/lib/apis/vehicles.js.map +1 -0
  23. package/lib/cjs/apis/vehicles.js +12 -1
  24. package/lib/cjs/apis/vehicles.js.map +1 -1
  25. package/lib/cjs/types/leasing-debtors.js.map +1 -1
  26. package/lib/cjs/types/leasing.js.map +1 -1
  27. package/lib/cjs/types/opportunities.js.map +1 -1
  28. package/lib/cjs/types/quotes.js.map +1 -1
  29. package/lib/cjs/types/roi-ratings.js +8 -0
  30. package/lib/cjs/types/roi-ratings.js.map +1 -0
  31. package/lib/cjs/types/tenants.js +1 -0
  32. package/lib/cjs/types/tenants.js.map +1 -1
  33. package/lib/constants.js +932 -0
  34. package/lib/constants.js.map +1 -0
  35. package/lib/ddb-entities.js +5 -0
  36. package/lib/ddb-entities.js.map +1 -0
  37. package/lib/esm/apis/vehicles.js +10 -0
  38. package/lib/esm/apis/vehicles.js.map +1 -1
  39. package/lib/esm/types/leasing-debtors.js.map +1 -1
  40. package/lib/esm/types/leasing.js.map +1 -1
  41. package/lib/esm/types/opportunities.js.map +1 -1
  42. package/lib/esm/types/quotes.js.map +1 -1
  43. package/lib/esm/types/roi-ratings.js +5 -0
  44. package/lib/esm/types/roi-ratings.js.map +1 -0
  45. package/lib/esm/types/tenants.js +1 -0
  46. package/lib/esm/types/tenants.js.map +1 -1
  47. package/lib/tsconfig.cjs.tsbuildinfo +1 -1
  48. package/lib/tsconfig.esm.tsbuildinfo +1 -1
  49. package/lib/types/activities.js +16 -0
  50. package/lib/types/activities.js.map +1 -0
  51. package/lib/types/apis/vehicles.d.ts +1 -0
  52. package/lib/types/apis/vehicles.d.ts.map +1 -1
  53. package/lib/types/crm.js +19 -0
  54. package/lib/types/crm.js.map +1 -0
  55. package/lib/types/definitions.js +3 -0
  56. package/lib/types/definitions.js.map +1 -0
  57. package/lib/types/delivery-settings.js +9 -0
  58. package/lib/types/delivery-settings.js.map +1 -0
  59. package/lib/types/documents.js +3 -0
  60. package/lib/types/documents.js.map +1 -0
  61. package/lib/types/events.js +10 -0
  62. package/lib/types/events.js.map +1 -0
  63. package/lib/types/fields.js +29 -0
  64. package/lib/types/fields.js.map +1 -0
  65. package/lib/types/internet-vehicles.js +3 -0
  66. package/lib/types/internet-vehicles.js.map +1 -0
  67. package/lib/types/leads.js +3 -0
  68. package/lib/types/leads.js.map +1 -0
  69. package/lib/types/leasing-administration.js +3 -0
  70. package/lib/types/leasing-administration.js.map +1 -0
  71. package/lib/types/leasing-debtors.js +3 -0
  72. package/lib/types/leasing-debtors.js.map +1 -0
  73. package/lib/types/leasing-search.js +3 -0
  74. package/lib/types/leasing-search.js.map +1 -0
  75. package/lib/types/leasing-settings.js +10 -0
  76. package/lib/types/leasing-settings.js.map +1 -0
  77. package/lib/types/leasing.js +24 -0
  78. package/lib/types/leasing.js.map +1 -0
  79. package/lib/types/machines.js +3 -0
  80. package/lib/types/machines.js.map +1 -0
  81. package/lib/types/opportunities.js +84 -0
  82. package/lib/types/opportunities.js.map +1 -0
  83. package/lib/types/payments.js +9 -0
  84. package/lib/types/payments.js.map +1 -0
  85. package/lib/types/picklists.js +3 -0
  86. package/lib/types/picklists.js.map +1 -0
  87. package/lib/types/quotes.js +46 -0
  88. package/lib/types/quotes.js.map +1 -0
  89. package/lib/types/recently-viewed.js +3 -0
  90. package/lib/types/recently-viewed.js.map +1 -0
  91. package/lib/types/roi-ratings.js +8 -0
  92. package/lib/types/roi-ratings.js.map +1 -0
  93. package/lib/types/saved-filters.js +12 -0
  94. package/lib/types/saved-filters.js.map +1 -0
  95. package/lib/types/search.js +36 -0
  96. package/lib/types/search.js.map +1 -0
  97. package/lib/types/settings.js +3 -0
  98. package/lib/types/settings.js.map +1 -0
  99. package/lib/types/storage.js +4 -0
  100. package/lib/types/storage.js.map +1 -0
  101. package/lib/types/templates.js +3 -0
  102. package/lib/types/templates.js.map +1 -0
  103. package/lib/types/tenants.js +17 -0
  104. package/lib/types/tenants.js.map +1 -0
  105. package/lib/types/types/leasing-debtors.d.ts +2 -0
  106. package/lib/types/types/leasing-debtors.d.ts.map +1 -1
  107. package/lib/types/types/leasing.d.ts +2 -0
  108. package/lib/types/types/leasing.d.ts.map +1 -1
  109. package/lib/types/types/opportunities.d.ts +1 -1
  110. package/lib/types/types/opportunities.d.ts.map +1 -1
  111. package/lib/types/types/quotes.d.ts +7 -2
  112. package/lib/types/types/quotes.d.ts.map +1 -1
  113. package/lib/types/types/roi-ratings.d.ts +42 -0
  114. package/lib/types/types/roi-ratings.d.ts.map +1 -0
  115. package/lib/types/types/tenants.d.ts +2 -1
  116. package/lib/types/types/tenants.d.ts.map +1 -1
  117. package/lib/types/users.js +3 -0
  118. package/lib/types/users.js.map +1 -0
  119. package/lib/types/utils.js +9 -0
  120. package/lib/types/utils.js.map +1 -0
  121. package/lib/types/vehicles.js +68 -0
  122. package/lib/types/vehicles.js.map +1 -0
  123. package/lib/types/website.js +3 -0
  124. package/lib/types/website.js.map +1 -0
  125. package/lib/utils/forms.js +30 -0
  126. package/lib/utils/forms.js.map +1 -0
  127. package/lib/utils/leasing.js +8 -0
  128. package/lib/utils/leasing.js.map +1 -0
  129. package/lib/utils/opportunities.js +60 -0
  130. package/lib/utils/opportunities.js.map +1 -0
  131. package/lib/utils/slug.js +20 -0
  132. package/lib/utils/slug.js.map +1 -0
  133. package/lib/utils/tenants.js +21 -0
  134. package/lib/utils/tenants.js.map +1 -0
  135. package/lib/utils/vehicles.js +72 -0
  136. package/lib/utils/vehicles.js.map +1 -0
  137. package/package.json +1 -1
  138. package/src/apis/vehicles.ts +14 -0
  139. package/src/types/leasing-debtors.ts +2 -0
  140. package/src/types/leasing.ts +2 -0
  141. package/src/types/opportunities.ts +1 -1
  142. package/src/types/quotes.ts +11 -3
  143. package/src/types/roi-ratings.ts +46 -0
  144. package/src/types/tenants.ts +1 -0
  145. package/tsconfig.json +1 -0
  146. package/tsconfig.tsbuildinfo +1 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"/","sources":["constants.ts"],"names":[],"mappings":";;;;AAEA,8DAAqE;AAA5D,8GAAA,iBAAiB,OAAA;AAKb,QAAA,yBAAyB,GAAG,cAAc,CAAC;AAC3C,QAAA,4BAA4B,GAAG,iBAAiB,CAAC;AACjD,QAAA,qBAAqB,GAAG,WAAW,CAAC;AACpC,QAAA,qBAAqB,GAAG,WAAW,CAAC;AACpC,QAAA,iCAAiC,GAAG,qBAAqB,CAAC;AAC1D,QAAA,iCAAiC,GAAG,qBAAqB,CAAC;AAC1D,QAAA,oCAAoC,GAAG,uBAAuB,CAAC;AAC/D,QAAA,+BAA+B,GAAG,oBAAoB,CAAC;AACvD,QAAA,8BAA8B,GAAG,mBAAmB,CAAC;AACrD,QAAA,mCAAmC,GAAG,uBAAuB,CAAC;AAC9D,QAAA,uCAAuC,GAAG,2BAA2B,CAAC;AACtE,QAAA,8BAA8B,GAAG,oBAAoB,CA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,KAAK;YACd,UAAU,EAAE,KAAK;SAClB;KACF;CACF,CAAC;AAEW,QAAA,gCAAgC,GAAG,CAAC,CAAC;AAGrC,QAAA,yBAAyB,GAAG,eAAe,CAAC;AAEzD,IAAY,YAIX;AAJD,WAAY,YAAY;IACtB,6BAAa,CAAA;IACb,mCAAmB,CAAA;IACnB,+BAAe,CAAA;AACjB,CAAC,EAJW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAIvB","sourcesContent":["import { VehicleAxle } from './types/vehicles';\n\nexport { BusinessEntityIds } from '@bisondesk/commons-sdk/constants';\n\n//\n// STATIC PICKLIST IDS\n//\nexport const APP_LANGUAGES_PICKLIST_ID = 'appLanguages';\nexport const CLIENT_LANGUAGES_PICKLIST_ID = 'clientLanguages';\nexport const TIMEZONES_PICKLIST_ID = 'timezones';\nexport const COUNTRIES_PICKLIST_ID = 'countries';\nexport const VEHICLE_MAIN_FEATURES_PICKLIST_ID = 'vehicleMainFeatures';\nexport const VEHICLE_STATE_FILTERS_PICKLIST_ID = 'vehicleStateFilters';\nexport const VEHICLE_SALE_DEAL_STATUS_PICKLIST_ID = 'vehicleSaleDealStatus';\nexport const MARKETING_PLATFORMS_PICKLIST_ID = 'marketingPlatforms';\nexport const OPPORTUNITY_STATUS_PICKLIST_ID = 'opportunityStatus';\nexport const OPPORTUNITY_DEAL_STATUS_PICKLIST_ID = 'opportunityDealStatus';\nexport const OPPORTUNITY_LOGISTIC_STATUS_PICKLIST_ID = 'opportunityLogisticStatus';\nexport const OPPORTUNITY_SOURCE_PICKLIST_ID = 'opportunity_source';\nexport const DEPARTMENT_PICKLIST_ID = 'department';\nexport const AXLE_TIRE_SIZE_PICKLIST_ID = 'axleTireSize';\nexport const GEARBOX_MAKE_PICKLIST_ID = 'gearboxMake';\nexport const LOCATION_PICKLIST_ID = 'location';\nexport const SUPPLIER_VAT_RATE_PICKLIST_ID = 'supplierVATRate';\nexport const AXLE_MAKE_PICKLIST_ID = 'axleMake';\nexport const TAILGATE_MAKE_PICKLIST_ID = 'tailgateMakes';\nexport const VAT_PERCENTAGE_PICKLIST_ID = 'vatPercentages';\nexport const CRANE_MAKE_PICKLIST_ID = 'craneMakes';\nexport const ENGINEERING_DOCS_PICKLIST_ID = 'engineeringDocs';\nexport const SHIPPING_COMPANIES_PICKLIST_ID = 'shippingCompanies';\n\n//\n// STATIC PICKLIST ID VALUES\nexport const WEBSITE_MARKETING_PLATFORM_ID = 'PUBLIC_WEBSITE';\n\n//\n// STATIC PICKLIST IDS FROM HyperDMS\n//\nexport const BODYWORKS_PICKLIST_ID = 'bodywork';\nexport const CABINS_PICKLIST_ID = 'cabin';\nexport const CATEGORIES_PICKLIST_ID = 'category';\nexport const CONFIGURATIONS_PICKLIST_ID = 'configuration';\nexport const EURONORMS_PICKLIST_ID = 'euronorm';\nexport const TRANSMISSIONS_PICKLIST_ID = 'gearbox';\nexport const MAKES_PICKLIST_ID = 'make';\nexport const MAKE_MODELS_PICKLIST_ID = 'make_model';\nexport const MAKE_MODEL_TYPES_PICKLIST_ID = 'make_model_type';\nexport const SUSPENSIONS_PICKLIST_ID = 'suspension';\nexport const ORG_SEGMENTS_PICKLIST_ID = 'segment';\nexport const HEIGTHENED_PICKLIST_ID = 'extended_height_dimension';\nexport const EXTENDED_PICKLIST_ID = 'extended_length_dimension';\nexport const JOB_CATEGORIES_PICKLIST_ID = 'job_category';\nexport const DOCUMENT_TYPES_PICKLIST_ID = 'document_types';\n\n//\n// STATIC VALUES FOR VEHICLE CATEGORIES\n//\nexport enum Categories {\n TractorHead = 'Tractor Head',\n Truck = 'Truck',\n Trailer = 'Trailer',\n SemiTrailer = 'Semi-Trailer',\n Van = 'Van',\n Machine = 'Machine',\n Car = 'Car',\n Superstructure = 'Superstructure',\n}\n\n//\n// PICKLIST CONSTANTS\n//\nexport const MAX_SORT_PRIORITY = 10_000;\nexport const MIN_SORT_PRIORITY = 1;\n\n//\n// SEARCH\n//\nexport const FILTER_RANGE_SEPARATOR = '__';\nexport const FILTER_MULTIPLE_SEPARATOR = '__';\n\n//\n// Lead interests\n//\nexport const MAX_AGE = 15;\nexport const MAX_KM = 1_000_000;\nexport const MAX_PRICE = 100_000;\nexport const PRICE_ROUNDING = 1000;\nexport const KM_ROUNDING = 100_000;\n\n//\n// Leasing administration\n//\nexport enum LeasingAdminUploadHandlers {\n DhondtMonthly = 'dhondt-monthly-invoice',\n DhondtProrata = 'dhondt-prorata-invoice',\n Belfius = 'belfius-monthly-invoice',\n ING = 'ing-monthly-invoice',\n}\n\nexport enum LeasingAdminEntities {\n Dhondt = 'dhondt',\n Becris = 'becris',\n ING = 'ing',\n}\n\nexport enum LeasingAdminUploadErrors {\n DuplicatedFile = 'leasing-administration.file-already-exists',\n FetchCurrentFile = 'leasing-administration.diff.fetch-current-file-failed',\n InvalidAttachment = 'leasing-administration.invalid-attachment',\n InvalidBelfiusXlsx = 'leasing-administration.belfius.invalid-xlsx',\n InvalidHandlerId = 'leasing-administration.invalid-handler',\n InvalidInvoiceFormat = 'leasing-administration.upload.invalid-invoice',\n NegativeAmount = 'leasing-administration.negative-amount',\n OngoingUpload = 'leasing-administration.ongoing-upload',\n Publish = 'leasing-administration.upload.publish-failed',\n UnknownVehicle = 'leasing-administration.belfius.unknown-vehicle',\n MissingVehicle = 'leasing-administration.belfius.missing-vehicle',\n Validation = 'leasing-administration.upload.invalid-request',\n}\n\n//\n// Lead interests\n//\nexport const INTERNET_VEHICLES_ANALYSIS_ALL_DATA = 'all';\n\n//\n// Opportunities\n//\nexport enum OpportunityType {\n LEASING = 'leasing',\n SALES = 'sales',\n}\n\n//\n// VEHICLES\n//\nexport const UNKNOWN_MAKE = 'other';\n\nexport const AXLE_CONFIG: { [config: string]: VehicleAxle[] } = {\n '4x2': [\n {\n nr: 1,\n position: 'Front',\n steering: true,\n powered: false,\n twinWheels: false,\n },\n {\n nr: 2,\n position: 'Back',\n steering: false,\n powered: true,\n twinWheels: true,\n },\n ],\n '4x4': [\n {\n nr: 1,\n position: 'Front',\n steering: true,\n powered: true,\n twinWheels: false,\n },\n {\n nr: 2,\n position: 'Back',\n steering: false,\n powered: true,\n twinWheels: true,\n },\n ],\n '6x2': [\n {\n nr: 1,\n position: 'Front',\n steering: true,\n powered: false,\n twinWheels: false,\n },\n {\n nr: 2,\n position: 'Back',\n steering: false,\n powered: true,\n twinWheels: false,\n },\n {\n nr: 3,\n position: 'Back',\n steering: false,\n powered: false,\n twinWheels: true,\n },\n ],\n '6x4': [\n {\n nr: 1,\n position: 'Front',\n steering: true,\n powered: false,\n twinWheels: false,\n },\n {\n nr: 2,\n position: 'Back',\n steering: false,\n powered: true,\n twinWheels: true,\n },\n {\n nr: 3,\n position: 'Back',\n steering: false,\n powered: true,\n twinWheels: true,\n },\n ],\n '6x6': [\n {\n nr: 1,\n position: 'Front',\n steering: true,\n powered: true,\n twinWheels: false,\n },\n {\n nr: 2,\n position: 'Back',\n steering: false,\n powered: true,\n twinWheels: true,\n },\n {\n nr: 3,\n position: 'Back',\n steering: false,\n powered: true,\n twinWheels: true,\n },\n ],\n '8x2': [\n {\n nr: 1,\n position: 'Front',\n steering: true,\n powered: false,\n twinWheels: false,\n },\n {\n nr: 2,\n position: 'Front',\n steering: true,\n powered: false,\n twinWheels: false,\n },\n {\n nr: 3,\n position: 'Back',\n steering: false,\n powered: true,\n twinWheels: false,\n },\n {\n nr: 4,\n position: 'Back',\n steering: false,\n powered: false,\n twinWheels: true,\n },\n ],\n '8x4': [\n {\n nr: 1,\n position: 'Front',\n steering: true,\n powered: false,\n twinWheels: false,\n },\n {\n nr: 2,\n position: 'Front',\n steering: true,\n powered: false,\n twinWheels: false,\n },\n {\n nr: 3,\n position: 'Back',\n steering: false,\n powered: true,\n twinWheels: true,\n },\n {\n nr: 4,\n position: 'Back',\n steering: false,\n powered: true,\n twinWheels: true,\n },\n ],\n '8x6': [\n {\n nr: 1,\n position: 'Front',\n steering: true,\n powered: true,\n twinWheels: false,\n },\n {\n nr: 2,\n position: 'Front',\n steering: true,\n powered: false,\n twinWheels: false,\n },\n {\n nr: 3,\n position: 'Back',\n steering: false,\n powered: true,\n twinWheels: true,\n },\n {\n nr: 4,\n position: 'Back',\n steering: false,\n powered: true,\n twinWheels: true,\n },\n ],\n '8x8': [\n {\n nr: 1,\n position: 'Front',\n steering: true,\n powered: true,\n twinWheels: false,\n },\n {\n nr: 2,\n position: 'Front',\n steering: true,\n powered: true,\n twinWheels: false,\n },\n {\n nr: 3,\n position: 'Back',\n steering: false,\n powered: true,\n twinWheels: true,\n },\n {\n nr: 4,\n position: 'Back',\n steering: false,\n powered: true,\n twinWheels: true,\n },\n ],\n '10x4': [\n {\n nr: 1,\n position: 'Front',\n steering: true,\n powered: false,\n twinWheels: false,\n },\n {\n nr: 2,\n position: 'Front',\n steering: true,\n powered: false,\n twinWheels: false,\n },\n {\n nr: 3,\n position: 'Front',\n steering: true,\n powered: false,\n twinWheels: false,\n },\n {\n nr: 4,\n position: 'Back',\n steering: false,\n powered: true,\n twinWheels: true,\n },\n {\n nr: 5,\n position: 'Back',\n steering: false,\n powered: true,\n twinWheels: true,\n },\n ],\n '10x6': [\n {\n nr: 1,\n position: 'Front',\n steering: true,\n powered: false,\n twinWheels: false,\n },\n {\n nr: 2,\n position: 'Front',\n steering: true,\n powered: false,\n twinWheels: false,\n },\n {\n nr: 3,\n position: 'Back',\n steering: false,\n powered: true,\n twinWheels: false,\n },\n {\n nr: 4,\n position: 'Back',\n steering: false,\n powered: true,\n twinWheels: true,\n },\n {\n nr: 5,\n position: 'Back',\n steering: false,\n powered: true,\n twinWheels: true,\n },\n ],\n '10x8': [\n {\n nr: 1,\n position: 'Front',\n steering: true,\n powered: true,\n twinWheels: false,\n },\n {\n nr: 2,\n position: 'Front',\n steering: true,\n powered: true,\n twinWheels: false,\n },\n {\n nr: 3,\n position: 'Front',\n steering: true,\n powered: false,\n twinWheels: false,\n },\n {\n nr: 4,\n position: 'Back',\n steering: false,\n powered: true,\n twinWheels: true,\n },\n {\n nr: 5,\n position: 'Back',\n steering: false,\n powered: true,\n twinWheels: true,\n },\n ],\n '10x10': [\n {\n nr: 1,\n position: 'Front',\n steering: true,\n powered: true,\n twinWheels: false,\n },\n {\n nr: 2,\n position: 'Front',\n steering: true,\n powered: true,\n twinWheels: false,\n },\n {\n nr: 3,\n position: 'Front',\n steering: true,\n powered: true,\n twinWheels: false,\n },\n {\n nr: 4,\n position: 'Back',\n steering: false,\n powered: true,\n twinWheels: true,\n },\n {\n nr: 5,\n position: 'Back',\n steering: false,\n powered: true,\n twinWheels: true,\n },\n ],\n '1 axle': [\n {\n nr: 1,\n position: 'Back',\n steering: false,\n powered: false,\n twinWheels: false,\n },\n ],\n '2 axles': [\n {\n nr: 1,\n position: 'Back',\n steering: false,\n powered: false,\n twinWheels: false,\n },\n {\n nr: 2,\n position: 'Back',\n steering: false,\n powered: false,\n twinWheels: false,\n },\n ],\n '3 axles': [\n {\n nr: 1,\n position: 'Back',\n steering: false,\n powered: false,\n twinWheels: false,\n },\n {\n nr: 2,\n position: 'Back',\n steering: false,\n powered: false,\n twinWheels: false,\n },\n {\n nr: 3,\n position: 'Back',\n steering: false,\n powered: false,\n twinWheels: false,\n },\n ],\n '4 axles': [\n {\n nr: 1,\n position: 'Back',\n steering: false,\n powered: false,\n twinWheels: false,\n },\n {\n nr: 2,\n position: 'Back',\n steering: false,\n powered: false,\n twinWheels: false,\n },\n {\n nr: 3,\n position: 'Back',\n steering: false,\n powered: false,\n twinWheels: false,\n },\n {\n nr: 4,\n position: 'Back',\n steering: false,\n powered: false,\n twinWheels: false,\n },\n ],\n '5 axles': [\n {\n nr: 1,\n position: 'Back',\n steering: false,\n powered: false,\n twinWheels: false,\n },\n {\n nr: 2,\n position: 'Back',\n steering: false,\n powered: false,\n twinWheels: false,\n },\n {\n nr: 3,\n position: 'Back',\n steering: false,\n powered: false,\n twinWheels: false,\n },\n {\n nr: 4,\n position: 'Back',\n steering: false,\n powered: false,\n twinWheels: false,\n },\n {\n nr: 5,\n position: 'Back',\n steering: false,\n powered: false,\n twinWheels: false,\n },\n ],\n '6 axles': [\n {\n nr: 1,\n position: 'Back',\n steering: false,\n powered: false,\n twinWheels: false,\n },\n {\n nr: 2,\n position: 'Back',\n steering: false,\n powered: false,\n twinWheels: false,\n },\n {\n nr: 3,\n position: 'Back',\n steering: false,\n powered: false,\n twinWheels: false,\n },\n {\n nr: 4,\n position: 'Back',\n steering: false,\n powered: false,\n twinWheels: false,\n },\n {\n nr: 5,\n position: 'Back',\n steering: false,\n powered: false,\n twinWheels: false,\n },\n {\n nr: 6,\n position: 'Back',\n steering: false,\n powered: false,\n twinWheels: false,\n },\n ],\n '7 axles': [\n {\n nr: 1,\n position: 'Back',\n steering: false,\n powered: false,\n twinWheels: false,\n },\n {\n nr: 2,\n position: 'Back',\n steering: false,\n powered: false,\n twinWheels: false,\n },\n {\n nr: 3,\n position: 'Back',\n steering: false,\n powered: false,\n twinWheels: false,\n },\n {\n nr: 4,\n position: 'Back',\n steering: false,\n powered: false,\n twinWheels: false,\n },\n {\n nr: 5,\n position: 'Back',\n steering: false,\n powered: false,\n twinWheels: false,\n },\n {\n nr: 6,\n position: 'Back',\n steering: false,\n powered: false,\n twinWheels: false,\n },\n {\n nr: 7,\n position: 'Back',\n steering: false,\n powered: false,\n twinWheels: false,\n },\n ],\n '8 axles': [\n {\n nr: 1,\n position: 'Back',\n steering: false,\n powered: false,\n twinWheels: false,\n },\n {\n nr: 2,\n position: 'Back',\n steering: false,\n powered: false,\n twinWheels: false,\n },\n {\n nr: 3,\n position: 'Back',\n steering: false,\n powered: false,\n twinWheels: false,\n },\n {\n nr: 4,\n position: 'Back',\n steering: false,\n powered: false,\n twinWheels: false,\n },\n {\n nr: 5,\n position: 'Back',\n steering: false,\n powered: false,\n twinWheels: false,\n },\n {\n nr: 6,\n position: 'Back',\n steering: false,\n powered: false,\n twinWheels: false,\n },\n {\n nr: 7,\n position: 'Back',\n steering: false,\n powered: false,\n twinWheels: false,\n },\n {\n nr: 8,\n position: 'Back',\n steering: false,\n powered: false,\n twinWheels: false,\n },\n ],\n '1 front, 1 rear': [\n {\n nr: 1,\n position: 'Front',\n steering: false,\n powered: false,\n twinWheels: false,\n },\n {\n nr: 2,\n position: 'Back',\n steering: false,\n powered: false,\n twinWheels: false,\n },\n ],\n '1 front, 2 rear': [\n {\n nr: 1,\n position: 'Front',\n steering: false,\n powered: false,\n twinWheels: false,\n },\n {\n nr: 2,\n position: 'Back',\n steering: false,\n powered: false,\n twinWheels: false,\n },\n {\n nr: 3,\n position: 'Back',\n steering: false,\n powered: false,\n twinWheels: false,\n },\n ],\n '1 front, 3 rear': [\n {\n nr: 1,\n position: 'Front',\n steering: false,\n powered: false,\n twinWheels: false,\n },\n {\n nr: 2,\n position: 'Back',\n steering: false,\n powered: false,\n twinWheels: false,\n },\n {\n nr: 3,\n position: 'Back',\n steering: false,\n powered: false,\n twinWheels: false,\n },\n {\n nr: 4,\n position: 'Back',\n steering: false,\n powered: false,\n twinWheels: false,\n },\n ],\n '2 front, 2 rear': [\n {\n nr: 1,\n position: 'Front',\n steering: false,\n powered: false,\n twinWheels: false,\n },\n {\n nr: 2,\n position: 'Front',\n steering: false,\n powered: false,\n twinWheels: false,\n },\n {\n nr: 3,\n position: 'Back',\n steering: false,\n powered: false,\n twinWheels: false,\n },\n {\n nr: 4,\n position: 'Back',\n steering: false,\n powered: false,\n twinWheels: false,\n },\n ],\n '2 front, 3 rear': [\n {\n nr: 1,\n position: 'Front',\n steering: false,\n powered: false,\n twinWheels: false,\n },\n {\n nr: 2,\n position: 'Front',\n steering: false,\n powered: false,\n twinWheels: false,\n },\n {\n nr: 3,\n position: 'Back',\n steering: false,\n powered: false,\n twinWheels: false,\n },\n {\n nr: 4,\n position: 'Back',\n steering: false,\n powered: false,\n twinWheels: false,\n },\n {\n nr: 5,\n position: 'Back',\n steering: false,\n powered: false,\n twinWheels: false,\n },\n ],\n '1 middle': [\n {\n nr: 1,\n position: 'Middle',\n steering: false,\n powered: false,\n twinWheels: false,\n },\n ],\n '2 middle': [\n {\n nr: 1,\n position: 'Middle',\n steering: false,\n powered: false,\n twinWheels: false,\n },\n {\n nr: 2,\n position: 'Middle',\n steering: false,\n powered: false,\n twinWheels: false,\n },\n ],\n '3 middle': [\n {\n nr: 1,\n position: 'Middle',\n steering: false,\n powered: false,\n twinWheels: false,\n },\n {\n nr: 2,\n position: 'Middle',\n steering: false,\n powered: false,\n twinWheels: false,\n },\n {\n nr: 3,\n position: 'Middle',\n steering: false,\n powered: false,\n twinWheels: false,\n },\n ],\n};\n\nexport const DEBTORS_MONTHS_UNTIL_TODAY_COUNT = 6;\n\n// Email Template IDs\nexport const VEHICLE_SHARE_TEMPLATE_ID = 'vehicle-share';\n\nexport enum WarningHints {\n INFO = 'info',\n WARNING = 'warning',\n ERROR = 'error',\n}\n"]}
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ITEM_VIEWS_KEY = void 0;
4
+ exports.ITEM_VIEWS_KEY = 'views';
5
+ //# sourceMappingURL=ddb-entities.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ddb-entities.js","sourceRoot":"/","sources":["ddb-entities.ts"],"names":[],"mappings":";;;AAAa,QAAA,cAAc,GAAG,OAAO,CAAC","sourcesContent":["export const ITEM_VIEWS_KEY = 'views';\n"]}
@@ -1,5 +1,6 @@
1
1
  import { SERVICE_ID_ADMIN_HEADER, TENANT_ID_ADMIN_HEADER } from '@bisondesk/commons-sdk/constants';
2
2
  import { XError } from '@bisondesk/commons-sdk/errors';
3
+ import { fetchJson } from '@bisondesk/commons-sdk/fetch';
3
4
  import fetch from 'node-fetch';
4
5
  import { cleanHeaders, getAdminAuth } from './utils';
5
6
  export const getVehicle = async (tenantId, vehicleId) => {
@@ -16,6 +17,15 @@ export const getVehicle = async (tenantId, vehicleId) => {
16
17
  const body = await response.text();
17
18
  throw new XError(response.statusText, { body });
18
19
  };
20
+ export const getVehicleByChassisNumber = async (tenantId, vin) => {
21
+ const auth = await getAdminAuth();
22
+ return fetchJson(`${process.env.CORE_API_ORIGIN}/api/vehicles/vin/${vin}`, {
23
+ headers: {
24
+ Authorization: auth,
25
+ [TENANT_ID_ADMIN_HEADER]: tenantId,
26
+ },
27
+ });
28
+ };
19
29
  export const getVehiclePurchase = async (tenantId, vehicleId) => {
20
30
  const auth = await getAdminAuth();
21
31
  const response = await fetch(`${process.env.CORE_API_ORIGIN}/api/vehicles/${vehicleId}/purchase`, {
@@ -1 +1 @@
1
- {"version":3,"file":"vehicles.js","sourceRoot":"/","sources":["apis/vehicles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AACnG,OAAO,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AACvD,OAAO,KAAmB,MAAM,YAAY,CAAC;AAG7C,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAErD,MAAM,CAAC,MAAM,UAAU,GAAG,KAAK,EAC7B,QAAgB,EAChB,SAAiB,EACyB,EAAE;IAC5C,MAAM,IAAI,GAAG,MAAM,YAAY,EAAE,CAAC;IAClC,MAAM,QAAQ,GAAa,MAAM,KAAK,CACpC,GAAG,OAAO,CAAC,GAAG,CAAC,eAAe,iBAAiB,SAAS,EAAE,EAC1D;QACE,OAAO,EAAE;YACP,aAAa,EAAE,IAAI;YACnB,CAAC,sBAAsB,CAAC,EAAE,QAAQ;SACnC;KACF,CACF,CAAC;IAEF,IAAI,QAAQ,CAAC,EAAE,EAAE;QACf,OAAO,QAAQ,CAAC,MAAM,KAAK,GAAG,CAAC,CAAC,CAAE,QAAQ,CAAC,IAAI,EAAU,CAAC,CAAC,CAAC,SAAS,CAAC;KACvE;IAED,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;IACnC,MAAM,IAAI,MAAM,CAAC,QAAQ,CAAC,UAAU,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;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Y,CAAC;YACpB,aAAa,EAAE,IAAI;YACnB,CAAC,sBAAsB,CAAC,EAAE,QAAQ;YAClC,CAAC,uBAAuB,CAAC,EAAE,IAAI,EAAE,SAAS;SAC3C,CAAC;KACH,CACF,CAAC;IAEF,IAAI,QAAQ,CAAC,EAAE,EAAE;QACf,OAAO;KACR;IAED,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;IACnC,MAAM,IAAI,MAAM,CAAC,QAAQ,CAAC,UAAU,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;AAC7E,CAAC,CAAC","sourcesContent":["import { SERVICE_ID_ADMIN_HEADER, TENANT_ID_ADMIN_HEADER } from '@bisondesk/commons-sdk/constants';\nimport { XError } from '@bisondesk/commons-sdk/errors';\nimport fetch, { Response } from 'node-fetch';\nimport { DataRecord } from '../types/utils';\nimport { NewVehicle, Vehicle, VehicleMarketing, VehiclePurchase } from '../types/vehicles';\nimport { cleanHeaders, getAdminAuth } from './utils';\n\nexport const getVehicle = async (\n tenantId: string,\n vehicleId: string\n): Promise<DataRecord<Vehicle> | undefined> => {\n const auth = await getAdminAuth();\n const response: Response = await fetch(\n `${process.env.CORE_API_ORIGIN}/api/vehicles/${vehicleId}`,\n {\n headers: {\n Authorization: auth,\n [TENANT_ID_ADMIN_HEADER]: tenantId,\n },\n }\n );\n\n if (response.ok) {\n return response.status === 200 ? (response.json() as any) : undefined;\n }\n\n const body = await response.text();\n throw new XError(response.statusText, { body });\n};\n\nexport const getVehiclePurchase = async (\n tenantId: string,\n vehicleId: string\n): Promise<DataRecord<VehiclePurchase> | undefined> => {\n const auth = await getAdminAuth();\n const response: Response = await fetch(\n `${process.env.CORE_API_ORIGIN}/api/vehicles/${vehicleId}/purchase`,\n {\n headers: {\n Authorization: auth,\n [TENANT_ID_ADMIN_HEADER]: tenantId,\n },\n }\n );\n\n if (response.ok) {\n return response.status === 200 ? (response.json() as any) : undefined;\n }\n\n const body = await response.text();\n throw new XError(response.statusText, { body });\n};\n\nexport const getVehicleByStockNumber = async (\n tenantId: string,\n stockNumber: string\n): Promise<Vehicle | undefined> => {\n const auth = await getAdminAuth();\n const response: Response = await fetch(\n `${process.env.CORE_API_ORIGIN}/api/vehicles/stock-number/${stockNumber}`,\n {\n headers: {\n Authorization: auth,\n [TENANT_ID_ADMIN_HEADER]: tenantId,\n },\n }\n );\n\n if (response.ok) {\n return response.status === 200 ? (response.json() as any) : undefined;\n }\n\n const body = await response.text();\n throw new XError(response.statusText, { body });\n};\n\nexport const getVehicleByPurchaseStockNumber = async (\n tenantId: string,\n stockNumber: string\n): Promise<Vehicle | undefined> => {\n const auth = await getAdminAuth();\n const response: Response = await fetch(\n `${process.env.CORE_API_ORIGIN}/api/vehicles/purchase-stock-number/${stockNumber}`,\n {\n headers: {\n Authorization: auth,\n [TENANT_ID_ADMIN_HEADER]: tenantId,\n },\n }\n );\n\n if (response.ok) {\n return response.status === 200 ? (response.json() as any) : undefined;\n }\n\n const body = await response.text();\n throw new XError(response.statusText, { body });\n};\n\nexport const listVehiclesMarketing = async (\n tenantId: string,\n offset: number,\n limit: number,\n opts?: { serviceId: string }\n): Promise<{ id: string; data: VehicleMarketing }[]> => {\n const auth = await getAdminAuth();\n const response: Response = await fetch(\n `${process.env.CORE_API_ORIGIN}/api/vehicles/marketing/list?offset=${offset}&limit=${limit}`,\n {\n headers: cleanHeaders({\n Authorization: auth,\n [TENANT_ID_ADMIN_HEADER]: tenantId,\n [SERVICE_ID_ADMIN_HEADER]: opts?.serviceId,\n }),\n }\n );\n\n if (response.ok) {\n return response.status === 200 ? (response.json() as any) : undefined;\n }\n\n const body = await response.text();\n throw new XError(response.statusText, { tenantId, body, offset, limit });\n};\n\nexport const getVehicleMarketing = async (\n tenantId: string,\n vehicleId: string\n): Promise<VehicleMarketing | undefined> => {\n const auth = await getAdminAuth();\n const response: Response = await fetch(\n `${process.env.CORE_API_ORIGIN}/api/vehicles/${vehicleId}/marketing`,\n {\n headers: {\n Authorization: auth,\n [TENANT_ID_ADMIN_HEADER]: tenantId,\n },\n }\n );\n\n if (response.ok) {\n return response.status === 200 ? (response.json() as any) : undefined;\n }\n\n const body = await response.text();\n throw new XError(response.statusText, { body });\n};\n\nexport const saveMarketing = async (\n tenantId: string,\n vehicleId: string,\n marketing: VehicleMarketing\n): Promise<VehicleMarketing> => {\n const auth = await getAdminAuth();\n\n const response: Response = await fetch(\n `${process.env.CORE_API_ORIGIN}/api/vehicles/${vehicleId}/marketing`,\n {\n method: 'POST',\n headers: cleanHeaders({\n Authorization: auth,\n 'Content-Type': 'application/json',\n [TENANT_ID_ADMIN_HEADER]: tenantId,\n }),\n body: JSON.stringify(marketing),\n }\n );\n\n if (response.ok) {\n return response.json() as any;\n }\n const body = await response.text();\n throw new XError(response.statusText, { body, tenantId, vehicleId, marketing });\n};\n\nexport const saveVehiclePurchase = async (\n tenantId: string,\n vehicleId: string,\n purchase: VehiclePurchase,\n opts?: { serviceId: string }\n): Promise<Vehicle> => {\n const auth = await getAdminAuth();\n const response: Response = await fetch(\n `${process.env.CORE_API_ORIGIN}/api/vehicles/${vehicleId}/purchase`,\n {\n method: 'POST',\n headers: cleanHeaders({\n Authorization: auth,\n 'Content-Type': 'application/json',\n [TENANT_ID_ADMIN_HEADER]: tenantId,\n [SERVICE_ID_ADMIN_HEADER]: opts?.serviceId,\n }),\n body: JSON.stringify(purchase),\n }\n );\n\n if (response.ok) {\n return response.json() as any;\n }\n const body = await response.text();\n throw new XError(response.statusText, { body, tenantId, vehicleId, purchase, opts });\n};\n\nexport const saveVehicle = async (\n tenantId: string,\n vehicle: NewVehicle | Vehicle,\n opts?: { serviceId: string }\n): Promise<Vehicle> => {\n const auth = await getAdminAuth();\n const response: Response = await fetch(`${process.env.CORE_API_ORIGIN}/api/vehicles`, {\n method: 'POST',\n headers: cleanHeaders({\n Authorization: auth,\n 'Content-Type': 'application/json',\n [TENANT_ID_ADMIN_HEADER]: tenantId,\n [SERVICE_ID_ADMIN_HEADER]: opts?.serviceId,\n }),\n body: JSON.stringify(vehicle),\n });\n\n if (response.ok) {\n return response.json() as any;\n }\n const body = await response.text();\n throw new XError(response.statusText, { body, tenantId, vehicle, opts });\n};\n\nexport const deleteVehicle = async (\n tenantId: string,\n vehicleId: string,\n opts?: { serviceId: string }\n): Promise<void> => {\n const auth = await getAdminAuth();\n const response: Response = await fetch(\n `${process.env.CORE_API_ORIGIN}/api/vehicles/${vehicleId}`,\n {\n method: 'DELETE',\n headers: cleanHeaders({\n Authorization: auth,\n [TENANT_ID_ADMIN_HEADER]: tenantId,\n [SERVICE_ID_ADMIN_HEADER]: opts?.serviceId,\n }),\n }\n );\n\n if (response.ok) {\n return;\n }\n\n const body = await response.text();\n throw new XError(response.statusText, { body, tenantId, vehicleId, opts });\n};\n"]}
1
+ {"version":3,"file":"vehicles.js","sourceRoot":"/","sources":["apis/vehicles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AACnG,OAAO,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,KAAmB,MAAM,YAAY,CAAC;AAG7C,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAErD,MAAM,CAAC,MAAM,UAAU,GAAG,KAAK,EAC7B,QAAgB,EAChB,SAAiB,EACyB,EAAE;IAC5C,MAAM,IAAI,GAAG,MAAM,YAAY,EAAE,CAAC;IAClC,MAAM,QAAQ,GAAa,MAAM,KAAK,CACpC,GAAG,OAAO,CAAC,GAAG,CAAC,eAAe,iBAAiB,SAAS,EAAE,EAC1D;QACE,OAAO,EAAE;YACP,aAAa,EAAE,IAAI;YACnB,CAAC,sBAAsB,CAAC,EAAE,QAAQ;SACnC;KACF,CACF,CAAC;IAEF,IAAI,QAAQ,CAAC,EAAE,EAAE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,CAAC;KAC9B,CAAC,CAAC;IAEH,IAAI,QAAQ,CAAC,EAAE,EAAE;QACf,OAAO,QAAQ,CAAC,IAAI,EAAS,CAAC;KAC/B;IACD,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;IACnC,MAAM,IAAI,MAAM,CAAC,QAAQ,CAAC,UAAU,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;AAC3E,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAG,KAAK,EAChC,QAAgB,EAChB,SAAiB,EACjB,IAA4B,EACb,EAAE;IACjB,MAAM,IAAI,GAAG,MAAM,YAAY,EAAE,CAAC;IAClC,MAAM,QAAQ,GAAa,MAAM,KAAK,CACpC,GAAG,OAAO,CAAC,GAAG,CAAC,eAAe,iBAAiB,SAAS,EAAE,EAC1D;QACE,MAAM,EAAE,QAAQ;QAChB,OAAO,EAAE,YAAY,CAAC;YACpB,aAAa,EAAE,IAAI;YACnB,CAAC,sBAAsB,CAAC,EAAE,QAAQ;YAClC,CAAC,uBAAuB,CAAC,EAAE,IAAI,EAAE,SAAS;SAC3C,CAAC;KACH,CACF,CAAC;IAEF,IAAI,QAAQ,CAAC,EAAE,EAAE;QACf,OAAO;KACR;IAED,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;IACnC,MAAM,IAAI,MAAM,CAAC,QAAQ,CAAC,UAAU,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;AAC7E,CAAC,CAAC","sourcesContent":["import { SERVICE_ID_ADMIN_HEADER, TENANT_ID_ADMIN_HEADER } from '@bisondesk/commons-sdk/constants';\nimport { XError } from '@bisondesk/commons-sdk/errors';\nimport { fetchJson } from '@bisondesk/commons-sdk/fetch';\nimport fetch, { Response } from 'node-fetch';\nimport { DataRecord } from '../types/utils';\nimport { NewVehicle, Vehicle, VehicleMarketing, VehiclePurchase } from '../types/vehicles';\nimport { cleanHeaders, getAdminAuth } from './utils';\n\nexport const getVehicle = async (\n tenantId: string,\n vehicleId: string\n): Promise<DataRecord<Vehicle> | undefined> => {\n const auth = await getAdminAuth();\n const response: Response = await fetch(\n `${process.env.CORE_API_ORIGIN}/api/vehicles/${vehicleId}`,\n {\n headers: {\n Authorization: auth,\n [TENANT_ID_ADMIN_HEADER]: tenantId,\n },\n }\n );\n\n if (response.ok) {\n return response.status === 200 ? (response.json() as any) : undefined;\n }\n\n const body = await response.text();\n throw new XError(response.statusText, { body });\n};\n\nexport const getVehicleByChassisNumber = async (\n tenantId: string,\n vin: string\n): Promise<DataRecord<Vehicle> | undefined> => {\n const auth = await getAdminAuth();\n return fetchJson(`${process.env.CORE_API_ORIGIN}/api/vehicles/vin/${vin}`, {\n headers: {\n Authorization: auth,\n [TENANT_ID_ADMIN_HEADER]: tenantId,\n },\n });\n};\n\nexport const getVehiclePurchase = async (\n tenantId: string,\n vehicleId: string\n): Promise<DataRecord<VehiclePurchase> | undefined> => {\n const auth = await getAdminAuth();\n const response: Response = await fetch(\n `${process.env.CORE_API_ORIGIN}/api/vehicles/${vehicleId}/purchase`,\n {\n headers: {\n Authorization: auth,\n [TENANT_ID_ADMIN_HEADER]: tenantId,\n },\n }\n );\n\n if (response.ok) {\n return response.status === 200 ? (response.json() as any) : undefined;\n }\n\n const body = await response.text();\n throw new XError(response.statusText, { body });\n};\n\nexport const getVehicleByStockNumber = async (\n tenantId: string,\n stockNumber: string\n): Promise<Vehicle | undefined> => {\n const auth = await getAdminAuth();\n const response: Response = await fetch(\n `${process.env.CORE_API_ORIGIN}/api/vehicles/stock-number/${stockNumber}`,\n {\n headers: {\n Authorization: auth,\n [TENANT_ID_ADMIN_HEADER]: tenantId,\n },\n }\n );\n\n if (response.ok) {\n return response.status === 200 ? (response.json() as any) : undefined;\n }\n\n const body = await response.text();\n throw new XError(response.statusText, { body });\n};\n\nexport const getVehicleByPurchaseStockNumber = async (\n tenantId: string,\n stockNumber: string\n): Promise<Vehicle | undefined> => {\n const auth = await getAdminAuth();\n const response: Response = await fetch(\n `${process.env.CORE_API_ORIGIN}/api/vehicles/purchase-stock-number/${stockNumber}`,\n {\n headers: {\n Authorization: auth,\n [TENANT_ID_ADMIN_HEADER]: tenantId,\n },\n }\n );\n\n if (response.ok) {\n return response.status === 200 ? (response.json() as any) : undefined;\n }\n\n const body = await response.text();\n throw new XError(response.statusText, { body });\n};\n\nexport const listVehiclesMarketing = async (\n tenantId: string,\n offset: number,\n limit: number,\n opts?: { serviceId: string }\n): Promise<{ id: string; data: VehicleMarketing }[]> => {\n const auth = await getAdminAuth();\n const response: Response = await fetch(\n `${process.env.CORE_API_ORIGIN}/api/vehicles/marketing/list?offset=${offset}&limit=${limit}`,\n {\n headers: cleanHeaders({\n Authorization: auth,\n [TENANT_ID_ADMIN_HEADER]: tenantId,\n [SERVICE_ID_ADMIN_HEADER]: opts?.serviceId,\n }),\n }\n );\n\n if (response.ok) {\n return response.status === 200 ? (response.json() as any) : undefined;\n }\n\n const body = await response.text();\n throw new XError(response.statusText, { tenantId, body, offset, limit });\n};\n\nexport const getVehicleMarketing = async (\n tenantId: string,\n vehicleId: string\n): Promise<VehicleMarketing | undefined> => {\n const auth = await getAdminAuth();\n const response: Response = await fetch(\n `${process.env.CORE_API_ORIGIN}/api/vehicles/${vehicleId}/marketing`,\n {\n headers: {\n Authorization: auth,\n [TENANT_ID_ADMIN_HEADER]: tenantId,\n },\n }\n );\n\n if (response.ok) {\n return response.status === 200 ? (response.json() as any) : undefined;\n }\n\n const body = await response.text();\n throw new XError(response.statusText, { body });\n};\n\nexport const saveMarketing = async (\n tenantId: string,\n vehicleId: string,\n marketing: VehicleMarketing\n): Promise<VehicleMarketing> => {\n const auth = await getAdminAuth();\n\n const response: Response = await fetch(\n `${process.env.CORE_API_ORIGIN}/api/vehicles/${vehicleId}/marketing`,\n {\n method: 'POST',\n headers: cleanHeaders({\n Authorization: auth,\n 'Content-Type': 'application/json',\n [TENANT_ID_ADMIN_HEADER]: tenantId,\n }),\n body: JSON.stringify(marketing),\n }\n );\n\n if (response.ok) {\n return response.json() as any;\n }\n const body = await response.text();\n throw new XError(response.statusText, { body, tenantId, vehicleId, marketing });\n};\n\nexport const saveVehiclePurchase = async (\n tenantId: string,\n vehicleId: string,\n purchase: VehiclePurchase,\n opts?: { serviceId: string }\n): Promise<Vehicle> => {\n const auth = await getAdminAuth();\n const response: Response = await fetch(\n `${process.env.CORE_API_ORIGIN}/api/vehicles/${vehicleId}/purchase`,\n {\n method: 'POST',\n headers: cleanHeaders({\n Authorization: auth,\n 'Content-Type': 'application/json',\n [TENANT_ID_ADMIN_HEADER]: tenantId,\n [SERVICE_ID_ADMIN_HEADER]: opts?.serviceId,\n }),\n body: JSON.stringify(purchase),\n }\n );\n\n if (response.ok) {\n return response.json() as any;\n }\n const body = await response.text();\n throw new XError(response.statusText, { body, tenantId, vehicleId, purchase, opts });\n};\n\nexport const saveVehicle = async (\n tenantId: string,\n vehicle: NewVehicle | Vehicle,\n opts?: { serviceId: string }\n): Promise<Vehicle> => {\n const auth = await getAdminAuth();\n const response: Response = await fetch(`${process.env.CORE_API_ORIGIN}/api/vehicles`, {\n method: 'POST',\n headers: cleanHeaders({\n Authorization: auth,\n 'Content-Type': 'application/json',\n [TENANT_ID_ADMIN_HEADER]: tenantId,\n [SERVICE_ID_ADMIN_HEADER]: opts?.serviceId,\n }),\n body: JSON.stringify(vehicle),\n });\n\n if (response.ok) {\n return response.json() as any;\n }\n const body = await response.text();\n throw new XError(response.statusText, { body, tenantId, vehicle, opts });\n};\n\nexport const deleteVehicle = async (\n tenantId: string,\n vehicleId: string,\n opts?: { serviceId: string }\n): Promise<void> => {\n const auth = await getAdminAuth();\n const response: Response = await fetch(\n `${process.env.CORE_API_ORIGIN}/api/vehicles/${vehicleId}`,\n {\n method: 'DELETE',\n headers: cleanHeaders({\n Authorization: auth,\n [TENANT_ID_ADMIN_HEADER]: tenantId,\n [SERVICE_ID_ADMIN_HEADER]: opts?.serviceId,\n }),\n }\n );\n\n if (response.ok) {\n return;\n }\n\n const body = await response.text();\n throw new XError(response.statusText, { body, tenantId, vehicleId, opts });\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"leasing-debtors.js","sourceRoot":"/","sources":["types/leasing-debtors.ts"],"names":[],"mappings":"","sourcesContent":["import { Organization } from './crm';\n\nexport type MonthData = {\n activeContractIds: string[];\n date: string; // YYYY-MM\n overdueAmount: string;\n unpaidAmount: string;\n overdueContractIds: string[];\n overdueInvoiceIds: string[];\n riskLevel: number;\n};\n\nexport type DebtorInfo = {\n clientId: string;\n months: MonthData[];\n\n // properties related to the current month\n activeContracts: number;\n overdueAmount: string;\n unpaidAmount: string;\n overdueContracts: number;\n riskLevel: number;\n};\n\nexport type SearchDebtorInfo = {\n org: Organization;\n debtor: DebtorInfo;\n custom: {\n riskLevelLabel: string;\n };\n};\n"]}
1
+ {"version":3,"file":"leasing-debtors.js","sourceRoot":"/","sources":["types/leasing-debtors.ts"],"names":[],"mappings":"","sourcesContent":["import { Organization } from './crm';\n\nexport type MonthData = {\n activeContractIds: string[];\n date: string; // YYYY-MM\n overdueAmount: string;\n unpaidAmount: string;\n overdueContractIds: string[];\n overdueInvoiceIds: string[];\n riskLevel: number;\n monthlyInvoicedAmount: string;\n};\n\nexport type DebtorInfo = {\n clientId: string;\n months: MonthData[];\n\n // properties related to the current month\n activeContracts: number;\n overdueAmount: string;\n unpaidAmount: string;\n overdueContracts: number;\n riskLevel: number;\n monthlyInvoicedAmount: string;\n};\n\nexport type SearchDebtorInfo = {\n org: Organization;\n debtor: DebtorInfo;\n custom: {\n riskLevelLabel: string;\n };\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"leasing.js","sourceRoot":"/","sources":["types/leasing.ts"],"names":[],"mappings":"AAyDA,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,qBAMX;AAND,WAAY,qBAAqB;IAC/B,wCAAe,CAAA;IACf,gDAAuB,CAAA;IACvB,0CAAiB,CAAA;IACjB,0CAAiB,CAAA;IACjB,wCAAe,CAAA;AACjB,CAAC,EANW,qBAAqB,KAArB,qBAAqB,QAMhC;AAqOD,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","sourcesContent":["import { EmailMessage } from '@bisondesk/commons-sdk/messages';\nimport { AttachmentValue, Document, LinkValue, PaginatedList } from '@bisondesk/commons-sdk/types';\nimport { SortFilter } from './search';\nimport { ReferenceData } from './utils';\n\nexport type LeasingContractEvent = {\n id: string;\n action: 'create' | 'update' | 'delete';\n actionAt: string;\n userId: string;\n tenantId: string;\n contract: LeasingContract;\n};\n\nexport type LeasingContractImportEvent = {\n tenantId: string;\n};\n\nexport type LeasingConditionEvent = {\n id: string;\n action: 'create';\n actionAt: string;\n userId: string;\n tenantId: string;\n};\n\nexport type OverdueDossier = {\n id: string;\n organizationId: string;\n organizationName: string;\n status: 'ONGOING' | 'ERROR' | 'SUCCESS' | 'EXPIRED';\n emails: EmailMessage[];\n createdAt: string;\n modifiedAt: string;\n completedAt?: string;\n nextActionAt: string;\n riskLevel: number;\n};\n\nexport type LeasingContractClient = {\n organizationId: string;\n contactIds: string[];\n email?: string;\n since: string;\n takeoverId?: string;\n country: string;\n beEntityType?: 'Legal Person' | 'Natural Person';\n beForeignEntity?: boolean;\n\n /**\n * Used to overwrite the startDate in the context of a Becris declaration. This might be necessary\n * when due to some data-quality issue we do not report the contract at the right period and it is no\n * longer possible to resend the declaration for the corresponding month.\n */\n becrisStartDate?: string;\n};\n\nexport enum LeasingContractSource {\n HYPERPORTAL = 'hyperportal',\n BISONDESK = 'bisondesk',\n}\n\nexport enum LeasingContractStatus {\n DRAFT = 'draft',\n DISCARDED = 'discarded',\n PAUSED = 'paused',\n ACTIVE = 'active',\n ENDED = 'ended',\n}\n\nexport type LeasingContractHyperportal = {\n source: LeasingContractSource.HYPERPORTAL;\n /** oldest first **/\n conditions: ConditionsRef[];\n opportunities?: undefined;\n};\n\nexport type LeasingContractBisondesk = {\n source: LeasingContractSource.BISONDESK;\n conditions?: undefined;\n /** oldest first **/\n opportunities: OpportunityRef[];\n};\n\nexport type LeasingContract<T = LeasingContractHyperportal | LeasingContractBisondesk> = {\n id: string;\n createdAt: string;\n updatedAt: string;\n contractNumber?: string;\n startDate: string;\n deliveryDate?: string;\n endDate?: string;\n slbPartner?: string;\n links?: LinkValue[];\n accountManager?: string;\n clients: LeasingContractClient[];\n vehicle: {\n id: string;\n stockNumber: string;\n administrativeNumber?: string;\n };\n status: LeasingContractStatus;\n documents: Document[];\n} & T;\n\nexport type NextLeasingRentRowRequest = {\n vehicleId: string;\n organizationId: string;\n issueDate: string;\n};\n\nexport type NextLeasingRentRowResponse = {\n capital: string;\n contract: string;\n insurance?: string;\n interest: string;\n other?: string; // insurance + taxes + others\n period: number;\n taxes?: string;\n total: string;\n};\n\ntype BaseRef = {\n id: string;\n depositAmount: string;\n durationInMonths: number;\n taxesAmount?: string;\n insuranceAmount?: string;\n saleAmount: string; // includes the extras\n interestRate: string; //TODO: In LC from BD value is percentage, in LC from HP value is decimal\n residualAmount: string;\n leasingMonthlyAmount: string; // excluding VAT\n otherMonthlyAmounts: string; // insurance + taxes + others (excluding VAT)\n totalMonthlyAmount: string; // excluding VAT\n};\n\nexport type ConditionsRef = BaseRef & {\n validSince: string;\n};\n\nexport type OpportunityRef = BaseRef & {\n createdAt: string;\n quoteId: string;\n //Since VAT is client specific and contracts can be transferred between clients, we always handle values without VAT\n};\n\nexport type ListOverdueRemindersResponse = PaginatedList<OverdueDossier, ReferenceData>;\nexport type ListOverdueRemindersRequest = {\n offset: number;\n limit: number;\n sortBy: SortFilter;\n};\n\nexport type NewLeasingConditions = {\n parameters: {\n yearlyRoadTax: string;\n civilLiability: string;\n oneTimeRoadTax: string;\n specialInsurance: string;\n allRisksPercentage: string;\n allRisksTaxPercentage: string;\n };\n\n inputs: {\n deposit: string;\n salesPrice: string;\n bankDeposit: string;\n purchasePrice: string;\n residualValue: string;\n insuranceAmount: string;\n durationInMonths: number;\n includesAllRisks: boolean;\n marginPercentage: string;\n bankResidualValue: string;\n bankDurationInMonths: number;\n startupFeePercentage: string;\n includesYearlyRoadTax: boolean;\n includesCivilLiability: boolean;\n includesOneTimeRoadTax: boolean;\n interestRatePercentage: string;\n includesSpecialInsurance: boolean;\n monthlyAdministrationFee: string;\n bankInterestRatePercentage: string;\n };\n\n outputs: {\n ROI: string;\n ROITarget: string;\n ROIPerYear: string;\n cashDeficit: string;\n totalProfit: string;\n ROIDifference: string;\n leasingAmount: string;\n leasingProfit: string;\n vehicleProfit: string;\n oneTimeTaxCost: string;\n financingAmount: string;\n bankContractValue: string;\n bankLeasingAmount: string;\n totalMonthlyPayment: string;\n leasingContractValue: string;\n monthlyTaxRetailPrice: string;\n allRisksInsuranceAmount: string;\n };\n\n cashIn: Array<{\n time: string;\n cashIn: string;\n deposit: string;\n startupFee: string;\n taxPayment: string;\n residualValue: string;\n cumulativeCash: string;\n insurancePayment: string;\n monthlyAdministrationFee: string;\n leasingAmountWithoutAdminFee: string;\n }>;\n\n cashOut: Array<{\n time: string;\n cashOut: string;\n deposit: string;\n taxPayment: string;\n leasingAmount: string;\n residualValue: string;\n cumulativeCash: string;\n insurancePayment: string;\n }>;\n};\n\nexport type LeasingConditions = NewLeasingConditions & {\n id: string;\n createdAt: string;\n createdBy: string;\n amortization: AmortizationTable;\n};\n\nexport type AmortizationRow = {\n period: number;\n /* An estimate of the date in which the period will happen\n based on the contract start date. Empty for period zero. */\n expectedPeriodDate?: string;\n buyOff: string;\n payment: string;\n capital: string;\n interest: string;\n totalInterest: string;\n balance: string;\n};\n\nexport type AmortizationTable = {\n annualInterestRate?: string;\n monthlyInterestRate?: string;\n rows: AmortizationRow[];\n};\n\nexport type AmortizationDocsEvent = {\n contractId: string;\n changedDocumentIds: string[];\n actionAt: string;\n userId: string;\n tenantId: string;\n};\n\nexport type AmortizationDocs = {\n contractId: string;\n period: number;\n documents: AmortizationDoc[];\n};\n\nexport type AmortizationDoc = {\n amount: string;\n bookingNumber: string;\n branchId: string;\n documentId: string;\n issueDate: string;\n subtype: 'Invoice' | 'Credit Note';\n clientExternalId: number;\n};\n\nexport type BecrisDeclaration = {\n createdAt: string;\n endDate: string;\n endingInstruments: number;\n existingInstruments: number;\n file: AttachmentValue;\n id: string;\n newInstruments: number;\n startDate: string;\n};\n\nexport type LeasingReportingSettings = {\n active: boolean;\n branchId: string;\n tenantId: string;\n};\n\nexport enum LeasingRemindersSortableColumns {\n NextActionAt = 'next_action_at',\n OrganizationName = 'organization_name',\n RemindersCount = 'reminders_count',\n Status = 'status',\n}\n\nexport type AmortizationTableRequest = {\n leasingAmount: string; // monthly amount\n deposit: string;\n salesPrice: string;\n duration: number; // in months\n residual: string;\n monthlyInterestRate: string; // the annual interest rate divided by 12\n startDate?: string; // should be filled in if you want an amortization table with expected period dates\n};\n\nexport type AmortizationTableTemplateData = {\n opportunity: {\n id: string;\n };\n v: {\n make: string;\n model: string;\n category: string;\n type?: string;\n vin: string;\n year?: string | number;\n stockNumber: string;\n };\n c: {\n clientNumber: number;\n company: string;\n fullName: string;\n vatNumber?: string;\n email?: string;\n phone?: string;\n address?: string;\n };\n leasing: {\n salesPrice: string;\n salesPriceVat: string;\n salesPriceExclVat: string;\n deposit: string;\n depositExclVat: string;\n depositVat: string;\n installment: string;\n installmentVat: string;\n installmentExclVat: string;\n duration: number;\n monthlyInsurance: string;\n monthlyTax: string;\n monthlyTaxesInsurance: string;\n residual: string;\n residualVat: string;\n residualExclVat: string;\n offerNumber: string;\n contractNumber: string;\n vatPercentage: string;\n };\n amortization: {\n period: number;\n periodStartDate: string;\n periodEndDate: string;\n deposit: string;\n startUpFee: string;\n monthlyAmount: string;\n insurance: string;\n expirationDate: string;\n total: string;\n }[];\n};\n"]}
1
+ {"version":3,"file":"leasing.js","sourceRoot":"/","sources":["types/leasing.ts"],"names":[],"mappings":"AAyDA,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,qBAMX;AAND,WAAY,qBAAqB;IAC/B,wCAAe,CAAA;IACf,gDAAuB,CAAA;IACvB,0CAAiB,CAAA;IACjB,0CAAiB,CAAA;IACjB,wCAAe,CAAA;AACjB,CAAC,EANW,qBAAqB,KAArB,qBAAqB,QAMhC;AAuOD,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","sourcesContent":["import { EmailMessage } from '@bisondesk/commons-sdk/messages';\nimport { AttachmentValue, Document, LinkValue, PaginatedList } from '@bisondesk/commons-sdk/types';\nimport { SortFilter } from './search';\nimport { ReferenceData } from './utils';\n\nexport type LeasingContractEvent = {\n id: string;\n action: 'create' | 'update' | 'delete';\n actionAt: string;\n userId: string;\n tenantId: string;\n contract: LeasingContract;\n};\n\nexport type LeasingContractImportEvent = {\n tenantId: string;\n};\n\nexport type LeasingConditionEvent = {\n id: string;\n action: 'create';\n actionAt: string;\n userId: string;\n tenantId: string;\n};\n\nexport type OverdueDossier = {\n id: string;\n organizationId: string;\n organizationName: string;\n status: 'ONGOING' | 'ERROR' | 'SUCCESS' | 'EXPIRED';\n emails: EmailMessage[];\n createdAt: string;\n modifiedAt: string;\n completedAt?: string;\n nextActionAt: string;\n riskLevel: number;\n};\n\nexport type LeasingContractClient = {\n organizationId: string;\n contactIds: string[];\n email?: string;\n since: string;\n takeoverId?: string;\n country: string;\n beEntityType?: 'Legal Person' | 'Natural Person';\n beForeignEntity?: boolean;\n\n /**\n * Used to overwrite the startDate in the context of a Becris declaration. This might be necessary\n * when due to some data-quality issue we do not report the contract at the right period and it is no\n * longer possible to resend the declaration for the corresponding month.\n */\n becrisStartDate?: string;\n};\n\nexport enum LeasingContractSource {\n HYPERPORTAL = 'hyperportal',\n BISONDESK = 'bisondesk',\n}\n\nexport enum LeasingContractStatus {\n DRAFT = 'draft',\n DISCARDED = 'discarded',\n PAUSED = 'paused',\n ACTIVE = 'active',\n ENDED = 'ended',\n}\n\nexport type LeasingContractHyperportal = {\n source: LeasingContractSource.HYPERPORTAL;\n /** oldest first **/\n conditions: ConditionsRef[];\n opportunities?: undefined;\n};\n\nexport type LeasingContractBisondesk = {\n source: LeasingContractSource.BISONDESK;\n conditions?: undefined;\n /** oldest first **/\n opportunities: OpportunityRef[];\n};\n\nexport type LeasingContract<T = LeasingContractHyperportal | LeasingContractBisondesk> = {\n id: string;\n createdAt: string;\n updatedAt: string;\n contractNumber?: string;\n startDate: string;\n deliveryDate?: string;\n endDate?: string;\n slbPartner?: string;\n links?: LinkValue[];\n accountManager?: string;\n clients: LeasingContractClient[];\n hasSlbPartnerAmortisationTable?: boolean;\n slbContractNumber?: string;\n vehicle: {\n id: string;\n stockNumber: string;\n administrativeNumber?: string;\n };\n status: LeasingContractStatus;\n documents: Document[];\n} & T;\n\nexport type NextLeasingRentRowRequest = {\n vehicleId: string;\n organizationId: string;\n issueDate: string;\n};\n\nexport type NextLeasingRentRowResponse = {\n capital: string;\n contract: string;\n insurance?: string;\n interest: string;\n other?: string; // insurance + taxes + others\n period: number;\n taxes?: string;\n total: string;\n};\n\ntype BaseRef = {\n id: string;\n depositAmount: string;\n durationInMonths: number;\n taxesAmount?: string;\n insuranceAmount?: string;\n saleAmount: string; // includes the extras\n interestRate: string; //TODO: In LC from BD value is percentage, in LC from HP value is decimal\n residualAmount: string;\n leasingMonthlyAmount: string; // excluding VAT\n otherMonthlyAmounts: string; // insurance + taxes + others (excluding VAT)\n totalMonthlyAmount: string; // excluding VAT\n};\n\nexport type ConditionsRef = BaseRef & {\n validSince: string;\n};\n\nexport type OpportunityRef = BaseRef & {\n createdAt: string;\n quoteId: string;\n //Since VAT is client specific and contracts can be transferred between clients, we always handle values without VAT\n};\n\nexport type ListOverdueRemindersResponse = PaginatedList<OverdueDossier, ReferenceData>;\nexport type ListOverdueRemindersRequest = {\n offset: number;\n limit: number;\n sortBy: SortFilter;\n};\n\nexport type NewLeasingConditions = {\n parameters: {\n yearlyRoadTax: string;\n civilLiability: string;\n oneTimeRoadTax: string;\n specialInsurance: string;\n allRisksPercentage: string;\n allRisksTaxPercentage: string;\n };\n\n inputs: {\n deposit: string;\n salesPrice: string;\n bankDeposit: string;\n purchasePrice: string;\n residualValue: string;\n insuranceAmount: string;\n durationInMonths: number;\n includesAllRisks: boolean;\n marginPercentage: string;\n bankResidualValue: string;\n bankDurationInMonths: number;\n startupFeePercentage: string;\n includesYearlyRoadTax: boolean;\n includesCivilLiability: boolean;\n includesOneTimeRoadTax: boolean;\n interestRatePercentage: string;\n includesSpecialInsurance: boolean;\n monthlyAdministrationFee: string;\n bankInterestRatePercentage: string;\n };\n\n outputs: {\n ROI: string;\n ROITarget: string;\n ROIPerYear: string;\n cashDeficit: string;\n totalProfit: string;\n ROIDifference: string;\n leasingAmount: string;\n leasingProfit: string;\n vehicleProfit: string;\n oneTimeTaxCost: string;\n financingAmount: string;\n bankContractValue: string;\n bankLeasingAmount: string;\n totalMonthlyPayment: string;\n leasingContractValue: string;\n monthlyTaxRetailPrice: string;\n allRisksInsuranceAmount: string;\n };\n\n cashIn: Array<{\n time: string;\n cashIn: string;\n deposit: string;\n startupFee: string;\n taxPayment: string;\n residualValue: string;\n cumulativeCash: string;\n insurancePayment: string;\n monthlyAdministrationFee: string;\n leasingAmountWithoutAdminFee: string;\n }>;\n\n cashOut: Array<{\n time: string;\n cashOut: string;\n deposit: string;\n taxPayment: string;\n leasingAmount: string;\n residualValue: string;\n cumulativeCash: string;\n insurancePayment: string;\n }>;\n};\n\nexport type LeasingConditions = NewLeasingConditions & {\n id: string;\n createdAt: string;\n createdBy: string;\n amortization: AmortizationTable;\n};\n\nexport type AmortizationRow = {\n period: number;\n /* An estimate of the date in which the period will happen\n based on the contract start date. Empty for period zero. */\n expectedPeriodDate?: string;\n buyOff: string;\n payment: string;\n capital: string;\n interest: string;\n totalInterest: string;\n balance: string;\n};\n\nexport type AmortizationTable = {\n annualInterestRate?: string;\n monthlyInterestRate?: string;\n rows: AmortizationRow[];\n};\n\nexport type AmortizationDocsEvent = {\n contractId: string;\n changedDocumentIds: string[];\n actionAt: string;\n userId: string;\n tenantId: string;\n};\n\nexport type AmortizationDocs = {\n contractId: string;\n period: number;\n documents: AmortizationDoc[];\n};\n\nexport type AmortizationDoc = {\n amount: string;\n bookingNumber: string;\n branchId: string;\n documentId: string;\n issueDate: string;\n subtype: 'Invoice' | 'Credit Note';\n clientExternalId: number;\n};\n\nexport type BecrisDeclaration = {\n createdAt: string;\n endDate: string;\n endingInstruments: number;\n existingInstruments: number;\n file: AttachmentValue;\n id: string;\n newInstruments: number;\n startDate: string;\n};\n\nexport type LeasingReportingSettings = {\n active: boolean;\n branchId: string;\n tenantId: string;\n};\n\nexport enum LeasingRemindersSortableColumns {\n NextActionAt = 'next_action_at',\n OrganizationName = 'organization_name',\n RemindersCount = 'reminders_count',\n Status = 'status',\n}\n\nexport type AmortizationTableRequest = {\n leasingAmount: string; // monthly amount\n deposit: string;\n salesPrice: string;\n duration: number; // in months\n residual: string;\n monthlyInterestRate: string; // the annual interest rate divided by 12\n startDate?: string; // should be filled in if you want an amortization table with expected period dates\n};\n\nexport type AmortizationTableTemplateData = {\n opportunity: {\n id: string;\n };\n v: {\n make: string;\n model: string;\n category: string;\n type?: string;\n vin: string;\n year?: string | number;\n stockNumber: string;\n };\n c: {\n clientNumber: number;\n company: string;\n fullName: string;\n vatNumber?: string;\n email?: string;\n phone?: string;\n address?: string;\n };\n leasing: {\n salesPrice: string;\n salesPriceVat: string;\n salesPriceExclVat: string;\n deposit: string;\n depositExclVat: string;\n depositVat: string;\n installment: string;\n installmentVat: string;\n installmentExclVat: string;\n duration: number;\n monthlyInsurance: string;\n monthlyTax: string;\n monthlyTaxesInsurance: string;\n residual: string;\n residualVat: string;\n residualExclVat: string;\n offerNumber: string;\n contractNumber: string;\n vatPercentage: string;\n };\n amortization: {\n period: number;\n periodStartDate: string;\n periodEndDate: string;\n deposit: string;\n startUpFee: string;\n monthlyAmount: string;\n insurance: string;\n expirationDate: string;\n total: string;\n }[];\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"opportunities.js","sourceRoot":"/","sources":["types/opportunities.ts"],"names":[],"mappings":"AASA,MAAM,CAAN,IAAY,kBAmBX;AAnBD,WAAY,kBAAkB;IAC5B,mDAA6B,CAAA;IAC7B,mCAAa,CAAA;IACb,uCAAiB,CAAA;IACjB,6DAAuC,CAAA;IACvC,+DAAyC,CAAA;IACzC,uDAAiC,CAAA;IACjC,yDAAmC,CAAA;IACnC,mDAA6B,CAAA;IAC7B,qDAA+B,CAAA;IAC/B,mDAA6B,CAAA;IAC7B,mDAA6B,CAAA;IAC7B,iDAA2B,CAAA;IAC3B,mDAA6B,CAAA;IAC7B,iDAA2B,CAAA;IAC3B,uDAAiC,CAAA;IACjC,yDAAmC,CAAA;IACnC,mEAA6C,CAAA;IAC7C,wDAAkC,CAAA;AACpC,CAAC,EAnBW,kBAAkB,KAAlB,kBAAkB,QAmB7B;AAED,MAAM,CAAN,IAAY,qBAIX;AAJD,WAAY,qBAAqB;IAC/B,sDAA6B,CAAA;IAC7B,wDAA+B,CAAA;IAC/B,sDAA6B,CAAA;AAC/B,CAAC,EAJW,qBAAqB,KAArB,qBAAqB,QAIhC;AAED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AAA;IACzD,2DAA4B,CAAA;IAC5B,6DAA8B,CAAA;IAC9B,+DAAgC,CAAA;IAChC,+DAAgC,CAAA;AAClC,CAAC,EATW,2BAA2B,KAA3B,2BAA2B,QAStC;AAmMD,MAAM,CAAC,MAAM,iCAAiC,GAAG,eAAe,CAAC;AACjE,MAAM,CAAC,MAAM,4CAA4C,GAAG,0BAA0B,CAAC;AACvF,MAAM,CAAC,MAAM,2CAA2C,GAAG,yBAAyB,CAAC;AACrF,MAAM,CAAC,MAAM,sCAAsC,GAAG,oBAAoB,CAAC;AAC3E,MAAM,CAAC,MAAM,iDAAiD,GAAG,+BAA+B,CAAC","sourcesContent":["import { Document } from '@bisondesk/commons-sdk/types';\nimport { BusinessEntityIds, OpportunityType, WarningHints } from '../constants';\nimport { Contact, Organization } from './crm';\nimport { Interest } from './leads';\nimport { Payment } from './payments';\nimport { Quote, QuoteStatus } from './quotes';\nimport { DataRecord, ReferenceData } from './utils';\nimport { Vehicle } from './vehicles';\n\nexport enum OpportunityActions {\n CREATE_QUOTE = 'create_quote',\n LOSE = 'lose',\n REOPEN = 'reopen',\n START_PREPARATION = 'start_preparation',\n REVERT_PREPARATION = 'revert_preparation',\n START_DELIVERY = 'start_delivery',\n REVERT_DELIVERY = 'revert_delivery',\n SET_CUSTOMER = 'set_customer',\n SET_DOCUMENTS = 'set_documents',\n SET_INTEREST = 'set_interest',\n SET_METADATA = 'set_metadata',\n SET_VEHICLE = 'set_vehicle',\n ADD_ACTIVITY = 'add_activity',\n ADD_PAYMENT = 'add_payment',\n SWITCH_VEHICLE = 'switch_vehicle',\n DELIVER_VEHICLE = 'deliver_vehicle',\n UNDO_DELIVER_VEHICLE = 'undo_deliver_vehicle',\n SET_DEAL_INFO = 'update_deal_info',\n}\n\nexport enum OpportunityDealStatus {\n SALES_AGREED = 'sales_agreed',\n FIRST_PAYMENT = 'first_payment',\n FULL_PAYMENT = 'full_payment',\n}\n\nexport enum OpportunityStatus {\n PROSPECTION = 'prospection',\n DISCOVERY = 'discovery',\n EVALUATION = 'evaluation',\n REVIEW = 'review',\n PREPARATION = 'preparation',\n DELIVERY = 'delivery',\n}\n\nexport const OpportunityStatusOrder: OpportunityStatus[] = [\n OpportunityStatus.PROSPECTION,\n OpportunityStatus.DISCOVERY,\n OpportunityStatus.EVALUATION,\n OpportunityStatus.REVIEW,\n OpportunityStatus.PREPARATION,\n OpportunityStatus.DELIVERY,\n];\n\nexport enum OpportunityLogisticStatus {\n AT_ORIGIN = 'at_origin',\n DELIVERED = 'delivered',\n}\n\nexport enum OpportunityRequirementsCode {\n VEHICLE_AT_ORIGIN = 'vehicle_at_origin',\n}\n\nexport enum OpportunityWarningsCode {\n QUOTE_PENDING_VALIDATION = 'quote_pending_validation',\n QUOTE_PEDING_MANAGER_APPROVAL = 'quote_pending_manager_approval',\n CONCURRENT_OPPORTUNITIES = 'concurrent_opportunities',\n VEHICLE_RESERVED = 'vehicle_reserved',\n OPPORTUNITY_NEEDS_SWITCH_VEHICLE = 'opportunity_needs_switch_vehicle',\n}\n\nexport const OpportunityWonColumnId = 'closed_won';\n\nexport const OpportunityKanbanColumns = [...OpportunityStatusOrder, OpportunityWonColumnId];\n\nexport const OpportunityKanbanEndColumns: string[] = [OpportunityWonColumnId];\n\nexport enum OpportunityLostReasonValues {\n Expensive = 'expensive',\n AlreadySold = 'already_sold',\n BadExperience = 'bad_experience',\n IncorrectVehicleCondition = 'incorrect_vehicle_condition',\n NoStock = 'not_enough_stock',\n SlowDelivery = 'slow_delivery',\n HighDeposit = 'deposit_too_high',\n NoAnswer = 'client_not_answered',\n}\n\ntype BaseBid = {\n vehicleId: string;\n opportunityId?: string;\n contactId: string;\n amount: string;\n};\n\nexport type NewBid = BaseBid & {};\n\nexport type Bid = BaseBid & {\n id: string;\n createdAt: string;\n createdBy: string;\n};\n\ntype BaseOpportunity = {\n accountManager?: string;\n administrativePerson?: string;\n type: OpportunityType;\n organizationId?: string;\n contactId?: string;\n vehicleId?: string;\n source?: string; // e.g. website, autoscout, mobile...\n branch: string;\n inquiry?: string;\n branchCountry: string;\n};\n\nexport type NewOpportunity = BaseOpportunity & {\n id?: undefined;\n createdAt?: undefined;\n createdBy?: undefined;\n modifiedAt?: undefined;\n modifiedBy?: undefined;\n};\n\nexport type Opportunity = BaseOpportunity & {\n id: string;\n createdAt: string;\n createdBy: string;\n modifiedAt: string;\n modifiedBy: string;\n validatedAt?: string;\n validatedBy?: string;\n acceptedAt?: string;\n acceptedBy?: string;\n lastActivityAt?: string; // last time we reached out to the customer, regardless of medium\n reviewedAt?: string;\n reviewedBy?: string;\n reviewExpiredAt?: string;\n preparedAt?: string;\n preparedBy?: string;\n lostAt?: string;\n lostBy?: string;\n wonAt?: string;\n lostReason?: OpportunityLostReasonValues;\n deliveredAt?: string;\n deliveredBy?: string;\n status: OpportunityStatus;\n dealStatus?: OpportunityDealStatus;\n logisticStatus?: OpportunityLogisticStatus;\n activeQuoteId?: string;\n amount?: string;\n interest?: Interest;\n documents?: Document[];\n leasingContractId?: string;\n requirementsOverride?: {\n [code: string]: { override: true; reason?: string; actionAt: string; actionBy: string };\n };\n};\n\nexport type OpportunityUpdate = {\n vehicleId?: string | null;\n accountManager?: string | null;\n administrativePerson?: string | null;\n contactId?: string | null;\n activeQuoteId?: string | null;\n interest?: Interest | null;\n reviewed?: boolean;\n prepared?: boolean;\n lost?: boolean;\n delivered?: boolean;\n lostReason?: OpportunityLostReasonValues;\n documents?: Document[];\n branch?: string;\n branchCountry?: string;\n type?: OpportunityType;\n lastActivityAt?: string | null; // null gives the possibility to delete this field if all activities are deleted\n reviewExpiredAt?: string | null; // null gives the possibility to delete this field if all activities are deleted\n source?: string | null;\n requirementsOverride?: {\n [code: string]: { override: true; reason?: string; actionAt: string; actionBy: string };\n };\n};\n\nexport type PaymentSummary = {\n total: string;\n paid: string;\n entries: DataRecord<Payment>[];\n};\n\nexport type VehicleBffMetadata = {\n openOpportunities: number;\n otherRelatedVehicleIds: string[];\n};\n\nexport type OpportunityStatusRequirement = { code: OpportunityRequirementsCode; title?: string };\n\nexport type OpportunityWarning = {\n code: OpportunityWarningsCode;\n title: string;\n description: string;\n level: WarningHints;\n businessEntityId?: BusinessEntityIds;\n recordId?: string;\n actionTitle?: string;\n};\n\nexport type OpportunityBffMeta = ReferenceData & {\n requirements: OpportunityStatusRequirement[];\n warnings: OpportunityWarning[];\n};\n\nexport type OpportunityBFF = {\n opportunity: DataRecord<Opportunity, OpportunityBffMeta>;\n vehicle?: DataRecord<Vehicle, VehicleBffMetadata>;\n bids: DataRecord<Bid>[];\n quotes: DataRecord<Quote>[];\n activeQuote?: DataRecord<Quote>;\n payments: PaymentSummary | undefined;\n customer?: {\n contact: DataRecord<Contact>;\n org?: DataRecord<Organization>;\n };\n};\n\ntype BaseOpportunityEvent = {\n actionAt: string;\n userId: string;\n tenantId: string;\n};\n\nexport type OpportunityCreateEvent = BaseOpportunityEvent & {\n opportunity: Opportunity;\n previousOpportunity?: undefined;\n action: 'create';\n};\n\nexport type OpportunityUpdateEvent = BaseOpportunityEvent & {\n opportunity: Opportunity;\n previousOpportunity: Opportunity;\n action: 'update';\n};\n\nexport type OpportunityDeleteEvent = BaseOpportunityEvent & {\n opportunity?: undefined;\n previousOpportunity: Opportunity;\n action: 'delete';\n};\n\nexport type OpportunityEvent =\n | OpportunityCreateEvent\n | OpportunityUpdateEvent\n | OpportunityDeleteEvent;\n\nexport type QuoteEvent = {\n quote: Quote;\n opportunity: Opportunity;\n action: 'create' | 'update' | 'delete';\n actionAt: string;\n userId: string;\n tenantId: string;\n};\n\n/* Quote summary with information that should be common to different types of quotes */\nexport type QuoteInfo = {\n status: QuoteStatus;\n roi: string;\n id: string;\n};\n\nexport type SearchOpportunity = {\n contact?: Contact;\n opportunity: Opportunity;\n org?: Organization;\n vehicle?: Vehicle;\n quote?: QuoteInfo;\n custom: {\n unassigned: boolean;\n assignees: string[];\n };\n};\n\nexport const QUOTE_CREATED_NOTIFICATION_ORIGIN = 'quote-created';\nexport const QUOTE_VALIDATOR_FEEDBACK_NOTIFICATION_ORIGIN = 'quote-validator-feedback';\nexport const QUOTE_CUSTOMER_FEEDBACK_NOTIFICATION_ORIGIN = 'quote-customer-feedback';\nexport const OPPORTUNITY_CLOSED_NOTIFICATION_ORIGIN = 'opportunity-closed';\nexport const OPPORTUNITY_VEHICLE_AVAILABLE_NOTIFICATION_ORIGIN = 'opportunity-vehicle-available';\n\nexport type OpportunityNotificationData = {\n quoteVersion?: number;\n};\n\nexport type LeasingQuoteTemplateData = {\n opportunity: {\n id: string;\n };\n currentDate: string;\n vehicle: {\n make: string;\n model: string;\n type?: string;\n km: string | number;\n vin: string;\n mainImage: string;\n localLicensePlate: boolean;\n description: string;\n year?: string | number;\n stockNumber?: string;\n };\n accountManager: {\n fullName: string;\n email: string;\n phone: string;\n };\n customer: {\n company: string;\n fullName: string;\n vatNumber?: string;\n address?: string;\n };\n settingId: string;\n leasing: {\n deposit: string;\n startupFee: string;\n totalExtras: string;\n totalBeforeDeliveryExclVat: string;\n totalBeforeDelivery: string;\n installment: string;\n duration: number;\n monthlyInsurance: string;\n monthlyTax: string;\n monthlyTaxesInsurance: string;\n residual: string;\n offerNumber: string;\n extras: { name: string }[];\n };\n};\n\nexport type LineItemPdfTemplate = {\n description: string;\n vat: string;\n quantity: number;\n unitPriceExclVat: string;\n amount: string;\n amountExclVat: string;\n};\n\nexport type LeasingProformaTemplateData = {\n opportunity: {\n id: string;\n offerNumber: string;\n };\n currentDate: string;\n accountManager: {\n fullName: string;\n email: string;\n phone: string;\n };\n vehicle: {\n line1: string;\n line2: string;\n stockNumber: string;\n };\n c: {\n organizationId?: string;\n clientId: string;\n company: string;\n fullName: string;\n vatNumber?: string;\n email?: string;\n phone?: string;\n address?: string;\n };\n i: LineItemPdfTemplate[];\n t: {\n totalExclVat: string;\n vatAmount: string;\n displayVatMessage: boolean;\n total: string;\n monthly: string;\n monthlyExclVat: string;\n residual: string;\n residualExclVat: string;\n duration: number;\n };\n};\n\nexport type SalesProformaTemplateData = {\n opportunity: {\n id: string;\n offerNumber: string;\n };\n currentDate: string;\n expirationDate: string;\n accountManager: {\n fullName: string;\n email: string;\n phone: string;\n };\n vehicle: {\n line1: string;\n line2: string;\n stockNumber: string;\n };\n c: {\n organizationId?: string;\n clientId: string;\n company: string;\n fullName: string;\n vatNumber?: string;\n email?: string;\n phone?: string;\n address?: string;\n };\n i: LineItemPdfTemplate[];\n t: {\n totalExclVat: string;\n vatAmount: string;\n total: string;\n };\n};\n\nexport type SalesAgreementTemplateData = {\n opportunity: {\n id: string;\n offerNumber: string;\n };\n currentDate: string;\n accountManager: {\n fullName: string;\n email: string;\n phone: string;\n };\n vehicle: {\n line1: string;\n line2: string;\n stockNumber: string;\n };\n c: {\n organizationId?: string;\n clientId: string;\n company: string;\n fullName: string;\n vatNumber?: string;\n email?: string;\n phone?: string;\n address?: string;\n };\n i: LineItemPdfTemplate[];\n t: {\n totalExclVat: string;\n vatAmount: string;\n total: string;\n };\n};\n\nexport type OpportunitiesKanbanColumn = {\n status: string;\n results: SearchOpportunity[];\n totalCount: number;\n totalValue: string;\n};\n\nexport type HpLeasingDealRequest = {\n tenantId: string;\n initiatedBy: 'bisondesk';\n processMetaId: string;\n processRunData: {\n entityOwner: string;\n leasingContractOwner: string;\n foreseenDeliveryDate?: string;\n deliveryAddressLeasing?: string;\n nameSalesPerson: string;\n durationLeasingInMonths: number;\n vanCourier: boolean;\n newVehicle?: boolean;\n newTrailer?: boolean;\n registrationOnTtcoBe?: string;\n yearOfConstruction?: number;\n chassisnumber?: string;\n vehicleModel?: string;\n vehicleCategory2?: string;\n licencePlate?: string;\n vatPercentage?: number;\n\n opportunityContractId: string;\n opportunityId: string;\n\n company?: string;\n customerNumber?: number; //bisondesk external id\n //MrLease fields\n vehicle?: string;\n salesPriceEur: string;\n depositFullAmountExclVat: string;\n depositToBePrepaidExclVat: string;\n vehicleMake3?: string;\n\n //TTC fields\n vehicleOriginalReference?: string;\n salesPrice: string;\n depositFullAmount: string;\n depositAmountToBePrepaid: string;\n make?: string;\n\n //Extras\n garageExtrasCodes: string[];\n allExtrasDescriptions: string[];\n administrationExtrasCodes: string[];\n logisticExtrasCodes: string[];\n customRequestDescriptions: string[];\n };\n};\n\nexport type HpLeasingDealResponse = {\n entityId: string;\n id: string;\n status: string;\n leasingContractNumber?: string;\n};\n\nexport type HpLeasingContractRequest = {\n tenantId: string;\n initiatedBy: 'bisondesk';\n processMetaId: string;\n processRunData: {\n entityOwner: string;\n company?: string;\n vehicle?: string;\n ldNumber: number;\n vanCourier: boolean;\n startDate: number;\n opportunityContractId: string;\n data: {\n leasingParameter: {\n allRisksPercentage: number;\n allRisksTaxPercentage: number;\n civilLiability: number;\n entityId: string;\n oneTimeRoadTax: number;\n specialInsurance: number;\n yearlyRoadTax: number;\n countries: string[];\n vehicleCategory: string;\n };\n\n calculatorRequest: {\n bankDeposit: number;\n bankDurationInMonths: number;\n bankInterestRatePercentage: number;\n bankResidualValue: number;\n deposit: number;\n durationInMonths: number;\n includesAllRisks: boolean;\n includesCivilLiability: boolean;\n includesOneTimeRoadTax: boolean;\n includesSpecialInsurance: boolean;\n includesYearlyRoadTax: boolean;\n insuranceAmount: number;\n interestRatePercentage: number;\n marginPercentage: number;\n monthlyAdministrationFee: 0;\n purchasePrice: number;\n residualValue: number;\n salesPrice: number;\n startupFeePercentage: number;\n };\n\n calculatorResponse: {\n ROI: number;\n ROIDifference: number;\n ROIPerYear: number;\n ROITarget: number;\n allRisksInsuranceAmount: number;\n bankContractValue: number;\n bankLeasingAmount: number;\n cashDeficit: number;\n financingAmount: number;\n leasingAmount: number;\n leasingContractValue: number;\n leasingProfit: number;\n monthlyTaxRetailPrice: number;\n oneTimeTaxCost: number;\n totalMonthlyPayment: number;\n totalProfit: number;\n vehicleProfit: number;\n };\n\n cashInValues: CashInRow[];\n\n cashOutValues: CashOutRow[];\n };\n };\n};\n\nexport type HpLeasingContractResponse = {\n entityId: string;\n id: string;\n status: string;\n createdAt: string;\n updatedAt: string;\n dateOfFinalSettlement: string;\n startDate: string;\n email: string;\n contractNumber: string;\n};\n\nexport type CashInRow = {\n time: number;\n deposit: number;\n monthlyAdministrationFee: 0; //Legacy field - Should always be 0\n residualValue: number;\n startupFee: number;\n leasingAmountWithoutAdminFee: number;\n insurancePayment: number;\n taxPayment: number;\n cashIn: number;\n cumulativeCash: number;\n};\n\nexport type CashOutRow = {\n time: number;\n deposit: number;\n residualValue: number;\n leasingAmount: number;\n insurancePayment: number;\n taxPayment: number;\n cashOut: number;\n cumulativeCash: number;\n};\n\nexport type HpIsaProcessRequest = {\n tenantId: string;\n initiatedBy: 'bisondesk';\n processMetaId: string;\n processRunData: {\n entityOwner: string;\n\n company?: string; //entityId\n proofOfSaleCustomerAgreement?: string; //entityId\n\n vehicle?: string; //entityId\n bodywork?: string; //entityId\n vehicleCategory: string; //entityId\n\n amountOfCommissionPaid: number;\n dealValidated: boolean;\n dealCancelled: boolean;\n opportunityId: string;\n deliveryType: string; //entity Id\n stackingVehicle?: boolean;\n detailsOfStacking?: string;\n\n //PickUP Delivery\n urgentDelivery?: boolean;\n dateOfPickUpByCustomer?: number;\n modeOfTransportPickUpByCustomer?: string; //entity Id\n detailsOfBorderCrossing?: string;\n technicalControlNeeded?: boolean;\n insuranceNeeded?: boolean;\n transitPlateBelgiumNeeded?: boolean;\n transitPlateAustriaNeeded?: boolean;\n licensePlateNeeded?: boolean;\n\n //Address Delivery\n addressOfDelivery?: string;\n kmToAddressOfDelivery?: number;\n\n //To Port Delivery\n portOfDelivery?: string; //entity Id\n shippingCompany?: string; //string Id\n destinationPort?: string;\n cleaningDegassingNeeded?: boolean;\n agreedPrice?: string;\n\n //Extras\n garageExtrasCodes: string[];\n logisticsExtrasCodes: string[];\n administrationExtrasCodes: string[];\n allExtrasDescriptions: string[];\n customRequestDescriptions: string[];\n infoSpoiler: string; // entity Id\n };\n};\n\nexport type HpIsaProcessResponse = {\n entityId: string;\n id: string;\n status: string;\n};\n\nexport type SwitchOpportunityVehicleRequest = {\n opportunityId: string;\n newVehicleId: string;\n};\n"]}
1
+ {"version":3,"file":"opportunities.js","sourceRoot":"/","sources":["types/opportunities.ts"],"names":[],"mappings":"AASA,MAAM,CAAN,IAAY,kBAmBX;AAnBD,WAAY,kBAAkB;IAC5B,mDAA6B,CAAA;IAC7B,mCAAa,CAAA;IACb,uCAAiB,CAAA;IACjB,6DAAuC,CAAA;IACvC,+DAAyC,CAAA;IACzC,uDAAiC,CAAA;IACjC,yDAAmC,CAAA;IACnC,mDAA6B,CAAA;IAC7B,qDAA+B,CAAA;IAC/B,mDAA6B,CAAA;IAC7B,mDAA6B,CAAA;IAC7B,iDAA2B,CAAA;IAC3B,mDAA6B,CAAA;IAC7B,iDAA2B,CAAA;IAC3B,uDAAiC,CAAA;IACjC,yDAAmC,CAAA;IACnC,mEAA6C,CAAA;IAC7C,wDAAkC,CAAA;AACpC,CAAC,EAnBW,kBAAkB,KAAlB,kBAAkB,QAmB7B;AAED,MAAM,CAAN,IAAY,qBAIX;AAJD,WAAY,qBAAqB;IAC/B,sDAA6B,CAAA;IAC7B,wDAA+B,CAAA;IAC/B,sDAA6B,CAAA;AAC/B,CAAC,EAJW,qBAAqB,KAArB,qBAAqB,QAIhC;AAED,MAAM,CAAN,IAAY,iBAOX;AAPD,WAAY,iBAAiB;IAC3B,gDAA2B,CAAA;IAC3B,4CAAuB,CAAA;IACvB,8CAAyB,CAAA;IACzB,sCAAiB,CAAA;IACjB,gDAA2B,CAAA;IAC3B,0CAAqB,CAAA;AACvB,CAAC,EAPW,iBAAiB,KAAjB,iBAAiB,QAO5B;AAED,MAAM,CAAC,MAAM,sBAAsB,GAAwB;IACzD,iBAAiB,CAAC,WAAW;IAC7B,iBAAiB,CAAC,SAAS;IAC3B,iBAAiB,CAAC,UAAU;IAC5B,iBAAiB,CAAC,MAAM;IACxB,iBAAiB,CAAC,WAAW;IAC7B,iBAAiB,CAAC,QAAQ;CAC3B,CAAC;AAEF,MAAM,CAAN,IAAY,yBAGX;AAHD,WAAY,yBAAyB;IACnC,oDAAuB,CAAA;IACvB,oDAAuB,CAAA;AACzB,CAAC,EAHW,yBAAyB,KAAzB,yBAAyB,QAGpC;AAED,MAAM,CAAN,IAAY,2BAEX;AAFD,WAAY,2BAA2B;IACrC,sEAAuC,CAAA;AACzC,CAAC,EAFW,2BAA2B,KAA3B,2BAA2B,QAEtC;AAED,MAAM,CAAN,IAAY,uBAMX;AAND,WAAY,uBAAuB;IACjC,gFAAqD,CAAA;IACrD,2FAAgE,CAAA;IAChE,gFAAqD,CAAA;IACrD,gEAAqC,CAAA;IACrC,gGAAqE,CAAA;AACvE,CAAC,EANW,uBAAuB,KAAvB,uBAAuB,QAMlC;AAED,MAAM,CAAC,MAAM,sBAAsB,GAAG,YAAY,CAAC;AAEnD,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,GAAG,sBAAsB,EAAE,sBAAsB,CAAC,CAAC;AAE5F,MAAM,CAAC,MAAM,2BAA2B,GAAa,CAAC,sBAAsB,CAAC,CAAC;AAE9E,MAAM,CAAN,IAAY,2BASX;AATD,WAAY,2BAA2B;IACrC,sDAAuB,CAAA;IACvB,2DAA4B,CAAA;IAC5B,+DAAgC,CAAA;IAChC,wFAAyD,CAAA;IACzD,2DAA4B,CAAA;IAC5B,6DAA8B,CAAA;IAC9B,+DAAgC,CAAA;IAChC,+DAAgC,CAAA;AAClC,CAAC,EATW,2BAA2B,KAA3B,2BAA2B,QAStC;AAkMD,MAAM,CAAC,MAAM,iCAAiC,GAAG,eAAe,CAAC;AACjE,MAAM,CAAC,MAAM,4CAA4C,GAAG,0BAA0B,CAAC;AACvF,MAAM,CAAC,MAAM,2CAA2C,GAAG,yBAAyB,CAAC;AACrF,MAAM,CAAC,MAAM,sCAAsC,GAAG,oBAAoB,CAAC;AAC3E,MAAM,CAAC,MAAM,iDAAiD,GAAG,+BAA+B,CAAC","sourcesContent":["import { Document } from '@bisondesk/commons-sdk/types';\nimport { BusinessEntityIds, OpportunityType, WarningHints } from '../constants';\nimport { Contact, Organization } from './crm';\nimport { Interest } from './leads';\nimport { Payment } from './payments';\nimport { Quote, QuoteStatus } from './quotes';\nimport { DataRecord, ReferenceData } from './utils';\nimport { Vehicle } from './vehicles';\n\nexport enum OpportunityActions {\n CREATE_QUOTE = 'create_quote',\n LOSE = 'lose',\n REOPEN = 'reopen',\n START_PREPARATION = 'start_preparation',\n REVERT_PREPARATION = 'revert_preparation',\n START_DELIVERY = 'start_delivery',\n REVERT_DELIVERY = 'revert_delivery',\n SET_CUSTOMER = 'set_customer',\n SET_DOCUMENTS = 'set_documents',\n SET_INTEREST = 'set_interest',\n SET_METADATA = 'set_metadata',\n SET_VEHICLE = 'set_vehicle',\n ADD_ACTIVITY = 'add_activity',\n ADD_PAYMENT = 'add_payment',\n SWITCH_VEHICLE = 'switch_vehicle',\n DELIVER_VEHICLE = 'deliver_vehicle',\n UNDO_DELIVER_VEHICLE = 'undo_deliver_vehicle',\n SET_DEAL_INFO = 'update_deal_info',\n}\n\nexport enum OpportunityDealStatus {\n SALES_AGREED = 'sales_agreed',\n FIRST_PAYMENT = 'first_payment',\n FULL_PAYMENT = 'full_payment',\n}\n\nexport enum OpportunityStatus {\n PROSPECTION = 'prospection',\n DISCOVERY = 'discovery',\n EVALUATION = 'evaluation',\n REVIEW = 'review',\n PREPARATION = 'preparation',\n DELIVERY = 'delivery',\n}\n\nexport const OpportunityStatusOrder: OpportunityStatus[] = [\n OpportunityStatus.PROSPECTION,\n OpportunityStatus.DISCOVERY,\n OpportunityStatus.EVALUATION,\n OpportunityStatus.REVIEW,\n OpportunityStatus.PREPARATION,\n OpportunityStatus.DELIVERY,\n];\n\nexport enum OpportunityLogisticStatus {\n AT_ORIGIN = 'at_origin',\n DELIVERED = 'delivered',\n}\n\nexport enum OpportunityRequirementsCode {\n VEHICLE_AT_ORIGIN = 'vehicle_at_origin',\n}\n\nexport enum OpportunityWarningsCode {\n QUOTE_PENDING_VALIDATION = 'quote_pending_validation',\n QUOTE_PEDING_MANAGER_APPROVAL = 'quote_pending_manager_approval',\n CONCURRENT_OPPORTUNITIES = 'concurrent_opportunities',\n VEHICLE_RESERVED = 'vehicle_reserved',\n OPPORTUNITY_NEEDS_SWITCH_VEHICLE = 'opportunity_needs_switch_vehicle',\n}\n\nexport const OpportunityWonColumnId = 'closed_won';\n\nexport const OpportunityKanbanColumns = [...OpportunityStatusOrder, OpportunityWonColumnId];\n\nexport const OpportunityKanbanEndColumns: string[] = [OpportunityWonColumnId];\n\nexport enum OpportunityLostReasonValues {\n Expensive = 'expensive',\n AlreadySold = 'already_sold',\n BadExperience = 'bad_experience',\n IncorrectVehicleCondition = 'incorrect_vehicle_condition',\n NoStock = 'not_enough_stock',\n SlowDelivery = 'slow_delivery',\n HighDeposit = 'deposit_too_high',\n NoAnswer = 'client_not_answered',\n}\n\ntype BaseBid = {\n vehicleId: string;\n opportunityId?: string;\n contactId: string;\n amount: string;\n};\n\nexport type NewBid = BaseBid & {};\n\nexport type Bid = BaseBid & {\n id: string;\n createdAt: string;\n createdBy: string;\n};\n\ntype BaseOpportunity = {\n accountManager?: string;\n administrativePerson?: string;\n type: OpportunityType;\n organizationId?: string;\n contactId?: string;\n vehicleId?: string;\n source?: string; // e.g. website, autoscout, mobile...\n branch: string;\n inquiry?: string;\n branchCountry: string;\n};\n\nexport type NewOpportunity = BaseOpportunity & {\n id?: undefined;\n createdAt?: undefined;\n createdBy?: undefined;\n modifiedAt?: undefined;\n modifiedBy?: undefined;\n};\n\nexport type Opportunity = BaseOpportunity & {\n id: string;\n createdAt: string;\n createdBy: string;\n modifiedAt: string;\n modifiedBy: string;\n validatedAt?: string;\n validatedBy?: string;\n acceptedAt?: string;\n acceptedBy?: string;\n lastActivityAt?: string; // last time we reached out to the customer, regardless of medium\n reviewedAt?: string;\n reviewedBy?: string;\n reviewExpiredAt?: string;\n preparedAt?: string;\n preparedBy?: string;\n lostAt?: string;\n lostBy?: string;\n wonAt?: string;\n lostReason?: OpportunityLostReasonValues;\n deliveredAt?: string;\n deliveredBy?: string;\n status: OpportunityStatus;\n dealStatus?: OpportunityDealStatus;\n logisticStatus?: OpportunityLogisticStatus;\n activeQuoteId?: string;\n amount?: string;\n interest?: Interest;\n documents?: Document[];\n leasingContractId?: string;\n requirementsOverride?: {\n [code: string]: { override: true; reason?: string; actionAt: string; actionBy: string };\n };\n};\n\nexport type OpportunityUpdate = {\n vehicleId?: string | null;\n accountManager?: string | null;\n administrativePerson?: string | null;\n contactId?: string | null;\n activeQuoteId?: string | null;\n interest?: Interest | null;\n reviewed?: boolean;\n prepared?: boolean;\n lost?: boolean;\n delivered?: boolean;\n lostReason?: OpportunityLostReasonValues;\n documents?: Document[];\n branch?: string;\n branchCountry?: string;\n type?: OpportunityType;\n lastActivityAt?: string | null; // null gives the possibility to delete this field if all activities are deleted\n reviewExpiredAt?: string | null; // null gives the possibility to delete this field if all activities are deleted\n source?: string | null;\n requirementsOverride?: {\n [code: string]: { override: true; reason?: string; actionAt: string; actionBy: string };\n };\n};\n\nexport type PaymentSummary = {\n total: string;\n paid: string;\n entries: DataRecord<Payment>[];\n};\n\nexport type VehicleBffMetadata = {\n openOpportunities: number;\n otherRelatedVehicleIds: string[];\n};\n\nexport type OpportunityStatusRequirement = { code: OpportunityRequirementsCode; title?: string };\n\nexport type OpportunityWarning = {\n code: OpportunityWarningsCode;\n title: string;\n description: string;\n level: WarningHints;\n businessEntityId?: BusinessEntityIds;\n recordId?: string;\n};\n\nexport type OpportunityBffMeta = ReferenceData & {\n requirements: OpportunityStatusRequirement[];\n warnings: OpportunityWarning[];\n};\n\nexport type OpportunityBFF = {\n opportunity: DataRecord<Opportunity, OpportunityBffMeta>;\n vehicle?: DataRecord<Vehicle, VehicleBffMetadata>;\n bids: DataRecord<Bid>[];\n quotes: DataRecord<Quote>[];\n activeQuote?: DataRecord<Quote>;\n payments: PaymentSummary | undefined;\n customer?: {\n contact: DataRecord<Contact>;\n org?: DataRecord<Organization>;\n };\n};\n\ntype BaseOpportunityEvent = {\n actionAt: string;\n userId: string;\n tenantId: string;\n};\n\nexport type OpportunityCreateEvent = BaseOpportunityEvent & {\n opportunity: Opportunity;\n previousOpportunity?: undefined;\n action: 'create';\n};\n\nexport type OpportunityUpdateEvent = BaseOpportunityEvent & {\n opportunity: Opportunity;\n previousOpportunity: Opportunity;\n action: 'update';\n};\n\nexport type OpportunityDeleteEvent = BaseOpportunityEvent & {\n opportunity?: undefined;\n previousOpportunity: Opportunity;\n action: 'delete';\n};\n\nexport type OpportunityEvent =\n | OpportunityCreateEvent\n | OpportunityUpdateEvent\n | OpportunityDeleteEvent;\n\nexport type QuoteEvent = {\n quote: Quote;\n opportunity: Opportunity;\n action: 'create' | 'update' | 'delete';\n actionAt: string;\n userId: string;\n tenantId: string;\n};\n\n/* Quote summary with information that should be common to different types of quotes */\nexport type QuoteInfo = {\n status: QuoteStatus;\n roi: string;\n id: string;\n};\n\nexport type SearchOpportunity = {\n contact?: Contact;\n opportunity: Opportunity;\n org?: Organization;\n vehicle?: Vehicle;\n quote?: QuoteInfo;\n custom: {\n unassigned: boolean;\n assignees: string[];\n };\n};\n\nexport const QUOTE_CREATED_NOTIFICATION_ORIGIN = 'quote-created';\nexport const QUOTE_VALIDATOR_FEEDBACK_NOTIFICATION_ORIGIN = 'quote-validator-feedback';\nexport const QUOTE_CUSTOMER_FEEDBACK_NOTIFICATION_ORIGIN = 'quote-customer-feedback';\nexport const OPPORTUNITY_CLOSED_NOTIFICATION_ORIGIN = 'opportunity-closed';\nexport const OPPORTUNITY_VEHICLE_AVAILABLE_NOTIFICATION_ORIGIN = 'opportunity-vehicle-available';\n\nexport type OpportunityNotificationData = {\n quoteVersion?: number;\n snippet?: string;\n};\n\nexport type LeasingQuoteTemplateData = {\n opportunity: {\n id: string;\n };\n currentDate: string;\n vehicle: {\n make: string;\n model: string;\n type?: string;\n km: string | number;\n vin: string;\n mainImage: string;\n localLicensePlate: boolean;\n description: string;\n year?: string | number;\n stockNumber?: string;\n };\n accountManager: {\n fullName: string;\n email: string;\n phone: string;\n };\n customer: {\n company: string;\n fullName: string;\n vatNumber?: string;\n address?: string;\n };\n settingId: string;\n leasing: {\n deposit: string;\n startupFee: string;\n totalExtras: string;\n totalBeforeDeliveryExclVat: string;\n totalBeforeDelivery: string;\n installment: string;\n duration: number;\n monthlyInsurance: string;\n monthlyTax: string;\n monthlyTaxesInsurance: string;\n residual: string;\n offerNumber: string;\n extras: { name: string }[];\n };\n};\n\nexport type LineItemPdfTemplate = {\n description: string;\n vat: string;\n quantity: number;\n unitPriceExclVat: string;\n amount: string;\n amountExclVat: string;\n};\n\nexport type LeasingProformaTemplateData = {\n opportunity: {\n id: string;\n offerNumber: string;\n };\n currentDate: string;\n accountManager: {\n fullName: string;\n email: string;\n phone: string;\n };\n vehicle: {\n line1: string;\n line2: string;\n stockNumber: string;\n };\n c: {\n organizationId?: string;\n clientId: string;\n company: string;\n fullName: string;\n vatNumber?: string;\n email?: string;\n phone?: string;\n address?: string;\n };\n i: LineItemPdfTemplate[];\n t: {\n totalExclVat: string;\n vatAmount: string;\n displayVatMessage: boolean;\n total: string;\n monthly: string;\n monthlyExclVat: string;\n residual: string;\n residualExclVat: string;\n duration: number;\n };\n};\n\nexport type SalesProformaTemplateData = {\n opportunity: {\n id: string;\n offerNumber: string;\n };\n currentDate: string;\n expirationDate: string;\n accountManager: {\n fullName: string;\n email: string;\n phone: string;\n };\n vehicle: {\n line1: string;\n line2: string;\n stockNumber: string;\n };\n c: {\n organizationId?: string;\n clientId: string;\n company: string;\n fullName: string;\n vatNumber?: string;\n email?: string;\n phone?: string;\n address?: string;\n };\n i: LineItemPdfTemplate[];\n t: {\n totalExclVat: string;\n vatAmount: string;\n total: string;\n };\n};\n\nexport type SalesAgreementTemplateData = {\n opportunity: {\n id: string;\n offerNumber: string;\n };\n currentDate: string;\n accountManager: {\n fullName: string;\n email: string;\n phone: string;\n };\n vehicle: {\n line1: string;\n line2: string;\n stockNumber: string;\n };\n c: {\n organizationId?: string;\n clientId: string;\n company: string;\n fullName: string;\n vatNumber?: string;\n email?: string;\n phone?: string;\n address?: string;\n };\n i: LineItemPdfTemplate[];\n t: {\n totalExclVat: string;\n vatAmount: string;\n total: string;\n };\n};\n\nexport type OpportunitiesKanbanColumn = {\n status: string;\n results: SearchOpportunity[];\n totalCount: number;\n totalValue: string;\n};\n\nexport type HpLeasingDealRequest = {\n tenantId: string;\n initiatedBy: 'bisondesk';\n processMetaId: string;\n processRunData: {\n entityOwner: string;\n leasingContractOwner: string;\n foreseenDeliveryDate?: string;\n deliveryAddressLeasing?: string;\n nameSalesPerson: string;\n durationLeasingInMonths: number;\n vanCourier: boolean;\n newVehicle?: boolean;\n newTrailer?: boolean;\n registrationOnTtcoBe?: string;\n yearOfConstruction?: number;\n chassisnumber?: string;\n vehicleModel?: string;\n vehicleCategory2?: string;\n licencePlate?: string;\n vatPercentage?: number;\n\n opportunityContractId: string;\n opportunityId: string;\n\n company?: string;\n customerNumber?: number; //bisondesk external id\n //MrLease fields\n vehicle?: string;\n salesPriceEur: string;\n depositFullAmountExclVat: string;\n depositToBePrepaidExclVat: string;\n vehicleMake3?: string;\n\n //TTC fields\n vehicleOriginalReference?: string;\n salesPrice: string;\n depositFullAmount: string;\n depositAmountToBePrepaid: string;\n make?: string;\n\n //Extras\n garageExtrasCodes: string[];\n allExtrasDescriptions: string[];\n administrationExtrasCodes: string[];\n logisticExtrasCodes: string[];\n customRequestDescriptions: string[];\n };\n};\n\nexport type HpLeasingDealResponse = {\n entityId: string;\n id: string;\n status: string;\n leasingContractNumber?: string;\n};\n\nexport type HpLeasingContractRequest = {\n tenantId: string;\n initiatedBy: 'bisondesk';\n processMetaId: string;\n processRunData: {\n entityOwner: string;\n company?: string;\n vehicle?: string;\n ldNumber: number;\n vanCourier: boolean;\n startDate: number;\n opportunityContractId: string;\n data: {\n leasingParameter: {\n allRisksPercentage: number;\n allRisksTaxPercentage: number;\n civilLiability: number;\n entityId: string;\n oneTimeRoadTax: number;\n specialInsurance: number;\n yearlyRoadTax: number;\n countries: string[];\n vehicleCategory: string;\n };\n\n calculatorRequest: {\n bankDeposit: number;\n bankDurationInMonths: number;\n bankInterestRatePercentage: number;\n bankResidualValue: number;\n deposit: number;\n durationInMonths: number;\n includesAllRisks: boolean;\n includesCivilLiability: boolean;\n includesOneTimeRoadTax: boolean;\n includesSpecialInsurance: boolean;\n includesYearlyRoadTax: boolean;\n insuranceAmount: number;\n interestRatePercentage: number;\n marginPercentage: number;\n monthlyAdministrationFee: 0;\n purchasePrice: number;\n residualValue: number;\n salesPrice: number;\n startupFeePercentage: number;\n };\n\n calculatorResponse: {\n ROI: number;\n ROIDifference: number;\n ROIPerYear: number;\n ROITarget: number;\n allRisksInsuranceAmount: number;\n bankContractValue: number;\n bankLeasingAmount: number;\n cashDeficit: number;\n financingAmount: number;\n leasingAmount: number;\n leasingContractValue: number;\n leasingProfit: number;\n monthlyTaxRetailPrice: number;\n oneTimeTaxCost: number;\n totalMonthlyPayment: number;\n totalProfit: number;\n vehicleProfit: number;\n };\n\n cashInValues: CashInRow[];\n\n cashOutValues: CashOutRow[];\n };\n };\n};\n\nexport type HpLeasingContractResponse = {\n entityId: string;\n id: string;\n status: string;\n createdAt: string;\n updatedAt: string;\n dateOfFinalSettlement: string;\n startDate: string;\n email: string;\n contractNumber: string;\n};\n\nexport type CashInRow = {\n time: number;\n deposit: number;\n monthlyAdministrationFee: 0; //Legacy field - Should always be 0\n residualValue: number;\n startupFee: number;\n leasingAmountWithoutAdminFee: number;\n insurancePayment: number;\n taxPayment: number;\n cashIn: number;\n cumulativeCash: number;\n};\n\nexport type CashOutRow = {\n time: number;\n deposit: number;\n residualValue: number;\n leasingAmount: number;\n insurancePayment: number;\n taxPayment: number;\n cashOut: number;\n cumulativeCash: number;\n};\n\nexport type HpIsaProcessRequest = {\n tenantId: string;\n initiatedBy: 'bisondesk';\n processMetaId: string;\n processRunData: {\n entityOwner: string;\n\n company?: string; //entityId\n proofOfSaleCustomerAgreement?: string; //entityId\n\n vehicle?: string; //entityId\n bodywork?: string; //entityId\n vehicleCategory: string; //entityId\n\n amountOfCommissionPaid: number;\n dealValidated: boolean;\n dealCancelled: boolean;\n opportunityId: string;\n deliveryType: string; //entity Id\n stackingVehicle?: boolean;\n detailsOfStacking?: string;\n\n //PickUP Delivery\n urgentDelivery?: boolean;\n dateOfPickUpByCustomer?: number;\n modeOfTransportPickUpByCustomer?: string; //entity Id\n detailsOfBorderCrossing?: string;\n technicalControlNeeded?: boolean;\n insuranceNeeded?: boolean;\n transitPlateBelgiumNeeded?: boolean;\n transitPlateAustriaNeeded?: boolean;\n licensePlateNeeded?: boolean;\n\n //Address Delivery\n addressOfDelivery?: string;\n kmToAddressOfDelivery?: number;\n\n //To Port Delivery\n portOfDelivery?: string; //entity Id\n shippingCompany?: string; //string Id\n destinationPort?: string;\n cleaningDegassingNeeded?: boolean;\n agreedPrice?: string;\n\n //Extras\n garageExtrasCodes: string[];\n logisticsExtrasCodes: string[];\n administrationExtrasCodes: string[];\n allExtrasDescriptions: string[];\n customRequestDescriptions: string[];\n infoSpoiler: string; // entity Id\n };\n};\n\nexport type HpIsaProcessResponse = {\n entityId: string;\n id: string;\n status: string;\n};\n\nexport type SwitchOpportunityVehicleRequest = {\n opportunityId: string;\n newVehicleId: string;\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"quotes.js","sourceRoot":"/","sources":["types/quotes.ts"],"names":[],"mappings":"AAaA,MAAM,CAAN,IAAY,YAMX;AAND,WAAY,YAAY;IACtB,iCAAiB,CAAA;IACjB,qCAAqB,CAAA;IACrB,+CAA+B,CAAA;IAC/B,iCAAiB,CAAA;IACjB,uDAAuC,CAAA;AACzC,CAAC,EANW,YAAY,KAAZ,YAAY,QAMvB;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';\nimport { DeliveryParams } from './delivery-settings';\nimport {\n CustomLeasingQuoteExtraInput,\n CustomSalesQuoteExtraInput,\n LeasingDeliveryPackageInput,\n LeasingQuoteExtraInput,\n LeasingQuoteParams,\n SalesQuoteExtraInput,\n} from './leasing-settings';\nimport { PricePercentageMode } from './utils';\n\nexport enum QuoteActions {\n ACCEPT = 'accept',\n VALIDATE = 'validate',\n DONWLOAD_PDFS = 'download-pdfs',\n CANCEL = 'cancel',\n COMMERCIAL_REVIEW = 'commercial-review',\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 branch: string;\n branchCountry: string;\n customerCountry: string;\n vehicleCategory: string;\n currency: string;\n bodywork?: string;\n};\n\nexport type LeasingCalculatorDefaultInput = BaseQuoteCalculatorInput & {\n salesPrice: string;\n purchasePrice: string;\n deliveryPackage?: LeasingQuoteExtraInput;\n};\n\nexport type LeasingCalculatorInput = BaseQuoteCalculatorInput & {\n localLicensePlate: boolean;\n vanCourier: boolean;\n leasing: {\n salesPrice: string;\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 purchasePrice: string;\n duration: number;\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 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 };\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};\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\nexport type SalesCalculatorDefaultInput = BaseQuoteCalculatorInput & {\n vehicle: {\n agreedPrice: string;\n comissionCost: string;\n id: string;\n };\n extras: SalesQuoteExtraInput[];\n customRequests: CustomSalesQuoteExtraInput[];\n};\n\nexport type SalesCalculatorInput = BaseQuoteCalculatorInput & {\n vehicle: {\n vatRate: string;\n agreedPrice: string;\n comissionCost: string;\n id: string;\n };\n delivery?: PickUpDeliveryType | AddressDeliveryType | PortDeliverytype;\n extras: SalesQuoteExtraInput[];\n customRequests: CustomSalesQuoteExtraInput[];\n};\n\nexport type LeasingCalculatorOutput = {\n vatApplicable: boolean;\n installment: string;\n installmentPrintable: string;\n totalMonthlyAmount: string;\n monthlyTaxesInsurance: string;\n beforeDelivery: string;\n financingAmount: string;\n settingId: 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 };\n insurance: {\n yearlyRetailPrice: string;\n monthlyRetailPrice: string;\n civilLiabilities: string;\n allRisks: string;\n specialTechnicalInsurance: string;\n roadAssistance: string;\n };\n costs: {\n financingAmount: string;\n finalCostPrice: string;\n monhtly: string;\n trackAndTrace: 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: { value: string; score: QuoteMetricsScore };\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 }\n | {\n type: OpportunityType.SALES;\n calculatorInput: SalesCalculatorInput;\n calculatorOutput: SalesCalculatorOutput;\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};\n\nexport type QuoteUpdate = {\n status?: QuoteStatus;\n active?: boolean;\n};\n\nexport type CalculatorLeasingIO = {\n output: LeasingCalculatorOutput;\n input: LeasingCalculatorInput;\n};\nexport type CalculatorSalesIO = { output: SalesCalculatorOutput; input: SalesCalculatorInput };\nexport type CalculatorQuoteIO = CalculatorLeasingIO | CalculatorSalesIO;\n\nexport type UsedVehiclesSalesParams = {\n id: string;\n modifiedAt: string;\n modifiedBy: string;\n countryCode: 'be';\n name: string;\n profitabilityDealGap: string;\n conglomerateProfitabilityDealGap: string;\n exaDocumentCosts: string;\n delivery?: DeliveryParams;\n};\n\nexport type QuoteSettings = LeasingQuoteParams | UsedVehiclesSalesParams;\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\nexport type ComissionRequest = {\n branchId: string;\n opportunityId: string;\n vehicleId: string;\n stockNumber: string;\n paidAmount: string;\n estimatedAmount: string;\n currency: string;\n notes?: string;\n paidAt?: string;\n estimatedPaidAt?: string;\n};\n\nexport type Commission = ComissionRequest & {\n modifiedAt: string;\n modifiedBy: string;\n};\n"]}
1
+ {"version":3,"file":"quotes.js","sourceRoot":"/","sources":["types/quotes.ts"],"names":[],"mappings":"AAcA,MAAM,CAAN,IAAY,YAMX;AAND,WAAY,YAAY;IACtB,iCAAiB,CAAA;IACjB,qCAAqB,CAAA;IACrB,+CAA+B,CAAA;IAC/B,iCAAiB,CAAA;IACjB,uDAAuC,CAAA;AACzC,CAAC,EANW,YAAY,KAAZ,YAAY,QAMvB;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';\nimport { DeliveryParams } from './delivery-settings';\nimport {\n CustomLeasingQuoteExtraInput,\n CustomSalesQuoteExtraInput,\n LeasingDeliveryPackageInput,\n LeasingQuoteExtraInput,\n LeasingQuoteParams,\n SalesQuoteExtraInput,\n} from './leasing-settings';\nimport { MatchingRuleValue } from './roi-ratings';\nimport { PricePercentageMode } from './utils';\n\nexport enum QuoteActions {\n ACCEPT = 'accept',\n VALIDATE = 'validate',\n DONWLOAD_PDFS = 'download-pdfs',\n CANCEL = 'cancel',\n COMMERCIAL_REVIEW = 'commercial-review',\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 branch: string;\n branchCountry: string;\n customerCountry: string;\n vehicleCategory: string;\n currency: string;\n bodywork?: string;\n};\n\nexport type LeasingCalculatorDefaultInput = BaseQuoteCalculatorInput & {\n salesPrice: string;\n purchasePrice: string;\n deliveryPackage?: LeasingQuoteExtraInput;\n};\n\nexport type LeasingCalculatorInput = BaseQuoteCalculatorInput & {\n localLicensePlate: boolean;\n vanCourier: boolean;\n leasing: {\n salesPrice: string;\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 purchasePrice: string;\n duration: number;\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 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 };\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};\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\nexport type SalesCalculatorDefaultInput = BaseQuoteCalculatorInput & {\n vehicle: {\n agreedPrice: string;\n comissionCost: string;\n id: string;\n };\n extras: SalesQuoteExtraInput[];\n customRequests: CustomSalesQuoteExtraInput[];\n};\n\nexport type SalesCalculatorInput = BaseQuoteCalculatorInput & {\n vehicle: {\n vatRate: string;\n agreedPrice: string;\n comissionCost: string;\n id: string;\n };\n delivery?: PickUpDeliveryType | AddressDeliveryType | PortDeliverytype;\n extras: SalesQuoteExtraInput[];\n customRequests: CustomSalesQuoteExtraInput[];\n};\n\nexport type LeasingCalculatorOutput = {\n vatApplicable: boolean;\n installment: string;\n installmentPrintable: string;\n totalMonthlyAmount: string;\n monthlyTaxesInsurance: string;\n beforeDelivery: string;\n financingAmount: string;\n settingId: 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 };\n insurance: {\n yearlyRetailPrice: string;\n monthlyRetailPrice: string;\n civilLiabilities: string;\n allRisks: string;\n specialTechnicalInsurance: string;\n roadAssistance: string;\n };\n costs: {\n financingAmount: string;\n finalCostPrice: string;\n monhtly: string;\n trackAndTrace: 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: { value: string; score: QuoteMetricsScore };\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};\n\nexport type QuoteUpdate = {\n status?: QuoteStatus;\n active?: 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 UsedVehiclesSalesParams = {\n id: string;\n modifiedAt: string;\n modifiedBy: string;\n countryCode: 'be';\n name: string;\n profitabilityDealGap: string;\n conglomerateProfitabilityDealGap: string;\n exaDocumentCosts: string;\n delivery?: DeliveryParams;\n};\n\nexport type QuoteSettings = LeasingQuoteParams | UsedVehiclesSalesParams;\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\nexport type ComissionRequest = {\n branchId: string;\n opportunityId: string;\n vehicleId: string;\n stockNumber: string;\n paidAmount: string;\n estimatedAmount: string;\n currency: string;\n notes?: string;\n paidAt?: string;\n estimatedPaidAt?: string;\n};\n\nexport type Commission = ComissionRequest & {\n modifiedAt: string;\n modifiedBy: string;\n};\n"]}
@@ -0,0 +1,5 @@
1
+ export var DisplayType;
2
+ (function (DisplayType) {
3
+ DisplayType["StarsRating"] = "stars-rating";
4
+ })(DisplayType || (DisplayType = {}));
5
+ //# sourceMappingURL=roi-ratings.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"roi-ratings.js","sourceRoot":"/","sources":["types/roi-ratings.ts"],"names":[],"mappings":"AAIA,MAAM,CAAN,IAAY,WAEX;AAFD,WAAY,WAAW;IACrB,2CAA4B,CAAA;AAC9B,CAAC,EAFW,WAAW,KAAX,WAAW,QAEtB","sourcesContent":["import { AdditionalOperation, RulesLogic } from 'json-logic-js';\nimport { OpportunityType } from '../constants';\nimport { FieldTypeInfo } from './fields';\n\nexport enum DisplayType {\n StarsRating = 'stars-rating',\n}\n\nexport type ROIRule = {\n conditions: RulesLogic<AdditionalOperation>;\n value: number;\n};\n\nexport type MatchingRuleValue = {\n value: number;\n createdAt: string;\n type: DisplayType;\n ruleIdx: number;\n opportunityType: OpportunityType;\n};\n\ntype BaseROIRatings = {\n type: DisplayType;\n opportunityType: OpportunityType;\n rules: ROIRule[];\n};\n\nexport type ROIRatings = BaseROIRatings & {\n readonly createdAt: string;\n readonly createdBy: string;\n readonly fields: DataFields;\n};\n\nexport type NewROIRatings = BaseROIRatings & {\n readonly createdAt?: undefined;\n readonly createdBy?: undefined;\n readonly fields?: DataFields;\n};\n\nexport type Field = {\n titles: { [lang: string]: string };\n} & FieldTypeInfo;\n\nexport type DataFields = {\n [key: string]: Field;\n};\n"]}
@@ -9,5 +9,6 @@ export var TenantModule;
9
9
  TenantModule["Opportunities"] = "opportunities";
10
10
  TenantModule["VehiclesMasterData"] = "vehicles_master_data";
11
11
  TenantModule["Vehicles"] = "vehicles";
12
+ TenantModule["TrackAndTrace"] = "track_and_trace";
12
13
  })(TenantModule || (TenantModule = {}));
13
14
  //# sourceMappingURL=tenants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"tenants.js","sourceRoot":"/","sources":["types/tenants.ts"],"names":[],"mappings":"AAgBA,MAAM,CAAN,IAAY,YAUX;AAVD,WAAY,YAAY;IACtB,2BAAW,CAAA;IACX,2BAAW,CAAA;IACX,6BAAa,CAAA;IACb,+BAAe,CAAA;IACf,mCAAmB,CAAA;IACnB,iCAAiB,CAAA;IACjB,+CAA+B,CAAA;IAC/B,2DAA2C,CAAA;IAC3C,qCAAqB,CAAA;AACvB,CAAC,EAVW,YAAY,KAAZ,YAAY,QAUvB","sourcesContent":["import { LocationValue, Region } from '@bisondesk/commons-sdk/types';\nimport { OpportunityType } from '../constants';\n\nexport type PublicTenant = {\n defaultCountry: string;\n defaultCurrency: string;\n defaultLanguage: string;\n id: string; // the id is provided on creation bc we assume tenants will be created by someone on the team\n name: string;\n region: Region;\n subdomain: string;\n\n // Pay attention to what information is added here since\n // the tenant can be obtained without authentication\n};\n\nexport enum TenantModule {\n App = 'app',\n CRM = 'crm',\n Docs = 'docs',\n Leads = 'leads',\n Leasing = 'leasing',\n Market = 'market',\n Opportunities = 'opportunities',\n VehiclesMasterData = 'vehicles_master_data',\n Vehicles = 'vehicles',\n}\n\nexport type Tenant = PublicTenant & {\n languages: [string, ...string[]];\n conglomerate?: string;\n emailDomain: string;\n hyperdmsIds?: string[];\n hyperportalId?: string;\n exactAccounting?: boolean;\n trackAndTrace?: boolean;\n branches: [Branch, ...Branch[]];\n modules: TenantModule[];\n opportunities: {\n types: OpportunityType[];\n };\n};\n\nexport type Branch = {\n id: string;\n name: string;\n country: string;\n exactAccounting?: boolean;\n currency: string;\n adminNumberPrefix: string;\n stockNumberPrefix: string;\n vatRates: {\n standard: string; //percentage value (e.g. 21)\n };\n location: LocationValue;\n};\n\nexport type HdmsVehiclesSync = {\n active: boolean;\n};\n\nexport type HdmsCrmSync = {\n active: boolean;\n};\n\nexport type TenantSyncSettings = {\n tenantId: string;\n hdmsVehicles: HdmsVehiclesSync | undefined;\n hdmsCrm: HdmsCrmSync | undefined;\n};\n"]}
1
+ {"version":3,"file":"tenants.js","sourceRoot":"/","sources":["types/tenants.ts"],"names":[],"mappings":"AAgBA,MAAM,CAAN,IAAY,YAWX;AAXD,WAAY,YAAY;IACtB,2BAAW,CAAA;IACX,2BAAW,CAAA;IACX,6BAAa,CAAA;IACb,+BAAe,CAAA;IACf,mCAAmB,CAAA;IACnB,iCAAiB,CAAA;IACjB,+CAA+B,CAAA;IAC/B,2DAA2C,CAAA;IAC3C,qCAAqB,CAAA;IACrB,iDAAiC,CAAA;AACnC,CAAC,EAXW,YAAY,KAAZ,YAAY,QAWvB","sourcesContent":["import { LocationValue, Region } from '@bisondesk/commons-sdk/types';\nimport { OpportunityType } from '../constants';\n\nexport type PublicTenant = {\n defaultCountry: string;\n defaultCurrency: string;\n defaultLanguage: string;\n id: string; // the id is provided on creation bc we assume tenants will be created by someone on the team\n name: string;\n region: Region;\n subdomain: string;\n\n // Pay attention to what information is added here since\n // the tenant can be obtained without authentication\n};\n\nexport enum TenantModule {\n App = 'app',\n CRM = 'crm',\n Docs = 'docs',\n Leads = 'leads',\n Leasing = 'leasing',\n Market = 'market',\n Opportunities = 'opportunities',\n VehiclesMasterData = 'vehicles_master_data',\n Vehicles = 'vehicles',\n TrackAndTrace = 'track_and_trace',\n}\n\nexport type Tenant = PublicTenant & {\n languages: [string, ...string[]];\n conglomerate?: string;\n emailDomain: string;\n hyperdmsIds?: string[];\n hyperportalId?: string;\n exactAccounting?: boolean;\n trackAndTrace?: boolean;\n branches: [Branch, ...Branch[]];\n modules: TenantModule[];\n opportunities: {\n types: OpportunityType[];\n };\n};\n\nexport type Branch = {\n id: string;\n name: string;\n country: string;\n exactAccounting?: boolean;\n currency: string;\n adminNumberPrefix: string;\n stockNumberPrefix: string;\n vatRates: {\n standard: string; //percentage value (e.g. 21)\n };\n location: LocationValue;\n};\n\nexport type HdmsVehiclesSync = {\n active: boolean;\n};\n\nexport type HdmsCrmSync = {\n active: boolean;\n};\n\nexport type TenantSyncSettings = {\n tenantId: string;\n hdmsVehicles: HdmsVehiclesSync | undefined;\n hdmsCrm: HdmsCrmSync | undefined;\n};\n"]}