@bisondesk/core-sdk 1.0.538 → 1.0.539
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/types/crm.d.ts +1 -0
- package/lib/types/crm.d.ts.map +1 -1
- package/lib/types/crm.js.map +1 -1
- package/lib/types/stocklists.d.ts +28 -0
- package/lib/types/stocklists.d.ts.map +1 -0
- package/lib/types/stocklists.js +7 -0
- package/lib/types/stocklists.js.map +1 -0
- package/lib/types/vehicle-performance.d.ts +8 -1
- package/lib/types/vehicle-performance.d.ts.map +1 -1
- package/lib/types/vehicle-performance.js.map +1 -1
- package/lib/utils/search.js +4 -4
- package/lib/utils/search.js.map +1 -1
- package/package.json +1 -1
- package/src/types/crm.ts +1 -0
- package/src/types/stocklists.ts +33 -0
- package/src/types/vehicle-performance.ts +8 -1
- package/src/utils/search.ts +4 -4
- package/tsconfig.tsbuildinfo +1 -1
package/lib/types/crm.d.ts
CHANGED
package/lib/types/crm.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"crm.d.ts","sourceRoot":"/","sources":["types/crm.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,mBAAmB,EACnB,gBAAgB,EAChB,iBAAiB,EAClB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE3C,oBAAY,mBAAmB;IAC7B,kBAAkB,uBAAuB;IACzC,SAAS,cAAc;IACvB,kBAAkB,uBAAuB;IACzC,QAAQ,aAAa;IACrB,eAAe,oBAAoB;IACnC,YAAY,iBAAiB;IAC7B,oBAAoB,yBAAyB;IAC7C,MAAM,WAAW;IACjB,UAAU,eAAe;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D,WAAY,iBAAiB;IAC3B,2DAAsC,CAAA;IACtC,yDAAoC,CAAA;AACtC,CAAC,EAHW,iBAAiB,KAAjB,iBAAiB,QAG5B;AAED,MAAM,CAAN,IAAY,cAGX;AAHD,WAAY,cAAc;IACxB,mCAAiB,CAAA;IACjB,+CAA6B,CAAA;AAC/B,CAAC,EAHW,cAAc,KAAd,cAAc,QAGzB;AAED,MAAM,CAAN,IAAY,iBAKX;AALD,WAAY,iBAAiB;IAC3B,sCAAiB,CAAA;IACjB,4CAAuB,CAAA;IACvB,oDAA+B,CAAA;IAC/B,oCAAe,CAAA;AACjB,CAAC,EALW,iBAAiB,KAAjB,iBAAiB,QAK5B","sourcesContent":["import {\n LocationValue,\n PhoneNumberRawValue,\n PhoneNumberValue,\n SearchPermissions,\n} from '@bisondesk/commons-sdk/types';\nimport { PublicSearchDefinition } from './definitions.js';\nimport { Interest } from './interests.js';\nimport { BaseEvent } from './internal-events.js';\nimport { ReferenceData } from './utils.js';\n\nexport enum OrganizatioRiskTags {\n BAD_FINANCIAL_INFO = 'BAD_FINANCIAL_INFO',\n WRITE_OFF = 'WRITE_OFF',\n VAT_NUMBER_INVALID = 'VAT_NUMBER_INVALID',\n INSTINCT = 'INSTINCT',\n INVALID_ADDRESS = 'INVALID_ADDRESS',\n NEW_CUSTOMER = 'NEW_CUSTOMER',\n BANK_ACCOUNT_BLOCKED = 'BANK_ACCOUNT_BLOCKED',\n NO_GPS = 'NO_GPS',\n BANKRUPTCY = 'BANKRUPTCY',\n JUDICIAL_REORGANISATION_WCO = 'JUDICIAL_REORGANISATION_WCO',\n}\n\nexport enum ContactActions {\n UPSERT = 'upsert',\n DELETE = 'delete',\n}\n\nexport enum OrganizationActions {\n ADD_ACTIVITY = 'add_activity',\n UPSERT = 'upsert',\n DELETE = 'delete',\n SELL_TO_ORGANIZATION = 'sell_to_organization',\n}\n\nexport type CrmEvent = CrmOrganizationEvent | CrmContactEvent;\n\ntype BaseContactEvent = BaseEvent & {\n contactId: string;\n organizationId?: string;\n actionAt: string;\n userId: string;\n tenantId: string;\n};\n\nexport type ContactCreateEvent = BaseContactEvent & {\n action: 'create';\n contact: Contact;\n previousContact?: undefined;\n};\n\nexport type ContactUpdateEvent = BaseContactEvent & {\n action: 'update';\n contact: Contact;\n previousContact: Contact;\n};\n\nexport type ContactDeleteEvent = BaseContactEvent & {\n action: 'delete';\n contact?: undefined;\n previousContact: Contact;\n};\n\nexport type CrmContactEvent = ContactCreateEvent | ContactUpdateEvent | ContactDeleteEvent;\n\ntype BaseOrgEvent = BaseEvent & {\n organizationId: string;\n actionAt: string;\n userId: string;\n tenantId: string;\n};\n\nexport type OrgCreateEvent = BaseOrgEvent & {\n action: 'create';\n org: Organization;\n previousOrg?: undefined;\n};\n\nexport type OrgUpdateEvent = BaseOrgEvent & {\n action: 'update';\n org: Organization;\n previousOrg: Organization;\n};\n\nexport type OrgDeleteEvent = BaseOrgEvent & {\n action: 'delete';\n org?: undefined;\n previousOrg: Organization;\n};\n\nexport type CrmOrganizationEvent = OrgCreateEvent | OrgUpdateEvent | OrgDeleteEvent;\n\ntype BaseOrganization = {\n usages: {\n [tenantId: string]: string[]; // branchIds that are using this organization\n };\n countryCode: string;\n name: string;\n segment?: string;\n type?: 'COMPANY' | 'INDIVIDUAL' | 'GOVERNMENT';\n vatNumber?: string;\n addresses?: {\n legal?: LocationValue;\n transport?: LocationValue;\n };\n conglomerate?: boolean;\n riskTags?: string[];\n\n // billing\n billingEmails?: string[];\n skipPaymentReminders?: boolean;\n trustworthy?: boolean;\n // meta\n slbPartner?: boolean;\n\n tags?: string[]; // custom tags for the organization\n};\n\nexport type NewOrganization = BaseOrganization & {\n id?: undefined;\n externalId?: undefined;\n createdAt?: undefined;\n createdBy?: undefined;\n billingPhone?: PhoneNumberValue | PhoneNumberRawValue;\n};\n\nexport type ValidatedNewOrganization = Omit<NewOrganization, 'billingPhone'> & {\n billingPhone?: PhoneNumberValue;\n};\n\nexport type Organization = BaseOrganization & {\n createdAt: string;\n externalId: number;\n createdBy: string;\n id: string;\n\n debt?: OrganizationDebtInfo;\n\n billingPhone?: PhoneNumberValue;\n\n disabled?: boolean;\n disabledAt?: string;\n disabledBy?: string;\n disabledReason?: string;\n};\n\nexport type OrganizationDebtInfo = {\n overdueSince?: string;\n overdueInvoices: number;\n overdueAmount: string;\n unpaidInvoices: number;\n unpaidAmount: string;\n};\n\nexport type OrgLeasingContract = {\n id: string;\n contractNumber?: string;\n vehicle: {\n id: string;\n stockNumber: string;\n administrativeNumber?: string;\n };\n};\n\nexport type SearchOrganization = {\n org: Organization;\n contract: OrgLeasingContract[]; // important for the logic regarding leasing overdue reminders\n custom: {\n inUse: boolean; // is this organization in use by any of the branches of this tenant, or is it an organization from another tenant.\n lastActivityAt: string | undefined; // last activity at this organization\n lastActivityBy: string | undefined; // user that did the last activity at this organization\n engagementTypes: OrgEngagementType[] | undefined; // types of engagements this organization has in the tenant\n\n accountManagers: string[]; // dynamically determined account managers for this organization\n };\n};\n\nexport type PotentialDuplicatesReferenceData = ReferenceData & { blockIgnore?: boolean };\n\nexport type InputSearchOrganization = SearchOrganization & {\n permissions: SearchPermissions | undefined;\n};\n\nexport type SearchContact = {\n contact: Contact;\n org?: Organization;\n interests?: Interest[];\n custom: {\n accountManagers: string[]; // dynamically determined account managers for this contact\n classification: 'prospect' | 'customer';\n hasOrganization: boolean;\n lastActivityAt: string | undefined;\n lastActivityBy: string | undefined;\n };\n};\n\nexport type InputSearchContact = SearchContact & {\n permissions: SearchPermissions | undefined;\n};\n\nexport type CrmPublicSearchDefinitions = {\n searchOrg: PublicSearchDefinition;\n searchContact: PublicSearchDefinition;\n};\n\nexport enum MarketingChannel {\n Email = 'email',\n Whatsapp = 'whatsapp',\n Sms = 'sms',\n Phone = 'phone',\n}\n\nexport type MarketingPreferenceEntry = {\n optedOut: boolean;\n updatedAt: string;\n};\n\nexport type MarketingPreferences = {\n [channel in MarketingChannel]?: MarketingPreferenceEntry;\n};\n\nexport enum PartnerLevel {\n Internal = '05-internal',\n Gold = '10-gold',\n Silver = '20-silver',\n Bronze = '30-bronze',\n}\n\ntype BaseContact = {\n accountManager?: string;\n countryCode?: string; // TODO review if this should be required (UI says it is)\n language?: string;\n emails: string[];\n job?: string;\n /** either firstName or lastName should be filled in */\n firstName?: string;\n lastName?: string;\n organizationId?: string;\n /** will not be filled if organizationId is present */\n orgName?: string;\n marketingPreferences?: MarketingPreferences;\n clientLevel?: PartnerLevel;\n\n disabledAt?: string;\n disabledBy?: string;\n disabledReason?: string;\n\n tags?: string[]; // custom tags for the contact\n};\n\nexport type NewContact = BaseContact & {\n id?: undefined;\n createdAt?: undefined;\n createdBy?: undefined;\n phones: Array<PhoneNumberValue | PhoneNumberRawValue>;\n organizationId?: string;\n};\n\nexport type NewContactValidated = BaseContact & {\n id?: undefined;\n createdAt?: undefined;\n createdBy?: undefined;\n organizationId?: string;\n phones: PhoneNumberValue[];\n};\n\nexport type Contact = BaseContact & {\n id: string;\n createdAt: string;\n createdBy: string;\n phones: PhoneNumberValue[];\n};\n\nexport enum SaveContactResolution {\n IgnoreDuplicates = 'IGNORE_DUPLICATES',\n BlockDuplicates = 'BLOCK_DUPLICATES',\n}\n\nexport enum SaveOrgResolution {\n IgnoreDuplicates = 'IGNORE_DUPLICATES',\n BlockDuplicates = 'BLOCK_DUPLICATES',\n}\n\nexport enum CrmSearchScope {\n Tenant = 'tenant',\n Conglomerate = 'conglomerate',\n}\n\nexport enum OrgEngagementType {\n offers = 'offers',\n purchases = 'purchases',\n opportunities = 'opportunities',\n sales = 'sales',\n}\n"]}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { AttachmentValue } from '@bisondesk/commons-sdk/types';
|
|
2
|
+
export type Stocklist = {
|
|
3
|
+
id: string;
|
|
4
|
+
createdAt: string;
|
|
5
|
+
createdBy: string;
|
|
6
|
+
branchId: string;
|
|
7
|
+
period: number;
|
|
8
|
+
year: number;
|
|
9
|
+
asOfDate: string;
|
|
10
|
+
status: StocklistStatus;
|
|
11
|
+
attachment?: AttachmentValue;
|
|
12
|
+
progress: number;
|
|
13
|
+
};
|
|
14
|
+
export declare enum StocklistStatus {
|
|
15
|
+
IN_PROGRESS = "IN_PROGRESS",
|
|
16
|
+
GENERATED = "GENERATED",
|
|
17
|
+
INTERRUPTED = "INTERRUPTED"
|
|
18
|
+
}
|
|
19
|
+
export type StocklistRequest = {
|
|
20
|
+
branchId: string;
|
|
21
|
+
year: number;
|
|
22
|
+
period: number;
|
|
23
|
+
};
|
|
24
|
+
export type StocklistListResponse = {
|
|
25
|
+
results: Stocklist[];
|
|
26
|
+
total: number;
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=stocklists.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stocklists.d.ts","sourceRoot":"/","sources":["types/stocklists.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAE/D,MAAM,MAAM,SAAS,GAAG;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IAEjB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IAEjB,MAAM,EAAE,eAAe,CAAC;IACxB,UAAU,CAAC,EAAE,eAAe,CAAC;IAC7B,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,oBAAY,eAAe;IACzB,WAAW,gBAAgB;IAC3B,SAAS,cAAc;IACvB,WAAW,gBAAgB;CAC5B;AAED,MAAM,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,OAAO,EAAE,SAAS,EAAE,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export var StocklistStatus;
|
|
2
|
+
(function (StocklistStatus) {
|
|
3
|
+
StocklistStatus["IN_PROGRESS"] = "IN_PROGRESS";
|
|
4
|
+
StocklistStatus["GENERATED"] = "GENERATED";
|
|
5
|
+
StocklistStatus["INTERRUPTED"] = "INTERRUPTED";
|
|
6
|
+
})(StocklistStatus || (StocklistStatus = {}));
|
|
7
|
+
//# sourceMappingURL=stocklists.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stocklists.js","sourceRoot":"/","sources":["types/stocklists.ts"],"names":[],"mappings":"AAiBA,MAAM,CAAN,IAAY,eAIX;AAJD,WAAY,eAAe;IACzB,8CAA2B,CAAA;IAC3B,0CAAuB,CAAA;IACvB,8CAA2B,CAAA;AAC7B,CAAC,EAJW,eAAe,KAAf,eAAe,QAI1B","sourcesContent":["import { AttachmentValue } from '@bisondesk/commons-sdk/types';\n\nexport type Stocklist = {\n id: string;\n createdAt: string;\n createdBy: string;\n branchId: string;\n\n period: number;\n year: number;\n asOfDate: string;\n\n status: StocklistStatus;\n attachment?: AttachmentValue;\n progress: number;\n};\n\nexport enum StocklistStatus {\n IN_PROGRESS = 'IN_PROGRESS',\n GENERATED = 'GENERATED',\n INTERRUPTED = 'INTERRUPTED',\n}\n\nexport type StocklistRequest = {\n branchId: string;\n year: number;\n period: number;\n};\n\nexport type StocklistListResponse = {\n results: Stocklist[];\n total: number;\n};\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { OpportunityType } from '../constants.js';
|
|
2
|
+
import { BaseEvent } from './internal-events.js';
|
|
2
3
|
import { VehicleSaleDealStatus, VehicleSaleLogisticsStatus } from './opportunities.js';
|
|
3
4
|
import { VehiclePurchaseDealStatus, VehiclePurchaseLogisticsStatus, VehicleRoles } from './vehicles.js';
|
|
4
|
-
import { BaseEvent } from './internal-events.js';
|
|
5
5
|
export type VehicleSaleOverview = {
|
|
6
6
|
opportunityId: string;
|
|
7
7
|
type: OpportunityType;
|
|
@@ -28,6 +28,7 @@ export type VehicleSaleOverview = {
|
|
|
28
28
|
wonAt?: string;
|
|
29
29
|
saleAt?: string;
|
|
30
30
|
firstInvoiceIssuedAt?: string;
|
|
31
|
+
firstInvoiceBookingNumber?: string;
|
|
31
32
|
lastInvoiceIssuedAt?: string;
|
|
32
33
|
firstPaymentAt?: string;
|
|
33
34
|
fullPaymentAt?: string;
|
|
@@ -50,11 +51,17 @@ export type VehiclePurchaseOverview = {
|
|
|
50
51
|
supplierEmail?: string;
|
|
51
52
|
supplierPhone?: string;
|
|
52
53
|
firstInvoiceIssuedAt?: string;
|
|
54
|
+
firstInvoiceBookingNumber?: string;
|
|
53
55
|
lastInvoiceIssuedAt?: string;
|
|
54
56
|
firstPaymentAt?: string;
|
|
55
57
|
fullPaymentAt?: string;
|
|
58
|
+
amountPaid?: string;
|
|
56
59
|
expectedAmount: string;
|
|
57
60
|
actualAmount: string;
|
|
61
|
+
purchaseAmount: string;
|
|
62
|
+
estimatedPurchasePrice: string;
|
|
63
|
+
creditNoteAmount: string;
|
|
64
|
+
additionalPurchaseCosts: string;
|
|
58
65
|
purchaseAt?: string;
|
|
59
66
|
marketingAt?: string;
|
|
60
67
|
evaluationAt?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vehicle-performance.d.ts","sourceRoot":"/","sources":["types/vehicle-performance.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,qBAAqB,EAAE,0BAA0B,EAAE,MAAM,oBAAoB,CAAC;AACvF,OAAO,EACL,yBAAyB,EACzB,8BAA8B,EAC9B,YAAY,EACb,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"vehicle-performance.d.ts","sourceRoot":"/","sources":["types/vehicle-performance.ts"],"names":[],"mappings":"AAAA,OAA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;IACrD,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,QAAQ,CAAC;IACjB,IAAI,EAAE,uBAAuB,CAAC;IAC9B,YAAY,CAAC,EAAE,uBAAuB,CAAC;CACxC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vehicle-performance.js","sourceRoot":"/","sources":["types/vehicle-performance.ts"],"names":[],"mappings":"","sourcesContent":["import { OpportunityType } from '../constants.js';\nimport { VehicleSaleDealStatus, VehicleSaleLogisticsStatus } from './opportunities.js';\nimport {\n VehiclePurchaseDealStatus,\n VehiclePurchaseLogisticsStatus,\n VehicleRoles,\n} from './vehicles.js';\
|
|
1
|
+
{"version":3,"file":"vehicle-performance.js","sourceRoot":"/","sources":["types/vehicle-performance.ts"],"names":[],"mappings":"","sourcesContent":["import { OpportunityType } from '../constants.js';\nimport { BaseEvent } from './internal-events.js';\nimport { VehicleSaleDealStatus, VehicleSaleLogisticsStatus } from './opportunities.js';\nimport {\n VehiclePurchaseDealStatus,\n VehiclePurchaseLogisticsStatus,\n VehicleRoles,\n} from './vehicles.js';\n\nexport type VehicleSaleOverview = {\n opportunityId: string;\n type: OpportunityType;\n userId: string; // account manager of the latest opportunity (if opportunity is >= review)\n teamId?: string; // team of the account manager at the time of the latest opportunity\n assistantUserId?: string;\n\n // client details\n clientId: string;\n clientCode: number;\n clientCountryCode: string;\n clientVat?: string;\n conglomerate?: boolean;\n clientEmail?: string;\n clientPhone?: string;\n\n // financing details\n financingOrgId?: string;\n\n // vehicle details\n dealStatus: VehicleSaleDealStatus;\n logisticsStatus: VehicleSaleLogisticsStatus;\n\n // opportunity dates\n createdAt: string;\n engagedAt?: string;\n acceptedAt?: string;\n validatedAt?: string;\n reviewedAt?: string;\n preparedAt?: string;\n deliveredAt?: string;\n wonAt?: string;\n\n saleAt?: string; // this is the date that should be considered for the sale according to TJ (often the same as fullPaymentAt)\n\n // money-related details\n firstInvoiceIssuedAt?: string;\n firstInvoiceBookingNumber?: string;\n lastInvoiceIssuedAt?: string;\n firstPaymentAt?: string;\n fullPaymentAt?: string;\n expectedAmount: string; // from quote(s)\n actualAmount: string; // from all invoices\n lifetimeActualAmount: string; // sum of all invoices from all opportunities for this vehicle\n\n // is there an invoice with line categories related to the purchase of commercial vehicle?\n hasMainInvoice?: boolean;\n};\n\nexport type VehiclePurchaseOverview = {\n userId: string; // purchaser\n teamId?: string; // team of the purchaser at the time of purchase\n assistantUserId?: string;\n\n dealStatus: VehiclePurchaseDealStatus;\n logisticsStatus: VehiclePurchaseLogisticsStatus;\n\n supplierId: string;\n supplierCode: string;\n supplierCountryCode: string;\n supplierVat?: string;\n conglomerate?: boolean;\n supplierEmail?: string;\n supplierPhone?: string;\n\n // money-related details\n firstInvoiceIssuedAt?: string;\n firstInvoiceBookingNumber?: string;\n lastInvoiceIssuedAt?: string;\n firstPaymentAt?: string;\n fullPaymentAt?: string;\n amountPaid?: string;\n expectedAmount: string;\n actualAmount: string;\n purchaseAmount: string;\n estimatedPurchasePrice: string;\n creditNoteAmount: string;\n additionalPurchaseCosts: string;\n\n purchaseAt?: string; // this is the date that should be considered for the purchase according to TJ (often the same as fullPaymentAt)\n\n // log\n marketingAt?: string; // no vehicle in our parking, just digital marketing\n evaluationAt?: string; // in consignation\n purchaseAgreedAt?: string;\n // firstPaymentAllowedAt?: string;\n // firstPaymentSentAt?: string;\n // fullPaymentAllowedAt?: string;\n // fullPaymentSentAt?: string;\n arrivedAt?: string;\n checkedInAt?: string;\n\n hasMainInvoice?: boolean;\n};\n\nexport type VehicleProfitOverview = {\n expectedProfit?: string;\n expectedRoi?: string;\n\n actualProfit?: string;\n actualRoi?: string;\n};\n\ntype VehicleSummary = {\n branch: string;\n stockNumber: string;\n id: string;\n role: VehicleRoles;\n newCondition?: boolean;\n\n // latest document of category Registration related to the vehicle\n hasRegistration?: boolean;\n registrationDocId?: string;\n\n // latest document of category CoC related to the vehicle\n hasCoc?: boolean;\n cocDocId?: string;\n};\n\nexport type VehicleBusinessOverview = {\n currency: string; // eg EUR\n vehicle: VehicleSummary;\n purchase: VehiclePurchaseOverview;\n sale?: VehicleSaleOverview;\n profit?: VehicleProfitOverview;\n};\n\nexport type VehicleBusinessOverviewXL = VehicleBusinessOverview & {\n statistics: {\n daysToArrival?: number; // days since full payment sent until vehicle arriving at our park\n daysToCheckIn?: number; // days since full payment sent until vehicle being checked-in\n daysToMakeReady?: number; // days since arrival until vehicle being checked-in\n daysInRealInventory?: number; // days since check-in until opportunity goes to Review (vehicle reserved)\n daysInVirtualInventory?: number; // days since vehicle created in the system until opportunity goes to Review\n cashConversionCycle?: number; // days since full payment sent until full payment received\n daysSaleUnpaid?: number; // days since opportunity goes to Review until it is fully paid\n };\n};\n\n// Event types for VehicleBusinessOverview changes\nexport type VehicleBusinessOverviewEvent = BaseEvent & {\n vehicleId: string;\n tenantId: string;\n actionAt: string;\n action: 'upsert';\n data: VehicleBusinessOverview;\n previousData?: VehicleBusinessOverview;\n};\n"]}
|
package/lib/utils/search.js
CHANGED
|
@@ -65,13 +65,13 @@ export const mappings = {
|
|
|
65
65
|
getTags: (contract) => [contract.id, contract.contractNumber].filter(Boolean),
|
|
66
66
|
},
|
|
67
67
|
[BusinessEntityIds.FinanceDocuments]: {
|
|
68
|
-
getMainEntity: (entity) => entity,
|
|
69
|
-
getTitle: (entity) => entity.
|
|
68
|
+
getMainEntity: (entity) => entity.doc,
|
|
69
|
+
getTitle: (entity) => entity.doc.reference,
|
|
70
70
|
getTags: (entity) => [entity.id],
|
|
71
71
|
},
|
|
72
72
|
[BusinessEntityIds.AdministrativeDocuments]: {
|
|
73
|
-
getMainEntity: (entity) => entity,
|
|
74
|
-
getTitle: (entity) => entity.
|
|
73
|
+
getMainEntity: (entity) => entity.doc,
|
|
74
|
+
getTitle: (entity) => entity.doc.category,
|
|
75
75
|
getTags: (entity) => [entity.id],
|
|
76
76
|
},
|
|
77
77
|
[BusinessEntityIds.DebtorsDossier]: {
|
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;AAqBpD,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,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;SACzE,CAAC;IACJ,CAAC;AACH,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,QAAQ,GASjB;IACF,CAAC,iBAAiB,CAAC,aAAa,CAAC,EAAE;QACjC,aAAa,EAAE,CAAC,MAAyB,EAAE,EAAE,CAAC,MAAM,CAAC,WAAW;QAChE,QAAQ,EAAE,CAAC,GAAgB,EAAE,EAAE,CAAC,GAAG,CAAC,EAAE;QACtC,cAAc,EAAE,CAAC,GAAsB,EAAE,EAAE;YACzC,MAAM,QAAQ,GAAG,sBAAsB,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC;YAC9D,OAAO,iBAAiB,CACtB,CAAC,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,CAA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,EACnC,YAAgC,EAChC,EAAE,CACF,wBAAwB,CACtB,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 { DebtorsDossier, SearchDebtorsDossier } from '../types/leasing-debtors.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 =\n | Opportunity\n | Vehicle\n | Organization\n | LeasingContract\n | DebtorsDossier;\nexport type GlobalSearchEntity =\n | SearchOpportunity\n | SearchVehicle\n | SearchOrganization\n | SearchLeasingContract\n | SearchDebtorsDossier;\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[];\n getTagsForSearchEntity?: (entity: any) => string[];\n getDescription?: (entity: any) => string;\n getMeta?: (entity: any) => Record<string, any>;\n };\n} = {\n [BusinessEntityIds.Opportunities]: {\n getMainEntity: (entity: SearchOpportunity) => entity.opportunity,\n getTitle: (opp: Opportunity) => opp.id,\n getDescription: (opp: SearchOpportunity) => {\n const customer = getCustomerInformation(opp.org, opp.contact);\n return joinWithSeparator(\n [customer?.code, customer?.title, opp.vehicle?.external.identification.stockNumber].filter(\n Boolean\n )\n );\n },\n getTags: (opp: Opportunity) => [opp.id],\n getTagsForSearchEntity: (opp: SearchOpportunity) => {\n const vehicleTags =\n opp.vehicle != null\n ? getTagsForBusinessEntity(BusinessEntityIds.Vehicles, opp.vehicle)\n : [];\n return [...vehicleTags, opp.opportunity.id];\n },\n getMeta: (opp: Opportunity) => ({\n status: opp.status,\n wonAt: opp.wonAt,\n lostAt: opp.lostAt,\n }),\n },\n [BusinessEntityIds.Vehicles]: {\n getMainEntity: (entity: SearchVehicle) => entity.vehicle,\n getTitle: (vehicle: Vehicle) => vehicle.internal.description.title,\n getTags: (vehicle: Vehicle) =>\n [\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 ].filter(Boolean) as string[],\n },\n [BusinessEntityIds.ExternalVehicleSale]: {\n getMainEntity: (entity: SearchVehicle) => entity.vehicle,\n getTitle: (vehicle: Vehicle) => vehicle.internal.description.title,\n getTags: (vehicle: Vehicle) =>\n [\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 ].filter(Boolean) as string[],\n },\n [BusinessEntityIds.Organizations]: {\n getMainEntity: (entity: SearchOrganization) => entity.org,\n getTitle: (org: Organization) => org.name,\n getTags: (org: Organization) =>\n [`${org.externalId}`, org.vatNumber].filter(Boolean) as string[],\n },\n [BusinessEntityIds.LeasingContracts]: {\n getMainEntity: (entity: SearchLeasingContract) => entity.contract,\n getTitle: (contract: LeasingContract) => contract.contractNumber ?? contract.id,\n getTags: (contract: LeasingContract) =>\n [contract.id, contract.contractNumber].filter(Boolean) as string[],\n },\n [BusinessEntityIds.FinanceDocuments]: {\n getMainEntity: (entity: any) => entity,\n getTitle: (entity: any) => entity.id,\n getTags: (entity: any) => [entity.id],\n },\n [BusinessEntityIds.AdministrativeDocuments]: {\n getMainEntity: (entity: any) => entity,\n getTitle: (entity: any) => entity.id,\n getTags: (entity: any) => [entity.id],\n },\n [BusinessEntityIds.DebtorsDossier]: {\n getMainEntity: (entity: SearchDebtorsDossier) => entity.debtorsDossier,\n getTitle: (dossier: DebtorsDossier) => dossier.id,\n getTags: (dossier: DebtorsDossier) => [dossier.id].filter(Boolean) as string[],\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);\n\nexport const getTagsForSearchBusinessEntity = (\n businessEntityId: BusinessEntityIds,\n entity: GlobalSearchEntity\n) => {\n const tags = getMapping(businessEntityId).getTagsForSearchEntity?.(entity);\n\n if (tags) {\n return tags;\n }\n\n return getTagsForBusinessEntity(\n businessEntityId,\n getMainEntityFromSearchEntity(businessEntityId, entity)\n );\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\nexport const getMetaForBusinessEntity = (\n businessEntityId: BusinessEntityIds,\n entity: GlobalBusinessEntity\n) => getMapping(businessEntityId).getMeta?.(entity);\n\nexport const getMetaForSearchBusinessEntity = (\n businessEntityId: BusinessEntityIds,\n searchEntity: GlobalSearchEntity\n) =>\n getMetaForBusinessEntity(\n businessEntityId,\n getMainEntityFromSearchEntity(businessEntityId, searchEntity)\n );\n"]}
|
|
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;AAqBpD,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,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;SACzE,CAAC;IACJ,CAAC;AACH,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,QAAQ,GASjB;IACF,CAAC,iBAAiB,CAAC,aAAa,CAAC,EAAE;QACjC,aAAa,EAAE,CAAC,MAAyB,EAAE,EAAE,CAAC,MAAM,CAAC,WAAW;QAChE,QAAQ,EAAE,CAAC,GAAgB,EAAE,EAAE,CAAC,GAAG,CAAC,EAAE;QACtC,cAAc,EAAE,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ChB,6BAA6B,CAAC,gBAAgB,EAAE,YAAY,CAAC,CAC9D,CAAC;AAEJ,MAAM,CAAC,MAAM,wBAAwB,GAAG,CACtC,gBAAmC,EACnC,MAA4B,EAC5B,EAAE,CAAC,UAAU,CAAC,gBAAgB,CAAC,CAAC,OAAO,EAAE,CAAC,MAAM,CAAC,CAAC;AAEpD,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAC5C,gBAAmC,EACnC,YAAgC,EAChC,EAAE,CACF,wBAAwB,CACtB,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 { DebtorsDossier, SearchDebtorsDossier } from '../types/leasing-debtors.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 =\n | Opportunity\n | Vehicle\n | Organization\n | LeasingContract\n | DebtorsDossier;\nexport type GlobalSearchEntity =\n | SearchOpportunity\n | SearchVehicle\n | SearchOrganization\n | SearchLeasingContract\n | SearchDebtorsDossier;\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[];\n getTagsForSearchEntity?: (entity: any) => string[];\n getDescription?: (entity: any) => string;\n getMeta?: (entity: any) => Record<string, any>;\n };\n} = {\n [BusinessEntityIds.Opportunities]: {\n getMainEntity: (entity: SearchOpportunity) => entity.opportunity,\n getTitle: (opp: Opportunity) => opp.id,\n getDescription: (opp: SearchOpportunity) => {\n const customer = getCustomerInformation(opp.org, opp.contact);\n return joinWithSeparator(\n [customer?.code, customer?.title, opp.vehicle?.external.identification.stockNumber].filter(\n Boolean\n )\n );\n },\n getTags: (opp: Opportunity) => [opp.id],\n getTagsForSearchEntity: (opp: SearchOpportunity) => {\n const vehicleTags =\n opp.vehicle != null\n ? getTagsForBusinessEntity(BusinessEntityIds.Vehicles, opp.vehicle)\n : [];\n return [...vehicleTags, opp.opportunity.id];\n },\n getMeta: (opp: Opportunity) => ({\n status: opp.status,\n wonAt: opp.wonAt,\n lostAt: opp.lostAt,\n }),\n },\n [BusinessEntityIds.Vehicles]: {\n getMainEntity: (entity: SearchVehicle) => entity.vehicle,\n getTitle: (vehicle: Vehicle) => vehicle.internal.description.title,\n getTags: (vehicle: Vehicle) =>\n [\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 ].filter(Boolean) as string[],\n },\n [BusinessEntityIds.ExternalVehicleSale]: {\n getMainEntity: (entity: SearchVehicle) => entity.vehicle,\n getTitle: (vehicle: Vehicle) => vehicle.internal.description.title,\n getTags: (vehicle: Vehicle) =>\n [\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 ].filter(Boolean) as string[],\n },\n [BusinessEntityIds.Organizations]: {\n getMainEntity: (entity: SearchOrganization) => entity.org,\n getTitle: (org: Organization) => org.name,\n getTags: (org: Organization) =>\n [`${org.externalId}`, org.vatNumber].filter(Boolean) as string[],\n },\n [BusinessEntityIds.LeasingContracts]: {\n getMainEntity: (entity: SearchLeasingContract) => entity.contract,\n getTitle: (contract: LeasingContract) => contract.contractNumber ?? contract.id,\n getTags: (contract: LeasingContract) =>\n [contract.id, contract.contractNumber].filter(Boolean) as string[],\n },\n [BusinessEntityIds.FinanceDocuments]: {\n getMainEntity: (entity: any) => entity.doc,\n getTitle: (entity: any) => entity.doc.reference,\n getTags: (entity: any) => [entity.id],\n },\n [BusinessEntityIds.AdministrativeDocuments]: {\n getMainEntity: (entity: any) => entity.doc,\n getTitle: (entity: any) => entity.doc.category,\n getTags: (entity: any) => [entity.id],\n },\n [BusinessEntityIds.DebtorsDossier]: {\n getMainEntity: (entity: SearchDebtorsDossier) => entity.debtorsDossier,\n getTitle: (dossier: DebtorsDossier) => dossier.id,\n getTags: (dossier: DebtorsDossier) => [dossier.id].filter(Boolean) as string[],\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);\n\nexport const getTagsForSearchBusinessEntity = (\n businessEntityId: BusinessEntityIds,\n entity: GlobalSearchEntity\n) => {\n const tags = getMapping(businessEntityId).getTagsForSearchEntity?.(entity);\n\n if (tags) {\n return tags;\n }\n\n return getTagsForBusinessEntity(\n businessEntityId,\n getMainEntityFromSearchEntity(businessEntityId, entity)\n );\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\nexport const getMetaForBusinessEntity = (\n businessEntityId: BusinessEntityIds,\n entity: GlobalBusinessEntity\n) => getMapping(businessEntityId).getMeta?.(entity);\n\nexport const getMetaForSearchBusinessEntity = (\n businessEntityId: BusinessEntityIds,\n searchEntity: GlobalSearchEntity\n) =>\n getMetaForBusinessEntity(\n businessEntityId,\n getMainEntityFromSearchEntity(businessEntityId, searchEntity)\n );\n"]}
|
package/package.json
CHANGED
package/src/types/crm.ts
CHANGED
|
@@ -189,6 +189,7 @@ export type SearchContact = {
|
|
|
189
189
|
custom: {
|
|
190
190
|
accountManagers: string[]; // dynamically determined account managers for this contact
|
|
191
191
|
classification: 'prospect' | 'customer';
|
|
192
|
+
hasOrganization: boolean;
|
|
192
193
|
lastActivityAt: string | undefined;
|
|
193
194
|
lastActivityBy: string | undefined;
|
|
194
195
|
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { AttachmentValue } from '@bisondesk/commons-sdk/types';
|
|
2
|
+
|
|
3
|
+
export type Stocklist = {
|
|
4
|
+
id: string;
|
|
5
|
+
createdAt: string;
|
|
6
|
+
createdBy: string;
|
|
7
|
+
branchId: string;
|
|
8
|
+
|
|
9
|
+
period: number;
|
|
10
|
+
year: number;
|
|
11
|
+
asOfDate: string;
|
|
12
|
+
|
|
13
|
+
status: StocklistStatus;
|
|
14
|
+
attachment?: AttachmentValue;
|
|
15
|
+
progress: number;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export enum StocklistStatus {
|
|
19
|
+
IN_PROGRESS = 'IN_PROGRESS',
|
|
20
|
+
GENERATED = 'GENERATED',
|
|
21
|
+
INTERRUPTED = 'INTERRUPTED',
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export type StocklistRequest = {
|
|
25
|
+
branchId: string;
|
|
26
|
+
year: number;
|
|
27
|
+
period: number;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export type StocklistListResponse = {
|
|
31
|
+
results: Stocklist[];
|
|
32
|
+
total: number;
|
|
33
|
+
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { OpportunityType } from '../constants.js';
|
|
2
|
+
import { BaseEvent } from './internal-events.js';
|
|
2
3
|
import { VehicleSaleDealStatus, VehicleSaleLogisticsStatus } from './opportunities.js';
|
|
3
4
|
import {
|
|
4
5
|
VehiclePurchaseDealStatus,
|
|
5
6
|
VehiclePurchaseLogisticsStatus,
|
|
6
7
|
VehicleRoles,
|
|
7
8
|
} from './vehicles.js';
|
|
8
|
-
import { BaseEvent } from './internal-events.js';
|
|
9
9
|
|
|
10
10
|
export type VehicleSaleOverview = {
|
|
11
11
|
opportunityId: string;
|
|
@@ -44,6 +44,7 @@ export type VehicleSaleOverview = {
|
|
|
44
44
|
|
|
45
45
|
// money-related details
|
|
46
46
|
firstInvoiceIssuedAt?: string;
|
|
47
|
+
firstInvoiceBookingNumber?: string;
|
|
47
48
|
lastInvoiceIssuedAt?: string;
|
|
48
49
|
firstPaymentAt?: string;
|
|
49
50
|
fullPaymentAt?: string;
|
|
@@ -73,11 +74,17 @@ export type VehiclePurchaseOverview = {
|
|
|
73
74
|
|
|
74
75
|
// money-related details
|
|
75
76
|
firstInvoiceIssuedAt?: string;
|
|
77
|
+
firstInvoiceBookingNumber?: string;
|
|
76
78
|
lastInvoiceIssuedAt?: string;
|
|
77
79
|
firstPaymentAt?: string;
|
|
78
80
|
fullPaymentAt?: string;
|
|
81
|
+
amountPaid?: string;
|
|
79
82
|
expectedAmount: string;
|
|
80
83
|
actualAmount: string;
|
|
84
|
+
purchaseAmount: string;
|
|
85
|
+
estimatedPurchasePrice: string;
|
|
86
|
+
creditNoteAmount: string;
|
|
87
|
+
additionalPurchaseCosts: string;
|
|
81
88
|
|
|
82
89
|
purchaseAt?: string; // this is the date that should be considered for the purchase according to TJ (often the same as fullPaymentAt)
|
|
83
90
|
|
package/src/utils/search.ts
CHANGED
|
@@ -109,13 +109,13 @@ export const mappings: {
|
|
|
109
109
|
[contract.id, contract.contractNumber].filter(Boolean) as string[],
|
|
110
110
|
},
|
|
111
111
|
[BusinessEntityIds.FinanceDocuments]: {
|
|
112
|
-
getMainEntity: (entity: any) => entity,
|
|
113
|
-
getTitle: (entity: any) => entity.
|
|
112
|
+
getMainEntity: (entity: any) => entity.doc,
|
|
113
|
+
getTitle: (entity: any) => entity.doc.reference,
|
|
114
114
|
getTags: (entity: any) => [entity.id],
|
|
115
115
|
},
|
|
116
116
|
[BusinessEntityIds.AdministrativeDocuments]: {
|
|
117
|
-
getMainEntity: (entity: any) => entity,
|
|
118
|
-
getTitle: (entity: any) => entity.
|
|
117
|
+
getMainEntity: (entity: any) => entity.doc,
|
|
118
|
+
getTitle: (entity: any) => entity.doc.category,
|
|
119
119
|
getTags: (entity: any) => [entity.id],
|
|
120
120
|
},
|
|
121
121
|
[BusinessEntityIds.DebtorsDossier]: {
|