@blackcode_sa/metaestetics-api 1.15.14 → 1.15.16

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/dist/index.d.mts CHANGED
@@ -9771,7 +9771,7 @@ declare function getEffectiveTier(db: Firestore, clinicGroupId: string): Promise
9771
9771
  declare function enforceProviderLimit(db: Firestore, clinicGroupId: string, branchId: string): Promise<void>;
9772
9772
  /**
9773
9773
  * Enforces tier limit before creating a procedure for a provider in a branch.
9774
- * Add-on aware: effective limit = base + (procedureBlocks × 10).
9774
+ * Add-on aware: effective limit = base + (procedureBlocks × 5).
9775
9775
  */
9776
9776
  declare function enforceProcedureLimit(db: Firestore, clinicGroupId: string, branchId: string, providerId: string, count?: number): Promise<void>;
9777
9777
  /**
@@ -9841,11 +9841,11 @@ type PermissionKey = keyof typeof PERMISSION_KEYS;
9841
9841
  * - Appointments and messages are NEVER limited (bad patient UX)
9842
9842
  * - Providers are per branch, not per clinic group
9843
9843
  * - Procedures are per provider (each provider gets this allowance)
9844
- * - Add-ons available on Connect/Pro: +1 branch, +1 provider, +10 procedures
9844
+ * - Add-ons available on Connect/Pro: +1 branch, +1 provider, +5 treatments
9845
9845
  *
9846
- * Free: 1 branch, 1 provider/branch, 3 procedures/provider
9847
- * Connect (CHF 59/mo): 1 branch, 3 providers/branch, 10 procedures/provider
9848
- * Pro (CHF 149/mo): 3 branches, 10 providers/branch, 20 procedures/provider
9846
+ * Free: 1 branch, 1 provider/branch, 3 treatments/provider
9847
+ * Connect (CHF 199/mo): 1 branch, 3 providers/branch, 10 treatments/provider
9848
+ * Pro (CHF 449/mo): 3 branches, 5 providers/branch, 20 treatments/provider
9849
9849
  */
9850
9850
  declare const TIER_CONFIG: Record<string, TierConfig>;
9851
9851
  /**
package/dist/index.d.ts CHANGED
@@ -9771,7 +9771,7 @@ declare function getEffectiveTier(db: Firestore, clinicGroupId: string): Promise
9771
9771
  declare function enforceProviderLimit(db: Firestore, clinicGroupId: string, branchId: string): Promise<void>;
9772
9772
  /**
9773
9773
  * Enforces tier limit before creating a procedure for a provider in a branch.
9774
- * Add-on aware: effective limit = base + (procedureBlocks × 10).
9774
+ * Add-on aware: effective limit = base + (procedureBlocks × 5).
9775
9775
  */
9776
9776
  declare function enforceProcedureLimit(db: Firestore, clinicGroupId: string, branchId: string, providerId: string, count?: number): Promise<void>;
9777
9777
  /**
@@ -9841,11 +9841,11 @@ type PermissionKey = keyof typeof PERMISSION_KEYS;
9841
9841
  * - Appointments and messages are NEVER limited (bad patient UX)
9842
9842
  * - Providers are per branch, not per clinic group
9843
9843
  * - Procedures are per provider (each provider gets this allowance)
9844
- * - Add-ons available on Connect/Pro: +1 branch, +1 provider, +10 procedures
9844
+ * - Add-ons available on Connect/Pro: +1 branch, +1 provider, +5 treatments
9845
9845
  *
9846
- * Free: 1 branch, 1 provider/branch, 3 procedures/provider
9847
- * Connect (CHF 59/mo): 1 branch, 3 providers/branch, 10 procedures/provider
9848
- * Pro (CHF 149/mo): 3 branches, 10 providers/branch, 20 procedures/provider
9846
+ * Free: 1 branch, 1 provider/branch, 3 treatments/provider
9847
+ * Connect (CHF 199/mo): 1 branch, 3 providers/branch, 10 treatments/provider
9848
+ * Pro (CHF 449/mo): 3 branches, 5 providers/branch, 20 treatments/provider
9849
9849
  */
9850
9850
  declare const TIER_CONFIG: Record<string, TierConfig>;
