@bisondesk/core-sdk 1.0.604 → 1.0.605

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.
@@ -27,7 +27,8 @@ export declare enum TenantModule {
27
27
  Bootstrap = "bootstrap",
28
28
  WhatsappNotifications = "whatsapp_notifications",
29
29
  Hexon = "hexon",
30
- Transport = "transport"
30
+ Transport = "transport",
31
+ Reports = "reports"
31
32
  }
32
33
  export type Tenant = PublicTenant & {
33
34
  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;IACX,GAAG,QAAQ;IACX,IAAI,SAAS;IACb,KAAK,UAAU;IACf,OAAO,YAAY;IACnB,SAAS,cAAc;IACvB,QAAQ,aAAa;IACrB,aAAa,kBAAkB;IAC/B,MAAM,WAAW;IACjB,kBAAkB,yBAAyB;IAC3C,QAAQ,aAAa;IACrB,KAAK,UAAU;IACf,aAAa,oBAAoB;IACjC,SAAS,cAAc;IACvB,qBAAqB,2BAA2B;IAChD,KAAK,UAAU;IACf,SAAS,cAAc;CACxB;AAED,MAAM,MAAM,MAAM,GAAG,YAAY,GAAG;IACl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aAAa,CAAC,EAAE;QAAE,SAAS,EAAE,MAAM,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"}
@@ -18,5 +18,6 @@ export var TenantModule;
18
18
  TenantModule["WhatsappNotifications"] = "whatsapp_notifications";
19
19
  TenantModule["Hexon"] = "hexon";
20
20
  TenantModule["Transport"] = "transport";
21
+ TenantModule["Reports"] = "reports";
21
22
  })(TenantModule || (TenantModule = {}));
22
23
  //# sourceMappingURL=tenants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"tenants.js","sourceRoot":"/","sources":["types/tenants.ts"],"names":[],"mappings":"AAgBA,MAAM,CAAN,IAAY,YAmBX;AAnBD,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;AACzB,CAAC,EAnBW,YAAY,KAAZ,YAAY,QAmBvB","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}\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};\n\nexport type Branch = {\n id: string;\n name: string;\n country: string;\n language: string;\n exactAccounting?: boolean;\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,YAoBX;AApBD,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;AACrB,CAAC,EApBW,YAAY,KAAZ,YAAY,QAoBvB","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}\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};\n\nexport type Branch = {\n id: string;\n name: string;\n country: string;\n language: string;\n exactAccounting?: boolean;\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"]}
@@ -9,7 +9,7 @@ export declare enum CommissionTeam {
9
9
  NEW_TRAILERS = "new_trailers_team",
10
10
  LEASING = "leasing_team"
11
11
  }
