@mydoormot/app-types 2.1.3 → 2.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +18 -18
- package/CHANGELOG.md +6 -0
- package/dist/index.cjs +9 -0
- package/dist/index.d.cts +24 -1
- package/dist/index.d.ts +24 -1
- package/dist/index.js +7 -0
- package/package.json +1 -1
- package/src/business.ts +28 -5
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
> @mydoormot/app-types@2.1.
|
|
3
|
-
> tsup src/index.ts --format esm,cjs --dts
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
1
|
+
|
|
2
|
+
> @mydoormot/app-types@2.1.4 build /Users/chuksben/Desktop/projects/microservices/mydoormot/packages/app-types
|
|
3
|
+
> tsup src/index.ts --format esm,cjs --dts
|
|
4
|
+
|
|
5
|
+
[34mCLI[39m Building entry: src/index.ts
|
|
6
|
+
[34mCLI[39m Using tsconfig: tsconfig.json
|
|
7
|
+
[34mCLI[39m tsup v7.3.0
|
|
8
|
+
[34mCLI[39m Target: es2021
|
|
9
|
+
[34mESM[39m Build start
|
|
10
|
+
[34mCJS[39m Build start
|
|
11
|
+
[32mESM[39m [1mdist/index.js [22m[32m15.04 KB[39m
|
|
12
|
+
[32mESM[39m ⚡️ Build success in 82ms
|
|
13
|
+
[32mCJS[39m [1mdist/index.cjs [22m[32m18.11 KB[39m
|
|
14
|
+
[32mCJS[39m ⚡️ Build success in 83ms
|
|
15
|
+
[34mDTS[39m Build start
|
|
16
|
+
[32mDTS[39m ⚡️ Build success in 1467ms
|
|
17
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m56.90 KB[39m
|
|
18
|
+
[32mDTS[39m [1mdist/index.d.cts [22m[32m56.90 KB[39m
|
package/CHANGELOG.md
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -49,6 +49,8 @@ __export(src_exports, {
|
|
|
49
49
|
LinkDestination: () => LinkDestination,
|
|
50
50
|
MembershipStatus: () => MembershipStatus,
|
|
51
51
|
NotificationType: () => NotificationType,
|
|
52
|
+
PLAN_LIMIT_REACHED: () => PLAN_LIMIT_REACHED,
|
|
53
|
+
PLAN_REQUIRED: () => PLAN_REQUIRED,
|
|
52
54
|
PaymentOptions: () => PaymentOptions,
|
|
53
55
|
PayoutPeriodType: () => PayoutPeriodType,
|
|
54
56
|
PayoutRateSource: () => PayoutRateSource,
|
|
@@ -305,10 +307,15 @@ var BusinessType = /* @__PURE__ */ ((BusinessType2) => {
|
|
|
305
307
|
})(BusinessType || {});
|
|
306
308
|
var BusinessPlan = /* @__PURE__ */ ((BusinessPlan2) => {
|
|
307
309
|
BusinessPlan2["NONE"] = "none";
|
|
310
|
+
BusinessPlan2["STARTER"] = "starter";
|
|
311
|
+
BusinessPlan2["GROWTH"] = "growth";
|
|
312
|
+
BusinessPlan2["SCALE"] = "scale";
|
|
308
313
|
BusinessPlan2["FULL"] = "full";
|
|
309
314
|
BusinessPlan2["INTERNAL"] = "internal";
|
|
310
315
|
return BusinessPlan2;
|
|
311
316
|
})(BusinessPlan || {});
|
|
317
|
+
var PLAN_LIMIT_REACHED = "PLAN_LIMIT_REACHED";
|
|
318
|
+
var PLAN_REQUIRED = "PLAN_REQUIRED";
|
|
312
319
|
var BusinessStatus = /* @__PURE__ */ ((BusinessStatus2) => {
|
|
313
320
|
BusinessStatus2["ACTIVE"] = "active";
|
|
314
321
|
BusinessStatus2["DISABLED"] = "disabled";
|
|
@@ -459,6 +466,8 @@ var LinkDestination = /* @__PURE__ */ ((LinkDestination2) => {
|
|
|
459
466
|
LinkDestination,
|
|
460
467
|
MembershipStatus,
|
|
461
468
|
NotificationType,
|
|
469
|
+
PLAN_LIMIT_REACHED,
|
|
470
|
+
PLAN_REQUIRED,
|
|
462
471
|
PaymentOptions,
|
|
463
472
|
PayoutPeriodType,
|
|
464
473
|
PayoutRateSource,
|
package/dist/index.d.cts
CHANGED
|
@@ -365,9 +365,25 @@ declare enum BusinessPlan {
|
|
|
365
365
|
* without deleting anything. For a hard cut-off use `BusinessStatus`.
|
|
366
366
|
*/
|
|
367
367
|
NONE = "none",
|
|
368
|
+
/** Paid tiers: same modules, different rider caps. */
|
|
369
|
+
STARTER = "starter",
|
|
370
|
+
GROWTH = "growth",
|
|
371
|
+
SCALE = "scale",
|
|
372
|
+
/** Pre-pricing businesses, grandfathered: no caps. */
|
|
368
373
|
FULL = "full",
|
|
369
374
|
INTERNAL = "internal"
|
|
370
375
|
}
|
|
376
|
+
/**
|
|
377
|
+
* Plan caps. `null` is unlimited. `riders` counts every rider not archived,
|
|
378
|
+
* suspended ones included.
|
|
379
|
+
*/
|
|
380
|
+
interface BusinessLimits {
|
|
381
|
+
riders: number | null;
|
|
382
|
+
}
|
|
383
|
+
/** 403 code: adding past a plan cap. */
|
|
384
|
+
declare const PLAN_LIMIT_REACHED = "PLAN_LIMIT_REACHED";
|
|
385
|
+
/** 403 code: creating anything with no active plan (trial over, unpaid). */
|
|
386
|
+
declare const PLAN_REQUIRED = "PLAN_REQUIRED";
|
|
371
387
|
/**
|
|
372
388
|
* What a module looks like to one business.
|
|
373
389
|
*
|
|
@@ -397,6 +413,11 @@ interface Business {
|
|
|
397
413
|
officeNumber: string;
|
|
398
414
|
type: BusinessType | `${BusinessType}`;
|
|
399
415
|
plan: BusinessPlan | `${BusinessPlan}`;
|
|
416
|
+
/** Trial plan, in force until `trialEndsAt`. Kept after it ends. */
|
|
417
|
+
trialPlan: BusinessPlan | `${BusinessPlan}` | NullOrUndefined;
|
|
418
|
+
trialEndsAt: string | Date | NullOrUndefined;
|
|
419
|
+
/** The plan in force (trial included). Show this, not `plan`. */
|
|
420
|
+
effectivePlan: BusinessPlan | `${BusinessPlan}`;
|
|
400
421
|
categoryId: string;
|
|
401
422
|
address: string | NullOrUndefined;
|
|
402
423
|
addressCoordinates: number[] | NullOrUndefined | {
|
|
@@ -452,6 +473,8 @@ interface Business {
|
|
|
452
473
|
* learns the feature exists.
|
|
453
474
|
*/
|
|
454
475
|
moduleStates: BusinessModuleStates;
|
|
476
|
+
/** Caps from `effectivePlan`. */
|
|
477
|
+
limits: BusinessLimits;
|
|
455
478
|
}
|
|
456
479
|
interface BusinessPg extends Business {
|
|
457
480
|
pgId: any;
|
|
@@ -1848,4 +1871,4 @@ declare enum LinkDestination {
|
|
|
1848
1871
|
}
|
|
1849
1872
|
type NullOrUndefined = null | undefined;
|
|
1850
1873
|
|
|
1851
|
-
export { type AddonGroup, type AddonGroupItem, type AddressDetails, AddressTypes, type AggregatedErrand, AuthType, type Business, BusinessCapability, type BusinessCategory, type BusinessCourierLink, BusinessCourierLinkStatus, type BusinessFuelSettings, type BusinessMember, type BusinessModuleKey, type BusinessModuleStates, type BusinessModules, type BusinessPg, BusinessPlan, type BusinessPortal, type BusinessRiderPaySettings, BusinessRole, type BusinessSettings, BusinessStatus, BusinessType, type BusinessWhatsappConfig, type City, type Collection, type Customer, type CustomerAddress, type CustomerBilling, type CustomerTransactionStats, DEFAULT_BUSINESS_FUEL_SETTINGS, DEFAULT_BUSINESS_RIDER_PAY_SETTINGS, DEFAULT_BUSINESS_SETTINGS, DeliveryStatus, type DraftErrand, DraftErrandStatus, type Enterprise, type EnterpriseCategoryDoc, type EnterpriseSubCategoryDoc, EnterpriseType, type Errand, type ErrandDeliveryTiming, ErrandFulfilment, ErrandInvoiceState, type ErrandPackagingQuality, type ErrandRating, type ErrandReview, type ErrandReviewLink, type ErrandRiderBehavior, ErrandStatus, type ErrandTimeline, type ExpensePaidBy, FeePaymentStatus, FeeSettlement, type FuelDueData, type FuelDueItem, FuelDueStatus, type FuelDueTotals, type FuelPercentSuggestion, type FuelSinceLastRefuel, type FuelSuggestionConfidence, type GeoPoint, GlobalRoles, type Invoice, type InvoiceDrift, type InvoiceEvent, InvoiceEventType, InvoiceGenerationType, type InvoiceItem, InvoiceItemType, type InvoicePayment, InvoicePaymentMethod, InvoiceStatus, type LatLng, LinkDestination, type MaintenanceItem, type MaintenancePartUsage, type MaintenanceRecord, type MaintenanceStats, type MaintenanceStatsSummary, type MaintenanceTopItem, MembershipStatus, type ModuleState, type Notification, type NotificationData, NotificationType, type NullOrUndefined, type OpeningHours, type PaginateResult, PaymentOptions, PayoutPeriodType, PayoutRateSource, type PendingErrand, type PortalHandleAvailability, PortalStatus, type Product, type ProductCategory, type ProductImage, type ProductOption, type ProductOptionValue, type ProductStatus, type ProductTag, type ProductVariant, type ProductVariantPrice, type PublicPortal, type PublicPortalBusiness, RemittanceStatus, type Rider, type RiderPayout, type RiderPayoutAdjustment, type RiderPayoutPreview, type RiderPayoutPreviewItem, RiderPayoutStatus, type RiderPerformanceItem, type RiderPerformanceStats, type RiderPerformanceSummary, type RiderPerformanceTimeSeries, type RiderSettlement, type RiderWithUserDetails, RoleType, type State, SweepExclusionReason, type TrackerPosition, type Transaction, type TransactionCategory, type TransactionItem, type TransactionRiderUser, type TransactionType, type TransactionWithCategory, type TransactionWithJoin, type User, type UserAddress, type Vehicle, type VehicleErrandStats, type VehicleFuelStats, type VehicleLog, type VehicleLogStatsSummary, VehicleLogType, type VehicleLogWithErrands, type VehicleMaintenanceStats, type VehiclePerformanceData, type VehiclePerformanceFilters, type VehiclePerformanceItem, type VehiclePerformanceTotals, VehicleType, type VehicleWithRider, type Vendor, WhatsappButtonType, WhatsappComponentType, WhatsappEvent, WhatsappRecipient, type WhatsappSendLog, type WhatsappTemplate, type WhatsappTemplateButton, type WhatsappTemplateComponent, WhatsappTemplateMetaStatus, WhatsappTemplateParamSource, type WhatsappTemplateSource, errandTimeline };
|
|
1874
|
+
export { type AddonGroup, type AddonGroupItem, type AddressDetails, AddressTypes, type AggregatedErrand, AuthType, type Business, BusinessCapability, type BusinessCategory, type BusinessCourierLink, BusinessCourierLinkStatus, type BusinessFuelSettings, type BusinessLimits, type BusinessMember, type BusinessModuleKey, type BusinessModuleStates, type BusinessModules, type BusinessPg, BusinessPlan, type BusinessPortal, type BusinessRiderPaySettings, BusinessRole, type BusinessSettings, BusinessStatus, BusinessType, type BusinessWhatsappConfig, type City, type Collection, type Customer, type CustomerAddress, type CustomerBilling, type CustomerTransactionStats, DEFAULT_BUSINESS_FUEL_SETTINGS, DEFAULT_BUSINESS_RIDER_PAY_SETTINGS, DEFAULT_BUSINESS_SETTINGS, DeliveryStatus, type DraftErrand, DraftErrandStatus, type Enterprise, type EnterpriseCategoryDoc, type EnterpriseSubCategoryDoc, EnterpriseType, type Errand, type ErrandDeliveryTiming, ErrandFulfilment, ErrandInvoiceState, type ErrandPackagingQuality, type ErrandRating, type ErrandReview, type ErrandReviewLink, type ErrandRiderBehavior, ErrandStatus, type ErrandTimeline, type ExpensePaidBy, FeePaymentStatus, FeeSettlement, type FuelDueData, type FuelDueItem, FuelDueStatus, type FuelDueTotals, type FuelPercentSuggestion, type FuelSinceLastRefuel, type FuelSuggestionConfidence, type GeoPoint, GlobalRoles, type Invoice, type InvoiceDrift, type InvoiceEvent, InvoiceEventType, InvoiceGenerationType, type InvoiceItem, InvoiceItemType, type InvoicePayment, InvoicePaymentMethod, InvoiceStatus, type LatLng, LinkDestination, type MaintenanceItem, type MaintenancePartUsage, type MaintenanceRecord, type MaintenanceStats, type MaintenanceStatsSummary, type MaintenanceTopItem, MembershipStatus, type ModuleState, type Notification, type NotificationData, NotificationType, type NullOrUndefined, type OpeningHours, PLAN_LIMIT_REACHED, PLAN_REQUIRED, type PaginateResult, PaymentOptions, PayoutPeriodType, PayoutRateSource, type PendingErrand, type PortalHandleAvailability, PortalStatus, type Product, type ProductCategory, type ProductImage, type ProductOption, type ProductOptionValue, type ProductStatus, type ProductTag, type ProductVariant, type ProductVariantPrice, type PublicPortal, type PublicPortalBusiness, RemittanceStatus, type Rider, type RiderPayout, type RiderPayoutAdjustment, type RiderPayoutPreview, type RiderPayoutPreviewItem, RiderPayoutStatus, type RiderPerformanceItem, type RiderPerformanceStats, type RiderPerformanceSummary, type RiderPerformanceTimeSeries, type RiderSettlement, type RiderWithUserDetails, RoleType, type State, SweepExclusionReason, type TrackerPosition, type Transaction, type TransactionCategory, type TransactionItem, type TransactionRiderUser, type TransactionType, type TransactionWithCategory, type TransactionWithJoin, type User, type UserAddress, type Vehicle, type VehicleErrandStats, type VehicleFuelStats, type VehicleLog, type VehicleLogStatsSummary, VehicleLogType, type VehicleLogWithErrands, type VehicleMaintenanceStats, type VehiclePerformanceData, type VehiclePerformanceFilters, type VehiclePerformanceItem, type VehiclePerformanceTotals, VehicleType, type VehicleWithRider, type Vendor, WhatsappButtonType, WhatsappComponentType, WhatsappEvent, WhatsappRecipient, type WhatsappSendLog, type WhatsappTemplate, type WhatsappTemplateButton, type WhatsappTemplateComponent, WhatsappTemplateMetaStatus, WhatsappTemplateParamSource, type WhatsappTemplateSource, errandTimeline };
|
package/dist/index.d.ts
CHANGED
|
@@ -365,9 +365,25 @@ declare enum BusinessPlan {
|
|
|
365
365
|
* without deleting anything. For a hard cut-off use `BusinessStatus`.
|
|
366
366
|
*/
|
|
367
367
|
NONE = "none",
|
|
368
|
+
/** Paid tiers: same modules, different rider caps. */
|
|
369
|
+
STARTER = "starter",
|
|
370
|
+
GROWTH = "growth",
|
|
371
|
+
SCALE = "scale",
|
|
372
|
+
/** Pre-pricing businesses, grandfathered: no caps. */
|
|
368
373
|
FULL = "full",
|
|
369
374
|
INTERNAL = "internal"
|
|
370
375
|
}
|
|
376
|
+
/**
|
|
377
|
+
* Plan caps. `null` is unlimited. `riders` counts every rider not archived,
|
|
378
|
+
* suspended ones included.
|
|
379
|
+
*/
|
|
380
|
+
interface BusinessLimits {
|
|
381
|
+
riders: number | null;
|
|
382
|
+
}
|
|
383
|
+
/** 403 code: adding past a plan cap. */
|
|
384
|
+
declare const PLAN_LIMIT_REACHED = "PLAN_LIMIT_REACHED";
|
|
385
|
+
/** 403 code: creating anything with no active plan (trial over, unpaid). */
|
|
386
|
+
declare const PLAN_REQUIRED = "PLAN_REQUIRED";
|
|
371
387
|
/**
|
|
372
388
|
* What a module looks like to one business.
|
|
373
389
|
*
|
|
@@ -397,6 +413,11 @@ interface Business {
|
|
|
397
413
|
officeNumber: string;
|
|
398
414
|
type: BusinessType | `${BusinessType}`;
|
|
399
415
|
plan: BusinessPlan | `${BusinessPlan}`;
|
|
416
|
+
/** Trial plan, in force until `trialEndsAt`. Kept after it ends. */
|
|
417
|
+
trialPlan: BusinessPlan | `${BusinessPlan}` | NullOrUndefined;
|
|
418
|
+
trialEndsAt: string | Date | NullOrUndefined;
|
|
419
|
+
/** The plan in force (trial included). Show this, not `plan`. */
|
|
420
|
+
effectivePlan: BusinessPlan | `${BusinessPlan}`;
|
|
400
421
|
categoryId: string;
|
|
401
422
|
address: string | NullOrUndefined;
|
|
402
423
|
addressCoordinates: number[] | NullOrUndefined | {
|
|
@@ -452,6 +473,8 @@ interface Business {
|
|
|
452
473
|
* learns the feature exists.
|
|
453
474
|
*/
|
|
454
475
|
moduleStates: BusinessModuleStates;
|
|
476
|
+
/** Caps from `effectivePlan`. */
|
|
477
|
+
limits: BusinessLimits;
|
|
455
478
|
}
|
|
456
479
|
interface BusinessPg extends Business {
|
|
457
480
|
pgId: any;
|
|
@@ -1848,4 +1871,4 @@ declare enum LinkDestination {
|
|
|
1848
1871
|
}
|
|
1849
1872
|
type NullOrUndefined = null | undefined;
|
|
1850
1873
|
|
|
1851
|
-
export { type AddonGroup, type AddonGroupItem, type AddressDetails, AddressTypes, type AggregatedErrand, AuthType, type Business, BusinessCapability, type BusinessCategory, type BusinessCourierLink, BusinessCourierLinkStatus, type BusinessFuelSettings, type BusinessMember, type BusinessModuleKey, type BusinessModuleStates, type BusinessModules, type BusinessPg, BusinessPlan, type BusinessPortal, type BusinessRiderPaySettings, BusinessRole, type BusinessSettings, BusinessStatus, BusinessType, type BusinessWhatsappConfig, type City, type Collection, type Customer, type CustomerAddress, type CustomerBilling, type CustomerTransactionStats, DEFAULT_BUSINESS_FUEL_SETTINGS, DEFAULT_BUSINESS_RIDER_PAY_SETTINGS, DEFAULT_BUSINESS_SETTINGS, DeliveryStatus, type DraftErrand, DraftErrandStatus, type Enterprise, type EnterpriseCategoryDoc, type EnterpriseSubCategoryDoc, EnterpriseType, type Errand, type ErrandDeliveryTiming, ErrandFulfilment, ErrandInvoiceState, type ErrandPackagingQuality, type ErrandRating, type ErrandReview, type ErrandReviewLink, type ErrandRiderBehavior, ErrandStatus, type ErrandTimeline, type ExpensePaidBy, FeePaymentStatus, FeeSettlement, type FuelDueData, type FuelDueItem, FuelDueStatus, type FuelDueTotals, type FuelPercentSuggestion, type FuelSinceLastRefuel, type FuelSuggestionConfidence, type GeoPoint, GlobalRoles, type Invoice, type InvoiceDrift, type InvoiceEvent, InvoiceEventType, InvoiceGenerationType, type InvoiceItem, InvoiceItemType, type InvoicePayment, InvoicePaymentMethod, InvoiceStatus, type LatLng, LinkDestination, type MaintenanceItem, type MaintenancePartUsage, type MaintenanceRecord, type MaintenanceStats, type MaintenanceStatsSummary, type MaintenanceTopItem, MembershipStatus, type ModuleState, type Notification, type NotificationData, NotificationType, type NullOrUndefined, type OpeningHours, type PaginateResult, PaymentOptions, PayoutPeriodType, PayoutRateSource, type PendingErrand, type PortalHandleAvailability, PortalStatus, type Product, type ProductCategory, type ProductImage, type ProductOption, type ProductOptionValue, type ProductStatus, type ProductTag, type ProductVariant, type ProductVariantPrice, type PublicPortal, type PublicPortalBusiness, RemittanceStatus, type Rider, type RiderPayout, type RiderPayoutAdjustment, type RiderPayoutPreview, type RiderPayoutPreviewItem, RiderPayoutStatus, type RiderPerformanceItem, type RiderPerformanceStats, type RiderPerformanceSummary, type RiderPerformanceTimeSeries, type RiderSettlement, type RiderWithUserDetails, RoleType, type State, SweepExclusionReason, type TrackerPosition, type Transaction, type TransactionCategory, type TransactionItem, type TransactionRiderUser, type TransactionType, type TransactionWithCategory, type TransactionWithJoin, type User, type UserAddress, type Vehicle, type VehicleErrandStats, type VehicleFuelStats, type VehicleLog, type VehicleLogStatsSummary, VehicleLogType, type VehicleLogWithErrands, type VehicleMaintenanceStats, type VehiclePerformanceData, type VehiclePerformanceFilters, type VehiclePerformanceItem, type VehiclePerformanceTotals, VehicleType, type VehicleWithRider, type Vendor, WhatsappButtonType, WhatsappComponentType, WhatsappEvent, WhatsappRecipient, type WhatsappSendLog, type WhatsappTemplate, type WhatsappTemplateButton, type WhatsappTemplateComponent, WhatsappTemplateMetaStatus, WhatsappTemplateParamSource, type WhatsappTemplateSource, errandTimeline };
|
|
1874
|
+
export { type AddonGroup, type AddonGroupItem, type AddressDetails, AddressTypes, type AggregatedErrand, AuthType, type Business, BusinessCapability, type BusinessCategory, type BusinessCourierLink, BusinessCourierLinkStatus, type BusinessFuelSettings, type BusinessLimits, type BusinessMember, type BusinessModuleKey, type BusinessModuleStates, type BusinessModules, type BusinessPg, BusinessPlan, type BusinessPortal, type BusinessRiderPaySettings, BusinessRole, type BusinessSettings, BusinessStatus, BusinessType, type BusinessWhatsappConfig, type City, type Collection, type Customer, type CustomerAddress, type CustomerBilling, type CustomerTransactionStats, DEFAULT_BUSINESS_FUEL_SETTINGS, DEFAULT_BUSINESS_RIDER_PAY_SETTINGS, DEFAULT_BUSINESS_SETTINGS, DeliveryStatus, type DraftErrand, DraftErrandStatus, type Enterprise, type EnterpriseCategoryDoc, type EnterpriseSubCategoryDoc, EnterpriseType, type Errand, type ErrandDeliveryTiming, ErrandFulfilment, ErrandInvoiceState, type ErrandPackagingQuality, type ErrandRating, type ErrandReview, type ErrandReviewLink, type ErrandRiderBehavior, ErrandStatus, type ErrandTimeline, type ExpensePaidBy, FeePaymentStatus, FeeSettlement, type FuelDueData, type FuelDueItem, FuelDueStatus, type FuelDueTotals, type FuelPercentSuggestion, type FuelSinceLastRefuel, type FuelSuggestionConfidence, type GeoPoint, GlobalRoles, type Invoice, type InvoiceDrift, type InvoiceEvent, InvoiceEventType, InvoiceGenerationType, type InvoiceItem, InvoiceItemType, type InvoicePayment, InvoicePaymentMethod, InvoiceStatus, type LatLng, LinkDestination, type MaintenanceItem, type MaintenancePartUsage, type MaintenanceRecord, type MaintenanceStats, type MaintenanceStatsSummary, type MaintenanceTopItem, MembershipStatus, type ModuleState, type Notification, type NotificationData, NotificationType, type NullOrUndefined, type OpeningHours, PLAN_LIMIT_REACHED, PLAN_REQUIRED, type PaginateResult, PaymentOptions, PayoutPeriodType, PayoutRateSource, type PendingErrand, type PortalHandleAvailability, PortalStatus, type Product, type ProductCategory, type ProductImage, type ProductOption, type ProductOptionValue, type ProductStatus, type ProductTag, type ProductVariant, type ProductVariantPrice, type PublicPortal, type PublicPortalBusiness, RemittanceStatus, type Rider, type RiderPayout, type RiderPayoutAdjustment, type RiderPayoutPreview, type RiderPayoutPreviewItem, RiderPayoutStatus, type RiderPerformanceItem, type RiderPerformanceStats, type RiderPerformanceSummary, type RiderPerformanceTimeSeries, type RiderSettlement, type RiderWithUserDetails, RoleType, type State, SweepExclusionReason, type TrackerPosition, type Transaction, type TransactionCategory, type TransactionItem, type TransactionRiderUser, type TransactionType, type TransactionWithCategory, type TransactionWithJoin, type User, type UserAddress, type Vehicle, type VehicleErrandStats, type VehicleFuelStats, type VehicleLog, type VehicleLogStatsSummary, VehicleLogType, type VehicleLogWithErrands, type VehicleMaintenanceStats, type VehiclePerformanceData, type VehiclePerformanceFilters, type VehiclePerformanceItem, type VehiclePerformanceTotals, VehicleType, type VehicleWithRider, type Vendor, WhatsappButtonType, WhatsappComponentType, WhatsappEvent, WhatsappRecipient, type WhatsappSendLog, type WhatsappTemplate, type WhatsappTemplateButton, type WhatsappTemplateComponent, WhatsappTemplateMetaStatus, WhatsappTemplateParamSource, type WhatsappTemplateSource, errandTimeline };
|
package/dist/index.js
CHANGED
|
@@ -234,10 +234,15 @@ var BusinessType = /* @__PURE__ */ ((BusinessType2) => {
|
|
|
234
234
|
})(BusinessType || {});
|
|
235
235
|
var BusinessPlan = /* @__PURE__ */ ((BusinessPlan2) => {
|
|
236
236
|
BusinessPlan2["NONE"] = "none";
|
|
237
|
+
BusinessPlan2["STARTER"] = "starter";
|
|
238
|
+
BusinessPlan2["GROWTH"] = "growth";
|
|
239
|
+
BusinessPlan2["SCALE"] = "scale";
|
|
237
240
|
BusinessPlan2["FULL"] = "full";
|
|
238
241
|
BusinessPlan2["INTERNAL"] = "internal";
|
|
239
242
|
return BusinessPlan2;
|
|
240
243
|
})(BusinessPlan || {});
|
|
244
|
+
var PLAN_LIMIT_REACHED = "PLAN_LIMIT_REACHED";
|
|
245
|
+
var PLAN_REQUIRED = "PLAN_REQUIRED";
|
|
241
246
|
var BusinessStatus = /* @__PURE__ */ ((BusinessStatus2) => {
|
|
242
247
|
BusinessStatus2["ACTIVE"] = "active";
|
|
243
248
|
BusinessStatus2["DISABLED"] = "disabled";
|
|
@@ -387,6 +392,8 @@ export {
|
|
|
387
392
|
LinkDestination,
|
|
388
393
|
MembershipStatus,
|
|
389
394
|
NotificationType,
|
|
395
|
+
PLAN_LIMIT_REACHED,
|
|
396
|
+
PLAN_REQUIRED,
|
|
390
397
|
PaymentOptions,
|
|
391
398
|
PayoutPeriodType,
|
|
392
399
|
PayoutRateSource,
|
package/package.json
CHANGED
package/src/business.ts
CHANGED
|
@@ -22,7 +22,6 @@ export enum BusinessCapability {
|
|
|
22
22
|
SELF_FULFILLMENT = 'self_fulfillment',
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
|
|
26
25
|
/**
|
|
27
26
|
* Who carried an errand: the originating business's own rider, or the wider
|
|
28
27
|
* network. The field rider-cost reporting splits on — own-rider cost against
|
|
@@ -65,10 +64,29 @@ export enum BusinessPlan {
|
|
|
65
64
|
* without deleting anything. For a hard cut-off use `BusinessStatus`.
|
|
66
65
|
*/
|
|
67
66
|
NONE = 'none',
|
|
67
|
+
/** Paid tiers: same modules, different rider caps. */
|
|
68
|
+
STARTER = 'starter',
|
|
69
|
+
GROWTH = 'growth',
|
|
70
|
+
SCALE = 'scale',
|
|
71
|
+
/** Pre-pricing businesses, grandfathered: no caps. */
|
|
68
72
|
FULL = 'full',
|
|
69
73
|
INTERNAL = 'internal',
|
|
70
74
|
}
|
|
71
75
|
|
|
76
|
+
/**
|
|
77
|
+
* Plan caps. `null` is unlimited. `riders` counts every rider not archived,
|
|
78
|
+
* suspended ones included.
|
|
79
|
+
*/
|
|
80
|
+
export interface BusinessLimits {
|
|
81
|
+
riders: number | null;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/** 403 code: adding past a plan cap. */
|
|
85
|
+
export const PLAN_LIMIT_REACHED = 'PLAN_LIMIT_REACHED';
|
|
86
|
+
|
|
87
|
+
/** 403 code: creating anything with no active plan (trial over, unpaid). */
|
|
88
|
+
export const PLAN_REQUIRED = 'PLAN_REQUIRED';
|
|
89
|
+
|
|
72
90
|
/**
|
|
73
91
|
* What a module looks like to one business.
|
|
74
92
|
*
|
|
@@ -86,10 +104,7 @@ export enum BusinessPlan {
|
|
|
86
104
|
*/
|
|
87
105
|
export type ModuleState = 'available' | 'locked' | 'hidden';
|
|
88
106
|
|
|
89
|
-
export type BusinessModuleStates = Record<
|
|
90
|
-
keyof BusinessModules,
|
|
91
|
-
ModuleState
|
|
92
|
-
>;
|
|
107
|
+
export type BusinessModuleStates = Record<keyof BusinessModules, ModuleState>;
|
|
93
108
|
|
|
94
109
|
export enum BusinessStatus {
|
|
95
110
|
ACTIVE = 'active',
|
|
@@ -104,6 +119,11 @@ export interface Business {
|
|
|
104
119
|
officeNumber: string;
|
|
105
120
|
type: BusinessType | `${BusinessType}`;
|
|
106
121
|
plan: BusinessPlan | `${BusinessPlan}`;
|
|
122
|
+
/** Trial plan, in force until `trialEndsAt`. Kept after it ends. */
|
|
123
|
+
trialPlan: BusinessPlan | `${BusinessPlan}` | NullOrUndefined;
|
|
124
|
+
trialEndsAt: string | Date | NullOrUndefined;
|
|
125
|
+
/** The plan in force (trial included). Show this, not `plan`. */
|
|
126
|
+
effectivePlan: BusinessPlan | `${BusinessPlan}`;
|
|
107
127
|
categoryId: string;
|
|
108
128
|
address: string | NullOrUndefined;
|
|
109
129
|
addressCoordinates:
|
|
@@ -169,6 +189,9 @@ export interface Business {
|
|
|
169
189
|
* learns the feature exists.
|
|
170
190
|
*/
|
|
171
191
|
moduleStates: BusinessModuleStates;
|
|
192
|
+
|
|
193
|
+
/** Caps from `effectivePlan`. */
|
|
194
|
+
limits: BusinessLimits;
|
|
172
195
|
}
|
|
173
196
|
|
|
174
197
|
export interface BusinessPg extends Business {
|