@mydoormot/app-types 2.1.2 → 2.1.3

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,5 +1,5 @@
1
1
 
2
- > @mydoormot/app-types@2.1.1 build /Users/chuksben/Desktop/projects/microservices/mydoormot/packages/app-types
2
+ > @mydoormot/app-types@2.1.2 build /Users/chuksben/Desktop/projects/microservices/mydoormot/packages/app-types
3
3
  > tsup src/index.ts --format esm,cjs --dts
4
4
 
5
5
  CLI Building entry: src/index.ts
@@ -8,11 +8,11 @@ CLI tsup v7.3.0
8
8
  CLI Target: es2021
9
9
  ESM Build start
10
10
  CJS Build start
11
- ESM dist/index.js 14.94 KB
12
- ESM ⚡️ Build success in 161ms
13
- CJS dist/index.cjs 17.98 KB
14
- CJS ⚡️ Build success in 171ms
11
+ ESM dist/index.js 14.81 KB
12
+ ESM ⚡️ Build success in 69ms
13
+ CJS dist/index.cjs 17.79 KB
14
+ CJS ⚡️ Build success in 69ms
15
15
  DTS Build start
16
- DTS ⚡️ Build success in 737ms
17
- DTS dist/index.d.ts 56.99 KB
18
- DTS dist/index.d.cts 56.99 KB
16
+ DTS ⚡️ Build success in 723ms
17
+ DTS dist/index.d.ts 55.91 KB
18
+ DTS dist/index.d.cts 55.91 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @mydoormot/app-types
2
2
 
3
+ ## 2.1.3
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated business settings
8
+
3
9
  ## 2.1.2
4
10
 
5
11
  ### Patch Changes
