@bisondesk/core-sdk 1.0.616 → 1.0.617

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (85) hide show
  1. package/lib/types/reports-leasing.d.ts +1 -0
  2. package/lib/types/reports-leasing.d.ts.map +1 -1
  3. package/lib/types/reports-leasing.js.map +1 -1
  4. package/lib/types/reports-sales.d.ts +9 -0
  5. package/lib/types/reports-sales.d.ts.map +1 -1
  6. package/lib/types/reports-sales.js.map +1 -1
  7. package/lib/types/tenants.d.ts +5 -0
  8. package/lib/types/tenants.d.ts.map +1 -1
  9. package/lib/types/tenants.js +1 -0
  10. package/lib/types/tenants.js.map +1 -1
  11. package/package.json +1 -1
  12. package/src/types/activities.js +13 -0
  13. package/src/types/activities.js.map +1 -0
  14. package/src/types/comparables.js +2 -0
  15. package/src/types/comparables.js.map +1 -0
  16. package/src/types/crm.js +58 -0
  17. package/src/types/crm.js.map +1 -0
  18. package/src/types/dashboard.js +2 -0
  19. package/src/types/dashboard.js.map +1 -0
  20. package/src/types/definitions.js +2 -0
  21. package/src/types/definitions.js.map +1 -0
  22. package/src/types/fields.js +2 -0
  23. package/src/types/fields.js.map +1 -0
  24. package/src/types/insights.js +2 -0
  25. package/src/types/insights.js.map +1 -0
  26. package/src/types/interests.js +6 -0
  27. package/src/types/interests.js.map +1 -0
  28. package/src/types/internal-events.js +18 -0
  29. package/src/types/internal-events.js.map +1 -0
  30. package/src/types/internet-opportunities.js +2 -0
  31. package/src/types/internet-opportunities.js.map +1 -0
  32. package/src/types/internet-vehicles.js +2 -0
  33. package/src/types/internet-vehicles.js.map +1 -0
  34. package/src/types/leasing-administration.js +2 -0
  35. package/src/types/leasing-administration.js.map +1 -0
  36. package/src/types/leasing-debtors.js +2 -0
  37. package/src/types/leasing-debtors.js.map +1 -0
  38. package/src/types/leasing-search.js +2 -0
  39. package/src/types/leasing-search.js.map +1 -0
  40. package/src/types/leasing-settings.js +7 -0
  41. package/src/types/leasing-settings.js.map +1 -0
  42. package/src/types/leasing.js +38 -0
  43. package/src/types/leasing.js.map +1 -0
  44. package/src/types/marketing.js +35 -0
  45. package/src/types/marketing.js.map +1 -0
  46. package/src/types/offers.js +56 -0
  47. package/src/types/opportunities.js +107 -0
  48. package/src/types/opportunities.js.map +1 -0
  49. package/src/types/payments.js +7 -0
  50. package/src/types/picklists.js +2 -0
  51. package/src/types/picklists.js.map +1 -0
  52. package/src/types/quotes.js +42 -0
  53. package/src/types/recently-viewed.js +2 -0
  54. package/src/types/recently-viewed.js.map +1 -0
  55. package/src/types/reports-leasing.ts +17 -4
  56. package/src/types/reports-sales.ts +16 -0
  57. package/src/types/reservations.js +5 -0
  58. package/src/types/reservations.js.map +1 -0
  59. package/src/types/roi-ratings.js +5 -0
  60. package/src/types/roi-ratings.js.map +1 -0
  61. package/src/types/saved-filters.js +9 -0
  62. package/src/types/saved-filters.js.map +1 -0
  63. package/src/types/search.js +2 -0
  64. package/src/types/search.js.map +1 -0
  65. package/src/types/settings.js +2 -0
  66. package/src/types/settings.js.map +1 -0
  67. package/src/types/templates.js +2 -0
  68. package/src/types/templates.js.map +1 -0
  69. package/src/types/tenants.js +21 -0
  70. package/src/types/tenants.js.map +1 -0
  71. package/src/types/tenants.ts +13 -0
  72. package/src/types/user-performance.js +7 -0
  73. package/src/types/user-performance.js.map +1 -0
  74. package/src/types/utils.js +2 -0
  75. package/src/types/validation.js +2 -0
  76. package/src/types/validation.js.map +1 -0
  77. package/src/types/vehicle-sales.js +6 -0
  78. package/src/types/vehicle-sales.js.map +1 -0
  79. package/src/types/vehicles.js +98 -0
  80. package/src/types/vehicles.js.map +1 -0
  81. package/src/utils/leasing.js +6 -0
  82. package/src/utils/leasing.js.map +1 -0
  83. package/src/utils/opportunities.js +48 -0
  84. package/src/utils/opportunities.js.map +1 -0
  85. package/tsconfig.tsbuildinfo +1 -1
@@ -89,6 +89,7 @@ export type LeasingReportResponse = {
89
89
  };
90
90
  cumulativeContracts: LeasingCumulativeBucket[];
91
91
  overdueHistory: LeasingOverdueBucket[];
92
+ overdueHistoryDay: number | null;
92
93
  invoicedHistory: LeasingInvoicedBucket[];