12
- export type CommissionType = 'percentage' | 'unit';
12
+ export type CommissionType = 'percentage' | 'unit' | 'bucket';
13
13
  export type MetricConfig = {
14
14
  id: string;
15
15
  commissionType: CommissionType;
@@ -1 +1 @@
1
- {"version":3,"file":"user-performance.d.ts","sourceRoot":"/","sources":["types/user-performance.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAE/D,oBAAY,iBAAiB;IAC3B,uBAAuB,4BAA4B;IACnD,gBAAgB,qBAAqB;IACrC,iBAAiB,sBAAsB;CACxC;AAED,oBAAY,cAAc;IACxB,IAAI,cAAc;IAClB,YAAY,sBAAsB;IAClC,OAAO,iBAAiB;CACzB;AAED,MAAM,MAAM,cAAc,GAAG,YAAY,GAAG,MAAM,CAAC;AAGnD,MAAM,MAAM,YAAY,GAAG;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,cAAc,EAAE,cAAc,CAAC;IAC/B,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,IAAI,CAAC,mBAAmB,CAAC;IAClC,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,CAAC,EAAE,iBAAiB,EAAE,CAAC;CAChC,CAAC;AAIF,MAAM,MAAM,cAAc,GAAG;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,MAAM,CAAC;IACvB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAIF,MAAM,MAAM,gB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AE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG;IACnC,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB,GAAG,yBAAyB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"user-performance.js","sourceRoot":"/","sources":["types/user-performance.ts"],"names":[],"mappings":"AAIA,MAAM,CAAN,IAAY,iBAIX;AAJD,WAAY,iBAAiB;IAC3B,wEAAmD,CAAA;IACnD,0DAAqC,CAAA;IACrC,4DAAuC,CAAA;AACzC,CAAC,EAJW,iBAAiB,KAAjB,iBAAiB,QAI5B;AAED,MAAM,CAAN,IAAY,cAIX;AAJD,WAAY,cAAc;IACxB,oCAAkB,CAAA;IAClB,oDAAkC,CAAA;IAClC,0CAAwB,CAAA;AAC1B,CAAC,EAJW,cAAc,KAAd,cAAc,QAIzB;AA0CD,MAAM,CAAN,IAAY,eAIX;AAJD,WAAY,eAAe;IACzB,oCAAiB,CAAA;IACjB,8BAAW,CAAA;IACX,wCAAqB,CAAA;AACvB,CAAC,EAJW,eAAe,KAAf,eAAe,QAI1B","sourcesContent":["// The commission can be expressed either as a percentage (for profit-based metrics)\n// or as an amount per unit (for unit-based metrics).\nimport { AttachmentValue } from '@bisondesk/commons-sdk/types';\n\nexport enum CommissionSetting {\n INBOUND_USED_TEAM_USERS = 'inbound_used_team_users',\n TEAM_MEMBERSHIPS = 'team_memberships',\n LEASING_COMPANIES = 'leasing_companies',\n}\n\nexport enum CommissionTeam {\n USED = 'used_team',\n NEW_TRAILERS = 'new_trailers_team',\n LEASING = 'leasing_team',\n}\n\nexport type CommissionType = 'percentage' | 'unit';\n\n// Comprehensive metric configuration\nexport type MetricConfig = {\n id: string;\n commissionType: CommissionType;\n personal: boolean; // if true, this metric is personal to the user\n format?: Intl.NumberFormatOptions;\n listVehicles?: boolean; // should this metric be allowed to list vehicles?\n defaultTarget?: number; // default target for the metric, useful for showing metrics to users w/o a commission plan\n autoHide?: boolean; // hide in UI when annual value is 0\n manualEntry?: boolean; // if true, data comes from manually added entries instead of vehicle_business_overviews\n settings?: CommissionSetting[]; // commission settings this metric depends on\n};\n\n// A tier defines a range of performance (using lower and optional upper bounds)\n// along with the associated commission rate. For example, 0–100 units, then 100–400 units, etc.\nexport type CommissionTier = {\n lowerBound: number; // inclusive\n upperBound?: number; // inclusive (omit for the last tier)\n commissionRate: number;\n default?: boolean; // if true, this tier's upper bound is used as reference for dashboards visualizations\n};\n\n// Each target (metric) has one or more tiers.\n// For example, for UnitsSold you might have three tiers corresponding to bare minimum, normal, and above average.\nexport type TargetCommission = {\n metricId: string;\n tiers: CommissionTier[];\n autoHide?: boolean; // overrides MetricConfig.autoHide for this user\n};\n\nexport type UserCommissionPlan = {\n userId: string;\n year: number;\n startDate?: string; // in case the commission plan is only valid from this date onwards, not the whole year\n targets: TargetCommission[];\n showCommissionToUser?: boolean; // if true, the user can see their own commission amounts\n};\n\nexport enum CommissionGrade {\n TooLow = 'tooLow',\n Low = 'low',\n OnTarget = 'onTarget',\n}\n\nexport type UserCommissionStatus = {\n userId: string;\n createdAt: string; // iso date string\n year: number;\n performance: {\n [metricId: string]: {\n value: string; // actual metric achieved\n estimated?: string; // estimated commission for the metric, based on the current trend\n grade?: CommissionGrade; // grade for the metric\n target?: string; // the upper bound of the default tier\n };\n };\n commission?: {\n total: string;\n potential?: string;\n estimated?: string; // estimated commission for the year, based on the current trend\n grade?: CommissionGrade;\n detailed?: {\n [metricId: string]: {\n earned: string; // commission amount for each target\n potential?: string; // potential commission for the metric, based on the actual metric achieved and the commission tiers\n };\n };\n };\n payments?: {\n total: string;\n yearly?: {\n // details for each year for which the outstanding commission is > 0\n [year: number]: {\n paid: string;\n };\n };\n };\n outstanding?: {\n total: string;\n // details for each year for which the outstanding commission is > 0\n yearly?: {\n [year: number]: {\n outstanding: string;\n };\n };\n };\n};\n\nexport type NewUserCommissionPayment = {\n userId: string; // who was the payment made to\n paidBy: string;\n paidAt: string;\n amount: string;\n comments?: string; // optional comment\n};\n\nexport type UserCommissionPayment = {\n id: string;\n} & NewUserCommissionPayment;\n\nexport type UserCommissionsPaymentRequest = {\n limit?: number;\n nextToken?: string;\n};\n\nexport type UserCommissionInfo = {\n manager?: boolean;\n canViewCommission?: boolean;\n performance: boolean;\n planYears: number[];\n};\n\nexport type UserCommissionListInfo = {\n users: { userId: string }[];\n};\n\nexport type MonthlyPerformanceData = {\n month: number; // 1-12\n metrics: Record<string, number>;\n};\n\nexport type PerformanceVehicle = {\n stockNumber: string;\n profit?: string;\n vehicleId: string;\n title: string;\n year: number;\n km?: number;\n configuration: string;\n euronorm?: string;\n mainPicture?: AttachmentValue;\n saleAt?: string;\n sellerId?: string;\n purchaseAt?: string;\n purchaserId?: string;\n};\n\nexport type PerformanceVehiclesRequest = {\n userId: string;\n targetId: string;\n year?: number;\n offset?: number;\n limit?: number;\n month?: number;\n};\n\nexport type NewManualPerformanceEntry = {\n userId: string;\n metricId: string;\n reference: string;\n year: number;\n};\n\nexport type ManualPerformanceEntry = {\n id: string;\n createdBy: string;\n createdAt: string;\n} & NewManualPerformanceEntry;\n"]}
1
+ {"version":3,"file":"user-performance.js","sourceRoot":"/","sources":["types/user-performance.ts"],"names":[],"mappings":"AAMA,MAAM,CAAN,IAAY,iBAIX;AAJD,WAAY,iBAAiB;IAC3B,wEAAmD,CAAA;IACnD,0DAAqC,CAAA;IACrC,4DAAuC,CAAA;AACzC,CAAC,EAJW,iBAAiB,KAAjB,iBAAiB,QAI5B;AAED,MAAM,CAAN,IAAY,cAIX;AAJD,WAAY,cAAc;IACxB,oCAAkB,CAAA;IAClB,oDAAkC,CAAA;IAClC,0CAAwB,CAAA;AAC1B,CAAC,EAJW,cAAc,KAAd,cAAc,QAIzB;AAoDD,MAAM,CAAN,IAAY,eAIX;AAJD,WAAY,eAAe;IACzB,oCAAiB,CAAA;IACjB,8BAAW,CAAA;IACX,wCAAqB,CAAA;AACvB,CAAC,EAJW,eAAe,KAAf,eAAe,QAI1B","sourcesContent":["// The commission can be expressed either as a percentage (for profit-based metrics),\n// as an amount per unit (for unit-based metrics), or as a per-deal bucket reward\n// (for metrics where each qualifying record earns a flat amount based on which tier\n// range it falls into — see 'bucket' below).\nimport { AttachmentValue } from '@bisondesk/commons-sdk/types';\n\nexport enum CommissionSetting {\n INBOUND_USED_TEAM_USERS = 'inbound_used_team_users',\n TEAM_MEMBERSHIPS = 'team_memberships',\n LEASING_COMPANIES = 'leasing_companies',\n}\n\nexport enum CommissionTeam {\n USED = 'used_team',\n NEW_TRAILERS = 'new_trailers_team',\n LEASING = 'leasing_team',\n}\n\n// - 'percentage': commission = value * rate / 100 (value is a money sum, rate is a %)\n// - 'unit': commission = value * rate (value is a count, rate is € per unit)\n// - 'bucket': non-cumulative per-deal reward. Each qualifying record is classified\n// into the tier whose [lowerBound, upperBound] range contains a measured\n// attribute (e.g. days until payment), and earns that tier's\n// commissionRate (€). The metric value is the already-summed € reward, so\n// the commission engine treats it as a passthrough (no marginal stacking).\nexport type CommissionType = 'percentage' | 'unit' | 'bucket';\n\n// Comprehensive metric configuration\nexport type MetricConfig = {\n id: string;\n commissionType: CommissionType;\n personal: boolean; // if true, this metric is personal to the user\n format?: Intl.NumberFormatOptions;\n listVehicles?: boolean; // should this metric be allowed to list vehicles?\n defaultTarget?: number; // default target for the metric, useful for showing metrics to users w/o a commission plan\n autoHide?: boolean; // hide in UI when annual value is 0\n manualEntry?: boolean; // if true, data comes from manually added entries instead of vehicle_business_overviews\n settings?: CommissionSetting[]; // commission settings this metric depends on\n};\n\n// A tier defines a range of performance (using lower and optional upper bounds)\n// along with the associated commission rate. For example, 0–100 units, then 100–400 units, etc.\n// For 'bucket' metrics the bounds describe the measured attribute (e.g. days until payment:\n// 0–7, 8–30, 30+) and commissionRate is the flat € awarded per qualifying deal in that range;\n// tiers are matched in order, first match wins, so overlapping bounds resolve to the first tier.\nexport type CommissionTier = {\n lowerBound: number; // inclusive\n upperBound?: number; // inclusive (omit for the last tier)\n commissionRate: number;\n default?: boolean; // if true, this tier's upper bound is used as reference for dashboards visualizations\n};\n\n// Each target (metric) has one or more tiers.\n// For example, for UnitsSold you might have three tiers corresponding to bare minimum, normal, and above average.\nexport type TargetCommission = {\n metricId: string;\n tiers: CommissionTier[];\n autoHide?: boolean; // overrides MetricConfig.autoHide for this user\n};\n\nexport type UserCommissionPlan = {\n userId: string;\n year: number;\n startDate?: string; // in case the commission plan is only valid from this date onwards, not the whole year\n targets: TargetCommission[];\n showCommissionToUser?: boolean; // if true, the user can see their own commission amounts\n};\n\nexport enum CommissionGrade {\n TooLow = 'tooLow',\n Low = 'low',\n OnTarget = 'onTarget',\n}\n\nexport type UserCommissionStatus = {\n userId: string;\n createdAt: string; // iso date string\n year: number;\n performance: {\n [metricId: string]: {\n value: string; // actual metric achieved\n estimated?: string; // estimated commission for the metric, based on the current trend\n grade?: CommissionGrade; // grade for the metric\n target?: string; // the upper bound of the default tier\n };\n };\n commission?: {\n total: string;\n potential?: string;\n estimated?: string; // estimated commission for the year, based on the current trend\n grade?: CommissionGrade;\n detailed?: {\n [metricId: string]: {\n earned: string; // commission amount for each target\n potential?: string; // potential commission for the metric, based on the actual metric achieved and the commission tiers\n };\n };\n };\n payments?: {\n total: string;\n yearly?: {\n // details for each year for which the outstanding commission is > 0\n [year: number]: {\n paid: string;\n };\n };\n };\n outstanding?: {\n total: string;\n // details for each year for which the outstanding commission is > 0\n yearly?: {\n [year: number]: {\n outstanding: string;\n };\n };\n };\n};\n\nexport type NewUserCommissionPayment = {\n userId: string; // who was the payment made to\n paidBy: string;\n paidAt: string;\n amount: string;\n comments?: string; // optional comment\n};\n\nexport type UserCommissionPayment = {\n id: string;\n} & NewUserCommissionPayment;\n\nexport type UserCommissionsPaymentRequest = {\n limit?: number;\n nextToken?: string;\n};\n\nexport type UserCommissionInfo = {\n manager?: boolean;\n canViewCommission?: boolean;\n performance: boolean;\n planYears: number[];\n};\n\nexport type UserCommissionListInfo = {\n users: { userId: string }[];\n};\n\nexport type MonthlyPerformanceData = {\n month: number; // 1-12\n metrics: Record<string, number>;\n};\n\nexport type PerformanceVehicle = {\n stockNumber: string;\n profit?: string;\n vehicleId: string;\n title: string;\n year: number;\n km?: number;\n configuration: string;\n euronorm?: string;\n mainPicture?: AttachmentValue;\n saleAt?: string;\n sellerId?: string;\n purchaseAt?: string;\n purchaserId?: string;\n};\n\nexport type PerformanceVehiclesRequest = {\n userId: string;\n targetId: string;\n year?: number;\n offset?: number;\n limit?: number;\n month?: number;\n};\n\nexport type NewManualPerformanceEntry = {\n userId: string;\n metricId: string;\n reference: string;\n year: number;\n};\n\nexport type ManualPerformanceEntry = {\n id: string;\n createdBy: string;\n createdAt: string;\n} & NewManualPerformanceEntry;\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bisondesk/core-sdk",
3
- "version": "1.0.604",
3
+ "version": "1.0.605",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "author": "TheTruckCompany",
@@ -33,6 +33,7 @@ export enum TenantModule {
33
33
  WhatsappNotifications = 'whatsapp_notifications',
34
34
  Hexon = 'hexon',
35
35
  Transport = 'transport',
36
+ Reports = 'reports',
36
37
  }
37
38
 
38
39
  export type Tenant = PublicTenant & {
@@ -1,5 +1,7 @@
1
- // The commission can be expressed either as a percentage (for profit-based metrics)
2
- // or as an amount per unit (for unit-based metrics).
1
+ // The commission can be expressed either as a percentage (for profit-based metrics),
2
+ // as an amount per unit (for unit-based metrics), or as a per-deal bucket reward
3
+ // (for metrics where each qualifying record earns a flat amount based on which tier
4
+ // range it falls into — see 'bucket' below).
3
5
  import { AttachmentValue } from '@bisondesk/commons-sdk/types';
4
6
 
5
7
  export enum CommissionSetting {
@@ -14,7 +16,14 @@ export enum CommissionTeam {
14
16
  LEASING = 'leasing_team',
15
17
  }
16
18
 
17
- export type CommissionType = 'percentage' | 'unit';
19
+ // - 'percentage': commission = value * rate / 100 (value is a money sum, rate is a %)
20
+ // - 'unit': commission = value * rate (value is a count, rate is € per unit)
21
+ // - 'bucket': non-cumulative per-deal reward. Each qualifying record is classified
22
+ // into the tier whose [lowerBound, upperBound] range contains a measured
23
+ // attribute (e.g. days until payment), and earns that tier's
24
+ // commissionRate (€). The metric value is the already-summed € reward, so
25
+ // the commission engine treats it as a passthrough (no marginal stacking).
26
+ export type CommissionType = 'percentage' | 'unit' | 'bucket';
18
27
 
19
28
  // Comprehensive metric configuration
20
29
  export type MetricConfig = {
@@ -31,6 +40,9 @@ export type MetricConfig = {
31
40
 
32
41
  // A tier defines a range of performance (using lower and optional upper bounds)
33
42
  // along with the associated commission rate. For example, 0–100 units, then 100–400 units, etc.
43
+ // For 'bucket' metrics the bounds describe the measured attribute (e.g. days until payment:
44
+ // 0–7, 8–30, 30+) and commissionRate is the flat € awarded per qualifying deal in that range;
45
+ // tiers are matched in order, first match wins, so overlapping bounds resolve to the first tier.
34
46
  export type CommissionTier = {
35
47
  lowerBound: number; // inclusive
36
48
  upperBound?: number; // inclusive (omit for the last tier)