@bisondesk/core-sdk 1.0.347 → 1.0.348
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/apis/crm.js.map +1 -1
- package/lib/apis/debtors.js.map +1 -1
- package/lib/apis/internet-vehicles.js.map +1 -1
- package/lib/apis/leasing-administration.js.map +1 -1
- package/lib/apis/leasing.js.map +1 -1
- package/lib/apis/opportunities.js.map +1 -1
- package/lib/apis/tenants.js.map +1 -1
- package/lib/apis/users.js.map +1 -1
- package/lib/apis/vehicles.js.map +1 -1
- package/lib/constants.js +6 -6
- package/lib/constants.js.map +1 -1
- package/lib/types/activities.js +2 -2
- package/lib/types/activities.js.map +1 -1
- package/lib/types/crm.js +3 -3
- package/lib/types/crm.js.map +1 -1
- package/lib/types/delivery-settings.js +1 -1
- package/lib/types/delivery-settings.js.map +1 -1
- package/lib/types/events.js +1 -1
- package/lib/types/events.js.map +1 -1
- package/lib/types/interests.js +1 -1
- package/lib/types/interests.js.map +1 -1
- package/lib/types/leasing-settings.js +1 -1
- package/lib/types/leasing-settings.js.map +1 -1
- package/lib/types/leasing.js +5 -5
- package/lib/types/leasing.js.map +1 -1
- package/lib/types/opportunities.d.ts +2 -2
- package/lib/types/opportunities.d.ts.map +1 -1
- package/lib/types/opportunities.js +10 -8
- package/lib/types/opportunities.js.map +1 -1
- package/lib/types/payments.js +1 -1
- package/lib/types/payments.js.map +1 -1
- package/lib/types/quotes.js +6 -6
- package/lib/types/quotes.js.map +1 -1
- package/lib/types/reservations.d.ts +2 -0
- package/lib/types/reservations.d.ts.map +1 -1
- package/lib/types/reservations.js +1 -1
- package/lib/types/reservations.js.map +1 -1
- package/lib/types/roi-ratings.js +1 -1
- package/lib/types/roi-ratings.js.map +1 -1
- package/lib/types/saved-filters.js +1 -1
- package/lib/types/saved-filters.js.map +1 -1
- package/lib/types/tenants.js +1 -1
- package/lib/types/tenants.js.map +1 -1
- package/lib/types/vehicles.js +7 -7
- package/lib/types/vehicles.js.map +1 -1
- package/lib/utils/forms.js.map +1 -1
- package/lib/utils/opportunities.js.map +1 -1
- package/lib/utils/search.js.map +1 -1
- package/lib/utils/tenants.js.map +1 -1
- package/lib/utils/vehicles.d.ts +3 -3
- package/lib/utils/vehicles.d.ts.map +1 -1
- package/lib/utils/vehicles.js.map +1 -1
- package/package.json +1 -1
- package/src/types/opportunities.ts +4 -2
- package/src/types/reservations.ts +3 -0
- package/tsconfig.deploy.tsbuildinfo +1 -1
- package/tsconfig.tsbuildinfo +1 -1
package/lib/utils/search.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search.js","sourceRoot":"/","sources":["utils/search.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAcpD,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,GAAkB,EAAE,OAAiB,EAAE,EAAE;IAC9E,IAAI,GAAG,IAAI,IAAI,EAAE;
|
|
1
|
+
{"version":3,"file":"search.js","sourceRoot":"/","sources":["utils/search.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAcpD,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,GAAkB,EAAE,OAAiB,EAAE,EAAE;IAC9E,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC;QAChB,OAAO;YACL,WAAW,EAAE,GAAG,CAAC,WAAW;YAC5B,KAAK,EAAE,GAAG,CAAC,IAAI;YACf,IAAI,EAAE,GAAG,CAAC,UAAU;SACrB,CAAC;IACJ,CAAC;IAED,IAAI,OAAO,IAAI,IAAI,EAAE,CAAC;QACpB,OAAO;YACL,WAAW,EAAE,OAAO,CAAC,WAAW;YAChC,KAAK,EAAE,CAAC,OAAO,EAA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,gBAAgB,EAAE,MAAM,CAAC,CAAC,CAAC;AAE3E,MAAM,CAAC,MAAM,qCAAqC,GAAG,CACnD,gBAAmC,EACnC,MAA0B,EAC1B,EAAE;IACF,OAAO,CACL,UAAU,CAAC,gBAAgB,CAAC,CAAC,cAAc,EAAE,CAAC,MAAM,CAAC;QACrD,+BAA+B,CAC7B,gBAAgB,EAChB,6BAA6B,CAAC,gBAAgB,EAAE,MAAM,CAAC,CACxD,CACF,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAC3C,gBAAmC,EACnC,MAA0B,EAC1B,EAAE,CAAC,UAAU,CAAC,gBAAgB,CAAC,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;AAExD,MAAM,CAAC,MAAM,yBAAyB,GAAG,CACvC,gBAAmC,EACnC,MAA4B,EAC5B,EAAE,CAAC,UAAU,CAAC,gBAAgB,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;AAEnD,MAAM,CAAC,MAAM,+BAA+B,GAAG,CAC7C,gBAAmC,EACnC,YAAgC,EAChC,EAAE,CACF,yBAAyB,CACvB,gBAAgB,EAChB,6BAA6B,CAAC,gBAAgB,EAAE,YAAY,CAAC,CAC9D,CAAC","sourcesContent":["import { joinWithSeparator } from '@bisondesk/commons-sdk/formatting';\nimport { BusinessEntityIds } from '../constants.js';\nimport { Contact, Organization, SearchOrganization } from '../types/crm.js';\nimport { SearchLeasingContract } from '../types/leasing-search.js';\nimport { LeasingContract } from '../types/leasing.js';\nimport { Opportunity, SearchOpportunity } from '../types/opportunities.js';\nimport { SearchVehicle, Vehicle } from '../types/vehicles.js';\n\nexport type GlobalBusinessEntity = Opportunity | Vehicle | Organization | LeasingContract;\nexport type GlobalSearchEntity =\n | SearchOpportunity\n | SearchVehicle\n | SearchOrganization\n | SearchLeasingContract;\n\nexport const getCustomerInformation = (org?: Organization, contact?: Contact) => {\n if (org != null) {\n return {\n countryCode: org.countryCode,\n title: org.name,\n code: org.externalId,\n };\n }\n\n if (contact != null) {\n return {\n countryCode: contact.countryCode,\n title: [contact?.firstName, contact?.lastName].filter(Boolean).join(' '),\n };\n }\n};\n\nexport const mappings: {\n [key in BusinessEntityIds]?: {\n getMainEntity: (entity: any) => GlobalBusinessEntity;\n getTitle: (entity: any) => string;\n getTags: (entity: any) => (string | undefined)[];\n getDescription?: (entity: any) => string;\n };\n} = {\n [BusinessEntityIds.Opportunities]: {\n getMainEntity: (entity: SearchOpportunity) => entity.opportunity,\n getTitle: (opp: Opportunity) => opp.id,\n getDescription: (opp: SearchOpportunity) =>\n joinWithSeparator(\n [\n getCustomerInformation(opp.org, opp.contact)?.code,\n opp.vehicle?.external.identification.stockNumber,\n ].filter(Boolean)\n ),\n getTags: (opp: Opportunity) => [opp.id],\n },\n [BusinessEntityIds.Vehicles]: {\n getMainEntity: (entity: SearchVehicle) => entity.vehicle,\n getTitle: (vehicle: Vehicle) => vehicle.internal.description.title,\n getTags: (vehicle: Vehicle) => [\n // the order of the tags here is relevant for exact integration\n // see: packages/exact/src/service/purchase.ts\n vehicle.external.identification?.stockNumber,\n vehicle.internal.identification?.administrativeNumber,\n vehicle.external.identification?.vin,\n ],\n },\n [BusinessEntityIds.Organizations]: {\n getMainEntity: (entity: SearchOrganization) => entity.org,\n getTitle: (org: Organization) => org.name,\n getTags: (org: Organization) => [`${org.externalId}`, org.vatNumber],\n },\n [BusinessEntityIds.LeasingContracts]: {\n getMainEntity: (entity: SearchLeasingContract) => entity.contract,\n getTitle: (contract: LeasingContract) => contract.contractNumber ?? contract.id,\n getTags: (contract: LeasingContract) => [contract.contractNumber, contract.slbPartner],\n },\n};\n\nconst getMapping = (businessEntityId: BusinessEntityIds) => {\n const mapping = mappings[businessEntityId];\n if (!mapping) {\n throw new Error(`Invalid business entity id ${businessEntityId}`);\n }\n return mapping;\n};\n\nexport const getTagsForBusinessEntity = (\n businessEntityId: BusinessEntityIds,\n entity: GlobalBusinessEntity\n): string[] => getMapping(businessEntityId).getTags(entity).filter(Boolean) as string[];\n\nexport const getTagsForSearchBusinessEntity = (\n businessEntityId: BusinessEntityIds,\n entity: GlobalSearchEntity\n) =>\n getTagsForBusinessEntity(\n businessEntityId,\n getMainEntityFromSearchEntity(businessEntityId, entity)\n );\n\nexport const getDescriptionForBusinessEntity = (\n businessEntityId: BusinessEntityIds,\n entity: GlobalBusinessEntity\n) => joinWithSeparator(getTagsForBusinessEntity(businessEntityId, entity));\n\nexport const getDescriptionForSearchBusinessEntity = (\n businessEntityId: BusinessEntityIds,\n entity: GlobalSearchEntity\n) => {\n return (\n getMapping(businessEntityId).getDescription?.(entity) ??\n getDescriptionForBusinessEntity(\n businessEntityId,\n getMainEntityFromSearchEntity(businessEntityId, entity)\n )\n );\n};\n\nexport const getMainEntityFromSearchEntity = (\n businessEntityId: BusinessEntityIds,\n entity: GlobalSearchEntity\n) => getMapping(businessEntityId).getMainEntity(entity);\n\nexport const getTitleForBusinessEntity = (\n businessEntityId: BusinessEntityIds,\n entity: GlobalBusinessEntity\n) => getMapping(businessEntityId).getTitle(entity);\n\nexport const getTitleForSearchBusinessEntity = (\n businessEntityId: BusinessEntityIds,\n searchEntity: GlobalSearchEntity\n) =>\n getTitleForBusinessEntity(\n businessEntityId,\n getMainEntityFromSearchEntity(businessEntityId, searchEntity)\n );\n"]}
|
package/lib/utils/tenants.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tenants.js","sourceRoot":"/","sources":["utils/tenants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AACvD,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAGlC,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,MAAc,EAAE,QAAgB,EAAU,EAAE;IACpE,MAAM,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,MAAc,EAAE,EAAE,CAAC,MAAM,CAAC,EAAE,KAAK,QAAQ,CAAC,CAAC;IAChF,IAAI,MAAM,IAAI,IAAI,EAAE;
|
|
1
|
+
{"version":3,"file":"tenants.js","sourceRoot":"/","sources":["utils/tenants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AACvD,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAGlC,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,MAAc,EAAE,QAAgB,EAAU,EAAE;IACpE,MAAM,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,MAAc,EAAE,EAAE,CAAC,MAAM,CAAC,EAAE,KAAK,QAAQ,CAAC,CAAC;IAChF,IAAI,MAAM,IAAI,IAAI,EAAE,CAAC;QACnB,MAAM,IAAI,MAAM,CAAC,0BAA0B,EAAE,EAAE,QAAQ,EAAE,MAAM,CAAC,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC;IAClF,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,MAAc,EAAU,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAE,CAAC;AAEpF,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,MAAc,EAAE,QAAgB,EAAU,EAAE;IACnF,MAAM,MAAM,GAAW,SAAS,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IACnD,OAAO,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC;AAClC,CAAC,CAAC","sourcesContent":["import { XError } from '@bisondesk/commons-sdk/errors';\nimport { first } from 'lodash-es';\nimport { Branch, Tenant } from '../types/tenants.js';\n\nexport const getBranch = (tenant: Tenant, branchId: string): Branch => {\n const branch = tenant.branches.find((branch: Branch) => branch.id === branchId);\n if (branch == null) {\n throw new XError('tenants.branch-not-found', { tenantId: tenant.id, branchId });\n }\n\n return branch;\n};\n\nexport const getDefaultBranch = (tenant: Tenant): Branch => first(tenant.branches)!;\n\nexport const getBranchStandardVatRate = (tenant: Tenant, branchId: string): string => {\n const branch: Branch = getBranch(tenant, branchId);\n return branch.vatRates.standard;\n};\n"]}
|
package/lib/utils/vehicles.d.ts
CHANGED
|
@@ -3,9 +3,9 @@ export declare const extractCustomFeatures: (vehicle: VehicleExternalInfo) => st
|
|
|
3
3
|
export declare const getInternalTitle: ({ make, category, modelName, bodywork, modelTypeName, }: {
|
|
4
4
|
make: string;
|
|
5
5
|
category: string;
|
|
6
|
-
modelName?: string
|
|
7
|
-
modelTypeName?: string
|
|
8
|
-
bodywork?: string
|
|
6
|
+
modelName?: string;
|
|
7
|
+
modelTypeName?: string;
|
|
8
|
+
bodywork?: string;
|
|
9
9
|
}) => string;
|
|
10
10
|
export declare const convertNumberToLetters: (num: number) => string;
|
|
11
11
|
//# sourceMappingURL=vehicles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vehicles.d.ts","sourceRoot":"/","sources":["utils/vehicles.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAE3D,eAAO,MAAM,qBAAqB,YAAa,mBAAmB,KAAG,MAAM,EA+B1E,CAAC;AAEF,eAAO,MAAM,gBAAgB;
|
|
1
|
+
{"version":3,"file":"vehicles.d.ts","sourceRoot":"/","sources":["utils/vehicles.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAE3D,eAAO,MAAM,qBAAqB,YAAa,mBAAmB,KAAG,MAAM,EA+B1E,CAAC;AAEF,eAAO,MAAM,gBAAgB,4DAM1B;IACD,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,KAAG,MAcH,CAAC;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Q,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,GAAG,aAAa,CAAC,CAAC;IAEjD,OAAO,sBAAsB,CAAC,QAAQ,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,SAAS,GAAG,CAAC,CAAC,CAAC;AAC1E,CAAC,CAAC","sourcesContent":["import { Categories } from '../constants.js';\nimport { VehicleExternalInfo } from '../types/vehicles.js';\n\nexport const extractCustomFeatures = (vehicle: VehicleExternalInfo): string[] => {\n const features: {\n getValue: (vehicle: VehicleExternalInfo) => any;\n picklistValueId: string;\n }[] = [\n {\n getValue: (vehicle) => vehicle.superstructure?.crane?.present,\n picklistValueId: 'crane',\n },\n {\n getValue: (vehicle) => vehicle.superstructure?.tailgate?.present,\n picklistValueId: 'tailgate',\n },\n { getValue: (vehicle) => vehicle.accessories.adr, picklistValueId: 'adr' },\n {\n getValue: (vehicle) => vehicle.accessories.retarderIntarder,\n picklistValueId: 'retarderIntarder',\n },\n {\n getValue: (vehicle) => vehicle.accessories.hydraulicTipperKit,\n picklistValueId: 'hydraulicTipperKit',\n },\n {\n getValue: (vehicle) => vehicle.accessories.lowDeck,\n picklistValueId: 'lowDeck',\n },\n ];\n\n return features\n .filter((feature) => !!feature.getValue(vehicle))\n .map((feature) => feature.picklistValueId);\n};\n\nexport const getInternalTitle = ({\n make,\n category,\n modelName,\n bodywork,\n modelTypeName,\n}: {\n make: string;\n category: string;\n modelName?: string;\n modelTypeName?: string;\n bodywork?: string;\n}): string => {\n if (category === Categories.Trailer || category === Categories.SemiTrailer) {\n return [make, modelName, bodywork]\n .filter((v): v is string => !!v)\n .map((v) => v.trim())\n .join(' ')\n .trim();\n }\n\n return [make, modelName, modelTypeName]\n .filter((v): v is string => !!v)\n .map((v) => v.trim())\n .join(' ')\n .trim();\n};\n\n// example: 1 -> A, 2 -> B, 26 -> Z, 27 -> AA, 28 -> AB, 52 -> AZ, 53 -> BA, 54 -> BB, 702 -> ZZ, 703 -> AAA\nexport const convertNumberToLetters = (num: number): string => {\n const letters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';\n const lettersLength = letters.length;\n\n if (num < 1) {\n return '';\n }\n\n const remainder = num % lettersLength;\n const quotient = Math.floor(num / lettersLength);\n\n return convertNumberToLetters(quotient) + letters.charAt(remainder - 1);\n};\n"]}
|
package/package.json
CHANGED
|
@@ -314,6 +314,10 @@ export const QUOTE_NOT_CREATED_BY_ACCOUNT_MANAGER = 'quote-not-created-by-accoun
|
|
|
314
314
|
export const QUOTE_VALIDATOR_FEEDBACK_NOTIFICATION_ORIGIN = 'quote-validation-feedback';
|
|
315
315
|
export const OPPORTUNITY_VEHICLE_AVAILABLE_NOTIFICATION_ORIGIN = 'opportunity-vehicle-available';
|
|
316
316
|
export const OPPORTUNITY_VEHICLE_DELIVERY_NOTIFICATION_ORIGIN = 'opportunity-vehicle-delivery';
|
|
317
|
+
export const OPPORTUNITY_VEHICLE_RESERVATION_ABOUT_TO_EXPIRE_NOTIFICATION_ORIGIN =
|
|
318
|
+
'opportunity-vehicle-reservation-to-expire';
|
|
319
|
+
export const OPPORTUNITY_VEHICLE_RESERVATION_EXPIRED_NOTIFICATION_ORIGIN =
|
|
320
|
+
'opportunity-vehicle-reservation-expired';
|
|
317
321
|
|
|
318
322
|
export type OpportunityNotificationData = {
|
|
319
323
|
quoteVersion?: number;
|
|
@@ -704,8 +708,6 @@ export type HpIsaProcessRequest = {
|
|
|
704
708
|
vehicleCategory: string; //entityId
|
|
705
709
|
|
|
706
710
|
amountOfCommissionPaid: number;
|
|
707
|
-
dealValidated: boolean;
|
|
708
|
-
dealCancelled: boolean;
|
|
709
711
|
opportunityId: string;
|
|
710
712
|
deliveryType: string; //entity Id
|
|
711
713
|
directDelivery?: boolean | null;
|