9851
9851
  /**
package/dist/index.js CHANGED
@@ -12752,7 +12752,7 @@ var TIER_CONFIG = {
12752
12752
  tier: "pro",
12753
12753
  name: "Pro",
12754
12754
  limits: {
12755
- maxProvidersPerBranch: 10,
12755
+ maxProvidersPerBranch: 5,
12756
12756
  maxProceduresPerProvider: 20,
12757
12757
  maxBranches: 3
12758
12758
  }
@@ -12976,7 +12976,7 @@ async function enforceProcedureLimit(db, clinicGroupId, branchId, providerId, co
12976
12976
  if (baseMax === -1) return;
12977
12977
  const addOns = (billing == null ? void 0 : billing.addOns) || {};
12978
12978
  const procedureBlocks = ((_a = addOns[branchId]) == null ? void 0 : _a.procedureBlocks) || 0;
12979
- const effectiveMax = baseMax + procedureBlocks * 10;
12979
+ const effectiveMax = baseMax + procedureBlocks * 5;
12980
12980
  const currentCount = await countProceduresForProvider(db, branchId, providerId);
12981
12981
  if (currentCount + count > effectiveMax) {
12982
12982
  throw new TierLimitError("procedures for this provider", tier, currentCount, effectiveMax);
package/dist/index.mjs CHANGED
@@ -12770,7 +12770,7 @@ var TIER_CONFIG = {
12770
12770
  tier: "pro",
12771
12771
  name: "Pro",
12772
12772
  limits: {
12773
- maxProvidersPerBranch: 10,
12773
+ maxProvidersPerBranch: 5,
12774
12774
  maxProceduresPerProvider: 20,
12775
12775
  maxBranches: 3
12776
12776
  }
@@ -12994,7 +12994,7 @@ async function enforceProcedureLimit(db, clinicGroupId, branchId, providerId, co
12994
12994
  if (baseMax === -1) return;
12995
12995
  const addOns = (billing == null ? void 0 : billing.addOns) || {};
12996
12996
  const procedureBlocks = ((_a = addOns[branchId]) == null ? void 0 : _a.procedureBlocks) || 0;
12997
- const effectiveMax = baseMax + procedureBlocks * 10;
12997
+ const effectiveMax = baseMax + procedureBlocks * 5;
12998
12998
  const currentCount = await countProceduresForProvider(db, branchId, providerId);
12999
12999
  if (currentCount + count > effectiveMax) {
13000
13000
  throw new TierLimitError("procedures for this provider", tier, currentCount, effectiveMax);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@blackcode_sa/metaestetics-api",
3
3
  "private": false,
4
- "version": "1.15.14",
4
+ "version": "1.15.16",
5
5
  "description": "Firebase authentication service with anonymous upgrade support",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.mjs",
@@ -57,11 +57,11 @@ export type PermissionKey = keyof typeof PERMISSION_KEYS;
57
57
  * - Appointments and messages are NEVER limited (bad patient UX)
58
58
  * - Providers are per branch, not per clinic group
59
59
  * - Procedures are per provider (each provider gets this allowance)
60
- * - Add-ons available on Connect/Pro: +1 branch, +1 provider, +10 procedures
60
+ * - Add-ons available on Connect/Pro: +1 branch, +1 provider, +5 treatments
61
61
  *
62
- * Free: 1 branch, 1 provider/branch, 3 procedures/provider
63
- * Connect (CHF 59/mo): 1 branch, 3 providers/branch, 10 procedures/provider
64
- * Pro (CHF 149/mo): 3 branches, 10 providers/branch, 20 procedures/provider
62
+ * Free: 1 branch, 1 provider/branch, 3 treatments/provider
63
+ * Connect (CHF 199/mo): 1 branch, 3 providers/branch, 10 treatments/provider
64
+ * Pro (CHF 449/mo): 3 branches, 5 providers/branch, 20 treatments/provider
65
65
  */
66
66
  export const TIER_CONFIG: Record<string, TierConfig> = {
67
67
  free: {
@@ -86,7 +86,7 @@ export const TIER_CONFIG: Record<string, TierConfig> = {
86
86
  tier: 'pro',
87
87
  name: 'Pro',
88
88
  limits: {
89
- maxProvidersPerBranch: 10,
89
+ maxProvidersPerBranch: 5,
90
90
  maxProceduresPerProvider: 20,
91
91
  maxBranches: 3,
92
92
  },
@@ -189,7 +189,7 @@ export async function enforceProviderLimit(
189
189
 
190
190
  /**
191
191
  * Enforces tier limit before creating a procedure for a provider in a branch.
192
- * Add-on aware: effective limit = base + (procedureBlocks × 10).
192
+ * Add-on aware: effective limit = base + (procedureBlocks × 5).
193
193
  */
194
194
  export async function enforceProcedureLimit(
195
195
  db: Firestore,
@@ -207,7 +207,7 @@ export async function enforceProcedureLimit(
207
207
 
208
208
  const addOns = billing?.addOns || {};
209
209
  const procedureBlocks = addOns[branchId]?.procedureBlocks || 0;
210
- const effectiveMax = baseMax + (procedureBlocks * 10);
210
+ const effectiveMax = baseMax + (procedureBlocks * 5);
211
211
 
212
212
  const currentCount = await countProceduresForProvider(db, branchId, providerId);
213
213
  if (currentCount + count > effectiveMax) {