@bisondesk/core-sdk 1.0.607 → 1.0.608
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.
|
@@ -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,gBAAgB,GAAG;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,cAAc,EAAE,CAAC;IACxB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAA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W,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":"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 customerName?: 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