@bisondesk/core-sdk 1.0.651 → 1.0.652
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/leasing.d.ts +1 -1
- package/lib/apis/leasing.d.ts.map +1 -1
- package/lib/apis/leasing.js +3 -2
- package/lib/apis/leasing.js.map +1 -1
- package/lib/types/quotes.d.ts +1 -0
- package/lib/types/quotes.d.ts.map +1 -1
- package/lib/types/quotes.js.map +1 -1
- package/lib/types/reports-arrivals.d.ts +67 -0
- package/lib/types/reports-arrivals.d.ts.map +1 -0
- package/lib/types/reports-arrivals.js +4 -0
- package/lib/types/reports-arrivals.js.map +1 -0
- package/lib/types/reports-sales.d.ts +7 -0
- package/lib/types/reports-sales.d.ts.map +1 -1
- package/lib/types/reports-sales.js.map +1 -1
- package/lib/types/templates.d.ts +22 -0
- package/lib/types/templates.d.ts.map +1 -1
- package/lib/types/templates.js.map +1 -1
- package/lib/types/tenants.d.ts +1 -1
- package/lib/types/tenants.d.ts.map +1 -1
- package/lib/types/tenants.js +1 -1
- package/lib/types/tenants.js.map +1 -1
- package/lib/types/transports.d.ts +5 -1
- package/lib/types/transports.d.ts.map +1 -1
- package/lib/types/transports.js +6 -0
- package/lib/types/transports.js.map +1 -1
- package/lib/utils/leasing.d.ts +1 -0
- package/lib/utils/leasing.d.ts.map +1 -1
- package/lib/utils/leasing.js +7 -1
- package/lib/utils/leasing.js.map +1 -1
- package/lib/utils/leasing.test.d.ts +2 -0
- package/lib/utils/leasing.test.d.ts.map +1 -0
- package/lib/utils/leasing.test.js +69 -0
- package/lib/utils/leasing.test.js.map +1 -0
- package/lib/utils/reports-arrivals.d.ts +3 -0
- package/lib/utils/reports-arrivals.d.ts.map +1 -0
- package/lib/utils/reports-arrivals.js +15 -0
- package/lib/utils/reports-arrivals.js.map +1 -0
- package/lib/utils/transports.d.ts +1 -0
- package/lib/utils/transports.d.ts.map +1 -1
- package/lib/utils/transports.js +3 -4
- package/lib/utils/transports.js.map +1 -1
- package/lib/utils/vehicles.d.ts +3 -1
- package/lib/utils/vehicles.d.ts.map +1 -1
- package/lib/utils/vehicles.js +6 -1
- package/lib/utils/vehicles.js.map +1 -1
- package/package.json +1 -1
- package/src/apis/leasing.ts +3 -1
- package/src/types/activities.js +13 -0
- package/src/types/activities.js.map +1 -0
- package/src/types/comparables.js +2 -0
- package/src/types/comparables.js.map +1 -0
- package/src/types/crm.js +58 -0
- package/src/types/crm.js.map +1 -0
- package/src/types/dashboard.js +2 -0
- package/src/types/dashboard.js.map +1 -0
- package/src/types/definitions.js +2 -0
- package/src/types/definitions.js.map +1 -0
- package/src/types/fields.js +2 -0
- package/src/types/fields.js.map +1 -0
- package/src/types/insights.js +2 -0
- package/src/types/insights.js.map +1 -0
- package/src/types/interests.js +6 -0
- package/src/types/interests.js.map +1 -0
- package/src/types/internal-events.js +18 -0
- package/src/types/internal-events.js.map +1 -0
- package/src/types/internet-opportunities.js +2 -0
- package/src/types/internet-opportunities.js.map +1 -0
- package/src/types/internet-vehicles.js +2 -0
- package/src/types/internet-vehicles.js.map +1 -0
- package/src/types/leasing-administration.js +2 -0
- package/src/types/leasing-administration.js.map +1 -0
- package/src/types/leasing-debtors.js +2 -0
- package/src/types/leasing-debtors.js.map +1 -0
- package/src/types/leasing-search.js +2 -0
- package/src/types/leasing-search.js.map +1 -0
- package/src/types/leasing-settings.js +7 -0
- package/src/types/leasing-settings.js.map +1 -0
- package/src/types/leasing.js +38 -0
- package/src/types/leasing.js.map +1 -0
- package/src/types/marketing.js +35 -0
- package/src/types/marketing.js.map +1 -0
- package/src/types/offers.js +56 -0
- package/src/types/opportunities.js +107 -0
- package/src/types/opportunities.js.map +1 -0
- package/src/types/payments.js +7 -0
- package/src/types/picklists.js +2 -0
- package/src/types/picklists.js.map +1 -0
- package/src/types/quotes.js +42 -0
- package/src/types/quotes.ts +1 -0
- package/src/types/recently-viewed.js +2 -0
- package/src/types/recently-viewed.js.map +1 -0
- package/src/types/reports-arrivals.ts +95 -0
- package/src/types/reports-sales.ts +13 -0
- package/src/types/reservations.js +5 -0
- package/src/types/reservations.js.map +1 -0
- package/src/types/roi-ratings.js +5 -0
- package/src/types/roi-ratings.js.map +1 -0
- package/src/types/saved-filters.js +9 -0
- package/src/types/saved-filters.js.map +1 -0
- package/src/types/search.js +2 -0
- package/src/types/search.js.map +1 -0
- package/src/types/settings.js +2 -0
- package/src/types/settings.js.map +1 -0
- package/src/types/templates.js +2 -0
- package/src/types/templates.js.map +1 -0
- package/src/types/templates.ts +27 -0
- package/src/types/tenants.js +21 -0
- package/src/types/tenants.js.map +1 -0
- package/src/types/tenants.ts +1 -1
- package/src/types/transports.ts +11 -1
- package/src/types/user-performance.js +7 -0
- package/src/types/user-performance.js.map +1 -0
- package/src/types/utils.js +2 -0
- package/src/types/validation.js +2 -0
- package/src/types/validation.js.map +1 -0
- package/src/types/vehicle-sales.js +6 -0
- package/src/types/vehicle-sales.js.map +1 -0
- package/src/types/vehicles.js +98 -0
- package/src/types/vehicles.js.map +1 -0
- package/src/utils/leasing.js +6 -0
- package/src/utils/leasing.js.map +1 -0
- package/src/utils/leasing.test.ts +79 -0
- package/src/utils/leasing.ts +22 -1
- package/src/utils/opportunities.js +48 -0
- package/src/utils/opportunities.js.map +1 -0
- package/src/utils/reports-arrivals.ts +19 -0
- package/src/utils/transports.ts +13 -7
- package/src/utils/vehicles.ts +10 -0
- package/tsconfig.tsbuildinfo +1 -1
package/lib/apis/leasing.d.ts
CHANGED
|
@@ -19,7 +19,7 @@ export declare const getLeasingContractDebtInfo: (tenantId: string, contractId:
|
|
|
19
19
|
export declare const searchLeasingContracts: (tenantId: string, request: SearchRequest) => Promise<PaginatedList<SearchLeasingContract, ReferenceData> | undefined>;
|
|
20
20
|
export declare const findLeasingContracts: (tenantId: string, clientId: string, vehicleId: string) => Promise<LeasingContract[]>;
|
|
21
21
|
export declare const upsertLeasingContract: (tenantId: string, contract: NewLeasingContract | LeasingContract) => Promise<LeasingContract>;
|
|
22
|
-
export declare const getLeasingAmortizations: (tenantId: string, contractId: string) => Promise<AmortizationTable | undefined>;
|
|
22
|
+
export declare const getLeasingAmortizations: (tenantId: string, contractId: string, asOfDate?: string) => Promise<AmortizationTable | undefined>;
|
|
23
23
|
export declare const addAmortizationDocs: (tenantId: string, contractId: string, docs: AmortizationDocs) => Promise<AmortizationDocs>;
|
|
24
24
|
export declare const listAmortizationDocsByContract: (tenantId: string, contractId: string) => Promise<AmortizationDocs[]>;
|
|
25
25
|
export declare const printLeasingAmortization: (tenantId: string, contractId: string) => Promise<AttachmentValue | undefined>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"leasing.d.ts","sourceRoot":"/","sources":["apis/leasing.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAE9E,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,wBAAwB,EACxB,iBAAiB,EACjB,eAAe,EACf,uBAAuB,EACvB,oBAAoB,EACpB,kBAAkB,EACnB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAE9D,eAAO,MAAM,kBAAkB,aACnB,MAAM,UACR,MAAM,SACP,MAAM,SACN;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE,KAC3B,OAAO,CAAC,MAAM,EAAE,CAiBlB,CAAC;AAEF,eAAO,MAAM,oBAAoB,aACrB,MAAM,UACR,MAAM,SACP,MAAM,SACN;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE,KAC3B,OAAO,CAAC,eAAe,EAAE,CAiB3B,CAAC;AAEF,eAAO,MAAM,oBAAoB,aACrB,MAAM,gBACF,MAAM,KACnB,OAAO,CAAC,iBAAiB,GAAG,SAA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AI,KACV,OAAO,CAAC,uBAAuB,GAAG,SAAS,CAyB7C,CAAC;AAEF,eAAO,MAAM,sBAAsB,aACvB,MAAM,WACP,aAAa,KACrB,OAAO,CAAC,aAAa,CAAC,qBAAqB,EAAE,aAAa,CAAC,GAAG,SAAS,CAoBzE,CAAC;AAEF,eAAO,MAAM,oBAAoB,aACrB,MAAM,YACN,MAAM,aACL,MAAM,KAChB,OAAO,CAAC,eAAe,EAAE,CAgB3B,CAAC;AAEF,eAAO,MAAM,qBAAqB,aACtB,MAAM,YACN,kBAAkB,GAAG,eAAe,KAC7C,OAAO,CAAC,eAAe,CAoBzB,CAAC;AAEF,eAAO,MAAM,uBAAuB,aACxB,MAAM,cACJ,MAAM,aACP,MAAM,KAChB,OAAO,CAAC,iBAAiB,GAAG,SAAS,CAiBvC,CAAC;AAEF,eAAO,MAAM,mBAAmB,aACpB,MAAM,cACJ,MAAM,QACZ,gBAAgB,KACrB,OAAO,CAAC,gBAAgB,CAoB1B,CAAC;AAEF,eAAO,MAAM,8BAA8B,aAC/B,MAAM,cACJ,MAAM,KACjB,OAAO,CAAC,gBAAgB,EAAE,CAgB5B,CAAC;AAEF,eAAO,MAAM,wBAAwB,aACzB,MAAM,cACJ,MAAM,KACjB,OAAO,CAAC,eAAe,GAAG,SAAS,CAgBrC,CAAC;AAEF,eAAO,MAAM,2BAA2B,aAC5B,MAAM,cACJ,MAAM,KACjB,OAAO,CAAC,wBAAwB,EAAE,GAAG,SAAS,CAgBhD,CAAC;AAIF,eAAO,MAAM,sBAAsB,aACvB,MAAM,cACJ,MAAM,KACjB,OAAO,CAAC,IAAI,CAmBd,CAAC"}
|
package/lib/apis/leasing.js
CHANGED
|
@@ -189,9 +189,10 @@ export const upsertLeasingContract = async (tenantId, contract) => {
|
|
|
189
189
|
const body = await response.text();
|
|
190
190
|
throw new XError(response.statusText, { method, url, tenantId, contract, body });
|
|
191
191
|
};
|
|
192
|
-
export const getLeasingAmortizations = async (tenantId, contractId) => {
|
|
192
|
+
export const getLeasingAmortizations = async (tenantId, contractId, asOfDate) => {
|
|
193
193
|
const auth = await getAdminAuth();
|
|
194
|
-
const
|
|
194
|
+
const query = asOfDate != null ? `?asOfDate=${encodeURIComponent(asOfDate)}` : '';
|
|
195
|
+
const url = `${process.env.CORE_API_ORIGIN}/api/leasing/contracts/${contractId}/amortization${query}`;
|
|
195
196
|
const response = await fetch(url, {
|
|
196
197
|
headers: {
|
|
197
198
|
Authorization: auth,
|
package/lib/apis/leasing.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"leasing.js","sourceRoot":"/","sources":["apis/leasing.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,YAAY,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAErF,OAAO,KAAmB,MAAM,YAAY,CAAC;AAe7C,MAAM,CAAC,MAAM,kBAAkB,GAAG,KAAK,EACrC,QAAgB,EAChB,MAAc,EACd,KAAa,EACb,IAA4B,EACT,EAAE;IACrB,MAAM,IAAI,GAAG,MAAM,YAAY,EAAE,CAAC;IAClC,MAAM,GAAG,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,eAAe,yCAAyC,MAAM,UAAU,KAAK,EAAE,CAAC;IAC3G,MAAM,QAAQ,GAAa,MAAM,KAAK,CAAC,GAAG,EAAE;QAC1C,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,CAAC,CAAC;IAEH,IAAI,QAAQ,CAAC,EAAE,EAAE,CAAC;QAChB,OAAO,QAAQ,CAAC,MAAM,KAAK,GAAG,CAAC,CAAC,CAAE,QAA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CAAC,GAAG,EAAE;QAC1C,MAAM,EAAE,MAAM;QACd,OAAO,EAAE;YACP,cAAc,EAAE,kBAAkB;YAClC,aAAa,EAAE,IAAI;YACnB,CAAC,sBAAsB,CAAC,EAAE,QAAQ;SACnC;QACD,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,QAAQ,EAAE,CAAC;KACnC,CAAC,CAAC;IAEH,IAAI,QAAQ,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC;QAC5B,OAAO;IACT,CAAC;IAED,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;IACnC,MAAM,IAAI,MAAM,CAAC,QAAQ,CAAC,UAAU,EAAE,EAAE,GAAG,EAAE,QAAQ,EAAE,UAAU,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 { cleanHeaders, fetchJson, getAdminAuth } from '@bisondesk/commons-sdk/fetch';\nimport { AttachmentValue, PaginatedList } from '@bisondesk/commons-sdk/types';\nimport fetch, { Response } from 'node-fetch';\nimport {\n AmortizationDocs,\n AmortizationTable,\n DocumentAmortizationData,\n LeasingConditions,\n LeasingContract,\n LeasingContractDebtInfo,\n NewLeasingConditions,\n NewLeasingContract,\n} from '../types/leasing.js';\nimport { SearchLeasingContract } from '../types/leasing-search.js';\nimport { SearchRequest } from '../types/search.js';\nimport { DataRecord, ReferenceData } from '../types/utils.js';\n\nexport const listLeasingClients = async (\n tenantId: string,\n offset: number,\n limit: number,\n opts?: { serviceId: string },\n): Promise<string[]> => {\n const auth = await getAdminAuth();\n const url = `${process.env.CORE_API_ORIGIN}/api/leasing/contracts/clients?offset=${offset}&limit=${limit}`;\n const response: Response = await fetch(url, {\n headers: cleanHeaders({\n Authorization: auth,\n [TENANT_ID_ADMIN_HEADER]: tenantId,\n [SERVICE_ID_ADMIN_HEADER]: opts?.serviceId,\n }),\n });\n\n if (response.ok) {\n return response.status === 200 ? (response.json() as any) : [];\n }\n\n const body = await response.text();\n throw new XError(response.statusText, { url, tenantId, body, offset, limit });\n};\n\nexport const listLeasingContracts = async (\n tenantId: string,\n offset: number,\n limit: number,\n opts?: { serviceId: string },\n): Promise<LeasingContract[]> => {\n const auth = await getAdminAuth();\n const url = `${process.env.CORE_API_ORIGIN}/api/leasing/contracts?offset=${offset}&limit=${limit}`;\n const response: Response = await fetch(url, {\n headers: cleanHeaders({\n Authorization: auth,\n [TENANT_ID_ADMIN_HEADER]: tenantId,\n [SERVICE_ID_ADMIN_HEADER]: opts?.serviceId,\n }),\n });\n\n if (response.ok) {\n return response.status === 200 ? (response.json() as any) : [];\n }\n\n const body = await response.text();\n throw new XError(response.statusText, { url, tenantId, body, offset, limit });\n};\n\nexport const getLeasingConditions = async (\n tenantId: string,\n conditionsId: string,\n): Promise<LeasingConditions | undefined> => {\n const auth = await getAdminAuth();\n const url = `${process.env.CORE_API_ORIGIN}/api/leasing/conditions/${conditionsId}`;\n const response: Response = await fetch(url, {\n headers: {\n Authorization: auth,\n [TENANT_ID_ADMIN_HEADER]: tenantId,\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, { url, tenantId, conditionsId, body });\n};\n\nexport const createLeasingConditions = async (\n tenantId: string,\n conditions: NewLeasingConditions,\n): Promise<LeasingConditions> => {\n const auth = await getAdminAuth();\n const url = `${process.env.CORE_API_ORIGIN}/api/leasing/conditions`;\n const method = 'POST';\n const response: Response = await fetch(url, {\n method,\n headers: {\n 'Content-Type': 'application/json',\n Authorization: auth,\n [TENANT_ID_ADMIN_HEADER]: tenantId,\n },\n body: JSON.stringify(conditions),\n });\n\n if (response.status === 200) {\n return response.json() as any;\n }\n\n const body = await response.text();\n throw new XError(response.statusText, { method, url, tenantId, conditions, body });\n};\n\nexport const getLeasingContractByStockNumber = async (\n tenantId: string,\n stockNumber: string,\n): Promise<LeasingContract | undefined> => {\n const auth = await getAdminAuth();\n const url = `${process.env.CORE_API_ORIGIN}/api/leasing/contracts/stock-number/${stockNumber}`;\n return fetchJson(url, {\n headers: {\n Authorization: auth,\n [TENANT_ID_ADMIN_HEADER]: tenantId,\n },\n });\n};\n\nexport const getLeasingContractByVehicleId = async (\n tenantId: string,\n vehicleId: string,\n): Promise<LeasingContract | undefined> => {\n const auth = await getAdminAuth();\n const url = `${process.env.CORE_API_ORIGIN}/api/leasing/contracts/vehicle-id/${vehicleId}`;\n return fetchJson(url, {\n headers: {\n Authorization: auth,\n [TENANT_ID_ADMIN_HEADER]: tenantId,\n },\n });\n};\n\nexport const getLeasingContractByNumber = async (\n tenantId: string,\n contractNumber: string,\n): Promise<LeasingContract | undefined> => {\n const auth = await getAdminAuth();\n const url = `${process.env.CORE_API_ORIGIN}/api/leasing/contracts/number/${contractNumber}`;\n const response: Response = await fetch(url, {\n headers: {\n Authorization: auth,\n [TENANT_ID_ADMIN_HEADER]: tenantId,\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, { url, tenantId, contractNumber, body });\n};\n\nexport const getLeasingContract = async (\n tenantId: string,\n contractId: string,\n): Promise<DataRecord<LeasingContract> | undefined> => {\n const auth = await getAdminAuth();\n const url = `${process.env.CORE_API_ORIGIN}/api/leasing/contracts/${contractId}`;\n const response: Response = await fetch(url, {\n headers: {\n Authorization: auth,\n [TENANT_ID_ADMIN_HEADER]: tenantId,\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, { url, tenantId, contractId, body });\n};\n\nexport const getLeasingContractDebtInfo = async (\n tenantId: string,\n contractId: string,\n date?: Date,\n): Promise<LeasingContractDebtInfo | undefined> => {\n const auth = await getAdminAuth();\n\n const url = new URL(\n `/api/leasing/contracts/${contractId}/debt-info`,\n process.env.CORE_API_ORIGIN,\n );\n\n if (date != null) {\n url.searchParams.append('date', date.toISOString());\n }\n\n const response: Response = await fetch(url, {\n headers: {\n Authorization: auth,\n [TENANT_ID_ADMIN_HEADER]: tenantId,\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, { url, tenantId, contractId, body });\n};\n\nexport const searchLeasingContracts = async (\n tenantId: string,\n request: SearchRequest,\n): Promise<PaginatedList<SearchLeasingContract, ReferenceData> | undefined> => {\n const auth = await getAdminAuth();\n const url = `${process.env.CORE_API_ORIGIN}/api/leasing/contracts/search/results`;\n const method = 'POST';\n const response: Response = await fetch(url, {\n method,\n headers: {\n 'Content-Type': 'application/json',\n Authorization: auth,\n [TENANT_ID_ADMIN_HEADER]: tenantId,\n },\n body: JSON.stringify(request),\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, { method, url, tenantId, body });\n};\n\nexport const findLeasingContracts = async (\n tenantId: string,\n clientId: string,\n vehicleId: string,\n): Promise<LeasingContract[]> => {\n const auth = await getAdminAuth();\n const url = `${process.env.CORE_API_ORIGIN}/api/leasing/contracts/find?clientId=${clientId}&vehicleId=${vehicleId}`;\n const response: Response = await fetch(url, {\n headers: {\n Authorization: auth,\n [TENANT_ID_ADMIN_HEADER]: tenantId,\n },\n });\n\n if (response.status === 200) {\n return response.json() as any;\n }\n\n const body = await response.text();\n throw new XError(response.statusText, { url, tenantId, clientId, vehicleId, body });\n};\n\nexport const upsertLeasingContract = async (\n tenantId: string,\n contract: NewLeasingContract | LeasingContract,\n): Promise<LeasingContract> => {\n const auth = await getAdminAuth();\n const url = `${process.env.CORE_API_ORIGIN}/api/leasing/contracts`;\n const method = 'POST';\n const response: Response = await fetch(url, {\n method,\n headers: {\n 'Content-Type': 'application/json',\n Authorization: auth,\n [TENANT_ID_ADMIN_HEADER]: tenantId,\n },\n body: JSON.stringify(contract),\n });\n\n if (response.status === 200) {\n return response.json() as any;\n }\n\n const body = await response.text();\n throw new XError(response.statusText, { method, url, tenantId, contract, body });\n};\n\nexport const getLeasingAmortizations = async (\n tenantId: string,\n contractId: string,\n): Promise<AmortizationTable | undefined> => {\n const auth = await getAdminAuth();\n const url = `${process.env.CORE_API_ORIGIN}/api/leasing/contracts/${contractId}/amortization`;\n const response: Response = await fetch(url, {\n headers: {\n Authorization: auth,\n [TENANT_ID_ADMIN_HEADER]: tenantId,\n },\n });\n\n if (response.status === 200) {\n return response.json() as any;\n }\n\n const body = await response.text();\n throw new XError(response.statusText, { url, tenantId, contractId, body });\n};\n\nexport const addAmortizationDocs = async (\n tenantId: string,\n contractId: string,\n docs: AmortizationDocs,\n): Promise<AmortizationDocs> => {\n const auth = await getAdminAuth();\n const url = `${process.env.CORE_API_ORIGIN}/api/leasing/contracts/${contractId}/amortization/add-docs`;\n const method = 'PATCH';\n const response: Response = await fetch(url, {\n method,\n headers: {\n 'Content-Type': 'application/json',\n Authorization: auth,\n [TENANT_ID_ADMIN_HEADER]: tenantId,\n },\n body: JSON.stringify(docs),\n });\n\n if (response.status === 200) {\n return response.json() as any;\n }\n\n const body = await response.text();\n throw new XError(response.statusText, { url, tenantId, docs, body });\n};\n\nexport const listAmortizationDocsByContract = async (\n tenantId: string,\n contractId: string,\n): Promise<AmortizationDocs[]> => {\n const auth = await getAdminAuth();\n const url = `${process.env.CORE_API_ORIGIN}/api/leasing/contracts/${contractId}/amortization/docs`;\n const response: Response = await fetch(url, {\n headers: {\n Authorization: auth,\n [TENANT_ID_ADMIN_HEADER]: tenantId,\n },\n });\n\n if (response.status === 200) {\n return response.json() as any as any;\n }\n\n const body = await response.text();\n throw new XError(response.statusText, { url, tenantId, contractId, body });\n};\n\nexport const printLeasingAmortization = async (\n tenantId: string,\n contractId: string,\n): Promise<AttachmentValue | undefined> => {\n const auth = await getAdminAuth();\n const url = `${process.env.CORE_API_ORIGIN}/api/leasing/contracts/${contractId}/amortization/print`;\n const response: Response = await fetch(url, {\n headers: {\n Authorization: auth,\n [TENANT_ID_ADMIN_HEADER]: tenantId,\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, { url, tenantId, contractId, body });\n};\n\nexport const getDocumentAmortizationData = async (\n tenantId: string,\n documentId: string,\n): Promise<DocumentAmortizationData[] | undefined> => {\n const auth = await getAdminAuth();\n const url = `${process.env.CORE_API_ORIGIN}/api/documents/finance/${documentId}/leasing`;\n const response: Response = await fetch(url, {\n headers: {\n Authorization: auth,\n [TENANT_ID_ADMIN_HEADER]: tenantId,\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, { url, tenantId, documentId, body });\n};\n\n// Triggers a synchronous re-index of a single leasing contract into the search index. Used by\n// other services (e.g. document-drafts) when contract-derived enrichment changes.\nexport const reindexLeasingContract = async (\n tenantId: string,\n contractId: string,\n): Promise<void> => {\n const auth = await getAdminAuth();\n const url = `${process.env.CORE_API_ORIGIN}/admin/leasing/contracts/${contractId}/reindex`;\n const response: Response = await fetch(url, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n Authorization: auth,\n [TENANT_ID_ADMIN_HEADER]: tenantId,\n },\n body: JSON.stringify({ tenantId }),\n });\n\n if (response.status === 204) {\n return;\n }\n\n const body = await response.text();\n throw new XError(response.statusText, { url, tenantId, contractId, body });\n};\n"]}
|
|
1
|
+
{"version":3,"file":"leasing.js","sourceRoot":"/","sources":["apis/leasing.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,YAAY,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;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,EAAE,QAAQ,EAAE,UAAU,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 { cleanHeaders, fetchJson, getAdminAuth } from '@bisondesk/commons-sdk/fetch';\nimport { AttachmentValue, PaginatedList } from '@bisondesk/commons-sdk/types';\nimport fetch, { Response } from 'node-fetch';\nimport {\n AmortizationDocs,\n AmortizationTable,\n DocumentAmortizationData,\n LeasingConditions,\n LeasingContract,\n LeasingContractDebtInfo,\n NewLeasingConditions,\n NewLeasingContract,\n} from '../types/leasing.js';\nimport { SearchLeasingContract } from '../types/leasing-search.js';\nimport { SearchRequest } from '../types/search.js';\nimport { DataRecord, ReferenceData } from '../types/utils.js';\n\nexport const listLeasingClients = async (\n tenantId: string,\n offset: number,\n limit: number,\n opts?: { serviceId: string },\n): Promise<string[]> => {\n const auth = await getAdminAuth();\n const url = `${process.env.CORE_API_ORIGIN}/api/leasing/contracts/clients?offset=${offset}&limit=${limit}`;\n const response: Response = await fetch(url, {\n headers: cleanHeaders({\n Authorization: auth,\n [TENANT_ID_ADMIN_HEADER]: tenantId,\n [SERVICE_ID_ADMIN_HEADER]: opts?.serviceId,\n }),\n });\n\n if (response.ok) {\n return response.status === 200 ? (response.json() as any) : [];\n }\n\n const body = await response.text();\n throw new XError(response.statusText, { url, tenantId, body, offset, limit });\n};\n\nexport const listLeasingContracts = async (\n tenantId: string,\n offset: number,\n limit: number,\n opts?: { serviceId: string },\n): Promise<LeasingContract[]> => {\n const auth = await getAdminAuth();\n const url = `${process.env.CORE_API_ORIGIN}/api/leasing/contracts?offset=${offset}&limit=${limit}`;\n const response: Response = await fetch(url, {\n headers: cleanHeaders({\n Authorization: auth,\n [TENANT_ID_ADMIN_HEADER]: tenantId,\n [SERVICE_ID_ADMIN_HEADER]: opts?.serviceId,\n }),\n });\n\n if (response.ok) {\n return response.status === 200 ? (response.json() as any) : [];\n }\n\n const body = await response.text();\n throw new XError(response.statusText, { url, tenantId, body, offset, limit });\n};\n\nexport const getLeasingConditions = async (\n tenantId: string,\n conditionsId: string,\n): Promise<LeasingConditions | undefined> => {\n const auth = await getAdminAuth();\n const url = `${process.env.CORE_API_ORIGIN}/api/leasing/conditions/${conditionsId}`;\n const response: Response = await fetch(url, {\n headers: {\n Authorization: auth,\n [TENANT_ID_ADMIN_HEADER]: tenantId,\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, { url, tenantId, conditionsId, body });\n};\n\nexport const createLeasingConditions = async (\n tenantId: string,\n conditions: NewLeasingConditions,\n): Promise<LeasingConditions> => {\n const auth = await getAdminAuth();\n const url = `${process.env.CORE_API_ORIGIN}/api/leasing/conditions`;\n const method = 'POST';\n const response: Response = await fetch(url, {\n method,\n headers: {\n 'Content-Type': 'application/json',\n Authorization: auth,\n [TENANT_ID_ADMIN_HEADER]: tenantId,\n },\n body: JSON.stringify(conditions),\n });\n\n if (response.status === 200) {\n return response.json() as any;\n }\n\n const body = await response.text();\n throw new XError(response.statusText, { method, url, tenantId, conditions, body });\n};\n\nexport const getLeasingContractByStockNumber = async (\n tenantId: string,\n stockNumber: string,\n): Promise<LeasingContract | undefined> => {\n const auth = await getAdminAuth();\n const url = `${process.env.CORE_API_ORIGIN}/api/leasing/contracts/stock-number/${stockNumber}`;\n return fetchJson(url, {\n headers: {\n Authorization: auth,\n [TENANT_ID_ADMIN_HEADER]: tenantId,\n },\n });\n};\n\nexport const getLeasingContractByVehicleId = async (\n tenantId: string,\n vehicleId: string,\n): Promise<LeasingContract | undefined> => {\n const auth = await getAdminAuth();\n const url = `${process.env.CORE_API_ORIGIN}/api/leasing/contracts/vehicle-id/${vehicleId}`;\n return fetchJson(url, {\n headers: {\n Authorization: auth,\n [TENANT_ID_ADMIN_HEADER]: tenantId,\n },\n });\n};\n\nexport const getLeasingContractByNumber = async (\n tenantId: string,\n contractNumber: string,\n): Promise<LeasingContract | undefined> => {\n const auth = await getAdminAuth();\n const url = `${process.env.CORE_API_ORIGIN}/api/leasing/contracts/number/${contractNumber}`;\n const response: Response = await fetch(url, {\n headers: {\n Authorization: auth,\n [TENANT_ID_ADMIN_HEADER]: tenantId,\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, { url, tenantId, contractNumber, body });\n};\n\nexport const getLeasingContract = async (\n tenantId: string,\n contractId: string,\n): Promise<DataRecord<LeasingContract> | undefined> => {\n const auth = await getAdminAuth();\n const url = `${process.env.CORE_API_ORIGIN}/api/leasing/contracts/${contractId}`;\n const response: Response = await fetch(url, {\n headers: {\n Authorization: auth,\n [TENANT_ID_ADMIN_HEADER]: tenantId,\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, { url, tenantId, contractId, body });\n};\n\nexport const getLeasingContractDebtInfo = async (\n tenantId: string,\n contractId: string,\n date?: Date,\n): Promise<LeasingContractDebtInfo | undefined> => {\n const auth = await getAdminAuth();\n\n const url = new URL(\n `/api/leasing/contracts/${contractId}/debt-info`,\n process.env.CORE_API_ORIGIN,\n );\n\n if (date != null) {\n url.searchParams.append('date', date.toISOString());\n }\n\n const response: Response = await fetch(url, {\n headers: {\n Authorization: auth,\n [TENANT_ID_ADMIN_HEADER]: tenantId,\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, { url, tenantId, contractId, body });\n};\n\nexport const searchLeasingContracts = async (\n tenantId: string,\n request: SearchRequest,\n): Promise<PaginatedList<SearchLeasingContract, ReferenceData> | undefined> => {\n const auth = await getAdminAuth();\n const url = `${process.env.CORE_API_ORIGIN}/api/leasing/contracts/search/results`;\n const method = 'POST';\n const response: Response = await fetch(url, {\n method,\n headers: {\n 'Content-Type': 'application/json',\n Authorization: auth,\n [TENANT_ID_ADMIN_HEADER]: tenantId,\n },\n body: JSON.stringify(request),\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, { method, url, tenantId, body });\n};\n\nexport const findLeasingContracts = async (\n tenantId: string,\n clientId: string,\n vehicleId: string,\n): Promise<LeasingContract[]> => {\n const auth = await getAdminAuth();\n const url = `${process.env.CORE_API_ORIGIN}/api/leasing/contracts/find?clientId=${clientId}&vehicleId=${vehicleId}`;\n const response: Response = await fetch(url, {\n headers: {\n Authorization: auth,\n [TENANT_ID_ADMIN_HEADER]: tenantId,\n },\n });\n\n if (response.status === 200) {\n return response.json() as any;\n }\n\n const body = await response.text();\n throw new XError(response.statusText, { url, tenantId, clientId, vehicleId, body });\n};\n\nexport const upsertLeasingContract = async (\n tenantId: string,\n contract: NewLeasingContract | LeasingContract,\n): Promise<LeasingContract> => {\n const auth = await getAdminAuth();\n const url = `${process.env.CORE_API_ORIGIN}/api/leasing/contracts`;\n const method = 'POST';\n const response: Response = await fetch(url, {\n method,\n headers: {\n 'Content-Type': 'application/json',\n Authorization: auth,\n [TENANT_ID_ADMIN_HEADER]: tenantId,\n },\n body: JSON.stringify(contract),\n });\n\n if (response.status === 200) {\n return response.json() as any;\n }\n\n const body = await response.text();\n throw new XError(response.statusText, { method, url, tenantId, contract, body });\n};\n\nexport const getLeasingAmortizations = async (\n tenantId: string,\n contractId: string,\n asOfDate?: string,\n): Promise<AmortizationTable | undefined> => {\n const auth = await getAdminAuth();\n const query = asOfDate != null ? `?asOfDate=${encodeURIComponent(asOfDate)}` : '';\n const url = `${process.env.CORE_API_ORIGIN}/api/leasing/contracts/${contractId}/amortization${query}`;\n const response: Response = await fetch(url, {\n headers: {\n Authorization: auth,\n [TENANT_ID_ADMIN_HEADER]: tenantId,\n },\n });\n\n if (response.status === 200) {\n return response.json() as any;\n }\n\n const body = await response.text();\n throw new XError(response.statusText, { url, tenantId, contractId, body });\n};\n\nexport const addAmortizationDocs = async (\n tenantId: string,\n contractId: string,\n docs: AmortizationDocs,\n): Promise<AmortizationDocs> => {\n const auth = await getAdminAuth();\n const url = `${process.env.CORE_API_ORIGIN}/api/leasing/contracts/${contractId}/amortization/add-docs`;\n const method = 'PATCH';\n const response: Response = await fetch(url, {\n method,\n headers: {\n 'Content-Type': 'application/json',\n Authorization: auth,\n [TENANT_ID_ADMIN_HEADER]: tenantId,\n },\n body: JSON.stringify(docs),\n });\n\n if (response.status === 200) {\n return response.json() as any;\n }\n\n const body = await response.text();\n throw new XError(response.statusText, { url, tenantId, docs, body });\n};\n\nexport const listAmortizationDocsByContract = async (\n tenantId: string,\n contractId: string,\n): Promise<AmortizationDocs[]> => {\n const auth = await getAdminAuth();\n const url = `${process.env.CORE_API_ORIGIN}/api/leasing/contracts/${contractId}/amortization/docs`;\n const response: Response = await fetch(url, {\n headers: {\n Authorization: auth,\n [TENANT_ID_ADMIN_HEADER]: tenantId,\n },\n });\n\n if (response.status === 200) {\n return response.json() as any as any;\n }\n\n const body = await response.text();\n throw new XError(response.statusText, { url, tenantId, contractId, body });\n};\n\nexport const printLeasingAmortization = async (\n tenantId: string,\n contractId: string,\n): Promise<AttachmentValue | undefined> => {\n const auth = await getAdminAuth();\n const url = `${process.env.CORE_API_ORIGIN}/api/leasing/contracts/${contractId}/amortization/print`;\n const response: Response = await fetch(url, {\n headers: {\n Authorization: auth,\n [TENANT_ID_ADMIN_HEADER]: tenantId,\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, { url, tenantId, contractId, body });\n};\n\nexport const getDocumentAmortizationData = async (\n tenantId: string,\n documentId: string,\n): Promise<DocumentAmortizationData[] | undefined> => {\n const auth = await getAdminAuth();\n const url = `${process.env.CORE_API_ORIGIN}/api/documents/finance/${documentId}/leasing`;\n const response: Response = await fetch(url, {\n headers: {\n Authorization: auth,\n [TENANT_ID_ADMIN_HEADER]: tenantId,\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, { url, tenantId, documentId, body });\n};\n\n// Triggers a synchronous re-index of a single leasing contract into the search index. Used by\n// other services (e.g. document-drafts) when contract-derived enrichment changes.\nexport const reindexLeasingContract = async (\n tenantId: string,\n contractId: string,\n): Promise<void> => {\n const auth = await getAdminAuth();\n const url = `${process.env.CORE_API_ORIGIN}/admin/leasing/contracts/${contractId}/reindex`;\n const response: Response = await fetch(url, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n Authorization: auth,\n [TENANT_ID_ADMIN_HEADER]: tenantId,\n },\n body: JSON.stringify({ tenantId }),\n });\n\n if (response.status === 204) {\n return;\n }\n\n const body = await response.text();\n throw new XError(response.statusText, { url, tenantId, contractId, body });\n};\n"]}
|
package/lib/types/quotes.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"quotes.d.ts","sourceRoot":"/","sources":["types/quotes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC9E,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EACL,4BAA4B,EAC5B,0BAA0B,EAC1B,2BAA2B,EAC3B,sBAAsB,EACtB,oBAAoB,EACrB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAEjD,oBAAY,YAAY;IACtB,MAAM,WAAW;IACjB,QAAQ,aAAa;IACrB,aAAa,kBAAkB;IAC/B,MAAM,WAAW;CAClB;AAED,oBAAY,WAAW;IACrB,OAAO,YAAY;IACnB,SAAS,cAAc;IACvB,WAAW,gBAAgB;IAC3B,Q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AC9B,WAAW,EAAE,qBAAqB,CAAC;CACpC,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,eAAe,CAAC;IACtB,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,iBAAiB,GAAG;IAC/C,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IACjC,cAAc,EAAE,OAAO,CAAC;CACzB,CAAC"}
|
package/lib/types/quotes.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"quotes.js","sourceRoot":"/","sources":["types/quotes.ts"],"names":[],"mappings":"AAYA,MAAM,CAAN,IAAY,YAKX;AALD,WAAY,YAAY;IACtB,iCAAiB,CAAA;IACjB,qCAAqB,CAAA;IACrB,+CAA+B,CAAA;IAC/B,iCAAiB,CAAA;AACnB,CAAC,EALW,YAAY,KAAZ,YAAY,QAKvB;AAED,MAAM,CAAN,IAAY,WASX;AATD,WAAY,WAAW;IACrB,kCAAmB,CAAA;IACnB,sCAAuB,CAAA;IACvB,0CAA2B,CAAA;IAC3B,oCAAqB,CAAA;IACrB,oCAAqB,CAAA;IACrB,sCAAuB,CAAA;IACvB,mDAAoC,CAAA;IACpC,mDAAoC,CAAA;AACtC,CAAC,EATW,WAAW,KAAX,WAAW,QAStB;AAED,MAAM,CAAN,IAAY,iBAIX;AAJD,WAAY,iBAAiB;IAC3B,sCAAiB,CAAA;IACjB,wCAAmB,CAAA;IACnB,kCAAa,CAAA;AACf,CAAC,EAJW,iBAAiB,KAAjB,iBAAiB,QAI5B;AACD,MAAM,CAAN,IAAY,aAKX;AALD,WAAY,aAAa;IACvB,mCAAkB,CAAA;IAClB,oCAAmB,CAAA;IACnB,8BAAa,CAAA;IACb,8CAA6B,CAAA;AAC/B,CAAC,EALW,aAAa,KAAb,aAAa,QAKxB;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;AAED,MAAM,CAAN,IAAY,iBAGX;AAHD,WAAY,iBAAiB;IAC3B,oDAA+B,CAAA;IAC/B,0DAAqC,CAAA;AACvC,CAAC,EAHW,iBAAiB,KAAjB,iBAAiB,QAG5B","sourcesContent":["import { AttachmentValue, LocationValue } from '@bisondesk/commons-sdk/types';\nimport { OpportunityType } from '../constants.js';\nimport {\n CustomLeasingQuoteExtraInput,\n CustomSalesQuoteExtraInput,\n LeasingDeliveryPackageInput,\n LeasingQuoteExtraInput,\n SalesQuoteExtraInput,\n} from './leasing-settings.js';\nimport { MatchingRuleValue } from './roi-ratings.js';\nimport { PricePercentageMode } from './utils.js';\n\nexport enum QuoteActions {\n ACCEPT = 'accept',\n VALIDATE = 'validate',\n DONWLOAD_PDFS = 'download-pdfs',\n CANCEL = 'cancel',\n}\n\nexport enum QuoteStatus {\n CREATED = 'created',\n VALIDATED = 'validated',\n INVALIDATED = 'invalidated',\n ACCEPTED = 'accepted',\n REJECTED = 'rejected',\n CANCELLED = 'cancelled',\n MANAGER_REJECTED = 'managerRejected',\n MANAGER_ACCEPTED = 'managerAccepted',\n}\n\nexport enum QuoteMetricsScore {\n DANGER = 'danger',\n NEUTRAL = 'neutral',\n GOOD = 'good',\n}\nexport enum DeliveryTypes {\n PICK_UP = 'pickUp',\n ADDRESS = 'address',\n PORT = 'port',\n PORT_AND_SHIP = 'portAndShip',\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\nexport enum SelfFinancingType {\n OWN_FINANCING = 'own_financing',\n ALREADY_FINANCED = 'already_financed',\n}\n\ntype BaseQuoteCalculatorInput = {\n branchId: string;\n branchCountry: string;\n customerCountry: string;\n customerVatNumber?: string;\n currency: string;\n alternativeCurrency?: string;\n exchangeRate?: string;\n vehicle: {\n id: string;\n category: string;\n bodywork?: string;\n agreedPriceExclVat: string;\n technicalNotes?: string;\n vatRate: string;\n };\n\n allRisksCost?: string;\n};\n\n// Sent by the Frontend to bootstrap the calculator\nexport type LeasingCalculatorDefaultInput = Omit<BaseQuoteCalculatorInput, 'vehicle'> & {\n vehicle: Omit<BaseQuoteCalculatorInput['vehicle'], 'vatRate'>;\n deliveryPackage?: LeasingQuoteExtraInput;\n settingsId: string;\n};\n\nexport type LeasingCalculatorInput = BaseQuoteCalculatorInput & {\n localLicensePlate: boolean;\n externalDelivery: boolean;\n settingsId: string;\n isRefinancingDebt?: boolean; // if true, the insurance amounts might not be the same as the leasing amount + and other costs like track and trace\n vehicle: BaseQuoteCalculatorInput['vehicle'] & {\n purchasePriceExclVat: string;\n agreedPrice: string;\n purchasePrice: string;\n };\n leasing: {\n deposit: string;\n depositMode: PricePercentageMode;\n depositPercentage: string;\n residual: string;\n residualMode: PricePercentageMode;\n residualPercentage: string;\n startupFee: string;\n startupFeeMode: PricePercentageMode;\n startupFeePercentage: string;\n /** Returnable security deposit (dépôt de garantie): VAT-free, never financed. Not the advance (`deposit`). */\n guaranteeDeposit?: string;\n interestRate: string;\n duration: number;\n contractStartDate: string;\n };\n bank: {\n interestRate: string;\n deposit: string;\n depositMode: PricePercentageMode;\n depositPercentage: string;\n residual: string;\n residualMode: PricePercentageMode;\n residualPercentage: string;\n duration: number;\n salesPrice: string;\n internalDealBranchId?: string;\n } & (\n | { selfFinancing: true; selfFinancingType?: SelfFinancingType; financing?: undefined }\n | {\n selfFinancing: false;\n selfFinancingType?: undefined;\n financing?: { bankAccountOrganizationId: string; amount: string };\n }\n );\n taxes: {\n yearlyRoadTax: boolean;\n yearlyRoadTaxCustomAmount: string;\n oneTimeRoadTax: boolean;\n margin: string; //Non Editable, copies the value insurance > margin\n };\n insurance: {\n margin: string;\n civilLiabilities: boolean;\n allRisks: boolean;\n specialTechnicalInsurance: boolean;\n roadAssistance: boolean;\n initialFractionPercentage: string;\n insuredAmount?: string;\n };\n deliveryPackage?: LeasingDeliveryPackageInput;\n extras: LeasingQuoteExtraInput[];\n customRequests: CustomLeasingQuoteExtraInput[];\n};\n\ntype BaseDeliveryType = {\n agreedPrice: string;\n spoiler?: SpoilerInfo;\n stackingVehicleNeeded?: boolean;\n detailsStacking?: string;\n};\n\nexport type PickUpDeliveryType = BaseDeliveryType & {\n type: DeliveryTypes.PICK_UP;\n urgent: boolean;\n transportationMode?: TransportationMode;\n detailsBorderCrossing?: string;\n technicalControlNeeded: boolean;\n insuranceNeeded: boolean;\n transitPlateBelgiumNeeded: boolean;\n transitPlateAustriaNeeded: boolean;\n licensePlateNeeded: boolean;\n dateOfPickUpByCustomer?: string;\n};\n\nexport type AddressDeliveryType = BaseDeliveryType & {\n type: DeliveryTypes.ADDRESS;\n address: LocationValue;\n distanceKm: string;\n technicalControlNeeded: boolean;\n};\n\nexport type PortDeliverytype = BaseDeliveryType & {\n type: DeliveryTypes.PORT | DeliveryTypes.PORT_AND_SHIP;\n portOriginId: string;\n portDestination?: string;\n shippingCompany?: string;\n portToPortCostPrice: string;\n parkToPortCostPrice?: string;\n portToPortMargin: string;\n ets?: string;\n eta?: string;\n etd?: string;\n bookingRef?: string;\n deliveryLocation?: string;\n};\n\n// Sent by the Frontend to bootstrap the calculator\nexport type SalesCalculatorDefaultInput = Omit<BaseQuoteCalculatorInput, 'vehicle'> & {\n vehicle: Omit<BaseQuoteCalculatorInput['vehicle'], 'vatRate'>;\n extras: SalesQuoteExtraInput[];\n customRequests: CustomSalesQuoteExtraInput[];\n};\n\nexport type SalesCalculatorInput = BaseQuoteCalculatorInput & {\n vehicle: BaseQuoteCalculatorInput['vehicle'] & {\n purchasePriceExclVat: string;\n premiumPrice?: string;\n minimumPrice: string;\n internetPrice?: string;\n comissionCost: string;\n };\n delivery?: PickUpDeliveryType | AddressDeliveryType | PortDeliverytype;\n extras: SalesQuoteExtraInput[];\n customRequests: CustomSalesQuoteExtraInput[];\n financing?: {\n organizationId: string;\n };\n};\n\nexport type SalesQuoteRuleInput = {\n minimumPrice?: number;\n internetPrice?: number;\n premiumPrice?: number;\n agreedPrice: number;\n stockAge: number;\n};\n\nexport type LeasingCalculatorOutput = {\n installment: string;\n installmentPrintable: string;\n totalMonthlyAmount: string;\n monthlyTaxesInsurance: string;\n beforeDeliveryExclVat: string;\n beforeDelivery: string;\n /** Portion of beforeDelivery that is the returnable guarantee deposit (VAT-free, not financed). */\n guaranteeDeposit?: string;\n financingAmount: string;\n settingId: string;\n totalRetailAmountExclVat: string;\n totalRetailAmount: string;\n totalRetailAmountAlternativeCurrency?: string;\n totalRetailAmountExclVatAlternativeCurrency?: string;\n finalSalesPrice: string;\n roi: {\n value: string;\n target: string;\n perYear: string;\n difference: string;\n score?: QuoteMetricsScore;\n };\n cashflow: {\n deficit: string;\n balanced: boolean;\n score: QuoteMetricsScore;\n };\n profitability: {\n leasing: string;\n vehicle: string;\n total: string;\n score: QuoteMetricsScore;\n };\n taxes: {\n yearlyRetailPrice: string;\n monthlyRetailPrice: string;\n yearlyRoadTax: string;\n oneTimeRoadTax: string;\n profit: string;\n };\n insurance: {\n beforeDelivery: string;\n yearlyRetailPrice: string;\n monthlyRetailPrice: string;\n civilLiabilities: string;\n allRisks: string;\n specialTechnicalInsurance: string;\n roadAssistance: string;\n profit: string;\n };\n trackAndTrace: {\n beforeDelivery: string;\n monthlyCost: string;\n installationCost: string; // currently this cost is being included as part of monthlyCost. In future, this will be a separate cost\n deviceCost: string; // same as above\n profit: string;\n };\n costs: {\n financingAmount: string;\n finalCostPrice: string;\n monhtly: string;\n };\n};\n\nexport type SalesCalculatorOutput = {\n totalRetailAmount: string;\n totalRetailAmountExclVat: string;\n totalRetailAmountAlternativeCurrency?: string;\n totalRetailAmountExclVatAlternativeCurrency?: string;\n retailAmounts: {\n vehicle: string;\n delivery: string;\n extras: string;\n };\n vehicle: {\n purchasePrice: string; //incl vat\n agreedPrice: string; // incl vat\n };\n roi: { value: string; score?: QuoteMetricsScore };\n profit: {\n value: string;\n percentage: string;\n score: QuoteMetricsScore;\n };\n profitOverMin?: {\n // deprecated\n value: string;\n percentage: string;\n score: QuoteMetricsScore;\n };\n delivery?: {\n retailPrice?: string;\n costPrice?: string;\n cleaningNeeded: boolean;\n cleaningNeededRetailPrice: string;\n transportationToPortRetailPrice?: string;\n };\n costs: {\n finalCostPrice: string;\n extras: string;\n delivery: string;\n };\n};\n\ntype BaseQuote = {\n opportunityId: string;\n preferredLanguage: string;\n clientNotes?: string;\n publicNotes?: string;\n} & (\n | {\n type: OpportunityType.LEASING;\n calculatorInput: LeasingCalculatorInput;\n calculatorOutput: LeasingCalculatorOutput;\n rating?: MatchingRuleValue;\n }\n | {\n type: OpportunityType.SALES;\n calculatorInput: SalesCalculatorInput;\n calculatorOutput: SalesCalculatorOutput;\n rating?: MatchingRuleValue;\n }\n | {\n type: OpportunityType.NEW_TRAILER | OpportunityType.NEW_TRAILER_NEW_PRODUCTION;\n calculatorInput: SalesCalculatorInput;\n calculatorOutput: SalesCalculatorOutput;\n rating?: MatchingRuleValue;\n }\n | {\n type:\n | OpportunityType.CUSTOMMADE_CONSTRUCTION_OUTSOURCING\n | OpportunityType.CUSTOMMADE_CONSTRUCTION_INSOURCING;\n calculatorInput: SalesCalculatorInput;\n calculatorOutput: SalesCalculatorOutput;\n rating?: MatchingRuleValue;\n }\n);\n\nexport type NewQuote = BaseQuote & {\n id?: undefined;\n createdAt?: undefined;\n createdBy?: undefined;\n modifiedAt?: undefined;\n modifiedBy?: undefined;\n active: true;\n};\n\nexport type Quote = BaseQuote & {\n id: string;\n createdAt: string;\n createdBy: string;\n modifiedAt: string;\n modifiedBy: string;\n validationBy?: string;\n validationAt?: string;\n cancelledBy?: string;\n cancelledAt?: string;\n customerFeedbackAt?: string;\n customerFeedbackBy?: string;\n managerFeedbackAt?: string;\n managerFeedbackBy?: string;\n version: number;\n status: QuoteStatus;\n proformaPdf?: AttachmentValue;\n quotePdf?: AttachmentValue;\n salesAgreementPdf?: AttachmentValue;\n active: boolean;\n contactId: string;\n vehicleId: string;\n organizationId: string;\n technicalNotesUpdated: boolean;\n technicalNotesValidated: boolean;\n technicalNotesValidatedAt?: string;\n technicalNotesValidatedBy?: string;\n externalQuote?: boolean;\n};\n\nexport type QuoteUpdate = {\n status?: QuoteStatus;\n active?: boolean;\n technicalNotesValidated?: boolean;\n};\n\nexport type CalculatorLeasingIO = {\n output: LeasingCalculatorOutput;\n input: LeasingCalculatorInput;\n rating?: MatchingRuleValue;\n};\nexport type CalculatorSalesIO = {\n output: SalesCalculatorOutput;\n input: SalesCalculatorInput;\n rating?: MatchingRuleValue;\n};\nexport type CalculatorQuoteIO = CalculatorLeasingIO | CalculatorSalesIO;\n\nexport type DeliveryLocationValue = Omit<LocationValue, 'addressLine1' | 'city'> & {\n addressLine1: string;\n city: string;\n};\n\nexport type DeliveryRoutesRequest = {\n origin: DeliveryLocationValue;\n destination: DeliveryLocationValue;\n};\n\nexport type NewQuoteValidator = {\n userId: string;\n countryCode: string;\n type: OpportunityType;\n canValidateOwn?: boolean;\n};\n\nexport type QuoteValidator = NewQuoteValidator & {\n createdAt: string;\n};\n\nexport type QuoteValidatorUpdate = {\n canValidateOwn: boolean;\n};\n"]}
|
|
1
|
+
{"version":3,"file":"quotes.js","sourceRoot":"/","sources":["types/quotes.ts"],"names":[],"mappings":"AAYA,MAAM,CAAN,IAAY,YAKX;AALD,WAAY,YAAY;IACtB,iCAAiB,CAAA;IACjB,qCAAqB,CAAA;IACrB,+CAA+B,CAAA;IAC/B,iCAAiB,CAAA;AACnB,CAAC,EALW,YAAY,KAAZ,YAAY,QAKvB;AAED,MAAM,CAAN,IAAY,WASX;AATD,WAAY,WAAW;IACrB,kCAAmB,CAAA;IACnB,sCAAuB,CAAA;IACvB,0CAA2B,CAAA;IAC3B,oCAAqB,CAAA;IACrB,oCAAqB,CAAA;IACrB,sCAAuB,CAAA;IACvB,mDAAoC,CAAA;IACpC,mDAAoC,CAAA;AACtC,CAAC,EATW,WAAW,KAAX,WAAW,QAStB;AAED,MAAM,CAAN,IAAY,iBAIX;AAJD,WAAY,iBAAiB;IAC3B,sCAAiB,CAAA;IACjB,wCAAmB,CAAA;IACnB,kCAAa,CAAA;AACf,CAAC,EAJW,iBAAiB,KAAjB,iBAAiB,QAI5B;AACD,MAAM,CAAN,IAAY,aAKX;AALD,WAAY,aAAa;IACvB,mCAAkB,CAAA;IAClB,oCAAmB,CAAA;IACnB,8BAAa,CAAA;IACb,8CAA6B,CAAA;AAC/B,CAAC,EALW,aAAa,KAAb,aAAa,QAKxB;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;AAED,MAAM,CAAN,IAAY,iBAGX;AAHD,WAAY,iBAAiB;IAC3B,oDAA+B,CAAA;IAC/B,0DAAqC,CAAA;AACvC,CAAC,EAHW,iBAAiB,KAAjB,iBAAiB,QAG5B","sourcesContent":["import { AttachmentValue, LocationValue } from '@bisondesk/commons-sdk/types';\nimport { OpportunityType } from '../constants.js';\nimport {\n CustomLeasingQuoteExtraInput,\n CustomSalesQuoteExtraInput,\n LeasingDeliveryPackageInput,\n LeasingQuoteExtraInput,\n SalesQuoteExtraInput,\n} from './leasing-settings.js';\nimport { MatchingRuleValue } from './roi-ratings.js';\nimport { PricePercentageMode } from './utils.js';\n\nexport enum QuoteActions {\n ACCEPT = 'accept',\n VALIDATE = 'validate',\n DONWLOAD_PDFS = 'download-pdfs',\n CANCEL = 'cancel',\n}\n\nexport enum QuoteStatus {\n CREATED = 'created',\n VALIDATED = 'validated',\n INVALIDATED = 'invalidated',\n ACCEPTED = 'accepted',\n REJECTED = 'rejected',\n CANCELLED = 'cancelled',\n MANAGER_REJECTED = 'managerRejected',\n MANAGER_ACCEPTED = 'managerAccepted',\n}\n\nexport enum QuoteMetricsScore {\n DANGER = 'danger',\n NEUTRAL = 'neutral',\n GOOD = 'good',\n}\nexport enum DeliveryTypes {\n PICK_UP = 'pickUp',\n ADDRESS = 'address',\n PORT = 'port',\n PORT_AND_SHIP = 'portAndShip',\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\nexport enum SelfFinancingType {\n OWN_FINANCING = 'own_financing',\n ALREADY_FINANCED = 'already_financed',\n}\n\ntype BaseQuoteCalculatorInput = {\n branchId: string;\n branchCountry: string;\n customerCountry: string;\n customerVatNumber?: string;\n currency: string;\n alternativeCurrency?: string;\n exchangeRate?: string;\n vehicle: {\n id: string;\n category: string;\n bodywork?: string;\n agreedPriceExclVat: string;\n technicalNotes?: string;\n vatRate: string;\n };\n\n allRisksCost?: string;\n};\n\n// Sent by the Frontend to bootstrap the calculator\nexport type LeasingCalculatorDefaultInput = Omit<BaseQuoteCalculatorInput, 'vehicle'> & {\n vehicle: Omit<BaseQuoteCalculatorInput['vehicle'], 'vatRate'>;\n deliveryPackage?: LeasingQuoteExtraInput;\n settingsId: string;\n};\n\nexport type LeasingCalculatorInput = BaseQuoteCalculatorInput & {\n localLicensePlate: boolean;\n externalDelivery: boolean;\n settingsId: string;\n isRefinancingDebt?: boolean; // if true, the insurance amounts might not be the same as the leasing amount + and other costs like track and trace\n vehicle: BaseQuoteCalculatorInput['vehicle'] & {\n purchasePriceExclVat: string;\n agreedPrice: string;\n purchasePrice: string;\n };\n leasing: {\n deposit: string;\n depositMode: PricePercentageMode;\n depositPercentage: string;\n residual: string;\n residualMode: PricePercentageMode;\n residualPercentage: string;\n startupFee: string;\n startupFeeMode: PricePercentageMode;\n startupFeePercentage: string;\n /** Returnable security deposit (dépôt de garantie): VAT-free, never financed. Not the advance (`deposit`). */\n guaranteeDeposit?: string;\n interestRate: string;\n duration: number;\n contractStartDate: string;\n };\n bank: {\n interestRate: string;\n deposit: string;\n depositMode: PricePercentageMode;\n depositPercentage: string;\n residual: string;\n residualMode: PricePercentageMode;\n residualPercentage: string;\n duration: number;\n salesPrice: string;\n internalDealBranchId?: string;\n } & (\n | { selfFinancing: true; selfFinancingType?: SelfFinancingType; financing?: undefined }\n | {\n selfFinancing: false;\n selfFinancingType?: undefined;\n financing?: { bankAccountOrganizationId: string; amount: string };\n }\n );\n taxes: {\n yearlyRoadTax: boolean;\n yearlyRoadTaxCustomAmount: string;\n oneTimeRoadTax: boolean;\n margin: string; //Non Editable, copies the value insurance > margin\n };\n insurance: {\n margin: string;\n civilLiabilities: boolean;\n allRisks: boolean;\n specialTechnicalInsurance: boolean;\n roadAssistance: boolean;\n initialFractionPercentage: string;\n insuredAmount?: string;\n };\n deliveryPackage?: LeasingDeliveryPackageInput;\n extras: LeasingQuoteExtraInput[];\n customRequests: CustomLeasingQuoteExtraInput[];\n};\n\ntype BaseDeliveryType = {\n agreedPrice: string;\n spoiler?: SpoilerInfo;\n stackingVehicleNeeded?: boolean;\n detailsStacking?: string;\n};\n\nexport type PickUpDeliveryType = BaseDeliveryType & {\n type: DeliveryTypes.PICK_UP;\n urgent: boolean;\n transportationMode?: TransportationMode;\n detailsBorderCrossing?: string;\n technicalControlNeeded: boolean;\n insuranceNeeded: boolean;\n transitPlateBelgiumNeeded: boolean;\n transitPlateAustriaNeeded: boolean;\n licensePlateNeeded: boolean;\n dateOfPickUpByCustomer?: string;\n};\n\nexport type AddressDeliveryType = BaseDeliveryType & {\n type: DeliveryTypes.ADDRESS;\n address: LocationValue;\n distanceKm: string;\n technicalControlNeeded: boolean;\n};\n\nexport type PortDeliverytype = BaseDeliveryType & {\n type: DeliveryTypes.PORT | DeliveryTypes.PORT_AND_SHIP;\n portOriginId: string;\n portDestination?: string;\n shippingCompany?: string;\n portToPortCostPrice: string;\n parkToPortCostPrice?: string;\n portToPortMargin: string;\n ets?: string;\n eta?: string;\n etd?: string;\n shipClosingDate?: string;\n bookingRef?: string;\n deliveryLocation?: string;\n};\n\n// Sent by the Frontend to bootstrap the calculator\nexport type SalesCalculatorDefaultInput = Omit<BaseQuoteCalculatorInput, 'vehicle'> & {\n vehicle: Omit<BaseQuoteCalculatorInput['vehicle'], 'vatRate'>;\n extras: SalesQuoteExtraInput[];\n customRequests: CustomSalesQuoteExtraInput[];\n};\n\nexport type SalesCalculatorInput = BaseQuoteCalculatorInput & {\n vehicle: BaseQuoteCalculatorInput['vehicle'] & {\n purchasePriceExclVat: string;\n premiumPrice?: string;\n minimumPrice: string;\n internetPrice?: string;\n comissionCost: string;\n };\n delivery?: PickUpDeliveryType | AddressDeliveryType | PortDeliverytype;\n extras: SalesQuoteExtraInput[];\n customRequests: CustomSalesQuoteExtraInput[];\n financing?: {\n organizationId: string;\n };\n};\n\nexport type SalesQuoteRuleInput = {\n minimumPrice?: number;\n internetPrice?: number;\n premiumPrice?: number;\n agreedPrice: number;\n stockAge: number;\n};\n\nexport type LeasingCalculatorOutput = {\n installment: string;\n installmentPrintable: string;\n totalMonthlyAmount: string;\n monthlyTaxesInsurance: string;\n beforeDeliveryExclVat: string;\n beforeDelivery: string;\n /** Portion of beforeDelivery that is the returnable guarantee deposit (VAT-free, not financed). */\n guaranteeDeposit?: string;\n financingAmount: string;\n settingId: string;\n totalRetailAmountExclVat: string;\n totalRetailAmount: string;\n totalRetailAmountAlternativeCurrency?: string;\n totalRetailAmountExclVatAlternativeCurrency?: string;\n finalSalesPrice: string;\n roi: {\n value: string;\n target: string;\n perYear: string;\n difference: string;\n score?: QuoteMetricsScore;\n };\n cashflow: {\n deficit: string;\n balanced: boolean;\n score: QuoteMetricsScore;\n };\n profitability: {\n leasing: string;\n vehicle: string;\n total: string;\n score: QuoteMetricsScore;\n };\n taxes: {\n yearlyRetailPrice: string;\n monthlyRetailPrice: string;\n yearlyRoadTax: string;\n oneTimeRoadTax: string;\n profit: string;\n };\n insurance: {\n beforeDelivery: string;\n yearlyRetailPrice: string;\n monthlyRetailPrice: string;\n civilLiabilities: string;\n allRisks: string;\n specialTechnicalInsurance: string;\n roadAssistance: string;\n profit: string;\n };\n trackAndTrace: {\n beforeDelivery: string;\n monthlyCost: string;\n installationCost: string; // currently this cost is being included as part of monthlyCost. In future, this will be a separate cost\n deviceCost: string; // same as above\n profit: string;\n };\n costs: {\n financingAmount: string;\n finalCostPrice: string;\n monhtly: string;\n };\n};\n\nexport type SalesCalculatorOutput = {\n totalRetailAmount: string;\n totalRetailAmountExclVat: string;\n totalRetailAmountAlternativeCurrency?: string;\n totalRetailAmountExclVatAlternativeCurrency?: string;\n retailAmounts: {\n vehicle: string;\n delivery: string;\n extras: string;\n };\n vehicle: {\n purchasePrice: string; //incl vat\n agreedPrice: string; // incl vat\n };\n roi: { value: string; score?: QuoteMetricsScore };\n profit: {\n value: string;\n percentage: string;\n score: QuoteMetricsScore;\n };\n profitOverMin?: {\n // deprecated\n value: string;\n percentage: string;\n score: QuoteMetricsScore;\n };\n delivery?: {\n retailPrice?: string;\n costPrice?: string;\n cleaningNeeded: boolean;\n cleaningNeededRetailPrice: string;\n transportationToPortRetailPrice?: string;\n };\n costs: {\n finalCostPrice: string;\n extras: string;\n delivery: string;\n };\n};\n\ntype BaseQuote = {\n opportunityId: string;\n preferredLanguage: string;\n clientNotes?: string;\n publicNotes?: string;\n} & (\n | {\n type: OpportunityType.LEASING;\n calculatorInput: LeasingCalculatorInput;\n calculatorOutput: LeasingCalculatorOutput;\n rating?: MatchingRuleValue;\n }\n | {\n type: OpportunityType.SALES;\n calculatorInput: SalesCalculatorInput;\n calculatorOutput: SalesCalculatorOutput;\n rating?: MatchingRuleValue;\n }\n | {\n type: OpportunityType.NEW_TRAILER | OpportunityType.NEW_TRAILER_NEW_PRODUCTION;\n calculatorInput: SalesCalculatorInput;\n calculatorOutput: SalesCalculatorOutput;\n rating?: MatchingRuleValue;\n }\n | {\n type:\n | OpportunityType.CUSTOMMADE_CONSTRUCTION_OUTSOURCING\n | OpportunityType.CUSTOMMADE_CONSTRUCTION_INSOURCING;\n calculatorInput: SalesCalculatorInput;\n calculatorOutput: SalesCalculatorOutput;\n rating?: MatchingRuleValue;\n }\n);\n\nexport type NewQuote = BaseQuote & {\n id?: undefined;\n createdAt?: undefined;\n createdBy?: undefined;\n modifiedAt?: undefined;\n modifiedBy?: undefined;\n active: true;\n};\n\nexport type Quote = BaseQuote & {\n id: string;\n createdAt: string;\n createdBy: string;\n modifiedAt: string;\n modifiedBy: string;\n validationBy?: string;\n validationAt?: string;\n cancelledBy?: string;\n cancelledAt?: string;\n customerFeedbackAt?: string;\n customerFeedbackBy?: string;\n managerFeedbackAt?: string;\n managerFeedbackBy?: string;\n version: number;\n status: QuoteStatus;\n proformaPdf?: AttachmentValue;\n quotePdf?: AttachmentValue;\n salesAgreementPdf?: AttachmentValue;\n active: boolean;\n contactId: string;\n vehicleId: string;\n organizationId: string;\n technicalNotesUpdated: boolean;\n technicalNotesValidated: boolean;\n technicalNotesValidatedAt?: string;\n technicalNotesValidatedBy?: string;\n externalQuote?: boolean;\n};\n\nexport type QuoteUpdate = {\n status?: QuoteStatus;\n active?: boolean;\n technicalNotesValidated?: boolean;\n};\n\nexport type CalculatorLeasingIO = {\n output: LeasingCalculatorOutput;\n input: LeasingCalculatorInput;\n rating?: MatchingRuleValue;\n};\nexport type CalculatorSalesIO = {\n output: SalesCalculatorOutput;\n input: SalesCalculatorInput;\n rating?: MatchingRuleValue;\n};\nexport type CalculatorQuoteIO = CalculatorLeasingIO | CalculatorSalesIO;\n\nexport type DeliveryLocationValue = Omit<LocationValue, 'addressLine1' | 'city'> & {\n addressLine1: string;\n city: string;\n};\n\nexport type DeliveryRoutesRequest = {\n origin: DeliveryLocationValue;\n destination: DeliveryLocationValue;\n};\n\nexport type NewQuoteValidator = {\n userId: string;\n countryCode: string;\n type: OpportunityType;\n canValidateOwn?: boolean;\n};\n\nexport type QuoteValidator = NewQuoteValidator & {\n createdAt: string;\n};\n\nexport type QuoteValidatorUpdate = {\n canValidateOwn: boolean;\n};\n"]}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { LocationValue } from '@bisondesk/commons-sdk/locations';
|
|
2
|
+
import { TransportLocationSource, TransportStatus, TransportType } from './transports.js';
|
|
3
|
+
import { VehiclePurchaseDeliveryType } from './vehicles.js';
|
|
4
|
+
export declare const ARRIVALS_HISTORY_MONTHS = 24;
|
|
5
|
+
export declare const ARRIVALS_USUAL_WAIT_MONTHS = 3;
|
|
6
|
+
export declare const ARRIVALS_LATE_AFTER_DAYS = 30;
|
|
7
|
+
export type ExpectedArrivalTransport = {
|
|
8
|
+
id: string;
|
|
9
|
+
type: TransportType;
|
|
10
|
+
status: TransportStatus;
|
|
11
|
+
date?: string;
|
|
12
|
+
transportCompany?: string;
|
|
13
|
+
driver?: string;
|
|
14
|
+
};
|
|
15
|
+
export type ExpectedArrivalRow = {
|
|
16
|
+
vehicleId: string;
|
|
17
|
+
stockNumber: string;
|
|
18
|
+
title: string;
|
|
19
|
+
used: boolean | null;
|
|
20
|
+
pictureUrl?: string;
|
|
21
|
+
branchId: string;
|
|
22
|
+
currency: string;
|
|
23
|
+
purchasedBy: string;
|
|
24
|
+
supplier: {
|
|
25
|
+
id: string;
|
|
26
|
+
name: string;
|
|
27
|
+
};
|
|
28
|
+
purchasePrice: number | null;
|
|
29
|
+
amountPaid: number;
|
|
30
|
+
fullPaymentSentAt: string;
|
|
31
|
+
firstPaymentSentAt?: string;
|
|
32
|
+
daysSincePayment: number;
|
|
33
|
+
sold: boolean;
|
|
34
|
+
opportunityId?: string;
|
|
35
|
+
clientOrgId?: string;
|
|
36
|
+
clientName?: string;
|
|
37
|
+
pickupAddress?: {
|
|
38
|
+
address: LocationValue;
|
|
39
|
+
source: TransportLocationSource;
|
|
40
|
+
};
|
|
41
|
+
deliveryType?: VehiclePurchaseDeliveryType;
|
|
42
|
+
readyToDeliver: boolean;
|
|
43
|
+
availableWeek?: string;
|
|
44
|
+
transport?: ExpectedArrivalTransport;
|
|
45
|
+
};
|
|
46
|
+
export type ArrivalsMonth = {
|
|
47
|
+
month: string;
|
|
48
|
+
arrivals: number;
|
|
49
|
+
paidFirst: number;
|
|
50
|
+
arrivedBeforePaid: number;
|
|
51
|
+
p50Days: number | null;
|
|
52
|
+
p80Days: number | null;
|
|
53
|
+
late: number;
|
|
54
|
+
};
|
|
55
|
+
export type ArrivalsWait = {
|
|
56
|
+
p50Days: number | null;
|
|
57
|
+
p80Days: number | null;
|
|
58
|
+
};
|
|
59
|
+
export type ExpectedArrivalsReportResponse = {
|
|
60
|
+
rows: ExpectedArrivalRow[];
|
|
61
|
+
history: ArrivalsMonth[];
|
|
62
|
+
usualWait: ArrivalsWait;
|
|
63
|
+
};
|
|
64
|
+
export type ExpectedArrivalsExportRequest = {
|
|
65
|
+
vehicleIds: string[];
|
|
66
|
+
};
|
|
67
|
+
//# sourceMappingURL=reports-arrivals.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reports-arrivals.d.ts","sourceRoot":"/","sources":["types/reports-arrivals.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAE,uBAAuB,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC1F,OAAO,EAAE,2BAA2B,EAAE,M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C,cAAc,EAAE,OAAO,CAAC;IACxB,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB,SAAS,CAAC,EAAE,wBAAwB,CAAC;CACtC,CAAC;AAGF,MAAM,MAAM,aAAa,GAAG;IAE1B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IAEjB,SAAS,EAAE,MAAM,CAAC;IAClB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAEvB,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAGF,MAAM,MAAM,YAAY,GAAG;IAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAAC;AAE9E,MAAM,MAAM,8BAA8B,GAAG;IAC3C,IAAI,EAAE,kBAAkB,EAAE,CAAC;IAE3B,OAAO,EAAE,aAAa,EAAE,CAAC;IAEzB,SAAS,EAAE,YAAY,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,6BAA6B,GAAG;IAC1C,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reports-arrivals.js","sourceRoot":"/","sources":["types/reports-arrivals.ts"],"names":[],"mappings":"AAcA,MAAM,CAAC,MAAM,uBAAuB,GAAG,EAAE,CAAC;AAG1C,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC;AAG5C,MAAM,CAAC,MAAM,wBAAwB,GAAG,EAAE,CAAC","sourcesContent":["/**\n * Expected arrivals report — the payload for the `Reports → Expected arrivals` tab: every\n * vehicle whose supplier has been fully paid but which has not arrived on our park (or, for a\n * direct supplier-to-client delivery, has not been delivered), with the monthly history of how\n * long a paid vehicle takes to arrive. The per-purchaser overview and the KPIs follow the\n * table's filters, so the client computes them from the rows it shows.\n *\n * The API returns raw numbers only; the client formats amounts and dates.\n */\nimport { LocationValue } from '@bisondesk/commons-sdk/locations';\nimport { TransportLocationSource, TransportStatus, TransportType } from './transports.js';\nimport { VehiclePurchaseDeliveryType } from './vehicles.js';\n\n/** Months of arrivals the history chart covers. */\nexport const ARRIVALS_HISTORY_MONTHS = 24;\n\n/** Full months of arrivals behind the \"usual wait\" benchmark. */\nexport const ARRIVALS_USUAL_WAIT_MONTHS = 3;\n\n/** Days after the full payment beyond which a vehicle still not arrived is flagged. */\nexport const ARRIVALS_LATE_AFTER_DAYS = 30;\n\nexport type ExpectedArrivalTransport = {\n id: string;\n type: TransportType;\n status: TransportStatus;\n /** Planned pick-up / delivery day. */\n date?: string;\n transportCompany?: string;\n driver?: string;\n};\n\nexport type ExpectedArrivalRow = {\n vehicleId: string;\n stockNumber: string;\n title: string;\n /** Vehicle condition; null when it has not been recorded. */\n used: boolean | null;\n /** Main picture, else the first picture; the client appends the resize parameters. */\n pictureUrl?: string;\n /** The client reads the branch location for the maps origin. */\n branchId: string;\n currency: string;\n /** User id from `purchase.purchasedBy`; the client resolves name + avatar. */\n purchasedBy: string;\n supplier: { id: string; name: string };\n /** `deal.purchase`, exclusive VAT. */\n purchasePrice: number | null;\n /** Σ of the payment rows marked paid — what left the bank. */\n amountPaid: number;\n fullPaymentSentAt: string;\n firstPaymentSentAt?: string;\n daysSincePayment: number;\n sold: boolean;\n opportunityId?: string;\n clientOrgId?: string;\n clientName?: string;\n /** The purchase transport's delivery address, else the supplier's legal address. */\n pickupAddress?: { address: LocationValue; source: TransportLocationSource };\n deliveryType?: VehiclePurchaseDeliveryType;\n /** Direct supplier-to-client delivery: no purchase logistics, the sale delivery is the exit. */\n readyToDeliver: boolean;\n availableWeek?: string;\n /** The purchase transport for a park vehicle, the sale delivery for a direct delivery. */\n transport?: ExpectedArrivalTransport;\n};\n\n/** One month of arrivals, keyed by month of arrival. Percentiles cover the paid-first rows only. */\nexport type ArrivalsMonth = {\n /** `YYYY-MM`. */\n month: string;\n arrivals: number;\n /** Fully paid before arriving — the ones with a wait to measure. */\n paidFirst: number;\n arrivedBeforePaid: number;\n p50Days: number | null;\n p80Days: number | null;\n /** Paid-first arrivals that waited more than `ARRIVALS_LATE_AFTER_DAYS`. */\n late: number;\n};\n\n/** Days between the full payment and the arrival, over a window of arrivals. */\nexport type ArrivalsWait = { p50Days: number | null; p80Days: number | null };\n\nexport type ExpectedArrivalsReportResponse = {\n rows: ExpectedArrivalRow[];\n /** The last `ARRIVALS_HISTORY_MONTHS` months, oldest first, every month present. */\n history: ArrivalsMonth[];\n /** Over the last `ARRIVALS_USUAL_WAIT_MONTHS` full months of arrivals. */\n usualWait: ArrivalsWait;\n};\n\nexport type ExpectedArrivalsExportRequest = {\n vehicleIds: string[];\n};\n"]}
|
|
@@ -35,6 +35,12 @@ export type SalesReportMake = {
|
|
|
35
35
|
units: number;
|
|
36
36
|
yoyPct: number | null;
|
|
37
37
|
};
|
|
38
|
+
export type SalesReportCategory = {
|
|
39
|
+
category: string;
|
|
40
|
+
units: number;
|
|
41
|
+
sharePct: number;
|
|
42
|
+
yoyPct: number | null;
|
|
43
|
+
};
|
|
38
44
|
export type SalesReportTopOrg = {
|
|
39
45
|
id: string;
|
|
40
46
|
name: string;
|
|
@@ -90,6 +96,7 @@ export type SalesReportResponse = {
|
|
|
90
96
|
};
|
|
91
97
|
countries: SalesReportCountry[];
|
|
92
98
|
makes: SalesReportMake[];
|
|
99
|
+
categories: SalesReportCategory[];
|
|
93
100
|
salespeople: SalesReportSalesperson[];
|
|
94
101
|
buyers: SalesReportBuyer[];
|
|
95
102
|
topClients: SalesReportTopOrg[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reports-sales.d.ts","sourceRoot":"/","sources":["types/reports-sales.ts"],"names":[],"mappings":"AAiBA,eAAO,MAAM,iBAAiB,YAC5B,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACL,WAAW,EACX,KAAK,EACL,KAAK,EACL,UAAU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K;IACL,KAAK;IACL,UAAU;IACV,KAAK;CACG,CAAC;AAIX,MAAM,CAAC,MAAM,oBAAoB,GAAmB,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"reports-sales.js","sourceRoot":"/","sources":["types/reports-sales.ts"],"names":[],"mappings":"AAiBA,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,WAAW;IACX,KAAK;IACL,KAAK;IACL,UAAU;IACV,KAAK;CACG,CAAC;AAIX,MAAM,CAAC,MAAM,oBAAoB,GAAmB,KAAK,CAAC;AA4H1D,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,CAAU,CAAC","sourcesContent":["/**\n * Sales report — the payload for the `Reports → Sales` tab. Sales-side metrics\n * are computed from the per-tenant `opportunities` OpenSearch index, keyed on\n * `opportunity.reviewedAt` (the moment an opportunity ENTERS Preparation — our\n * \"sale\" event; `preparedAt` is when it leaves Preparation into Delivery). The\n * buyer ranking comes from the vehicles index, keyed on `purchase.purchaseAgreedAt`.\n *\n * The API returns raw numbers only; the client formats (€, %, pp, \"younger\") and\n * colors the deltas.\n */\n\n/**\n * Period presets driving every metric except the fixed 18-month histogram, in\n * selector order. Single source of truth — `SalesPeriodKey` is derived from it.\n * `mtd`/`ytd` are to-date ranges (start of month/year → now); `lastMonth`/`lastYear`\n * are the previous complete calendar month/year.\n */\nexport const SALES_PERIOD_KEYS = [\n '30d',\n '45d',\n '60d',\n '90d',\n 'lastMonth',\n 'mtd',\n 'ytd',\n 'lastYear',\n '12m',\n] as const;\n\nexport type SalesPeriodKey = (typeof SALES_PERIOD_KEYS)[number];\n\nexport const DEFAULT_SALES_PERIOD: SalesPeriodKey = 'mtd';\n\nexport type SalesReportRequest = { period: SalesPeriodKey };\n\n/**\n * A metric for the selected window with its year-over-year counterpart.\n * - `value`: current window (null when undefined, e.g. no data / no median).\n * - `prev`: same metric in the window shifted back exactly one year.\n * - `pct`: fractional change `(value - prev) / prev` (null when prev is 0 or\n * either side is undefined). The client renders/colors the delta.\n */\nexport type YoyMetric = { value: number | null; prev: number | null; pct: number | null };\n\n/** Tenure buckets for returning-customer analysis (share of buyers in the window). */\nexport type TenureBucketKey = '2y' | '1-2y' | '<1y' | 'new';\n\nexport type TenureBucket = {\n bucket: TenureBucketKey;\n /** Share of buyers in this bucket, 0–100. */\n sharePct: number;\n /** Year-over-year change in this share, as a fractional relative change (null when no prior data). */\n yoyPct: number | null;\n};\n\nexport type SalesReportCountry = {\n /** ISO country code (lowercase) from `org.countryCode`. */\n code: string;\n units: number;\n yoyPct: number | null;\n};\n\nexport type SalesReportSalesperson = {\n /** User id from `opportunity.accountManager`; the client resolves name + avatar. */\n id: string;\n units: number;\n yoyPct: number | null;\n};\n\nexport type SalesReportBuyer = {\n /** User id from `purchase.purchasedBy`; the client resolves name + avatar. */\n id: string;\n units: number;\n yoyPct: number | null;\n};\n\nexport type SalesReportMake = {\n /** Vehicle make name from `vehicle.external.general.make` (stored verbatim, e.g. \"DAF\"). */\n make: string;\n units: number;\n yoyPct: number | null;\n};\n\nexport type SalesReportCategory = {\n /** Vehicle category; empty when missing or outside the supported categories. */\n category: string;\n /** Number of opportunities in the current window. */\n units: number;\n /** Share of all opportunities in the current window, 0–100. */\n sharePct: number;\n /** Fractional year-over-year change in opportunity count; 0 when both counts are zero. */\n yoyPct: number | null;\n};\n\n/** A ranked organization row for the top-clients / top-suppliers cards. */\nexport type SalesReportTopOrg = {\n /** Organization id (`org.id` for clients; `purchase.organizationId` for suppliers). */\n id: string;\n /** Organization name (resolved server-side); falls back to the id when missing. */\n name: string;\n /** The org's ISO country code (lowercase); null when not recorded. */\n countryCode: string | null;\n units: number;\n yoyPct: number | null;\n};\n\n/** A conglomerate-flagged organization (there is no group/parent model — each org stands alone). */\nexport type SalesReportConglomerateOrg = {\n /** `org.id`. */\n id: string;\n /** `org.name` (resolved server-side); falls back to the id when missing. */\n name: string;\n units: number;\n yoyPct: number | null;\n};\n\nexport type SalesReportConglomerate = {\n /** Share of units going to conglomerate-flagged customers, 0–100 (null when no sales). */\n sharePct: number | null;\n /** Year-over-year change in that share, as a fractional relative change (null when no prior data). */\n yoyPct: number | null;\n /** The conglomerate share in the year-ago window, 0–100. */\n lastYearPct: number | null;\n /** Top conglomerate-flagged organizations by units in the current window. */\n orgs: SalesReportConglomerateOrg[];\n};\n\nexport type SalesReportHistogramBucket = {\n /** Calendar month, `YYYY-MM`. */\n month: string;\n count: number;\n};\n\n/**\n * Current-month sales projection for the histogram's last bucket: the average sales\n * per business day over the last 5 business days, extended over the business days\n * left in the month. Business days are UTC weekdays (Mon–Fri) — no holiday calendar.\n * Today is excluded on both sides: it is still filling up (its sales land in the\n * month's actual count as they happen).\n */\nexport type SalesReportProjection = {\n /** The projected month, `YYYY-MM` — always the histogram's last bucket. */\n month: string;\n /** Average sales per business day over the last 5 business days. */\n salesPerBusinessDay: number;\n /** Business days (Mon–Fri, UTC) left in the month after today. */\n businessDaysLeft: number;\n /** Expected further sales this month: `salesPerBusinessDay × businessDaysLeft` (unrounded). */\n projectedRemaining: number;\n};\n\n/**\n * Age-of-stock bands, in days of capital tied up. Cut points at 30 / 90 / 180 days,\n * upper bound inclusive; the last band is open-ended, so `180+` means \"181 and over\".\n */\nexport const STOCK_AGE_BANDS = ['0-30', '31-90', '91-180', '180+'] as const;\n\nexport type StockAgeBand = (typeof STOCK_AGE_BANDS)[number];\n\n/**\n * One monthly snapshot on the stock-age charts, measured by capital tied up in\n * inventory. A vehicle counts on `date` when the supplier was fully paid on or before\n * that day and it had not been sold yet; its age is `date − supplierFullyPaidAt` in\n * days. Used vehicles only.\n */\nexport type StockAgePoint = {\n /** Snapshot day — the 1st of a month, `YYYY-MM-DD` (UTC). */\n date: string;\n /** In-stock vehicle count per age band on that day. */\n counts: Record<StockAgeBand, number>;\n /**\n * Sum of those vehicles' purchase costs per age band on that day (`deal.purchase`,\n * excl VAT, tenant currency). A vehicle without a recorded purchase cost still counts\n * in `counts` but contributes 0 here.\n */\n purchaseCosts: Record<StockAgeBand, number>;\n};\n\nexport type SalesReportResponse = {\n period: {\n key: SalesPeriodKey;\n /** Current window, half-open `[start, end)` (ISO strings). */\n start: string;\n end: string;\n /** Number of days in the window (the `salesPerDay` denominator). */\n days: number;\n /** Year-ago window `[yoyStart, yoyEnd)`. */\n yoyStart: string;\n yoyEnd: string;\n };\n /** All-types overview KPIs. `medianAge` is in years (a decrease is good — younger stock). */\n overview: {\n salesPerDay: YoyMetric;\n salesTotal: YoyMetric;\n medianRoi: YoyMetric;\n medianPrice: YoyMetric;\n medianAge: YoyMetric;\n uniqueCustomers: YoyMetric;\n };\n /** Top countries by units in the current window. */\n countries: SalesReportCountry[];\n /** Top vehicle makes by units in the current window (the client slices to its top N). */\n makes: SalesReportMake[];\n /** Every vehicle category, ordered by current units; includes unassigned opportunities. */\n categories: SalesReportCategory[];\n /** All sales people with units in either window (capped; the client list scrolls). */\n salespeople: SalesReportSalesperson[];\n /** All purchasers with vehicles bought in the current window (capped; the client list scrolls). */\n buyers: SalesReportBuyer[];\n /** Top client organizations by units bought from us in the current window. */\n topClients: SalesReportTopOrg[];\n /** Top supplier organizations by used vehicles purchased from them in the current window. */\n topSuppliers: SalesReportTopOrg[];\n /** Returning-customer tenure shares (4 buckets). */\n returning: TenureBucket[];\n conglomerate: SalesReportConglomerate;\n /** Fixed last-18-calendar-months histogram of opps into Preparation (period-independent). */\n histogram: SalesReportHistogramBucket[];\n /** Current-month projection, stacked on the histogram's last bucket by the client. */\n projection: SalesReportProjection;\n /**\n * Stock-age evolution measured as capital tied up in inventory: one snapshot per\n * month-1st of vehicles by days from supplier-fully-paid to sold (used vehicles).\n * Fixed to the last 24 months, period-independent.\n */\n stockAge: StockAgePoint[];\n /**\n * Customer concentration: the 10 largest customers' share of units in the window, as a\n * fraction (0–1); null when there are no sales. A risk signal — over-reliance on a few\n * buyers.\n */\n concentration: number | null;\n};\n"]}
|
package/lib/types/templates.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { EmailContent, EmailRequest } from '@bisondesk/commons-sdk/messages';
|
|
1
2
|
export type TemplateContent = {
|
|
2
3
|
subject: string;
|
|
3
4
|
content: {
|
|
@@ -30,4 +31,25 @@ export type UpdateTemplateInfoRequest = {
|
|
|
30
31
|
name: string;
|
|
31
32
|
tags?: any;
|
|
32
33
|
};
|
|
34
|
+
export type CodeEmailTemplateInfo = Pick<TemplateInfo, 'id' | 'name' | 'countries'> & {
|
|
35
|
+
format: 'react-email';
|
|
36
|
+
};
|
|
37
|
+
export type TemplateCatalogueEntry = (TemplateInfo & {
|
|
38
|
+
format: 'html';
|
|
39
|
+
}) | CodeEmailTemplateInfo;
|
|
40
|
+
export type TemplateEmailRequest<T extends Record<string, unknown> = Record<string, unknown>> = Omit<EmailRequest, 'subject' | 'body'> & {
|
|
41
|
+
templateId: string;
|
|
42
|
+
country: string;
|
|
43
|
+
fallbackCountry?: string;
|
|
44
|
+
data: T;
|
|
45
|
+
subject?: string;
|
|
46
|
+
};
|
|
47
|
+
export type EmailTemplatePreviewRequest = {
|
|
48
|
+
data?: Record<string, unknown>;
|
|
49
|
+
subject?: string;
|
|
50
|
+
};
|
|
51
|
+
export type EmailTemplatePreview = {
|
|
52
|
+
content: EmailContent;
|
|
53
|
+
data: Record<string, unknown>;
|
|
54
|
+
};
|
|
33
55
|
//# sourceMappingURL=templates.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"templates.d.ts","sourceRoot":"/","sources":["types/templates.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,eAAe,GAAG;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE;QACP,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,GAAG,CAAC;KACb,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,EAAE,CAAC,EAAE,MAAM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AM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IACjC,OAAO,EAAE,YAAY,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC/B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"templates.js","sourceRoot":"/","sources":["types/templates.ts"],"names":[],"mappings":"","sourcesContent":["
|
|
1
|
+
{"version":3,"file":"templates.js","sourceRoot":"/","sources":["types/templates.ts"],"names":[],"mappings":"","sourcesContent":["import type { EmailContent, EmailRequest } from '@bisondesk/commons-sdk/messages';\n\nexport type TemplateContent = {\n subject: string;\n content: {\n html: string;\n design: any;\n };\n};\n\nexport type NewTemplateRequest = {\n id?: string;\n country: string;\n tags?: any;\n name: string;\n} & TemplateContent;\n\nexport type Template = {\n id: string;\n modifiedAt: string;\n modifiedBy: string;\n tags?: any;\n\n country: string;\n name: string;\n} & TemplateContent;\n\nexport type TemplateInfo = {\n id: string;\n countries: string[];\n modifiedAt: string;\n name: string;\n tags?: any;\n};\n\nexport type UpdateTemplateInfoRequest = {\n name: string;\n tags?: any;\n};\n\nexport type CodeEmailTemplateInfo = Pick<TemplateInfo, 'id' | 'name' | 'countries'> & {\n format: 'react-email';\n};\n\nexport type TemplateCatalogueEntry = (TemplateInfo & { format: 'html' }) | CodeEmailTemplateInfo;\n\nexport type TemplateEmailRequest<T extends Record<string, unknown> = Record<string, unknown>> =\n Omit<EmailRequest, 'subject' | 'body'> & {\n templateId: string;\n country: string;\n fallbackCountry?: string;\n data: T;\n subject?: string;\n };\n\nexport type EmailTemplatePreviewRequest = {\n data?: Record<string, unknown>;\n subject?: string;\n};\n\nexport type EmailTemplatePreview = {\n content: EmailContent;\n data: Record<string, unknown>;\n};\n"]}
|
package/lib/types/tenants.d.ts
CHANGED
|
@@ -36,7 +36,7 @@ export declare enum TenantModule {
|
|
|
36
36
|
Reports = "reports",
|
|
37
37
|
Prospects = "prospects"
|
|
38
38
|
}
|
|
39
|
-
export declare const REPORT_TAB_KEYS: readonly ['sales', 'leasing', 'purchases'];
|
|
39
|
+
export declare const REPORT_TAB_KEYS: readonly ['sales', 'leasing', 'purchases', 'arrivals'];
|
|
40
40
|
export type ReportTabKey = (typeof REPORT_TAB_KEYS)[number];
|
|
41
41
|
export type Tenant = PublicTenant & {
|
|
42
42
|
cognito?: CognitoInfo;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tenants.d.ts","sourceRoot":"/","sources":["types/tenants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAC;AAClF,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAElD,MAAM,MAAM,YAAY,GAAG;IACzB,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,CAAC,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC,CAAC;CAInC,CAAC;AAEF,oBAAY,YAAY;IACtB,cAAc,mBAAmB;IACjC,GAAG,QAAQ;IAOX,UAAU,gBAAgB;IAC1B,GAAG,QAAQ;IACX,IAAI,SAAS;IAMb,UAAU,gBAAgB;IAQ1B,WAAW,iBAAiB;IAC5B,KAAK,UAAU;IACf,OAAO,YAAY;IACnB,yBAAyB,gCAAgC;IACzD,SAAS,cAAc;IACvB,QAAQ,aAAa;IAQrB,YAAY,iBAAiB;IAC7B,aAAa,kBAAkB;IAC/B,MAAM,WAAW;IACjB,QAAQ,aAAa;IACrB,KAAK,UAAU;IACf,aAAa,oBAAoB;IACjC,SAAS,cAAc;IACvB,aAAa,mBAAmB;IAChC,KAAK,UAAU;IACf,oBAAoB,0BAA0B;IAC9C,SAAS,cAAc;I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,qBAAqB,GAAG;IAClC,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC;AAUF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,MAAM,EAAE,YAAY,CAAC;IACrB,QAAQ,EAAE,OAAO,CAAC;IAClB,WAAW,EAAE,OAAO,CAAC;IACrB,OAAO,EAAE,WAAW,CAAC;CACtB,CAAC"}
|
package/lib/types/tenants.js
CHANGED
|
@@ -26,5 +26,5 @@ export var TenantModule;
|
|
|
26
26
|
TenantModule["Reports"] = "reports";
|
|
27
27
|
TenantModule["Prospects"] = "prospects";
|
|
28
28
|
})(TenantModule || (TenantModule = {}));
|
|
29
|
-
export const REPORT_TAB_KEYS = ['sales', 'leasing', 'purchases'];
|
|
29
|
+
export const REPORT_TAB_KEYS = ['sales', 'leasing', 'purchases', 'arrivals'];
|
|
30
30
|
//# sourceMappingURL=tenants.js.map
|
package/lib/types/tenants.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tenants.js","sourceRoot":"/","sources":["types/tenants.ts"],"names":[],"mappings":"AAgBA,MAAM,CAAN,IAAY,YAmDX;AAnDD,WAAY,YAAY;IACtB,iDAAiC,CAAA;IACjC,2BAAW,CAAA;IAOX,0CAA0B,CAAA;IAC1B,2BAAW,CAAA;IACX,6BAAa,CAAA;IAMb,0CAA0B,CAAA;IAQ1B,4CAA4B,CAAA;IAC5B,+BAAe,CAAA;IACf,mCAAmB,CAAA;IACnB,yEAAyD,CAAA;IACzD,uCAAuB,CAAA;IACvB,qCAAqB,CAAA;IAQrB,6CAA6B,CAAA;IAC7B,+CAA+B,CAAA;IAC/B,iCAAiB,CAAA;IACjB,qCAAqB,CAAA;IACrB,+BAAe,CAAA;IACf,iDAAiC,CAAA;IACjC,uCAAuB,CAAA;IACvB,gDAAgC,CAAA;IAChC,+BAAe,CAAA;IACf,8DAA8C,CAAA;IAC9C,uCAAuB,CAAA;IACvB,mCAAmB,CAAA;IACnB,uCAAuB,CAAA;AACzB,CAAC,EAnDW,YAAY,KAAZ,YAAY,QAmDvB;AAGD,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,OAAO,EAAE,SAAS,EAAE,WAAW,CAAU,CAAC","sourcesContent":["import { CognitoInfo, LocationValue, Region } from '@bisondesk/commons-sdk/types';\nimport { OpportunityType } from '../constants.js';\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 subdomains: [string, ...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 Administration = 'administration',\n App = 'app',\n /**\n * The tenant's users can put the app into client mode, hiding the internal-only pages while\n * showing a screen to a customer. Left off for a tenant whose users are themselves the\n * customer: it would hide their sign-out to no purpose, and turning it back off needs a PIN\n * they were never given.\n */\n ClientMode = 'client_mode',\n CRM = 'crm',\n Docs = 'docs',\n /**\n * The app may send email on behalf of this tenant's users, e.g. sharing a vehicle: the\n * sender is the requesting user's own address, so the tenant's email domain must be one we\n * can deliver from. Absent on client tenants — we do not send mail as outsiders.\n */\n EmailShare = 'email_share',\n /**\n * The tenant's users can sign in with Google. It is a tenant fact rather than a user one:\n * `googleEmail` is only filled when the Google address differs from the BisonDesk one, and\n * every pool carries the Google provider regardless, so neither can tell who actually uses it.\n * Absent means password-only, which is what routes those users an emailed invite with a\n * genuine temporary password.\n */\n GoogleLogin = 'google_login',\n Leads = 'leads',\n Leasing = 'leasing',\n LeasingContractGeneration = 'leasing_contract_generation',\n Marketing = 'marketing',\n Insights = 'insights',\n /**\n * The tenant has agreed to exchange deal data through BisonDesk automatically, on top of the\n * bare vehicle distribution: it may be named as the buyer on an intercompany sale, which lets\n * the invoice sync and the purchase reconciliation write a purchase onto its copy. Read on the\n * BUYER only. All group tenants have it today; a supplier or client tenant that wants deal\n * data pushed too joins the exchange by being granted it.\n */\n Intercompany = 'intercompany',\n Opportunities = 'opportunities',\n Offers = 'offers',\n Vehicles = 'vehicles',\n Tasks = 'tasks',\n TrackAndTrace = 'track_and_trace',\n Bootstrap = 'bootstrap',\n WhatsappCrisp = 'whatsapp_crisp',\n Hexon = 'hexon',\n DeliveryConfirmation = 'delivery_confirmation',\n Transport = 'transport',\n Reports = 'reports',\n Prospects = 'prospects',\n}\n\n/** Report tabs a tenant can enable, in canonical order. */\nexport const REPORT_TAB_KEYS = ['sales', 'leasing', 'purchases'] as const;\n\nexport type ReportTabKey = (typeof REPORT_TAB_KEYS)[number];\n\nexport type Tenant = PublicTenant & {\n cognito?: CognitoInfo;\n languages: [string, ...string[]];\n conglomerate?: string;\n emailDomain: string;\n hyperdmsIds?: string[];\n hyperportalId?: string;\n\n /* deprecated */\n exactAccounting?: boolean;\n\n branches: [Branch, ...Branch[]];\n modules: TenantModule[];\n /**\n * Reports page configuration. `tabs` lists the visible tabs in display order;\n * absent or empty means no reports are configured for the tenant (the page\n * shows a notice instead of tabs).\n */\n reports?: {\n tabs: ReportTabKey[];\n };\n test?: boolean;\n opportunities: {\n types: OpportunityType[];\n };\n /**\n * Reservation expiry for this tenant's OWN vehicles (ADR-0026): the truck's owner sets the\n * clock, wherever the deal runs — for a cross-tenant copy the chain origin's policy\n * applies, whatever opportunity type the tenant selling to the end customer uses.\n * Absent = the default\n * business-day tiers; the tier is still picked by the local customer org's\n * trustworthy/conglomerate flags.\n */\n reservationExpiry?: ReservationExpiryPolicy;\n crm?: {\n vatNumberRequiredForCompanies?: boolean;\n };\n accounting?: {\n costCenterPerLine?: boolean;\n };\n // E.164 Twilio caller ID used as a fallback when a user has no own number configured\n defaultTwilioPhoneNumber?: string;\n deliveryEmail?: string;\n};\n\nexport type ReservationExpiryPolicy =\n | { policy: 'disabled' }\n | { policy: 'days'; generic: number; trustworthy: number; conglomerate: number };\n\nexport type AccountingProvider = 'exact' | 'odoo';\n\nexport type Branch = {\n id: string;\n name: string;\n country: string;\n language: string;\n /* deprecated — use `accounting === 'exact'` instead. Kept until prod cutover. */\n exactAccounting?: boolean;\n accounting?: AccountingProvider;\n currency: string;\n adminNumberPrefix: string;\n stockNumberPrefix: string;\n vatNumber: string;\n contactPerson?: { firstName: string; lastName: string };\n vatRates: {\n standard: string; //percentage value (e.g. 21)\n };\n location: LocationValue;\n\n storecoveExternalId?: number;\n // true if the branch is for a company where VAT is due when the invoice\n // is issued not when the payment is collected (e.g. France, Italy, Spain)\n vatOnDebits?: boolean;\n /**\n * The French issuing duties — e-invoicing, e-reporting and the Encaissée status — are switched\n * on for this branch. Receiving is unaffected and always active.\n *\n * Kept separate from `storecoveExternalId` on purpose: registering a Storecove legal entity only\n * makes a branch reachable, it does not mean the French duties have started. As a PME those\n * duties begin 2027-09-01, so this stays off until then or until a deliberate earlier adoption.\n */\n frIssuingEnabled?: boolean;\n externalQuote?: boolean;\n hyperdmsId?: string;\n internalDealsEnabled?: boolean;\n /** The source invoices the end customer directly; this branch collects payment and earns\n * commission. Intercompany source opportunities for this branch's deals take the buyer\n * deal's own client instead of the branch counterparty org. */\n dropshipping?: boolean;\n};\n\nexport type HdmsVehiclesSync = {\n active: boolean;\n};\n\nexport type HdmsCrmSync = {\n active: boolean;\n};\n\nexport type HdmsDocumentSync = {\n active: boolean;\n};\n\nexport type TenantSyncSettings = {\n tenantId: string;\n hdmsVehicles: HdmsVehiclesSync | undefined;\n hdmsCrm: HdmsCrmSync | undefined;\n hdmsDocuments: HdmsDocumentSync | undefined;\n};\n\nexport type WhatsappStateResponse = {\n enabled: boolean;\n};\n\n/**\n * What the login page is told about a tenant before anyone has signed in. Reached by subdomain\n * on the one public tenant endpoint, so it carries only what an anonymous visitor may see —\n * mind that when adding to it.\n *\n * The two booleans are answers the page cannot work out for itself: it has no session, so no\n * modules to read. They say which sign-in options to offer and whether WhatsApp sharing is on.\n */\nexport type TenantInfoResponse = {\n tenant: PublicTenant;\n whatsapp: boolean;\n googleLogin: boolean;\n cognito: CognitoInfo;\n};\n"]}
|
|
1
|
+
{"version":3,"file":"tenants.js","sourceRoot":"/","sources":["types/tenants.ts"],"names":[],"mappings":"AAgBA,MAAM,CAAN,IAAY,YAmDX;AAnDD,WAAY,YAAY;IACtB,iDAAiC,CAAA;IACjC,2BAAW,CAAA;IAOX,0CAA0B,CAAA;IAC1B,2BAAW,CAAA;IACX,6BAAa,CAAA;IAMb,0CAA0B,CAAA;IAQ1B,4CAA4B,CAAA;IAC5B,+BAAe,CAAA;IACf,mCAAmB,CAAA;IACnB,yEAAyD,CAAA;IACzD,uCAAuB,CAAA;IACvB,qCAAqB,CAAA;IAQrB,6CAA6B,CAAA;IAC7B,+CAA+B,CAAA;IAC/B,iCAAiB,CAAA;IACjB,qCAAqB,CAAA;IACrB,+BAAe,CAAA;IACf,iDAAiC,CAAA;IACjC,uCAAuB,CAAA;IACvB,gDAAgC,CAAA;IAChC,+BAAe,CAAA;IACf,8DAA8C,CAAA;IAC9C,uCAAuB,CAAA;IACvB,mCAAmB,CAAA;IACnB,uCAAuB,CAAA;AACzB,CAAC,EAnDW,YAAY,KAAZ,YAAY,QAmDvB;AAGD,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,UAAU,CAAU,CAAC","sourcesContent":["import { CognitoInfo, LocationValue, Region } from '@bisondesk/commons-sdk/types';\nimport { OpportunityType } from '../constants.js';\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 subdomains: [string, ...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 Administration = 'administration',\n App = 'app',\n /**\n * The tenant's users can put the app into client mode, hiding the internal-only pages while\n * showing a screen to a customer. Left off for a tenant whose users are themselves the\n * customer: it would hide their sign-out to no purpose, and turning it back off needs a PIN\n * they were never given.\n */\n ClientMode = 'client_mode',\n CRM = 'crm',\n Docs = 'docs',\n /**\n * The app may send email on behalf of this tenant's users, e.g. sharing a vehicle: the\n * sender is the requesting user's own address, so the tenant's email domain must be one we\n * can deliver from. Absent on client tenants — we do not send mail as outsiders.\n */\n EmailShare = 'email_share',\n /**\n * The tenant's users can sign in with Google. It is a tenant fact rather than a user one:\n * `googleEmail` is only filled when the Google address differs from the BisonDesk one, and\n * every pool carries the Google provider regardless, so neither can tell who actually uses it.\n * Absent means password-only, which is what routes those users an emailed invite with a\n * genuine temporary password.\n */\n GoogleLogin = 'google_login',\n Leads = 'leads',\n Leasing = 'leasing',\n LeasingContractGeneration = 'leasing_contract_generation',\n Marketing = 'marketing',\n Insights = 'insights',\n /**\n * The tenant has agreed to exchange deal data through BisonDesk automatically, on top of the\n * bare vehicle distribution: it may be named as the buyer on an intercompany sale, which lets\n * the invoice sync and the purchase reconciliation write a purchase onto its copy. Read on the\n * BUYER only. All group tenants have it today; a supplier or client tenant that wants deal\n * data pushed too joins the exchange by being granted it.\n */\n Intercompany = 'intercompany',\n Opportunities = 'opportunities',\n Offers = 'offers',\n Vehicles = 'vehicles',\n Tasks = 'tasks',\n TrackAndTrace = 'track_and_trace',\n Bootstrap = 'bootstrap',\n WhatsappCrisp = 'whatsapp_crisp',\n Hexon = 'hexon',\n DeliveryConfirmation = 'delivery_confirmation',\n Transport = 'transport',\n Reports = 'reports',\n Prospects = 'prospects',\n}\n\n/** Report tabs a tenant can enable, in canonical order. */\nexport const REPORT_TAB_KEYS = ['sales', 'leasing', 'purchases', 'arrivals'] as const;\n\nexport type ReportTabKey = (typeof REPORT_TAB_KEYS)[number];\n\nexport type Tenant = PublicTenant & {\n cognito?: CognitoInfo;\n languages: [string, ...string[]];\n conglomerate?: string;\n emailDomain: string;\n hyperdmsIds?: string[];\n hyperportalId?: string;\n\n /* deprecated */\n exactAccounting?: boolean;\n\n branches: [Branch, ...Branch[]];\n modules: TenantModule[];\n /**\n * Reports page configuration. `tabs` lists the visible tabs in display order;\n * absent or empty means no reports are configured for the tenant (the page\n * shows a notice instead of tabs).\n */\n reports?: {\n tabs: ReportTabKey[];\n };\n test?: boolean;\n opportunities: {\n types: OpportunityType[];\n };\n /**\n * Reservation expiry for this tenant's OWN vehicles (ADR-0026): the truck's owner sets the\n * clock, wherever the deal runs — for a cross-tenant copy the chain origin's policy\n * applies, whatever opportunity type the tenant selling to the end customer uses.\n * Absent = the default\n * business-day tiers; the tier is still picked by the local customer org's\n * trustworthy/conglomerate flags.\n */\n reservationExpiry?: ReservationExpiryPolicy;\n crm?: {\n vatNumberRequiredForCompanies?: boolean;\n };\n accounting?: {\n costCenterPerLine?: boolean;\n };\n // E.164 Twilio caller ID used as a fallback when a user has no own number configured\n defaultTwilioPhoneNumber?: string;\n deliveryEmail?: string;\n};\n\nexport type ReservationExpiryPolicy =\n | { policy: 'disabled' }\n | { policy: 'days'; generic: number; trustworthy: number; conglomerate: number };\n\nexport type AccountingProvider = 'exact' | 'odoo';\n\nexport type Branch = {\n id: string;\n name: string;\n country: string;\n language: string;\n /* deprecated — use `accounting === 'exact'` instead. Kept until prod cutover. */\n exactAccounting?: boolean;\n accounting?: AccountingProvider;\n currency: string;\n adminNumberPrefix: string;\n stockNumberPrefix: string;\n vatNumber: string;\n contactPerson?: { firstName: string; lastName: string };\n vatRates: {\n standard: string; //percentage value (e.g. 21)\n };\n location: LocationValue;\n\n storecoveExternalId?: number;\n // true if the branch is for a company where VAT is due when the invoice\n // is issued not when the payment is collected (e.g. France, Italy, Spain)\n vatOnDebits?: boolean;\n /**\n * The French issuing duties — e-invoicing, e-reporting and the Encaissée status — are switched\n * on for this branch. Receiving is unaffected and always active.\n *\n * Kept separate from `storecoveExternalId` on purpose: registering a Storecove legal entity only\n * makes a branch reachable, it does not mean the French duties have started. As a PME those\n * duties begin 2027-09-01, so this stays off until then or until a deliberate earlier adoption.\n */\n frIssuingEnabled?: boolean;\n externalQuote?: boolean;\n hyperdmsId?: string;\n internalDealsEnabled?: boolean;\n /** The source invoices the end customer directly; this branch collects payment and earns\n * commission. Intercompany source opportunities for this branch's deals take the buyer\n * deal's own client instead of the branch counterparty org. */\n dropshipping?: boolean;\n};\n\nexport type HdmsVehiclesSync = {\n active: boolean;\n};\n\nexport type HdmsCrmSync = {\n active: boolean;\n};\n\nexport type HdmsDocumentSync = {\n active: boolean;\n};\n\nexport type TenantSyncSettings = {\n tenantId: string;\n hdmsVehicles: HdmsVehiclesSync | undefined;\n hdmsCrm: HdmsCrmSync | undefined;\n hdmsDocuments: HdmsDocumentSync | undefined;\n};\n\nexport type WhatsappStateResponse = {\n enabled: boolean;\n};\n\n/**\n * What the login page is told about a tenant before anyone has signed in. Reached by subdomain\n * on the one public tenant endpoint, so it carries only what an anonymous visitor may see —\n * mind that when adding to it.\n *\n * The two booleans are answers the page cannot work out for itself: it has no session, so no\n * modules to read. They say which sign-in options to offer and whether WhatsApp sharing is on.\n */\nexport type TenantInfoResponse = {\n tenant: PublicTenant;\n whatsapp: boolean;\n googleLogin: boolean;\n cognito: CognitoInfo;\n};\n"]}
|