93
94
  fleet: {
94
95
  medianKm30d: number | null;
@@ -1 +1 @@
1
- {"version":3,"file":"reports-leasing.d.ts","sourceRoot":"/","sources":["types/reports-leasing.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAS/C,eAAO,MAAM,mBAAmB,gGAQtB,CAAC;AAEX,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEpE,eAAO,MAAM,sBAAsB,EAAE,gBAAwB,CAAC;AAE9D,MAAM,MAAM,oBAAoB,GAAG;IAAE,MAAM,EAAE,gBAAgB,CAAA;CAAE,CAAC;AAEhE,YAAY,EAAE,SAAS,EAAE,CAAC;AAG1B,MAAM,MAAM,qBAAqB,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,MAAM,GAAG,KAAK,CAAC;AAE3E,MAAM,MAAM,kBAAkB,GAAG;IAC/B,MAAM,EAAE,qBAAqB,CAAC;IAE9B,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IAEjC,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IAEd,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAE/B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAE9B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IAEd,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAEhC,EAAE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W,EAAE,MAAM,CAAC;KACrB,CAAC;CACH,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"reports-leasing.js","sourceRoot":"/","sources":["types/reports-leasing.ts"],"names":[],"mappings":"AAwBA,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,KAAK;IACL,KAAK;IACL,WAAW;IACX,aAAa;IACb,aAAa;IACb,cAAc;IACd,UAAU;CACF,CAAC;AAIX,MAAM,CAAC,MAAM,sBAAsB,GAAqB,KAAK,CAAC","sourcesContent":["/**\n * Leasing report — the payload for the `Reports → Leasing` tab. Computed entirely from\n * OpenSearch: receivables (`finance_docs`), contracts (`leasing_contracts`), leasing\n * opportunities (`opportunities`) and client risk (`debtors`).\n *\n * Every metric except the fixed cumulative chart is evaluated over — or as of the end\n * of — the selected whole-month window. `asOf = window.end`: `now` for `mtd`/`ytd`, and\n * the period boundary for historical ranges (so \"last year\" shows the state at the end\n * of last year). Flow metrics (invoiced, contracts started/ended, opportunities) sum over\n * the window; point-in-time metrics (overdue, aging, active contracts, risk) are\n * reconstructed as of `asOf`.\n *\n * The API returns raw numbers only; the client formats (€, %) and colors the deltas.\n */\n\nimport { YoyMetric } from './reports-sales.js';\n\n/**\n * Period presets driving every metric except the fixed cumulative chart, in selector\n * order. All are month-aligned (contracts start on the 1st of a month), so there are no\n * day-based ranges. `mtd`/`ytd` are to-date; `last{3,6,12}Months` are complete months\n * from the first of a month back to the start of the current month; `lastMonth`/\n * `lastYear` are the previous complete calendar month/year.\n */\nexport const LEASING_PERIOD_KEYS = [\n 'mtd',\n 'ytd',\n 'lastMonth',\n 'last3Months',\n 'last6Months',\n 'last12Months',\n 'lastYear',\n] as const;\n\nexport type LeasingPeriodKey = (typeof LEASING_PERIOD_KEYS)[number];\n\nexport const DEFAULT_LEASING_PERIOD: LeasingPeriodKey = 'mtd';\n\nexport type LeasingReportRequest = { period: LeasingPeriodKey };\n\nexport type { YoyMetric };\n\n/** Outstanding-invoice age bands, in calendar months from issue date as of the window end. */\nexport type LeasingAgingBucketKey = '0-1' | '1-2' | '2-3' | '3-12' | '1y+';\n\nexport type LeasingAgingBucket = {\n bucket: LeasingAgingBucketKey;\n /** Outstanding amount (excl VAT) in this age band, as of the window end. */\n amount: number;\n};\n\nexport type LeasingCategorySplit = {\n /** Vehicle category from `vehicle.external.general.category` (e.g. \"Tractor Head\"). */\n category: string;\n count: number;\n /** Share of opportunities into preparation in the current window, 0–100. */\n sharePct: number;\n};\n\nexport type LeasingSalesperson = {\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 LeasingOppCountry = {\n /** ISO country code (lowercase) from `org.countryCode`. */\n code: string;\n units: number;\n /** Share of opportunities into preparation in the current window, 0–100. */\n sharePct: number;\n};\n\nexport type LeasingRealSupplier = {\n /** CRM organization id for the operational supplier. */\n id: string;\n /** CRM organization name at report generation time; falls back to `id` when unavailable. */\n name: string;\n units: number;\n /** Share of opportunities with a resolved real supplier in the current window, 0–100. */\n sharePct: number;\n yoyPct: number | null;\n};\n\nexport type LeasingCumulativeBucket = {\n /** Calendar month, 1–12. */\n month: number;\n /** Cumulative new contracts started this calendar year through this month. */\n thisYear: number;\n /** Cumulative new contracts started last calendar year through this month. */\n lastYear: number;\n};\n\nexport type LeasingOverdueBucket = {\n /** `YYYY-MM` month. */\n month: string;\n /** Overdue rent amount (excl VAT) as of the end of that month. */\n amount: number;\n};\n\nexport type LeasingInvoicedBucket = {\n /** `YYYY-MM` month. */\n month: string;\n /** Net invoiced rent (invoices − credit notes, excl VAT) issued in that month. */\n amount: number;\n};\n\nexport type LeasingReportResponse = {\n period: {\n key: LeasingPeriodKey;\n /** Current window, half-open `[start, end)` (ISO strings). `end` is `asOf`. */\n start: string;\n end: string;\n /** Number of days in the window. */\n days: number;\n /** Year-ago window `[yoyStart, yoyEnd)`. */\n yoyStart: string;\n yoyEnd: string;\n };\n receivables: {\n /** Net invoiced (invoices − credit notes), excl VAT, over the window. */\n invoiced: YoyMetric;\n /** Overdue (excl VAT) as of the window end (+ as of end − 1y). */\n overdue: YoyMetric;\n /**\n * `overdue / total outstanding` as a fraction 0–1, both from finance_docs as of the window\n * end (overdue ÷ all unpaid rent). Null when nothing is outstanding.\n */\n overdueShareOfOutstanding: number | null;\n /**\n * Share of total outstanding rent held by the 10 largest debtors (concentration), as a\n * fraction 0–1. Null when nothing is outstanding.\n */\n top10ClientShare: number | null;\n };\n /** Outstanding leasing invoices by issue-date age, as of the window end. */\n aging: LeasingAgingBucket[];\n contracts: {\n /** Active contracts as of the window end (+ as of end − 1y). */\n active: YoyMetric;\n /** New contracts started over the window. */\n started: YoyMetric;\n /** Contracts that ended over the window (actual end date in range, excludes discarded). */\n ended: YoyMetric;\n };\n opportunities: {\n /** Leasing opportunities entering Preparation over the window. */\n intoPreparation: YoyMetric;\n /** Median opportunity amount over the window. */\n medianPrice: YoyMetric;\n /** Median leasing term in months, from each opp's active leasing quote. */\n medianDuration: YoyMetric;\n /** Median yearly ROI as a percentage 0–100, from each opp's active leasing quote. */\n medianRoiPerYear: YoyMetric;\n /** 75th-percentile yearly ROI (%) over the current window; null if no quotes. */\n roiPerYearP75: number | null;\n /** Median advance (deposit) as a percentage 0–100, from each opp's active leasing quote. */\n medianAdvancePct: YoyMetric;\n /** Vehicle category split of opportunities into Preparation (current window). */\n categorySplit: LeasingCategorySplit[];\n /** Sellers ranked by opportunities into Preparation (current units desc), with YoY. */\n salespeople: LeasingSalesperson[];\n /** Real suppliers ranked by opportunities into Preparation (current units desc), with YoY. */\n realSuppliers: LeasingRealSupplier[];\n /** Org-country split of opportunities into Preparation (current window). */\n countries: LeasingOppCountry[];\n };\n // Client risk, as of the snapshot month. `riskLevel` is zero-inflated (most clients\n // are 0), so this is the at-risk tail shape, not a central statistic.\n risk: {\n /** Active-contract clients with non-zero risk, with YoY. */\n clientsAtRisk: YoyMetric;\n /** Total active-contract clients (the at-risk denominator). */\n activeClients: number;\n /** Severity-band counts of at-risk clients (`riskLevel` floored: levels 1/2/3/4+). */\n bands: { band: string; count: number }[];\n };\n /** Fixed 12-month cumulative new contracts, this calendar year vs last. */\n cumulativeContracts: LeasingCumulativeBucket[];\n /** Fixed trailing-6-month overdue rent amount (excl VAT), as of each month-end. */\n overdueHistory: LeasingOverdueBucket[];\n /** Net invoiced rent (excl VAT) by issue month, from a fixed start (Jan 2025) to now. */\n invoicedHistory: LeasingInvoicedBucket[];\n /** Track-and-trace fleet usage over the window. */\n fleet: {\n /**\n * Median `last30DaysKm` across wired track-and-trace devices that pinged within the window;\n * null when no such device. From the `track_and_trace_devices` index.\n */\n medianKm30d: number | null;\n /** Number of wired devices (carrying a km value) the median was taken over. */\n deviceCount: number;\n };\n};\n"]}
1
+ {"version":3,"file":"reports-leasing.js","sourceRoot":"/","sources":["types/reports-leasing.ts"],"names":[],"mappings":"AAwBA,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,KAAK;IACL,KAAK;IACL,WAAW;IACX,aAAa;IACb,aAAa;IACb,cAAc;IACd,UAAU;CACF,CAAC;AAIX,MAAM,CAAC,MAAM,sBAAsB,GAAqB,KAAK,CAAC","sourcesContent":["/**\n * Leasing report — the payload for the `Reports → Leasing` tab. Computed entirely from\n * OpenSearch: receivables (`finance_docs`), contracts (`leasing_contracts`), leasing\n * opportunities (`opportunities`) and client risk (`debtors`).\n *\n * Every metric except the fixed cumulative chart is evaluated over — or as of the end\n * of — the selected whole-month window. `asOf = window.end`: `now` for `mtd`/`ytd`, and\n * the period boundary for historical ranges (so \"last year\" shows the state at the end\n * of last year). Flow metrics (invoiced, contracts started/ended, opportunities) sum over\n * the window; point-in-time metrics (overdue, aging, active contracts, risk) are\n * reconstructed as of `asOf`.\n *\n * The API returns raw numbers only; the client formats (€, %) and colors the deltas.\n */\n\nimport { YoyMetric } from './reports-sales.js';\n\n/**\n * Period presets driving every metric except the fixed cumulative chart, in selector\n * order. All are month-aligned (contracts start on the 1st of a month), so there are no\n * day-based ranges. `mtd`/`ytd` are to-date; `last{3,6,12}Months` are complete months\n * from the first of a month back to the start of the current month; `lastMonth`/\n * `lastYear` are the previous complete calendar month/year.\n */\nexport const LEASING_PERIOD_KEYS = [\n 'mtd',\n 'ytd',\n 'lastMonth',\n 'last3Months',\n 'last6Months',\n 'last12Months',\n 'lastYear',\n] as const;\n\nexport type LeasingPeriodKey = (typeof LEASING_PERIOD_KEYS)[number];\n\nexport const DEFAULT_LEASING_PERIOD: LeasingPeriodKey = 'mtd';\n\nexport type LeasingReportRequest = { period: LeasingPeriodKey };\n\nexport type { YoyMetric };\n\n/** Outstanding-invoice age bands, in calendar months from issue date as of the window end. */\nexport type LeasingAgingBucketKey = '0-1' | '1-2' | '2-3' | '3-12' | '1y+';\n\nexport type LeasingAgingBucket = {\n bucket: LeasingAgingBucketKey;\n /** Outstanding amount (excl VAT) in this age band, as of the window end. */\n amount: number;\n};\n\nexport type LeasingCategorySplit = {\n /** Vehicle category from `vehicle.external.general.category` (e.g. \"Tractor Head\"). */\n category: string;\n count: number;\n /** Share of opportunities into preparation in the current window, 0–100. */\n sharePct: number;\n};\n\nexport type LeasingSalesperson = {\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 LeasingOppCountry = {\n /** ISO country code (lowercase) from `org.countryCode`. */\n code: string;\n units: number;\n /** Share of opportunities into preparation in the current window, 0–100. */\n sharePct: number;\n};\n\nexport type LeasingRealSupplier = {\n /** CRM organization id for the operational supplier. */\n id: string;\n /** CRM organization name at report generation time; falls back to `id` when unavailable. */\n name: string;\n units: number;\n /** Share of opportunities with a resolved real supplier in the current window, 0–100. */\n sharePct: number;\n yoyPct: number | null;\n};\n\nexport type LeasingCumulativeBucket = {\n /** Calendar month, 1–12. */\n month: number;\n /** Cumulative new contracts started this calendar year through this month. */\n thisYear: number;\n /** Cumulative new contracts started last calendar year through this month. */\n lastYear: number;\n};\n\nexport type LeasingOverdueBucket = {\n /** `YYYY-MM` month. */\n month: string;\n /** Overdue rent amount (excl VAT) as of that month's snapshot (see `overdueHistoryDay`). */\n amount: number;\n};\n\nexport type LeasingInvoicedBucket = {\n /** `YYYY-MM` month. */\n month: string;\n /** Net invoiced rent (invoices − credit notes, excl VAT) issued in that month. */\n amount: number;\n};\n\nexport type LeasingReportResponse = {\n period: {\n key: LeasingPeriodKey;\n /** Current window, half-open `[start, end)` (ISO strings). `end` is `asOf`. */\n start: string;\n end: string;\n /** Number of days in the window. */\n days: number;\n /** Year-ago window `[yoyStart, yoyEnd)`. */\n yoyStart: string;\n yoyEnd: string;\n };\n receivables: {\n /** Net invoiced (invoices − credit notes), excl VAT, over the window. */\n invoiced: YoyMetric;\n /** Overdue (excl VAT) as of the window end (+ as of end − 1y). */\n overdue: YoyMetric;\n /**\n * `overdue / total outstanding` as a fraction 0–1, both from finance_docs as of the window\n * end (overdue ÷ all unpaid rent). Null when nothing is outstanding.\n */\n overdueShareOfOutstanding: number | null;\n /**\n * Share of total outstanding rent held by the 10 largest debtors (concentration), as a\n * fraction 0–1. Null when nothing is outstanding.\n */\n top10ClientShare: number | null;\n };\n /** Outstanding leasing invoices by issue-date age, as of the window end. */\n aging: LeasingAgingBucket[];\n contracts: {\n /** Active contracts as of the window end (+ as of end − 1y). */\n active: YoyMetric;\n /** New contracts started over the window. */\n started: YoyMetric;\n /** Contracts that ended over the window (actual end date in range, excludes discarded). */\n ended: YoyMetric;\n };\n opportunities: {\n /** Leasing opportunities entering Preparation over the window. */\n intoPreparation: YoyMetric;\n /** Median opportunity amount over the window. */\n medianPrice: YoyMetric;\n /** Median leasing term in months, from each opp's active leasing quote. */\n medianDuration: YoyMetric;\n /** Median yearly ROI as a percentage 0–100, from each opp's active leasing quote. */\n medianRoiPerYear: YoyMetric;\n /** 75th-percentile yearly ROI (%) over the current window; null if no quotes. */\n roiPerYearP75: number | null;\n /** Median advance (deposit) as a percentage 0–100, from each opp's active leasing quote. */\n medianAdvancePct: YoyMetric;\n /** Vehicle category split of opportunities into Preparation (current window). */\n categorySplit: LeasingCategorySplit[];\n /** Sellers ranked by opportunities into Preparation (current units desc), with YoY. */\n salespeople: LeasingSalesperson[];\n /** Real suppliers ranked by opportunities into Preparation (current units desc), with YoY. */\n realSuppliers: LeasingRealSupplier[];\n /** Org-country split of opportunities into Preparation (current window). */\n countries: LeasingOppCountry[];\n };\n // Client risk, as of the snapshot month. `riskLevel` is zero-inflated (most clients\n // are 0), so this is the at-risk tail shape, not a central statistic.\n risk: {\n /**\n * Active-contract clients at risk level ≥ 2, with YoY. Level 1 (one overdue invoice\n * per overdue contract) is the ordinary pays-next-month case and isn't counted, so\n * this can be lower than the sum of `bands` (which still includes level 1).\n * For in-progress periods (mtd/ytd) `prev`/`pct` are null: the risk history stores\n * month-end states only, so a mid-month reading has no day-aligned year-ago base.\n */\n clientsAtRisk: YoyMetric;\n /** Total active-contract clients (the at-risk denominator). */\n activeClients: number;\n /** Severity-band counts of all overdue clients (`riskLevel` floored: levels 1/2/3/4+). */\n bands: { band: string; count: number }[];\n };\n /** Fixed 12-month cumulative new contracts, this calendar year vs last. */\n cumulativeContracts: LeasingCumulativeBucket[];\n /** Fixed trailing-6-month overdue rent amount (excl VAT), one snapshot per month. */\n overdueHistory: LeasingOverdueBucket[];\n /**\n * Day-of-month the overdue-history snapshots are taken on — today's day, so every past\n * month is measured at the same point in its month as the in-progress one. Null when\n * today is past the 28th (a day not every month has) and the snapshots are month-ends\n * instead, with the current month at now.\n */\n overdueHistoryDay: number | null;\n /** Net invoiced rent (excl VAT) by issue month, from a fixed start (Jan 2025) to now. */\n invoicedHistory: LeasingInvoicedBucket[];\n /** Track-and-trace fleet usage over the window. */\n fleet: {\n /**\n * Median `last30DaysKm` across wired track-and-trace devices that pinged within the window;\n * null when no such device. From the `track_and_trace_devices` index.\n */\n medianKm30d: number | null;\n /** Number of wired devices (carrying a km value) the median was taken over. */\n deviceCount: number;\n };\n};\n"]}
@@ -35,6 +35,13 @@ export type SalesReportMake = {
35
35
  units: number;
36
36
  yoyPct: number | null;
37
37
  };
38
+ export type SalesReportTopOrg = {
39
+ id: string;
40
+ name: string;
41
+ countryCode: string | null;
42
+ units: number;
43
+ yoyPct: number | null;
44
+ };
38
45
  export type SalesReportConglomerateOrg = {
39
46
  id: string;
40
47
  name: string;
@@ -78,6 +85,8 @@ export type SalesReportResponse = {
78
85
  makes: SalesReportMake[];
79
86
  salespeople: SalesReportSalesperson[];
80
87
  buyers: SalesReportBuyer[];
88
+ topClients: SalesReportTopOrg[];
89
+ topSuppliers: SalesReportTopOrg[];
81
90
  returning: TenureBucket[];
82
91
  conglomerate: SalesReportConglomerate;
83
92
  histogram: SalesReportHistogramBucket[];
@@ -1 +1 @@
1
- {"version":3,"file":"reports-sales.d.ts","sourceRoot":"/","sources":["types/reports-sales.ts"],"names":[],"mappings":"AAiBA,eAAO,MAAM,iBAAiB,qFAUpB,CAAC;AAEX,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEhE,eAAO,MAAM,oBAAoB,EAAE,cAAsB,CAAC;AAE1D,MAAM,MAAM,kBAAkB,GAAG;IAAE,MAAM,EAAE,cAAc,CAAA;CAAE,CAAC;AAS5D,MAAM,MAAM,SAAS,GAAG;IAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAAC;AAG1F,MAAM,MAAM,eAAe,GAAG,IAAI,GAAG,MAAM,GAAG,KAAK,GAAG,KAAK,CAAC;AAE5D,MAAM,MAAM,YAAY,GAAG;IACzB,MAAM,EAAE,eAAe,CAAC;IAExB,QAAQ,EAAE,MAAM,CAAC;IAEjB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAE/B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;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AE3B,UAAU,EAAE,iBAAiB,EAAE,CAAC;IAEhC,YAAY,EAAE,iBAAiB,EAAE,CAAC;IAElC,SAAS,EAAE,YAAY,EAAE,CAAC;IAC1B,YAAY,EAAE,uBAAuB,CAAC;IAEtC,SAAS,EAAE,0BAA0B,EAAE,CAAC;IAMxC,QAAQ,EAAE,aAAa,EAAE,CAAC;IAM1B,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B,CAAC"}
@@ -1 +1 @@
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;AAmF1D,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\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 * 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 day on the stock-age chart, measured by capital tied up in inventory. A vehicle\n * counts on `date` when the supplier was fully paid on or before that day and it had not\n * been sold yet; its age is `date − supplierFullyPaidAt` in days. Used vehicles only.\n */\nexport type StockAgePoint = {\n /** Snapshot day, `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\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 /** 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 /** 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 /**\n * Stock-age evolution measured as capital tied up in inventory: one daily snapshot of\n * vehicles by days from supplier-fully-paid to sold (used vehicles). Fixed to the last\n * 6 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"]}
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;AA+F1D,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\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 * 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 day on the stock-age chart, measured by capital tied up in inventory. A vehicle\n * counts on `date` when the supplier was fully paid on or before that day and it had not\n * been sold yet; its age is `date − supplierFullyPaidAt` in days. Used vehicles only.\n */\nexport type StockAgePoint = {\n /** Snapshot day, `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\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 /** 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 /**\n * Stock-age evolution measured as capital tied up in inventory: one daily snapshot of\n * vehicles by days from supplier-fully-paid to sold (used vehicles). Fixed to the last\n * 6 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"]}
@@ -31,6 +31,8 @@ export declare enum TenantModule {
31
31
  Reports = "reports",
32
32
  Prospects = "prospects"
33
33
  }
34
+ export declare const REPORT_TAB_KEYS: readonly ["sales", "leasing", "purchases"];
35
+ export type ReportTabKey = (typeof REPORT_TAB_KEYS)[number];
34
36
  export type Tenant = PublicTenant & {
35
37
  cognito?: CognitoInfo;
36
38
  languages: [string, ...string[]];
@@ -41,6 +43,9 @@ export type Tenant = PublicTenant & {
41
43
  exactAccounting?: boolean;
42
44
  branches: [Branch, ...Branch[]];
43
45
  modules: TenantModule[];
46
+ reports?: {
47
+ tabs: ReportTabKey[];
48
+ };
44
49
  test?: boolean;
45
50
  opportunities: {
46
51
  types: OpportunityType[];
@@ -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,Y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AAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC;IACxD,QAAQ,EAAE;QACR,QAAQ,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,QAAQ,EAAE,aAAa,CAAC;IAExB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAChC,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,MAAM,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACxB,MAAM,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,MAAM,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,gBAAgB,GAAG,SAAS,CAAC;IAC3C,OAAO,EAAE,WAAW,GAAG,SAAS,CAAC;IACjC,aAAa,EAAE,gBAAgB,GAAG,SAAS,CAAC;CAC7C,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC"}
@@ -21,4 +21,5 @@ export var TenantModule;
21
21
  TenantModule["Reports"] = "reports";
22
22
  TenantModule["Prospects"] = "prospects";
23
23
  })(TenantModule || (TenantModule = {}));
24
+ export const REPORT_TAB_KEYS = ['sales', 'leasing', 'purchases'];
24
25
  //# sourceMappingURL=tenants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"tenants.js","sourceRoot":"/","sources":["types/tenants.ts"],"names":[],"mappings":"AAgBA,MAAM,CAAN,IAAY,YAqBX;AArBD,WAAY,YAAY;IACtB,iDAAiC,CAAA;IACjC,2BAAW,CAAA;IACX,2BAAW,CAAA;IACX,6BAAa,CAAA;IACb,+BAAe,CAAA;IACf,mCAAmB,CAAA;IACnB,uCAAuB,CAAA;IACvB,qCAAqB,CAAA;IACrB,+CAA+B,CAAA;IAC/B,iCAAiB,CAAA;IACjB,2DAA2C,CAAA;IAC3C,qCAAqB,CAAA;IACrB,+BAAe,CAAA;IACf,iDAAiC,CAAA;IACjC,uCAAuB,CAAA;IACvB,gEAAgD,CAAA;IAChD,+BAAe,CAAA;IACf,uCAAuB,CAAA;IACvB,mCAAmB,CAAA;IACnB,uCAAuB,CAAA;AACzB,CAAC,EArBW,YAAY,KAAZ,YAAY,QAqBvB","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 CRM = 'crm',\n Docs = 'docs',\n Leads = 'leads',\n Leasing = 'leasing',\n Marketing = 'marketing',\n Insights = 'insights',\n Opportunities = 'opportunities',\n Offers = 'offers',\n VehiclesMasterData = 'vehicles_master_data',\n Vehicles = 'vehicles',\n Tasks = 'tasks',\n TrackAndTrace = 'track_and_trace',\n Bootstrap = 'bootstrap',\n WhatsappNotifications = 'whatsapp_notifications',\n Hexon = 'hexon',\n Transport = 'transport',\n Reports = 'reports',\n Prospects = 'prospects',\n}\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 test?: boolean;\n opportunities: {\n types: OpportunityType[];\n };\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};\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 externalQuote?: boolean;\n hyperdmsId?: string;\n internalDealsEnabled?: 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"]}
1
+ {"version":3,"file":"tenants.js","sourceRoot":"/","sources":["types/tenants.ts"],"names":[],"mappings":"AAgBA,MAAM,CAAN,IAAY,YAqBX;AArBD,WAAY,YAAY;IACtB,iDAAiC,CAAA;IACjC,2BAAW,CAAA;IACX,2BAAW,CAAA;IACX,6BAAa,CAAA;IACb,+BAAe,CAAA;IACf,mCAAmB,CAAA;IACnB,uCAAuB,CAAA;IACvB,qCAAqB,CAAA;IACrB,+CAA+B,CAAA;IAC/B,iCAAiB,CAAA;IACjB,2DAA2C,CAAA;IAC3C,qCAAqB,CAAA;IACrB,+BAAe,CAAA;IACf,iDAAiC,CAAA;IACjC,uCAAuB,CAAA;IACvB,gEAAgD,CAAA;IAChD,+BAAe,CAAA;IACf,uCAAuB,CAAA;IACvB,mCAAmB,CAAA;IACnB,uCAAuB,CAAA;AACzB,CAAC,EArBW,YAAY,KAAZ,YAAY,QAqBvB;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 CRM = 'crm',\n Docs = 'docs',\n Leads = 'leads',\n Leasing = 'leasing',\n Marketing = 'marketing',\n Insights = 'insights',\n Opportunities = 'opportunities',\n Offers = 'offers',\n VehiclesMasterData = 'vehicles_master_data',\n Vehicles = 'vehicles',\n Tasks = 'tasks',\n TrackAndTrace = 'track_and_trace',\n Bootstrap = 'bootstrap',\n WhatsappNotifications = 'whatsapp_notifications',\n Hexon = 'hexon',\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 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};\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 externalQuote?: boolean;\n hyperdmsId?: string;\n internalDealsEnabled?: 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"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bisondesk/core-sdk",
3
- "version": "1.0.616",
3
+ "version": "1.0.617",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "author": "TheTruckCompany",
@@ -0,0 +1,13 @@
1
+ export var ActivityType;
2
+ (function (ActivityType) {
3
+ ActivityType["CALL"] = "call";
4
+ ActivityType["MEETING"] = "meeting";
5
+ ActivityType["EMAIL"] = "email";
6
+ ActivityType["CHAT"] = "chat";
7
+ })(ActivityType || (ActivityType = {}));
8
+ export var ActivityActions;
9
+ (function (ActivityActions) {
10
+ ActivityActions["DELETE"] = "delete";
11
+ ActivityActions["EDIT"] = "edit";
12
+ })(ActivityActions || (ActivityActions = {}));
13
+ //# sourceMappingURL=activities.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"activities.js","sourceRoot":"","sources":["activities.ts"],"names":[],"mappings":"AAGA,MAAM,CAAN,IAAY,YAKX;AALD,WAAY,YAAY;IACtB,6BAAa,CAAA;IACb,mCAAmB,CAAA;IACnB,+BAAe,CAAA;IACf,6BAAa,CAAA;AACf,CAAC,EALW,YAAY,KAAZ,YAAY,QAKvB;AAED,MAAM,CAAN,IAAY,eAGX;AAHD,WAAY,eAAe;IACzB,oCAAiB,CAAA;IACjB,gCAAa,CAAA;AACf,CAAC,EAHW,eAAe,KAAf,eAAe,QAG1B"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=comparables.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"comparables.js","sourceRoot":"","sources":["comparables.ts"],"names":[],"mappings":""}
@@ -0,0 +1,58 @@
1
+ export var OrganizatioRiskTags;
2
+ (function (OrganizatioRiskTags) {
3
+ OrganizatioRiskTags["BAD_FINANCIAL_INFO"] = "BAD_FINANCIAL_INFO";
4
+ OrganizatioRiskTags["VAT_NUMBER_INVALID"] = "VAT_NUMBER_INVALID";
5
+ OrganizatioRiskTags["INSTINCT"] = "INSTINCT";
6
+ OrganizatioRiskTags["NEW_CUSTOMER"] = "NEW_CUSTOMER";
7
+ OrganizatioRiskTags["BANK_ACCOUNT_BLOCKED"] = "BANK_ACCOUNT_BLOCKED";
8
+ OrganizatioRiskTags["NO_GPS"] = "NO_GPS";
9
+ })(OrganizatioRiskTags || (OrganizatioRiskTags = {}));
10
+ export var ContactActions;
11
+ (function (ContactActions) {
12
+ ContactActions["UPSERT"] = "upsert";
13
+ ContactActions["DELETE"] = "delete";
14
+ })(ContactActions || (ContactActions = {}));
15
+ export var OrganizationActions;
16
+ (function (OrganizationActions) {
17
+ OrganizationActions["ADD_ACTIVITY"] = "add_activity";
18
+ OrganizationActions["UPSERT"] = "upsert";
19
+ OrganizationActions["DELETE"] = "delete";
20
+ OrganizationActions["SELL_TO_ORGANIZATION"] = "sell_to_organization";
21
+ })(OrganizationActions || (OrganizationActions = {}));
22
+ export var MarketingChannel;
23
+ (function (MarketingChannel) {
24
+ MarketingChannel["Email"] = "email";
25
+ MarketingChannel["Whatsapp"] = "whatsapp";
26
+ MarketingChannel["Sms"] = "sms";
27
+ MarketingChannel["Phone"] = "phone";
28
+ })(MarketingChannel || (MarketingChannel = {}));
29
+ export var PartnerLevel;
30
+ (function (PartnerLevel) {
31
+ PartnerLevel["Internal"] = "05-internal";
32
+ PartnerLevel["Gold"] = "10-gold";
33
+ PartnerLevel["Silver"] = "20-silver";
34
+ PartnerLevel["Bronze"] = "30-bronze";
35
+ })(PartnerLevel || (PartnerLevel = {}));
36
+ export var SaveContactResolution;
37
+ (function (SaveContactResolution) {
38
+ SaveContactResolution["IgnoreDuplicates"] = "IGNORE_DUPLICATES";
39
+ SaveContactResolution["BlockDuplicates"] = "BLOCK_DUPLICATES";
40
+ })(SaveContactResolution || (SaveContactResolution = {}));
41
+ export var SaveOrgResolution;
42
+ (function (SaveOrgResolution) {
43
+ SaveOrgResolution["IgnoreDuplicates"] = "IGNORE_DUPLICATES";
44
+ SaveOrgResolution["BlockDuplicates"] = "BLOCK_DUPLICATES";
45
+ })(SaveOrgResolution || (SaveOrgResolution = {}));
46
+ export var CrmSearchScope;
47
+ (function (CrmSearchScope) {
48
+ CrmSearchScope["Tenant"] = "tenant";
49
+ CrmSearchScope["Conglomerate"] = "conglomerate";
50
+ })(CrmSearchScope || (CrmSearchScope = {}));
51
+ export var OrgEngagementType;
52
+ (function (OrgEngagementType) {
53
+ OrgEngagementType["offers"] = "offers";
54
+ OrgEngagementType["purchases"] = "purchases";
55
+ OrgEngagementType["opportunities"] = "opportunities";
56
+ OrgEngagementType["sales"] = "sales";
57
+ })(OrgEngagementType || (OrgEngagementType = {}));
58
+ //# sourceMappingURL=crm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"crm.js","sourceRoot":"","sources":["crm.ts"],"names":[],"mappings":"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AiB,CAAA;IACjB,+CAA6B,CAAA;AAC/B,CAAC,EAHW,cAAc,KAAd,cAAc,QAGzB;AAED,MAAM,CAAN,IAAY,iBAKX;AALD,WAAY,iBAAiB;IAC3B,sCAAiB,CAAA;IACjB,4CAAuB,CAAA;IACvB,oDAA+B,CAAA;IAC/B,oCAAe,CAAA;AACjB,CAAC,EALW,iBAAiB,KAAjB,iBAAiB,QAK5B"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=dashboard.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dashboard.js","sourceRoot":"","sources":["dashboard.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export * from '@bisondesk/commons-sdk/definitions';
2
+ //# sourceMappingURL=definitions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"definitions.js","sourceRoot":"","sources":["definitions.ts"],"names":[],"mappings":"AAAA,cAAc,oCAAoC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from '@bisondesk/commons-sdk/fields';
2
+ //# sourceMappingURL=fields.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fields.js","sourceRoot":"","sources":["fields.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=insights.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"insights.js","sourceRoot":"","sources":["insights.ts"],"names":[],"mappings":""}
@@ -0,0 +1,6 @@
1
+ export var InterestActions;
2
+ (function (InterestActions) {
3
+ InterestActions["SET_INTEREST"] = "set_interest";
4
+ })(InterestActions || (InterestActions = {}));
5
+ export const isOpportunityInterest = (interest) => 'opportunityId' in interest;
6
+ //# sourceMappingURL=interests.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interests.js","sourceRoot":"","sources":["interests.ts"],"names":[],"mappings":"AAGA,MAAM,CAAN,IAAY,eAEX;AAFD,WAAY,eAAe;IACzB,gDAA6B,CAAA;AAC/B,CAAC,EAFW,eAAe,KAAf,eAAe,QAE1B;AAwBD,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,QAAkB,EAAmC,EAAE,CAC3F,eAAe,IAAI,QAAQ,CAAC"}
@@ -0,0 +1,18 @@
1
+ export var InternalEventTypes;
2
+ (function (InternalEventTypes) {
3
+ InternalEventTypes["VEHICLE_PURCHASE"] = "vehicle-purchases";
4
+ InternalEventTypes["ORGANIZATION"] = "organizations";
5
+ InternalEventTypes["CONTACT"] = "contacts";
6
+ InternalEventTypes["FINANCE_DOCUMENT"] = "finance-documents";
7
+ InternalEventTypes["OPPORTUNITY"] = "opportunities";
8
+ InternalEventTypes["VEHICLE"] = "vehicles";
9
+ InternalEventTypes["SALE_PAYMENT"] = "sale-payments";
10
+ InternalEventTypes["PURCHASE_PAYMENT"] = "vehicle-purchase-payments";
11
+ InternalEventTypes["OFFER"] = "offers";
12
+ })(InternalEventTypes || (InternalEventTypes = {}));
13
+ export var InternalNotificationChannels;
14
+ (function (InternalNotificationChannels) {
15
+ InternalNotificationChannels["APP"] = "app";
16
+ InternalNotificationChannels["EMAIL"] = "email";
17
+ })(InternalNotificationChannels || (InternalNotificationChannels = {}));
18
+ //# sourceMappingURL=internal-events.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"internal-events.js","sourceRoot":"","sources":["internal-events.ts"],"names":[],"mappings":"AASA,MAAM,CAAN,IAAY,kBAUX;AAVD,WAAY,kBAAkB;IAC5B,4DAAsC,CAAA;IACtC,oDAA8B,CAAA;IAC9B,0CAAoB,CAAA;IACpB,4DAAsC,CAAA;IACtC,mDAA6B,CAAA;IAC7B,0CAAoB,CAAA;IACpB,oDAA8B,CAAA;IAC9B,oEAA8C,CAAA;IAC9C,sCAAgB,CAAA;AAClB,CAAC,EAVW,kBAAkB,KAAlB,kBAAkB,QAU7B;AAED,MAAM,CAAN,IAAY,4BAGX;AAHD,WAAY,4BAA4B;IACtC,2CAAW,CAAA;IACX,+CAAe,CAAA;AACjB,CAAC,EAHW,4BAA4B,KAA5B,4BAA4B,QAGvC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=internet-opportunities.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"internet-opportunities.js","sourceRoot":"","sources":["internet-opportunities.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=internet-vehicles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"internet-vehicles.js","sourceRoot":"","sources":["internet-vehicles.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=leasing-administration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"leasing-administration.js","sourceRoot":"","sources":["leasing-administration.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=leasing-debtors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"leasing-debtors.js","sourceRoot":"","sources":["leasing-debtors.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=leasing-search.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"leasing-search.js","sourceRoot":"","sources":["leasing-search.ts"],"names":[],"mappings":""}
@@ -0,0 +1,7 @@
1
+ export var LeasingItemsPaymentSplit;
2
+ (function (LeasingItemsPaymentSplit) {
3
+ LeasingItemsPaymentSplit["Customer"] = "customer";
4
+ LeasingItemsPaymentSplit["Split"] = "split";
5
+ LeasingItemsPaymentSplit["Company"] = "company";
6
+ })(LeasingItemsPaymentSplit || (LeasingItemsPaymentSplit = {}));
7
+ //# sourceMappingURL=leasing-settings.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"leasing-settings.js","sourceRoot":"","sources":["leasing-settings.ts"],"names":[],"mappings":"AAwCA,MAAM,CAAN,IAAY,wBAIX;AAJD,WAAY,wBAAwB;IAClC,iDAAqB,CAAA;IACrB,2CAAe,CAAA;IACf,+CAAmB,CAAA;AACrB,CAAC,EAJW,wBAAwB,KAAxB,wBAAwB,QAInC"}
@@ -0,0 +1,38 @@
1
+ export var LeasingContractActions;
2
+ (function (LeasingContractActions) {
3
+ LeasingContractActions["CREATE_FINANCE_DOCUMENT"] = "create_finance_document";
4
+ LeasingContractActions["START_RETAKE_VEHICLE"] = "start_retake_vehicle";
5
+ LeasingContractActions["END_RETAKE_VEHICLE"] = "end_retake_vehicle";
6
+ LeasingContractActions["START_CONTRACT_END"] = "start_contract_end";
7
+ LeasingContractActions["END_CONTRACT"] = "end_contract";
8
+ LeasingContractActions["CANCEL_RETAKE_VEHICLE"] = "cancel_retake_vehicle";
9
+ })(LeasingContractActions || (LeasingContractActions = {}));
10
+ export var LeasingContractSource;
11
+ (function (LeasingContractSource) {
12
+ LeasingContractSource["HYPERPORTAL"] = "hyperportal";
13
+ LeasingContractSource["BISONDESK"] = "bisondesk";
14
+ })(LeasingContractSource || (LeasingContractSource = {}));
15
+ export var LeasingContractStatus;
16
+ (function (LeasingContractStatus) {
17
+ LeasingContractStatus["DRAFT"] = "draft";
18
+ LeasingContractStatus["DISCARDED"] = "discarded";
19
+ LeasingContractStatus["PAUSED"] = "paused";
20
+ LeasingContractStatus["ACTIVE"] = "active";
21
+ LeasingContractStatus["LEASING_RETURN"] = "leasing_return";
22
+ LeasingContractStatus["RECOVERED"] = "recovered";
23
+ LeasingContractStatus["ENDING"] = "ending";
24
+ LeasingContractStatus["ENDED"] = "ended";
25
+ })(LeasingContractStatus || (LeasingContractStatus = {}));
26
+ export var LeasingRemindersSortableColumns;
27
+ (function (LeasingRemindersSortableColumns) {
28
+ LeasingRemindersSortableColumns["NextActionAt"] = "next_action_at";
29
+ LeasingRemindersSortableColumns["OrganizationName"] = "organization_name";
30
+ LeasingRemindersSortableColumns["RemindersCount"] = "reminders_count";
31
+ LeasingRemindersSortableColumns["Status"] = "status";
32
+ })(LeasingRemindersSortableColumns || (LeasingRemindersSortableColumns = {}));
33
+ export var LEASING_EXPORT_TYPES;
34
+ (function (LEASING_EXPORT_TYPES) {
35
+ LEASING_EXPORT_TYPES["RENTAL_SOLUTIONS"] = "rental-solutions";
36
+ LEASING_EXPORT_TYPES["DEFAULT"] = "default";
37
+ })(LEASING_EXPORT_TYPES || (LEASING_EXPORT_TYPES = {}));
38
+ //# sourceMappingURL=leasing.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"leasing.js","sourceRoot":"","sources":["leasing.ts"],"names":[],"mappings":"AAKA,MAAM,CAAN,IAAY,sBAOX;AAPD,WAAY,sBAAsB;IAChC,6EAAmD,CAAA;IACnD,uEAA6C,CAAA;IAC7C,mEAAyC,CAAA;IACzC,mEAAyC,CAAA;IACzC,uDAA6B,CAAA;IAC7B,yEAA+C,CAAA;AACjD,CAAC,EAPW,sBAAsB,KAAtB,sBAAsB,QAOjC;AA8DD,MAAM,CAAN,IAAY,qBAGX;AAHD,WAAY,qBAAqB;IAC/B,oDAA2B,CAAA;IAC3B,gDAAuB,CAAA;AACzB,CAAC,EAHW,qBAAqB,KAArB,qBAAqB,QAGhC;AAED,MAAM,CAAN,IAAY,qBASX;AATD,WAAY,qBAAqB;IAC/B,wCAAe,CAAA;IACf,gDAAuB,CAAA;IACvB,0CAAiB,CAAA;IACjB,0CAAiB,CAAA;IACjB,0DAAiC,CAAA;IACjC,gDAAuB,CAAA;IACvB,0CAAiB,CAAA;IACjB,wCAAe,CAAA;AACjB,CAAC,EATW,qBAAqB,KAArB,qBAAqB,QAShC;AAuQD,MAAM,CAAN,IAAY,+BAKX;AALD,WAAY,+BAA+B;IACzC,kEAA+B,CAAA;IAC/B,yEAAsC,CAAA;IACtC,qEAAkC,CAAA;IAClC,oDAAiB,CAAA;AACnB,CAAC,EALW,+BAA+B,KAA/B,+BAA+B,QAK1C;AAgGD,MAAM,CAAN,IAAY,oBAGX;AAHD,WAAY,oBAAoB;IAC9B,6DAAqC,CAAA;IACrC,2CAAmB,CAAA;AACrB,CAAC,EAHW,oBAAoB,KAApB,oBAAoB,QAG/B"}
@@ -0,0 +1,35 @@
1
+ export var MarketingPlatform;
2
+ (function (MarketingPlatform) {
3
+ MarketingPlatform["autoscout24"] = "autoscout24";
4
+ MarketingPlatform["autoline"] = "autoline";
5
+ MarketingPlatform["exportseller"] = "exportseller";
6
+ MarketingPlatform["machineryplanet"] = "machineryplanet";
7
+ MarketingPlatform["machinetrack"] = "machinetrack";
8
+ MarketingPlatform["marktnet"] = "marktnet";
9
+ MarketingPlatform["mobile"] = "mobile";
10
+ MarketingPlatform["truck1st"] = "truck1st";
11
+ MarketingPlatform["trucks"] = "trucks";
12
+ MarketingPlatform["truckscout"] = "truckscout24";
13
+ MarketingPlatform["tweedehandsbe"] = "2ehandsbe";
14
+ MarketingPlatform["viamobilis"] = "planettrucks";
15
+ MarketingPlatform["youtube"] = "youtube";
16
+ })(MarketingPlatform || (MarketingPlatform = {}));
17
+ export var MarketingEventStatus;
18
+ (function (MarketingEventStatus) {
19
+ MarketingEventStatus["Scheduled"] = "scheduled";
20
+ MarketingEventStatus["Processing"] = "processing";
21
+ MarketingEventStatus["Skipped"] = "skipped";
22
+ MarketingEventStatus["Error"] = "error";
23
+ MarketingEventStatus["Sent"] = "processed";
24
+ })(MarketingEventStatus || (MarketingEventStatus = {}));
25
+ export var MarketingEventType;
26
+ (function (MarketingEventType) {
27
+ MarketingEventType["PriceDrop"] = "price-drop";
28
+ MarketingEventType["PartnerOffer"] = "partner-offer";
29
+ })(MarketingEventType || (MarketingEventType = {}));
30
+ export var MarketingMessageChannelType;
31
+ (function (MarketingMessageChannelType) {
32
+ MarketingMessageChannelType["Whatsapp"] = "whatsapp";
33
+ MarketingMessageChannelType["Email"] = "email";
34
+ })(MarketingMessageChannelType || (MarketingMessageChannelType = {}));
35
+ //# sourceMappingURL=marketing.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"marketing.js","sourceRoot":"","sources":["marketing.ts"],"names":[],"mappings":"AAEA,MAAM,CAAN,IAAY,iBAcX;AAdD,WAAY,iBAAiB;IAC3B,gDAA2B,CAAA;IAC3B,0CAAqB,CAAA;IACrB,kDAA6B,CAAA;IAC7B,wDAAmC,CAAA;IACnC,kDAA6B,CAAA;IAC7B,0CAAqB,CAAA;IACrB,sCAAiB,CAAA;IACjB,0CAAqB,CAAA;IACrB,sCAAiB,CAAA;IACjB,gDAA2B,CAAA;IAC3B,gDAA2B,CAAA;IAC3B,gDAA2B,CAAA;IAC3B,wCAAmB,CAAA;AACrB,CAAC,EAdW,iBAAiB,KAAjB,iBAAiB,QAc5B;AA8DD,MAAM,CAAN,IAAY,oBAMX;AAND,WAAY,oBAAoB;IAC9B,+CAAuB,CAAA;IACvB,iDAAyB,CAAA;IACzB,2CAAmB,CAAA;IACnB,uCAAe,CAAA;IACf,0CAAkB,CAAA;AACpB,CAAC,EANW,oBAAoB,KAApB,oBAAoB,QAM/B;AAED,MAAM,CAAN,IAAY,kBAGX;AAHD,WAAY,kBAAkB;IAC5B,8CAAwB,CAAA;IACxB,oDAA8B,CAAA;AAChC,CAAC,EAHW,kBAAkB,KAAlB,kBAAkB,QAG7B;AAED,MAAM,CAAN,IAAY,2BAGX;AAHD,WAAY,2BAA2B;IACrC,oDAAqB,CAAA;IACrB,8CAAe,CAAA;AACjB,CAAC,EAHW,2BAA2B,KAA3B,2BAA2B,QAGtC"}
@@ -0,0 +1,56 @@
1
+ export var OfferActions;
2
+ (function (OfferActions) {
3
+ OfferActions["CREATE_BID"] = "create_bid";
4
+ OfferActions["SET_FINAL_VALUATION"] = "set_final_valuation";
5
+ OfferActions["LOSE"] = "lose";
6
+ OfferActions["REOPEN"] = "reopen";
7
+ OfferActions["SET_DOCUMENTS"] = "set_documents";
8
+ OfferActions["SET_METADATA"] = "set_metadata";
9
+ OfferActions["SEE_SUPPLIER"] = "see_supplier";
10
+ OfferActions["SEE_INSIGHTS"] = "see_insights";
11
+ OfferActions["VIEW_BIDS"] = "view_bids";
12
+ OfferActions["DELETE_FINAL_VALUATION"] = "delete_final_valuation";
13
+ OfferActions["SEE_ASKING_PRICE"] = "see_asking_price";
14
+ OfferActions["ACCEPT_NEGOTIATION"] = "accept_negotiation";
15
+ OfferActions["UNDO_ACCEPT_NEGOTIATION"] = "undo_accept_negotiation";
16
+ OfferActions["SET_SUPPLIER_VEHICLE"] = "set_supplier_vehicle";
17
+ OfferActions["CAN_PURCHASE"] = "can_purchase";
18
+ })(OfferActions || (OfferActions = {}));
19
+ export var OfferBidActions;
20
+ (function (OfferBidActions) {
21
+ OfferBidActions["EDIT_BID"] = "create_bid";
22
+ OfferBidActions["DELETE_BID"] = "delete_bid";
23
+ })(OfferBidActions || (OfferBidActions = {}));
24
+ export var OfferStatus;
25
+ (function (OfferStatus) {
26
+ OfferStatus["PROSPECTION"] = "prospection";
27
+ OfferStatus["VALUATION"] = "valuation";
28
+ OfferStatus["NEGOTIATION"] = "negotiation";
29
+ })(OfferStatus || (OfferStatus = {}));
30
+ export var OfferLostReasonValues;
31
+ (function (OfferLostReasonValues) {
32
+ OfferLostReasonValues["Expensive"] = "expensive";
33
+ OfferLostReasonValues["NoMarket"] = "no_market";
34
+ OfferLostReasonValues["BadExperience"] = "bad_experience";
35
+ OfferLostReasonValues["NoAnswer"] = "supplier_mia";
36
+ OfferLostReasonValues["Other"] = "other";
37
+ OfferLostReasonValues["Automatic"] = "automatic";
38
+ })(OfferLostReasonValues || (OfferLostReasonValues = {}));
39
+ export var OfferBidType;
40
+ (function (OfferBidType) {
41
+ OfferBidType["INTERNAL"] = "internal";
42
+ OfferBidType["EXTERNAL"] = "external";
43
+ })(OfferBidType || (OfferBidType = {}));
44
+ export var OfferWarningsCode;
45
+ (function (OfferWarningsCode) {
46
+ OfferWarningsCode["NO_SUPPLIER"] = "no_supplier";
47
+ })(OfferWarningsCode || (OfferWarningsCode = {}));
48
+ export const OfferStatusOrder = [
49
+ OfferStatus.PROSPECTION,
50
+ OfferStatus.VALUATION,
51
+ OfferStatus.NEGOTIATION,
52
+ ];
53
+ export const OfferWonColumnId = 'closed_won';
54
+ export const OfferKanbanColumns = [...OfferStatusOrder, OfferWonColumnId];
55
+ export const OfferKanbanEndColumns = [OfferWonColumnId];
56
+ //# sourceMappingURL=offers.js.map