package/dist/index.cjs CHANGED
@@ -29,7 +29,6 @@ __export(src_exports, {
29
29
  BusinessStatus: () => BusinessStatus,
30
30
  BusinessType: () => BusinessType,
31
31
  DEFAULT_BUSINESS_FUEL_SETTINGS: () => DEFAULT_BUSINESS_FUEL_SETTINGS,
32
- DEFAULT_BUSINESS_MODULES: () => DEFAULT_BUSINESS_MODULES,
33
32
  DEFAULT_BUSINESS_RIDER_PAY_SETTINGS: () => DEFAULT_BUSINESS_RIDER_PAY_SETTINGS,
34
33
  DEFAULT_BUSINESS_SETTINGS: () => DEFAULT_BUSINESS_SETTINGS,
35
34
  DeliveryStatus: () => DeliveryStatus,
@@ -306,7 +305,6 @@ var BusinessType = /* @__PURE__ */ ((BusinessType2) => {
306
305
  })(BusinessType || {});
307
306
  var BusinessPlan = /* @__PURE__ */ ((BusinessPlan2) => {
308
307
  BusinessPlan2["NONE"] = "none";
309
- BusinessPlan2["MVP"] = "mvp";
310
308
  BusinessPlan2["FULL"] = "full";
311
309
  BusinessPlan2["INTERNAL"] = "internal";
312
310
  return BusinessPlan2;
@@ -336,7 +334,6 @@ var DEFAULT_BUSINESS_RIDER_PAY_SETTINGS = {
336
334
  defaultPercentage: null,
337
335
  periodType: null
338
336
  };
339
- var DEFAULT_BUSINESS_MODULES = {};
340
337
  var DEFAULT_BUSINESS_SETTINGS = {
341
338
  whatsappNotificationEnabled: true,
342
339
  whatsapp: {
@@ -360,7 +357,6 @@ var DEFAULT_BUSINESS_SETTINGS = {
360
357
  tiktok: null,
361
358
  website: null
362
359
  },
363
- modules: DEFAULT_BUSINESS_MODULES,
364
360
  fuel: DEFAULT_BUSINESS_FUEL_SETTINGS,
365
361
  riderPay: DEFAULT_BUSINESS_RIDER_PAY_SETTINGS
366
362
  };
@@ -443,7 +439,6 @@ var LinkDestination = /* @__PURE__ */ ((LinkDestination2) => {
443
439
  BusinessStatus,
444
440
  BusinessType,
445
441
  DEFAULT_BUSINESS_FUEL_SETTINGS,
446
- DEFAULT_BUSINESS_MODULES,
447
442
  DEFAULT_BUSINESS_RIDER_PAY_SETTINGS,
448
443
  DEFAULT_BUSINESS_SETTINGS,
449
444
  DeliveryStatus,
package/dist/index.d.cts CHANGED
@@ -362,12 +362,9 @@ declare enum BusinessPlan {
362
362
  * No tier at all — every module falls to its default of off.
363
363
  *
364
364
  * For a business that has bought nothing, or whose access is being pulled
365
- * without deleting anything. Per-business overrides in `settings.modules`
366
- * still apply on top: an override is a deliberate grant, and a plan change
367
- * must not silently revoke one. For a hard cut-off use `BusinessStatus`.
365
+ * without deleting anything. For a hard cut-off use `BusinessStatus`.
368
366
  */
369
367
  NONE = "none",
370
- MVP = "mvp",
371
368
  FULL = "full",
372
369
  INTERNAL = "internal"
373
370
  }
@@ -442,9 +439,8 @@ interface Business {
442
439
  disabledReason: string | NullOrUndefined;
443
440
  settings: BusinessSettings | NullOrUndefined;
444
441
  /**
445
- * The resolved feature set — the plan's defaults with this business's own
446
- * overrides applied. Server-computed; read this, never `settings.modules`,
447
- * which holds only the deliberate exceptions.
442
+ * Which features this business has, from its `type` and `plan`.
443
+ * Server-computed, so no client has to know the plan map.
448
444
  */
449
445
  modules: Required<{
450
446
  [K in keyof BusinessModules]: boolean;
@@ -493,15 +489,9 @@ interface OpeningHours {
493
489
  /**
494
490
  * Which features a business sees.
495
491
  *
496
- * Every value is optional, and `undefined` means *inherit from the plan* — not
497
- * `false`. That distinction is the whole point: a stored `true` is a decision
498
- * somebody made, so the plan can never quietly take it back, while an unset key
499
- * follows whatever the plan says today. Storing a resolved default would
500
- * collapse the two and freeze every business on the defaults it was created
501
- * with.
502
- *
503
- * Resolve with `modulesForPlan(type, plan)[key] ?? ...` — never read a key off
504
- * this object directly.
492
+ * Purely a function of its `type` and `plan` — there is no per-business
493
+ * override layer. A business needing something its plan does not include moves
494
+ * plan; there is no third place to look.
505
495
  */
506
496
  interface BusinessModules {
507
497
  draftErrands?: boolean;
@@ -585,22 +575,11 @@ interface BusinessSettings {
585
575
  tiktok: string | null;
586
576
  website: string | null;
587
577
  };
588
- modules: BusinessModules;
589
578
  fuel?: BusinessFuelSettings;
590
579
  riderPay?: BusinessRiderPaySettings;
591
580
  }
592
581
  declare const DEFAULT_BUSINESS_FUEL_SETTINGS: BusinessFuelSettings;
593
582
  declare const DEFAULT_BUSINESS_RIDER_PAY_SETTINGS: BusinessRiderPaySettings;
594
- /**
595
- * @deprecated Defaults live in `modulesForPlan(type, plan)` on the server. This
596
- * was an all-`true` deny-list: every new feature shipped to every business
597
- * until someone remembered to switch it off, and writing it into each new
598
- * business made the stored value indistinguishable from a deliberate grant.
599
- *
600
- * Kept only so nothing importing it breaks mid-migration. Empty on purpose —
601
- * unset means inherit.
602
- */
603
- declare const DEFAULT_BUSINESS_MODULES: BusinessModules;
604
583
  declare const DEFAULT_BUSINESS_SETTINGS: BusinessSettings;
605
584
  interface BusinessMember {
606
585
  id: string;
@@ -1869,4 +1848,4 @@ declare enum LinkDestination {
1869
1848
  }
1870
1849
  type NullOrUndefined = null | undefined;
1871
1850
 
1872
- 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_MODULES, 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 };
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 };
package/dist/index.d.ts CHANGED
@@ -362,12 +362,9 @@ declare enum BusinessPlan {
362
362
  * No tier at all — every module falls to its default of off.
363
363
  *
364
364
  * For a business that has bought nothing, or whose access is being pulled
365
- * without deleting anything. Per-business overrides in `settings.modules`
366
- * still apply on top: an override is a deliberate grant, and a plan change
367
- * must not silently revoke one. For a hard cut-off use `BusinessStatus`.
365
+ * without deleting anything. For a hard cut-off use `BusinessStatus`.
368
366
  */
369
367
  NONE = "none",
370
- MVP = "mvp",
371
368
  FULL = "full",
372
369
  INTERNAL = "internal"
373
370
  }
@@ -442,9 +439,8 @@ interface Business {
442
439
  disabledReason: string | NullOrUndefined;
443
440
  settings: BusinessSettings | NullOrUndefined;
444
441
  /**
445
- * The resolved feature set — the plan's defaults with this business's own
446
- * overrides applied. Server-computed; read this, never `settings.modules`,
447
- * which holds only the deliberate exceptions.
442
+ * Which features this business has, from its `type` and `plan`.
443
+ * Server-computed, so no client has to know the plan map.
448
444
  */
449
445
  modules: Required<{
450
446
  [K in keyof BusinessModules]: boolean;
@@ -493,15 +489,9 @@ interface OpeningHours {
493
489
  /**
494
490
  * Which features a business sees.
495
491
  *
496
- * Every value is optional, and `undefined` means *inherit from the plan* — not
497
- * `false`. That distinction is the whole point: a stored `true` is a decision
498
- * somebody made, so the plan can never quietly take it back, while an unset key
499
- * follows whatever the plan says today. Storing a resolved default would
500
- * collapse the two and freeze every business on the defaults it was created
501
- * with.
502
- *
503
- * Resolve with `modulesForPlan(type, plan)[key] ?? ...` — never read a key off
504
- * this object directly.
492
+ * Purely a function of its `type` and `plan` — there is no per-business
493
+ * override layer. A business needing something its plan does not include moves
494
+ * plan; there is no third place to look.
505
495
  */
506
496
  interface BusinessModules {
507
497
  draftErrands?: boolean;
@@ -585,22 +575,11 @@ interface BusinessSettings {
585
575
  tiktok: string | null;
586
576
  website: string | null;
587
577
  };
588
- modules: BusinessModules;
589
578
  fuel?: BusinessFuelSettings;
590
579
  riderPay?: BusinessRiderPaySettings;
591
580
  }
592
581
  declare const DEFAULT_BUSINESS_FUEL_SETTINGS: BusinessFuelSettings;
593
582
  declare const DEFAULT_BUSINESS_RIDER_PAY_SETTINGS: BusinessRiderPaySettings;
594
- /**
595
- * @deprecated Defaults live in `modulesForPlan(type, plan)` on the server. This
596
- * was an all-`true` deny-list: every new feature shipped to every business
597
- * until someone remembered to switch it off, and writing it into each new
598
- * business made the stored value indistinguishable from a deliberate grant.
599
- *
600
- * Kept only so nothing importing it breaks mid-migration. Empty on purpose —
601
- * unset means inherit.
602
- */
603
- declare const DEFAULT_BUSINESS_MODULES: BusinessModules;
604
583
  declare const DEFAULT_BUSINESS_SETTINGS: BusinessSettings;
605
584
  interface BusinessMember {
606
585
  id: string;
@@ -1869,4 +1848,4 @@ declare enum LinkDestination {
1869
1848
  }
1870
1849
  type NullOrUndefined = null | undefined;
1871
1850
 
1872
- 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_MODULES, 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 };
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 };
package/dist/index.js CHANGED
@@ -234,7 +234,6 @@ var BusinessType = /* @__PURE__ */ ((BusinessType2) => {
234
234
  })(BusinessType || {});
235
235
  var BusinessPlan = /* @__PURE__ */ ((BusinessPlan2) => {
236
236
  BusinessPlan2["NONE"] = "none";
237
- BusinessPlan2["MVP"] = "mvp";
238
237
  BusinessPlan2["FULL"] = "full";
239
238
  BusinessPlan2["INTERNAL"] = "internal";
240
239
  return BusinessPlan2;
@@ -264,7 +263,6 @@ var DEFAULT_BUSINESS_RIDER_PAY_SETTINGS = {
264
263
  defaultPercentage: null,
265
264
  periodType: null
266
265
  };
267
- var DEFAULT_BUSINESS_MODULES = {};
268
266
  var DEFAULT_BUSINESS_SETTINGS = {
269
267
  whatsappNotificationEnabled: true,
270
268
  whatsapp: {
@@ -288,7 +286,6 @@ var DEFAULT_BUSINESS_SETTINGS = {
288
286
  tiktok: null,
289
287
  website: null
290
288
  },
291
- modules: DEFAULT_BUSINESS_MODULES,
292
289
  fuel: DEFAULT_BUSINESS_FUEL_SETTINGS,
293
290
  riderPay: DEFAULT_BUSINESS_RIDER_PAY_SETTINGS
294
291
  };
@@ -370,7 +367,6 @@ export {
370
367
  BusinessStatus,
371
368
  BusinessType,
372
369
  DEFAULT_BUSINESS_FUEL_SETTINGS,
373
- DEFAULT_BUSINESS_MODULES,
374
370
  DEFAULT_BUSINESS_RIDER_PAY_SETTINGS,
375
371
  DEFAULT_BUSINESS_SETTINGS,
376
372
  DeliveryStatus,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mydoormot/app-types",
3
- "version": "2.1.2",
3
+ "version": "2.1.3",
4
4
  "description": "",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.js",
package/src/business.ts CHANGED
@@ -62,12 +62,9 @@ export enum BusinessPlan {
62
62
  * No tier at all — every module falls to its default of off.
63
63
  *
64
64
  * For a business that has bought nothing, or whose access is being pulled
65
- * without deleting anything. Per-business overrides in `settings.modules`
66
- * still apply on top: an override is a deliberate grant, and a plan change
67
- * must not silently revoke one. For a hard cut-off use `BusinessStatus`.
65
+ * without deleting anything. For a hard cut-off use `BusinessStatus`.
68
66
  */
69
67
  NONE = 'none',
70
- MVP = 'mvp',
71
68
  FULL = 'full',
72
69
  INTERNAL = 'internal',
73
70
  }
@@ -160,9 +157,8 @@ export interface Business {
160
157
  settings: BusinessSettings | NullOrUndefined;
161
158
 
162
159
  /**
163
- * The resolved feature set — the plan's defaults with this business's own
164
- * overrides applied. Server-computed; read this, never `settings.modules`,
165
- * which holds only the deliberate exceptions.
160
+ * Which features this business has, from its `type` and `plan`.
161
+ * Server-computed, so no client has to know the plan map.
166
162
  */
167
163
  modules: Required<{ [K in keyof BusinessModules]: boolean }>;
168
164
 
@@ -219,15 +215,9 @@ export interface OpeningHours {
219
215
  /**
220
216
  * Which features a business sees.
221
217
  *
222
- * Every value is optional, and `undefined` means *inherit from the plan* — not
223
- * `false`. That distinction is the whole point: a stored `true` is a decision
224
- * somebody made, so the plan can never quietly take it back, while an unset key
225
- * follows whatever the plan says today. Storing a resolved default would
226
- * collapse the two and freeze every business on the defaults it was created
227
- * with.
228
- *
229
- * Resolve with `modulesForPlan(type, plan)[key] ?? ...` — never read a key off
230
- * this object directly.
218
+ * Purely a function of its `type` and `plan` — there is no per-business
219
+ * override layer. A business needing something its plan does not include moves
220
+ * plan; there is no third place to look.
231
221
  */
232
222
  export interface BusinessModules {
233
223
  draftErrands?: boolean;
@@ -315,7 +305,6 @@ export interface BusinessSettings {
315
305
  tiktok: string | null;
316
306
  website: string | null;
317
307
  };
318
- modules: BusinessModules;
319
308
  fuel?: BusinessFuelSettings;
320
309
  riderPay?: BusinessRiderPaySettings;
321
310
  }
@@ -329,17 +318,6 @@ export const DEFAULT_BUSINESS_RIDER_PAY_SETTINGS: BusinessRiderPaySettings = {
329
318
  periodType: null,
330
319
  };
331
320
 
332
- /**
333
- * @deprecated Defaults live in `modulesForPlan(type, plan)` on the server. This
334
- * was an all-`true` deny-list: every new feature shipped to every business
335
- * until someone remembered to switch it off, and writing it into each new
336
- * business made the stored value indistinguishable from a deliberate grant.
337
- *
338
- * Kept only so nothing importing it breaks mid-migration. Empty on purpose —
339
- * unset means inherit.
340
- */
341
- export const DEFAULT_BUSINESS_MODULES: BusinessModules = {};
342
-
343
321
  export const DEFAULT_BUSINESS_SETTINGS: BusinessSettings = {
344
322
  whatsappNotificationEnabled: true,
345
323
  whatsapp: {
@@ -363,7 +341,6 @@ export const DEFAULT_BUSINESS_SETTINGS: BusinessSettings = {
363
341
  tiktok: null,
364
342
  website: null,
365
343
  },
366
- modules: DEFAULT_BUSINESS_MODULES,
367
344
  fuel: DEFAULT_BUSINESS_FUEL_SETTINGS,
368
345
  riderPay: DEFAULT_BUSINESS_RIDER_PAY_SETTINGS,
369
346
  };