@blackcode_sa/metaestetics-api 1.15.17-staging.8 → 1.15.17-staging.9
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 +25 -3
- package/dist/index.d.ts +25 -3
- package/dist/index.js +119 -21
- package/dist/index.mjs +119 -21
- package/package.json +1 -1
- package/src/config/tiers.config.ts +126 -21
package/dist/index.d.mts
CHANGED
|
@@ -10282,14 +10282,25 @@ declare const getFirebaseFunctions: () => Promise<Functions>;
|
|
|
10282
10282
|
* what a given role (owner/admin/receptionist/assistant) can do.
|
|
10283
10283
|
* New roles can be added by extending the ClinicRole enum and adding
|
|
10284
10284
|
* a corresponding entry here.
|
|
10285
|
+
*
|
|
10286
|
+
* v2 (2026-03-31): Expanded from 23 to 40 permissions.
|
|
10287
|
+
* - providers.manage → providers.create, providers.invite, providers.edit
|
|
10288
|
+
* - staff.manage → staff.view, staff.edit, staff.invite, staff.delete, staff.viewTokens, staff.deleteTokens
|
|
10289
|
+
* - Added: clinic.create, calendar.addEvent, calendar.editEvent, calendar.deleteEvent,
|
|
10290
|
+
* appointments.reschedule, patients.viewDetails, patients.create, patients.manageTokens, billing.view
|
|
10285
10291
|
*/
|
|
10286
10292
|
declare const PERMISSION_KEYS: {
|
|
10287
10293
|
readonly 'clinic.view': true;
|
|
10288
10294
|
readonly 'clinic.edit': true;
|
|
10295
|
+
readonly 'clinic.create': true;
|
|
10289
10296
|
readonly 'reviews.view': true;
|
|
10290
10297
|
readonly 'calendar.view': true;
|
|
10298
|
+
readonly 'calendar.addEvent': true;
|
|
10299
|
+
readonly 'calendar.editEvent': true;
|
|
10300
|
+
readonly 'calendar.deleteEvent': true;
|
|
10291
10301
|
readonly 'appointments.view': true;
|
|
10292
10302
|
readonly 'appointments.confirm': true;
|
|
10303
|
+
readonly 'appointments.reschedule': true;
|
|
10293
10304
|
readonly 'appointments.cancel': true;
|
|
10294
10305
|
readonly messaging: true;
|
|
10295
10306
|
readonly 'procedures.view': true;
|
|
@@ -10301,12 +10312,23 @@ declare const PERMISSION_KEYS: {
|
|
|
10301
10312
|
readonly 'resources.edit': true;
|
|
10302
10313
|
readonly 'resources.delete': true;
|
|
10303
10314
|
readonly 'patients.view': true;
|
|
10315
|
+
readonly 'patients.viewDetails': true;
|
|
10316
|
+
readonly 'patients.create': true;
|
|
10304
10317
|
readonly 'patients.edit': true;
|
|
10318
|
+
readonly 'patients.manageTokens': true;
|
|
10305
10319
|
readonly 'providers.view': true;
|
|
10306
|
-
readonly 'providers.
|
|
10320
|
+
readonly 'providers.create': true;
|
|
10321
|
+
readonly 'providers.invite': true;
|
|
10322
|
+
readonly 'providers.edit': true;
|
|
10307
10323
|
readonly 'analytics.view': true;
|
|
10308
|
-
readonly 'staff.
|
|
10324
|
+
readonly 'staff.view': true;
|
|
10325
|
+
readonly 'staff.edit': true;
|
|
10326
|
+
readonly 'staff.invite': true;
|
|
10327
|
+
readonly 'staff.delete': true;
|
|
10328
|
+
readonly 'staff.viewTokens': true;
|
|
10329
|
+
readonly 'staff.deleteTokens': true;
|
|
10309
10330
|
readonly 'settings.manage': true;
|
|
10331
|
+
readonly 'billing.view': true;
|
|
10310
10332
|
readonly 'billing.manage': true;
|
|
10311
10333
|
};
|
|
10312
10334
|
type PermissionKey = keyof typeof PERMISSION_KEYS;
|
|
@@ -10348,7 +10370,7 @@ declare const PERMISSION_LABELS: Record<string, {
|
|
|
10348
10370
|
category: string;
|
|
10349
10371
|
}>;
|
|
10350
10372
|
/** All unique permission categories in display order. */
|
|
10351
|
-
declare const PERMISSION_CATEGORIES: readonly ["Clinic", "Calendar", "Appointments", "Messaging", "Procedures", "Resources", "Patients", "Providers", "Analytics", "Administration"];
|
|
10373
|
+
declare const PERMISSION_CATEGORIES: readonly ["Clinic", "Calendar", "Appointments", "Messaging", "Procedures", "Resources", "Patients", "Providers", "Analytics", "Staff Management", "Administration"];
|
|
10352
10374
|
/**
|
|
10353
10375
|
* Resolves the effective tier for a subscription model string.
|
|
10354
10376
|
*/
|
package/dist/index.d.ts
CHANGED
|
@@ -10282,14 +10282,25 @@ declare const getFirebaseFunctions: () => Promise<Functions>;
|
|
|
10282
10282
|
* what a given role (owner/admin/receptionist/assistant) can do.
|
|
10283
10283
|
* New roles can be added by extending the ClinicRole enum and adding
|
|
10284
10284
|
* a corresponding entry here.
|
|
10285
|
+
*
|
|
10286
|
+
* v2 (2026-03-31): Expanded from 23 to 40 permissions.
|
|
10287
|
+
* - providers.manage → providers.create, providers.invite, providers.edit
|
|
10288
|
+
* - staff.manage → staff.view, staff.edit, staff.invite, staff.delete, staff.viewTokens, staff.deleteTokens
|
|
10289
|
+
* - Added: clinic.create, calendar.addEvent, calendar.editEvent, calendar.deleteEvent,
|
|
10290
|
+
* appointments.reschedule, patients.viewDetails, patients.create, patients.manageTokens, billing.view
|
|
10285
10291
|
*/
|
|
10286
10292
|
declare const PERMISSION_KEYS: {
|
|
10287
10293
|
readonly 'clinic.view': true;
|
|
10288
10294
|
readonly 'clinic.edit': true;
|
|
10295
|
+
readonly 'clinic.create': true;
|
|
10289
10296
|
readonly 'reviews.view': true;
|
|
10290
10297
|
readonly 'calendar.view': true;
|
|
10298
|
+
readonly 'calendar.addEvent': true;
|
|
10299
|
+
readonly 'calendar.editEvent': true;
|
|
10300
|
+
readonly 'calendar.deleteEvent': true;
|
|
10291
10301
|
readonly 'appointments.view': true;
|
|
10292
10302
|
readonly 'appointments.confirm': true;
|
|
10303
|
+
readonly 'appointments.reschedule': true;
|
|
10293
10304
|
readonly 'appointments.cancel': true;
|
|
10294
10305
|
readonly messaging: true;
|
|
10295
10306
|
readonly 'procedures.view': true;
|
|
@@ -10301,12 +10312,23 @@ declare const PERMISSION_KEYS: {
|
|
|
10301
10312
|
readonly 'resources.edit': true;
|
|
10302
10313
|
readonly 'resources.delete': true;
|
|
10303
10314
|
readonly 'patients.view': true;
|
|
10315
|
+
readonly 'patients.viewDetails': true;
|
|
10316
|
+
readonly 'patients.create': true;
|
|
10304
10317
|
readonly 'patients.edit': true;
|
|
10318
|
+
readonly 'patients.manageTokens': true;
|
|
10305
10319
|
readonly 'providers.view': true;
|
|
10306
|
-
readonly 'providers.
|
|
10320
|
+
readonly 'providers.create': true;
|
|
10321
|
+
readonly 'providers.invite': true;
|
|
10322
|
+
readonly 'providers.edit': true;
|
|
10307
10323
|
readonly 'analytics.view': true;
|
|
10308
|
-
readonly 'staff.
|
|
10324
|
+
readonly 'staff.view': true;
|
|
10325
|
+
readonly 'staff.edit': true;
|
|
10326
|
+
readonly 'staff.invite': true;
|
|
10327
|
+
readonly 'staff.delete': true;
|
|
10328
|
+
readonly 'staff.viewTokens': true;
|
|
10329
|
+
readonly 'staff.deleteTokens': true;
|
|
10309
10330
|
readonly 'settings.manage': true;
|
|
10331
|
+
readonly 'billing.view': true;
|
|
10310
10332
|
readonly 'billing.manage': true;
|
|
10311
10333
|
};
|
|
10312
10334
|
type PermissionKey = keyof typeof PERMISSION_KEYS;
|
|
@@ -10348,7 +10370,7 @@ declare const PERMISSION_LABELS: Record<string, {
|
|
|
10348
10370
|
category: string;
|
|
10349
10371
|
}>;
|
|
10350
10372
|
/** All unique permission categories in display order. */
|
|
10351
|
-
declare const PERMISSION_CATEGORIES: readonly ["Clinic", "Calendar", "Appointments", "Messaging", "Procedures", "Resources", "Patients", "Providers", "Analytics", "Administration"];
|
|
10373
|
+
declare const PERMISSION_CATEGORIES: readonly ["Clinic", "Calendar", "Appointments", "Messaging", "Procedures", "Resources", "Patients", "Providers", "Analytics", "Staff Management", "Administration"];
|
|
10352
10374
|
/**
|
|
10353
10375
|
* Resolves the effective tier for a subscription model string.
|
|
10354
10376
|
*/
|
package/dist/index.js
CHANGED
|
@@ -12751,14 +12751,20 @@ var import_firestore36 = require("firebase/firestore");
|
|
|
12751
12751
|
|
|
12752
12752
|
// src/config/tiers.config.ts
|
|
12753
12753
|
var PERMISSION_KEYS = {
|
|
12754
|
-
//
|
|
12754
|
+
// Clinic
|
|
12755
12755
|
"clinic.view": true,
|
|
12756
12756
|
"clinic.edit": true,
|
|
12757
|
+
"clinic.create": true,
|
|
12757
12758
|
"reviews.view": true,
|
|
12758
|
-
// Calendar
|
|
12759
|
+
// Calendar
|
|
12759
12760
|
"calendar.view": true,
|
|
12761
|
+
"calendar.addEvent": true,
|
|
12762
|
+
"calendar.editEvent": true,
|
|
12763
|
+
"calendar.deleteEvent": true,
|
|
12764
|
+
// Appointments
|
|
12760
12765
|
"appointments.view": true,
|
|
12761
12766
|
"appointments.confirm": true,
|
|
12767
|
+
"appointments.reschedule": true,
|
|
12762
12768
|
"appointments.cancel": true,
|
|
12763
12769
|
// Messaging
|
|
12764
12770
|
"messaging": true,
|
|
@@ -12774,16 +12780,27 @@ var PERMISSION_KEYS = {
|
|
|
12774
12780
|
"resources.delete": true,
|
|
12775
12781
|
// Patients
|
|
12776
12782
|
"patients.view": true,
|
|
12783
|
+
"patients.viewDetails": true,
|
|
12784
|
+
"patients.create": true,
|
|
12777
12785
|
"patients.edit": true,
|
|
12786
|
+
"patients.manageTokens": true,
|
|
12778
12787
|
// Providers (doctors, nurses, laser assistants, etc.)
|
|
12779
12788
|
"providers.view": true,
|
|
12780
|
-
"providers.
|
|
12789
|
+
"providers.create": true,
|
|
12790
|
+
"providers.invite": true,
|
|
12791
|
+
"providers.edit": true,
|
|
12781
12792
|
// Analytics
|
|
12782
12793
|
"analytics.view": true,
|
|
12783
12794
|
// Staff management
|
|
12784
|
-
"staff.
|
|
12795
|
+
"staff.view": true,
|
|
12796
|
+
"staff.edit": true,
|
|
12797
|
+
"staff.invite": true,
|
|
12798
|
+
"staff.delete": true,
|
|
12799
|
+
"staff.viewTokens": true,
|
|
12800
|
+
"staff.deleteTokens": true,
|
|
12785
12801
|
// Settings / Admin
|
|
12786
12802
|
"settings.manage": true,
|
|
12803
|
+
"billing.view": true,
|
|
12787
12804
|
"billing.manage": true
|
|
12788
12805
|
};
|
|
12789
12806
|
var TIER_CONFIG = {
|
|
@@ -12819,10 +12836,15 @@ var DEFAULT_ROLE_PERMISSIONS = {
|
|
|
12819
12836
|
["owner" /* OWNER */]: {
|
|
12820
12837
|
"clinic.view": true,
|
|
12821
12838
|
"clinic.edit": true,
|
|
12839
|
+
"clinic.create": true,
|
|
12822
12840
|
"reviews.view": true,
|
|
12823
12841
|
"calendar.view": true,
|
|
12842
|
+
"calendar.addEvent": true,
|
|
12843
|
+
"calendar.editEvent": true,
|
|
12844
|
+
"calendar.deleteEvent": true,
|
|
12824
12845
|
"appointments.view": true,
|
|
12825
12846
|
"appointments.confirm": true,
|
|
12847
|
+
"appointments.reschedule": true,
|
|
12826
12848
|
"appointments.cancel": true,
|
|
12827
12849
|
"messaging": true,
|
|
12828
12850
|
"procedures.view": true,
|
|
@@ -12834,21 +12856,37 @@ var DEFAULT_ROLE_PERMISSIONS = {
|
|
|
12834
12856
|
"resources.edit": true,
|
|
12835
12857
|
"resources.delete": true,
|
|
12836
12858
|
"patients.view": true,
|
|
12859
|
+
"patients.viewDetails": true,
|
|
12860
|
+
"patients.create": true,
|
|
12837
12861
|
"patients.edit": true,
|
|
12862
|
+
"patients.manageTokens": true,
|
|
12838
12863
|
"providers.view": true,
|
|
12839
|
-
"providers.
|
|
12864
|
+
"providers.create": true,
|
|
12865
|
+
"providers.invite": true,
|
|
12866
|
+
"providers.edit": true,
|
|
12840
12867
|
"analytics.view": true,
|
|
12841
|
-
"staff.
|
|
12868
|
+
"staff.view": true,
|
|
12869
|
+
"staff.edit": true,
|
|
12870
|
+
"staff.invite": true,
|
|
12871
|
+
"staff.delete": true,
|
|
12872
|
+
"staff.viewTokens": true,
|
|
12873
|
+
"staff.deleteTokens": true,
|
|
12842
12874
|
"settings.manage": true,
|
|
12875
|
+
"billing.view": true,
|
|
12843
12876
|
"billing.manage": true
|
|
12844
12877
|
},
|
|
12845
12878
|
["admin" /* ADMIN */]: {
|
|
12846
12879
|
"clinic.view": true,
|
|
12847
12880
|
"clinic.edit": true,
|
|
12881
|
+
"clinic.create": false,
|
|
12848
12882
|
"reviews.view": true,
|
|
12849
12883
|
"calendar.view": true,
|
|
12884
|
+
"calendar.addEvent": true,
|
|
12885
|
+
"calendar.editEvent": true,
|
|
12886
|
+
"calendar.deleteEvent": true,
|
|
12850
12887
|
"appointments.view": true,
|
|
12851
12888
|
"appointments.confirm": true,
|
|
12889
|
+
"appointments.reschedule": true,
|
|
12852
12890
|
"appointments.cancel": true,
|
|
12853
12891
|
"messaging": true,
|
|
12854
12892
|
"procedures.view": true,
|
|
@@ -12860,21 +12898,37 @@ var DEFAULT_ROLE_PERMISSIONS = {
|
|
|
12860
12898
|
"resources.edit": true,
|
|
12861
12899
|
"resources.delete": true,
|
|
12862
12900
|
"patients.view": true,
|
|
12901
|
+
"patients.viewDetails": true,
|
|
12902
|
+
"patients.create": true,
|
|
12863
12903
|
"patients.edit": true,
|
|
12904
|
+
"patients.manageTokens": true,
|
|
12864
12905
|
"providers.view": true,
|
|
12865
|
-
"providers.
|
|
12906
|
+
"providers.create": true,
|
|
12907
|
+
"providers.invite": true,
|
|
12908
|
+
"providers.edit": true,
|
|
12866
12909
|
"analytics.view": true,
|
|
12867
|
-
"staff.
|
|
12910
|
+
"staff.view": true,
|
|
12911
|
+
"staff.edit": false,
|
|
12912
|
+
"staff.invite": false,
|
|
12913
|
+
"staff.delete": false,
|
|
12914
|
+
"staff.viewTokens": false,
|
|
12915
|
+
"staff.deleteTokens": false,
|
|
12868
12916
|
"settings.manage": true,
|
|
12917
|
+
"billing.view": true,
|
|
12869
12918
|
"billing.manage": false
|
|
12870
12919
|
},
|
|
12871
12920
|
["receptionist" /* RECEPTIONIST */]: {
|
|
12872
12921
|
"clinic.view": true,
|
|
12873
12922
|
"clinic.edit": false,
|
|
12923
|
+
"clinic.create": false,
|
|
12874
12924
|
"reviews.view": true,
|
|
12875
12925
|
"calendar.view": true,
|
|
12926
|
+
"calendar.addEvent": true,
|
|
12927
|
+
"calendar.editEvent": false,
|
|
12928
|
+
"calendar.deleteEvent": false,
|
|
12876
12929
|
"appointments.view": true,
|
|
12877
12930
|
"appointments.confirm": true,
|
|
12931
|
+
"appointments.reschedule": true,
|
|
12878
12932
|
"appointments.cancel": false,
|
|
12879
12933
|
"messaging": true,
|
|
12880
12934
|
"procedures.view": true,
|
|
@@ -12886,21 +12940,37 @@ var DEFAULT_ROLE_PERMISSIONS = {
|
|
|
12886
12940
|
"resources.edit": false,
|
|
12887
12941
|
"resources.delete": false,
|
|
12888
12942
|
"patients.view": true,
|
|
12943
|
+
"patients.viewDetails": true,
|
|
12944
|
+
"patients.create": true,
|
|
12889
12945
|
"patients.edit": false,
|
|
12946
|
+
"patients.manageTokens": false,
|
|
12890
12947
|
"providers.view": true,
|
|
12891
|
-
"providers.
|
|
12948
|
+
"providers.create": false,
|
|
12949
|
+
"providers.invite": false,
|
|
12950
|
+
"providers.edit": false,
|
|
12892
12951
|
"analytics.view": false,
|
|
12893
|
-
"staff.
|
|
12952
|
+
"staff.view": false,
|
|
12953
|
+
"staff.edit": false,
|
|
12954
|
+
"staff.invite": false,
|
|
12955
|
+
"staff.delete": false,
|
|
12956
|
+
"staff.viewTokens": false,
|
|
12957
|
+
"staff.deleteTokens": false,
|
|
12894
12958
|
"settings.manage": false,
|
|
12959
|
+
"billing.view": false,
|
|
12895
12960
|
"billing.manage": false
|
|
12896
12961
|
},
|
|
12897
12962
|
["assistant" /* ASSISTANT */]: {
|
|
12898
12963
|
"clinic.view": true,
|
|
12899
12964
|
"clinic.edit": false,
|
|
12965
|
+
"clinic.create": false,
|
|
12900
12966
|
"reviews.view": true,
|
|
12901
12967
|
"calendar.view": true,
|
|
12968
|
+
"calendar.addEvent": false,
|
|
12969
|
+
"calendar.editEvent": false,
|
|
12970
|
+
"calendar.deleteEvent": false,
|
|
12902
12971
|
"appointments.view": true,
|
|
12903
12972
|
"appointments.confirm": false,
|
|
12973
|
+
"appointments.reschedule": false,
|
|
12904
12974
|
"appointments.cancel": false,
|
|
12905
12975
|
"messaging": false,
|
|
12906
12976
|
"procedures.view": true,
|
|
@@ -12912,12 +12982,23 @@ var DEFAULT_ROLE_PERMISSIONS = {
|
|
|
12912
12982
|
"resources.edit": false,
|
|
12913
12983
|
"resources.delete": false,
|
|
12914
12984
|
"patients.view": true,
|
|
12985
|
+
"patients.viewDetails": false,
|
|
12986
|
+
"patients.create": false,
|
|
12915
12987
|
"patients.edit": false,
|
|
12988
|
+
"patients.manageTokens": false,
|
|
12916
12989
|
"providers.view": true,
|
|
12917
|
-
"providers.
|
|
12990
|
+
"providers.create": false,
|
|
12991
|
+
"providers.invite": false,
|
|
12992
|
+
"providers.edit": false,
|
|
12918
12993
|
"analytics.view": false,
|
|
12919
|
-
"staff.
|
|
12994
|
+
"staff.view": false,
|
|
12995
|
+
"staff.edit": false,
|
|
12996
|
+
"staff.invite": false,
|
|
12997
|
+
"staff.delete": false,
|
|
12998
|
+
"staff.viewTokens": false,
|
|
12999
|
+
"staff.deleteTokens": false,
|
|
12920
13000
|
"settings.manage": false,
|
|
13001
|
+
"billing.view": false,
|
|
12921
13002
|
"billing.manage": false
|
|
12922
13003
|
}
|
|
12923
13004
|
};
|
|
@@ -13004,28 +13085,44 @@ var DEFAULT_PLAN_CONFIG = {
|
|
|
13004
13085
|
var PERMISSION_LABELS = {
|
|
13005
13086
|
"clinic.view": { label: "View Clinic", description: "See clinic information and profile", category: "Clinic" },
|
|
13006
13087
|
"clinic.edit": { label: "Edit Clinic", description: "Modify clinic settings and profile", category: "Clinic" },
|
|
13088
|
+
"clinic.create": { label: "Create Clinic", description: "Create new clinic branches", category: "Clinic" },
|
|
13007
13089
|
"reviews.view": { label: "View Reviews", description: "See patient reviews and ratings", category: "Clinic" },
|
|
13008
13090
|
"calendar.view": { label: "View Calendar", description: "See the clinic calendar and schedules", category: "Calendar" },
|
|
13091
|
+
"calendar.addEvent": { label: "Add Events", description: "Create appointments and blocking events on the calendar", category: "Calendar" },
|
|
13092
|
+
"calendar.editEvent": { label: "Edit Events", description: "Edit blocking events on the calendar", category: "Calendar" },
|
|
13093
|
+
"calendar.deleteEvent": { label: "Delete Events", description: "Delete blocking events from the calendar", category: "Calendar" },
|
|
13009
13094
|
"appointments.view": { label: "View Appointments", description: "See appointment list and details", category: "Appointments" },
|
|
13010
|
-
"appointments.confirm": { label: "Confirm Appointments", description: "Confirm
|
|
13095
|
+
"appointments.confirm": { label: "Confirm Appointments", description: "Confirm, reject, check in, and manage appointment status", category: "Appointments" },
|
|
13096
|
+
"appointments.reschedule": { label: "Reschedule Appointments", description: "Reschedule confirmed appointments to a new time", category: "Appointments" },
|
|
13011
13097
|
"appointments.cancel": { label: "Cancel Appointments", description: "Cancel existing appointments", category: "Appointments" },
|
|
13012
13098
|
"messaging": { label: "Messaging", description: "Send and receive messages with patients", category: "Messaging" },
|
|
13013
13099
|
"procedures.view": { label: "View Procedures", description: "See the procedures catalog", category: "Procedures" },
|
|
13014
|
-
"procedures.create": { label: "Create Procedures", description: "Add new procedures to
|
|
13100
|
+
"procedures.create": { label: "Create Procedures", description: "Add new procedures and assign to practitioners", category: "Procedures" },
|
|
13015
13101
|
"procedures.edit": { label: "Edit Procedures", description: "Modify existing procedures", category: "Procedures" },
|
|
13016
13102
|
"procedures.delete": { label: "Delete Procedures", description: "Remove procedures from the catalog", category: "Procedures" },
|
|
13017
13103
|
"resources.view": { label: "View Resources", description: "See clinic resources and equipment", category: "Resources" },
|
|
13018
13104
|
"resources.create": { label: "Create Resources", description: "Add new resources", category: "Resources" },
|
|
13019
|
-
"resources.edit": { label: "Edit Resources", description: "Modify existing resources", category: "Resources" },
|
|
13020
|
-
"resources.delete": { label: "Delete Resources", description: "
|
|
13021
|
-
"patients.view": { label: "View Patients", description: "See patient list
|
|
13022
|
-
"patients.
|
|
13105
|
+
"resources.edit": { label: "Edit Resources", description: "Modify existing resources and activate instances", category: "Resources" },
|
|
13106
|
+
"resources.delete": { label: "Delete Resources", description: "Deactivate resources and delete instances", category: "Resources" },
|
|
13107
|
+
"patients.view": { label: "View Patients", description: "See patient list", category: "Patients" },
|
|
13108
|
+
"patients.viewDetails": { label: "View Patient Details", description: "Open patient file and detailed profile", category: "Patients" },
|
|
13109
|
+
"patients.create": { label: "Create Patients", description: "Add new patients", category: "Patients" },
|
|
13110
|
+
"patients.edit": { label: "Edit Patients", description: "Modify patient records and schedule appointments", category: "Patients" },
|
|
13111
|
+
"patients.manageTokens": { label: "Manage Patient Tokens", description: "Create and manage patient invitation tokens", category: "Patients" },
|
|
13023
13112
|
"providers.view": { label: "View Providers", description: "See the practitioners/providers list", category: "Providers" },
|
|
13024
|
-
"providers.
|
|
13113
|
+
"providers.create": { label: "Create Providers", description: "Add new practitioners to the clinic", category: "Providers" },
|
|
13114
|
+
"providers.invite": { label: "Invite Providers", description: "Invite existing practitioners to the clinic", category: "Providers" },
|
|
13115
|
+
"providers.edit": { label: "Edit Providers", description: "Edit practitioner profiles and manage tokens", category: "Providers" },
|
|
13025
13116
|
"analytics.view": { label: "View Analytics", description: "Access analytics dashboards and reports", category: "Analytics" },
|
|
13026
|
-
"staff.
|
|
13117
|
+
"staff.view": { label: "View Staff", description: "See staff management page and team members", category: "Staff Management" },
|
|
13118
|
+
"staff.edit": { label: "Edit Staff", description: "Edit roles, permissions, and clinic assignments", category: "Staff Management" },
|
|
13119
|
+
"staff.invite": { label: "Invite Staff", description: "Invite new team members", category: "Staff Management" },
|
|
13120
|
+
"staff.delete": { label: "Delete Staff", description: "Remove team members and cancel invitations", category: "Staff Management" },
|
|
13121
|
+
"staff.viewTokens": { label: "View Tokens", description: "See registration tokens", category: "Staff Management" },
|
|
13122
|
+
"staff.deleteTokens": { label: "Delete Tokens", description: "Delete registration tokens", category: "Staff Management" },
|
|
13027
13123
|
"settings.manage": { label: "Manage Settings", description: "Modify clinic group settings", category: "Administration" },
|
|
13028
|
-
"billing.
|
|
13124
|
+
"billing.view": { label: "View Billing", description: "View subscription plans and billing history", category: "Administration" },
|
|
13125
|
+
"billing.manage": { label: "Manage Billing", description: "Manage subscriptions, upgrades, and payments", category: "Administration" }
|
|
13029
13126
|
};
|
|
13030
13127
|
var PERMISSION_CATEGORIES = [
|
|
13031
13128
|
"Clinic",
|
|
@@ -13037,6 +13134,7 @@ var PERMISSION_CATEGORIES = [
|
|
|
13037
13134
|
"Patients",
|
|
13038
13135
|
"Providers",
|
|
13039
13136
|
"Analytics",
|
|
13137
|
+
"Staff Management",
|
|
13040
13138
|
"Administration"
|
|
13041
13139
|
];
|
|
13042
13140
|
var TIER_MAP = {
|
package/dist/index.mjs
CHANGED
|
@@ -12753,14 +12753,20 @@ import {
|
|
|
12753
12753
|
|
|
12754
12754
|
// src/config/tiers.config.ts
|
|
12755
12755
|
var PERMISSION_KEYS = {
|
|
12756
|
-
//
|
|
12756
|
+
// Clinic
|
|
12757
12757
|
"clinic.view": true,
|
|
12758
12758
|
"clinic.edit": true,
|
|
12759
|
+
"clinic.create": true,
|
|
12759
12760
|
"reviews.view": true,
|
|
12760
|
-
// Calendar
|
|
12761
|
+
// Calendar
|
|
12761
12762
|
"calendar.view": true,
|
|
12763
|
+
"calendar.addEvent": true,
|
|
12764
|
+
"calendar.editEvent": true,
|
|
12765
|
+
"calendar.deleteEvent": true,
|
|
12766
|
+
// Appointments
|
|
12762
12767
|
"appointments.view": true,
|
|
12763
12768
|
"appointments.confirm": true,
|
|
12769
|
+
"appointments.reschedule": true,
|
|
12764
12770
|
"appointments.cancel": true,
|
|
12765
12771
|
// Messaging
|
|
12766
12772
|
"messaging": true,
|
|
@@ -12776,16 +12782,27 @@ var PERMISSION_KEYS = {
|
|
|
12776
12782
|
"resources.delete": true,
|
|
12777
12783
|
// Patients
|
|
12778
12784
|
"patients.view": true,
|
|
12785
|
+
"patients.viewDetails": true,
|
|
12786
|
+
"patients.create": true,
|
|
12779
12787
|
"patients.edit": true,
|
|
12788
|
+
"patients.manageTokens": true,
|
|
12780
12789
|
// Providers (doctors, nurses, laser assistants, etc.)
|
|
12781
12790
|
"providers.view": true,
|
|
12782
|
-
"providers.
|
|
12791
|
+
"providers.create": true,
|
|
12792
|
+
"providers.invite": true,
|
|
12793
|
+
"providers.edit": true,
|
|
12783
12794
|
// Analytics
|
|
12784
12795
|
"analytics.view": true,
|
|
12785
12796
|
// Staff management
|
|
12786
|
-
"staff.
|
|
12797
|
+
"staff.view": true,
|
|
12798
|
+
"staff.edit": true,
|
|
12799
|
+
"staff.invite": true,
|
|
12800
|
+
"staff.delete": true,
|
|
12801
|
+
"staff.viewTokens": true,
|
|
12802
|
+
"staff.deleteTokens": true,
|
|
12787
12803
|
// Settings / Admin
|
|
12788
12804
|
"settings.manage": true,
|
|
12805
|
+
"billing.view": true,
|
|
12789
12806
|
"billing.manage": true
|
|
12790
12807
|
};
|
|
12791
12808
|
var TIER_CONFIG = {
|
|
@@ -12821,10 +12838,15 @@ var DEFAULT_ROLE_PERMISSIONS = {
|
|
|
12821
12838
|
["owner" /* OWNER */]: {
|
|
12822
12839
|
"clinic.view": true,
|
|
12823
12840
|
"clinic.edit": true,
|
|
12841
|
+
"clinic.create": true,
|
|
12824
12842
|
"reviews.view": true,
|
|
12825
12843
|
"calendar.view": true,
|
|
12844
|
+
"calendar.addEvent": true,
|
|
12845
|
+
"calendar.editEvent": true,
|
|
12846
|
+
"calendar.deleteEvent": true,
|
|
12826
12847
|
"appointments.view": true,
|
|
12827
12848
|
"appointments.confirm": true,
|
|
12849
|
+
"appointments.reschedule": true,
|
|
12828
12850
|
"appointments.cancel": true,
|
|
12829
12851
|
"messaging": true,
|
|
12830
12852
|
"procedures.view": true,
|
|
@@ -12836,21 +12858,37 @@ var DEFAULT_ROLE_PERMISSIONS = {
|
|
|
12836
12858
|
"resources.edit": true,
|
|
12837
12859
|
"resources.delete": true,
|
|
12838
12860
|
"patients.view": true,
|
|
12861
|
+
"patients.viewDetails": true,
|
|
12862
|
+
"patients.create": true,
|
|
12839
12863
|
"patients.edit": true,
|
|
12864
|
+
"patients.manageTokens": true,
|
|
12840
12865
|
"providers.view": true,
|
|
12841
|
-
"providers.
|
|
12866
|
+
"providers.create": true,
|
|
12867
|
+
"providers.invite": true,
|
|
12868
|
+
"providers.edit": true,
|
|
12842
12869
|
"analytics.view": true,
|
|
12843
|
-
"staff.
|
|
12870
|
+
"staff.view": true,
|
|
12871
|
+
"staff.edit": true,
|
|
12872
|
+
"staff.invite": true,
|
|
12873
|
+
"staff.delete": true,
|
|
12874
|
+
"staff.viewTokens": true,
|
|
12875
|
+
"staff.deleteTokens": true,
|
|
12844
12876
|
"settings.manage": true,
|
|
12877
|
+
"billing.view": true,
|
|
12845
12878
|
"billing.manage": true
|
|
12846
12879
|
},
|
|
12847
12880
|
["admin" /* ADMIN */]: {
|
|
12848
12881
|
"clinic.view": true,
|
|
12849
12882
|
"clinic.edit": true,
|
|
12883
|
+
"clinic.create": false,
|
|
12850
12884
|
"reviews.view": true,
|
|
12851
12885
|
"calendar.view": true,
|
|
12886
|
+
"calendar.addEvent": true,
|
|
12887
|
+
"calendar.editEvent": true,
|
|
12888
|
+
"calendar.deleteEvent": true,
|
|
12852
12889
|
"appointments.view": true,
|
|
12853
12890
|
"appointments.confirm": true,
|
|
12891
|
+
"appointments.reschedule": true,
|
|
12854
12892
|
"appointments.cancel": true,
|
|
12855
12893
|
"messaging": true,
|
|
12856
12894
|
"procedures.view": true,
|
|
@@ -12862,21 +12900,37 @@ var DEFAULT_ROLE_PERMISSIONS = {
|
|
|
12862
12900
|
"resources.edit": true,
|
|
12863
12901
|
"resources.delete": true,
|
|
12864
12902
|
"patients.view": true,
|
|
12903
|
+
"patients.viewDetails": true,
|
|
12904
|
+
"patients.create": true,
|
|
12865
12905
|
"patients.edit": true,
|
|
12906
|
+
"patients.manageTokens": true,
|
|
12866
12907
|
"providers.view": true,
|
|
12867
|
-
"providers.
|
|
12908
|
+
"providers.create": true,
|
|
12909
|
+
"providers.invite": true,
|
|
12910
|
+
"providers.edit": true,
|
|
12868
12911
|
"analytics.view": true,
|
|
12869
|
-
"staff.
|
|
12912
|
+
"staff.view": true,
|
|
12913
|
+
"staff.edit": false,
|
|
12914
|
+
"staff.invite": false,
|
|
12915
|
+
"staff.delete": false,
|
|
12916
|
+
"staff.viewTokens": false,
|
|
12917
|
+
"staff.deleteTokens": false,
|
|
12870
12918
|
"settings.manage": true,
|
|
12919
|
+
"billing.view": true,
|
|
12871
12920
|
"billing.manage": false
|
|
12872
12921
|
},
|
|
12873
12922
|
["receptionist" /* RECEPTIONIST */]: {
|
|
12874
12923
|
"clinic.view": true,
|
|
12875
12924
|
"clinic.edit": false,
|
|
12925
|
+
"clinic.create": false,
|
|
12876
12926
|
"reviews.view": true,
|
|
12877
12927
|
"calendar.view": true,
|
|
12928
|
+
"calendar.addEvent": true,
|
|
12929
|
+
"calendar.editEvent": false,
|
|
12930
|
+
"calendar.deleteEvent": false,
|
|
12878
12931
|
"appointments.view": true,
|
|
12879
12932
|
"appointments.confirm": true,
|
|
12933
|
+
"appointments.reschedule": true,
|
|
12880
12934
|
"appointments.cancel": false,
|
|
12881
12935
|
"messaging": true,
|
|
12882
12936
|
"procedures.view": true,
|
|
@@ -12888,21 +12942,37 @@ var DEFAULT_ROLE_PERMISSIONS = {
|
|
|
12888
12942
|
"resources.edit": false,
|
|
12889
12943
|
"resources.delete": false,
|
|
12890
12944
|
"patients.view": true,
|
|
12945
|
+
"patients.viewDetails": true,
|
|
12946
|
+
"patients.create": true,
|
|
12891
12947
|
"patients.edit": false,
|
|
12948
|
+
"patients.manageTokens": false,
|
|
12892
12949
|
"providers.view": true,
|
|
12893
|
-
"providers.
|
|
12950
|
+
"providers.create": false,
|
|
12951
|
+
"providers.invite": false,
|
|
12952
|
+
"providers.edit": false,
|
|
12894
12953
|
"analytics.view": false,
|
|
12895
|
-
"staff.
|
|
12954
|
+
"staff.view": false,
|
|
12955
|
+
"staff.edit": false,
|
|
12956
|
+
"staff.invite": false,
|
|
12957
|
+
"staff.delete": false,
|
|
12958
|
+
"staff.viewTokens": false,
|
|
12959
|
+
"staff.deleteTokens": false,
|
|
12896
12960
|
"settings.manage": false,
|
|
12961
|
+
"billing.view": false,
|
|
12897
12962
|
"billing.manage": false
|
|
12898
12963
|
},
|
|
12899
12964
|
["assistant" /* ASSISTANT */]: {
|
|
12900
12965
|
"clinic.view": true,
|
|
12901
12966
|
"clinic.edit": false,
|
|
12967
|
+
"clinic.create": false,
|
|
12902
12968
|
"reviews.view": true,
|
|
12903
12969
|
"calendar.view": true,
|
|
12970
|
+
"calendar.addEvent": false,
|
|
12971
|
+
"calendar.editEvent": false,
|
|
12972
|
+
"calendar.deleteEvent": false,
|
|
12904
12973
|
"appointments.view": true,
|
|
12905
12974
|
"appointments.confirm": false,
|
|
12975
|
+
"appointments.reschedule": false,
|
|
12906
12976
|
"appointments.cancel": false,
|
|
12907
12977
|
"messaging": false,
|
|
12908
12978
|
"procedures.view": true,
|
|
@@ -12914,12 +12984,23 @@ var DEFAULT_ROLE_PERMISSIONS = {
|
|
|
12914
12984
|
"resources.edit": false,
|
|
12915
12985
|
"resources.delete": false,
|
|
12916
12986
|
"patients.view": true,
|
|
12987
|
+
"patients.viewDetails": false,
|
|
12988
|
+
"patients.create": false,
|
|
12917
12989
|
"patients.edit": false,
|
|
12990
|
+
"patients.manageTokens": false,
|
|
12918
12991
|
"providers.view": true,
|
|
12919
|
-
"providers.
|
|
12992
|
+
"providers.create": false,
|
|
12993
|
+
"providers.invite": false,
|
|
12994
|
+
"providers.edit": false,
|
|
12920
12995
|
"analytics.view": false,
|
|
12921
|
-
"staff.
|
|
12996
|
+
"staff.view": false,
|
|
12997
|
+
"staff.edit": false,
|
|
12998
|
+
"staff.invite": false,
|
|
12999
|
+
"staff.delete": false,
|
|
13000
|
+
"staff.viewTokens": false,
|
|
13001
|
+
"staff.deleteTokens": false,
|
|
12922
13002
|
"settings.manage": false,
|
|
13003
|
+
"billing.view": false,
|
|
12923
13004
|
"billing.manage": false
|
|
12924
13005
|
}
|
|
12925
13006
|
};
|
|
@@ -13006,28 +13087,44 @@ var DEFAULT_PLAN_CONFIG = {
|
|
|
13006
13087
|
var PERMISSION_LABELS = {
|
|
13007
13088
|
"clinic.view": { label: "View Clinic", description: "See clinic information and profile", category: "Clinic" },
|
|
13008
13089
|
"clinic.edit": { label: "Edit Clinic", description: "Modify clinic settings and profile", category: "Clinic" },
|
|
13090
|
+
"clinic.create": { label: "Create Clinic", description: "Create new clinic branches", category: "Clinic" },
|
|
13009
13091
|
"reviews.view": { label: "View Reviews", description: "See patient reviews and ratings", category: "Clinic" },
|
|
13010
13092
|
"calendar.view": { label: "View Calendar", description: "See the clinic calendar and schedules", category: "Calendar" },
|
|
13093
|
+
"calendar.addEvent": { label: "Add Events", description: "Create appointments and blocking events on the calendar", category: "Calendar" },
|
|
13094
|
+
"calendar.editEvent": { label: "Edit Events", description: "Edit blocking events on the calendar", category: "Calendar" },
|
|
13095
|
+
"calendar.deleteEvent": { label: "Delete Events", description: "Delete blocking events from the calendar", category: "Calendar" },
|
|
13011
13096
|
"appointments.view": { label: "View Appointments", description: "See appointment list and details", category: "Appointments" },
|
|
13012
|
-
"appointments.confirm": { label: "Confirm Appointments", description: "Confirm
|
|
13097
|
+
"appointments.confirm": { label: "Confirm Appointments", description: "Confirm, reject, check in, and manage appointment status", category: "Appointments" },
|
|
13098
|
+
"appointments.reschedule": { label: "Reschedule Appointments", description: "Reschedule confirmed appointments to a new time", category: "Appointments" },
|
|
13013
13099
|
"appointments.cancel": { label: "Cancel Appointments", description: "Cancel existing appointments", category: "Appointments" },
|
|
13014
13100
|
"messaging": { label: "Messaging", description: "Send and receive messages with patients", category: "Messaging" },
|
|
13015
13101
|
"procedures.view": { label: "View Procedures", description: "See the procedures catalog", category: "Procedures" },
|
|
13016
|
-
"procedures.create": { label: "Create Procedures", description: "Add new procedures to
|
|
13102
|
+
"procedures.create": { label: "Create Procedures", description: "Add new procedures and assign to practitioners", category: "Procedures" },
|
|
13017
13103
|
"procedures.edit": { label: "Edit Procedures", description: "Modify existing procedures", category: "Procedures" },
|
|
13018
13104
|
"procedures.delete": { label: "Delete Procedures", description: "Remove procedures from the catalog", category: "Procedures" },
|
|
13019
13105
|
"resources.view": { label: "View Resources", description: "See clinic resources and equipment", category: "Resources" },
|
|
13020
13106
|
"resources.create": { label: "Create Resources", description: "Add new resources", category: "Resources" },
|
|
13021
|
-
"resources.edit": { label: "Edit Resources", description: "Modify existing resources", category: "Resources" },
|
|
13022
|
-
"resources.delete": { label: "Delete Resources", description: "
|
|
13023
|
-
"patients.view": { label: "View Patients", description: "See patient list
|
|
13024
|
-
"patients.
|
|
13107
|
+
"resources.edit": { label: "Edit Resources", description: "Modify existing resources and activate instances", category: "Resources" },
|
|
13108
|
+
"resources.delete": { label: "Delete Resources", description: "Deactivate resources and delete instances", category: "Resources" },
|
|
13109
|
+
"patients.view": { label: "View Patients", description: "See patient list", category: "Patients" },
|
|
13110
|
+
"patients.viewDetails": { label: "View Patient Details", description: "Open patient file and detailed profile", category: "Patients" },
|
|
13111
|
+
"patients.create": { label: "Create Patients", description: "Add new patients", category: "Patients" },
|
|
13112
|
+
"patients.edit": { label: "Edit Patients", description: "Modify patient records and schedule appointments", category: "Patients" },
|
|
13113
|
+
"patients.manageTokens": { label: "Manage Patient Tokens", description: "Create and manage patient invitation tokens", category: "Patients" },
|
|
13025
13114
|
"providers.view": { label: "View Providers", description: "See the practitioners/providers list", category: "Providers" },
|
|
13026
|
-
"providers.
|
|
13115
|
+
"providers.create": { label: "Create Providers", description: "Add new practitioners to the clinic", category: "Providers" },
|
|
13116
|
+
"providers.invite": { label: "Invite Providers", description: "Invite existing practitioners to the clinic", category: "Providers" },
|
|
13117
|
+
"providers.edit": { label: "Edit Providers", description: "Edit practitioner profiles and manage tokens", category: "Providers" },
|
|
13027
13118
|
"analytics.view": { label: "View Analytics", description: "Access analytics dashboards and reports", category: "Analytics" },
|
|
13028
|
-
"staff.
|
|
13119
|
+
"staff.view": { label: "View Staff", description: "See staff management page and team members", category: "Staff Management" },
|
|
13120
|
+
"staff.edit": { label: "Edit Staff", description: "Edit roles, permissions, and clinic assignments", category: "Staff Management" },
|
|
13121
|
+
"staff.invite": { label: "Invite Staff", description: "Invite new team members", category: "Staff Management" },
|
|
13122
|
+
"staff.delete": { label: "Delete Staff", description: "Remove team members and cancel invitations", category: "Staff Management" },
|
|
13123
|
+
"staff.viewTokens": { label: "View Tokens", description: "See registration tokens", category: "Staff Management" },
|
|
13124
|
+
"staff.deleteTokens": { label: "Delete Tokens", description: "Delete registration tokens", category: "Staff Management" },
|
|
13029
13125
|
"settings.manage": { label: "Manage Settings", description: "Modify clinic group settings", category: "Administration" },
|
|
13030
|
-
"billing.
|
|
13126
|
+
"billing.view": { label: "View Billing", description: "View subscription plans and billing history", category: "Administration" },
|
|
13127
|
+
"billing.manage": { label: "Manage Billing", description: "Manage subscriptions, upgrades, and payments", category: "Administration" }
|
|
13031
13128
|
};
|
|
13032
13129
|
var PERMISSION_CATEGORIES = [
|
|
13033
13130
|
"Clinic",
|
|
@@ -13039,6 +13136,7 @@ var PERMISSION_CATEGORIES = [
|
|
|
13039
13136
|
"Patients",
|
|
13040
13137
|
"Providers",
|
|
13041
13138
|
"Analytics",
|
|
13139
|
+
"Staff Management",
|
|
13042
13140
|
"Administration"
|
|
13043
13141
|
];
|
|
13044
13142
|
var TIER_MAP = {
|
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.17-staging.
|
|
4
|
+
"version": "1.15.17-staging.9",
|
|
5
5
|
"description": "Firebase authentication service with anonymous upgrade support",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"module": "dist/index.mjs",
|
|
@@ -8,17 +8,30 @@ import type { PlanConfigDocument } from '../types/system/planConfig.types';
|
|
|
8
8
|
* what a given role (owner/admin/receptionist/assistant) can do.
|
|
9
9
|
* New roles can be added by extending the ClinicRole enum and adding
|
|
10
10
|
* a corresponding entry here.
|
|
11
|
+
*
|
|
12
|
+
* v2 (2026-03-31): Expanded from 23 to 40 permissions.
|
|
13
|
+
* - providers.manage → providers.create, providers.invite, providers.edit
|
|
14
|
+
* - staff.manage → staff.view, staff.edit, staff.invite, staff.delete, staff.viewTokens, staff.deleteTokens
|
|
15
|
+
* - Added: clinic.create, calendar.addEvent, calendar.editEvent, calendar.deleteEvent,
|
|
16
|
+
* appointments.reschedule, patients.viewDetails, patients.create, patients.manageTokens, billing.view
|
|
11
17
|
*/
|
|
12
18
|
export const PERMISSION_KEYS = {
|
|
13
|
-
//
|
|
19
|
+
// Clinic
|
|
14
20
|
'clinic.view': true,
|
|
15
21
|
'clinic.edit': true,
|
|
22
|
+
'clinic.create': true,
|
|
16
23
|
'reviews.view': true,
|
|
17
24
|
|
|
18
|
-
// Calendar
|
|
25
|
+
// Calendar
|
|
19
26
|
'calendar.view': true,
|
|
27
|
+
'calendar.addEvent': true,
|
|
28
|
+
'calendar.editEvent': true,
|
|
29
|
+
'calendar.deleteEvent': true,
|
|
30
|
+
|
|
31
|
+
// Appointments
|
|
20
32
|
'appointments.view': true,
|
|
21
33
|
'appointments.confirm': true,
|
|
34
|
+
'appointments.reschedule': true,
|
|
22
35
|
'appointments.cancel': true,
|
|
23
36
|
|
|
24
37
|
// Messaging
|
|
@@ -38,20 +51,31 @@ export const PERMISSION_KEYS = {
|
|
|
38
51
|
|
|
39
52
|
// Patients
|
|
40
53
|
'patients.view': true,
|
|
54
|
+
'patients.viewDetails': true,
|
|
55
|
+
'patients.create': true,
|
|
41
56
|
'patients.edit': true,
|
|
57
|
+
'patients.manageTokens': true,
|
|
42
58
|
|
|
43
59
|
// Providers (doctors, nurses, laser assistants, etc.)
|
|
44
60
|
'providers.view': true,
|
|
45
|
-
'providers.
|
|
61
|
+
'providers.create': true,
|
|
62
|
+
'providers.invite': true,
|
|
63
|
+
'providers.edit': true,
|
|
46
64
|
|
|
47
65
|
// Analytics
|
|
48
66
|
'analytics.view': true,
|
|
49
67
|
|
|
50
68
|
// Staff management
|
|
51
|
-
'staff.
|
|
69
|
+
'staff.view': true,
|
|
70
|
+
'staff.edit': true,
|
|
71
|
+
'staff.invite': true,
|
|
72
|
+
'staff.delete': true,
|
|
73
|
+
'staff.viewTokens': true,
|
|
74
|
+
'staff.deleteTokens': true,
|
|
52
75
|
|
|
53
76
|
// Settings / Admin
|
|
54
77
|
'settings.manage': true,
|
|
78
|
+
'billing.view': true,
|
|
55
79
|
'billing.manage': true,
|
|
56
80
|
} as const;
|
|
57
81
|
|
|
@@ -110,10 +134,15 @@ export const DEFAULT_ROLE_PERMISSIONS: Record<ClinicRole, Record<string, boolean
|
|
|
110
134
|
[ClinicRole.OWNER]: {
|
|
111
135
|
'clinic.view': true,
|
|
112
136
|
'clinic.edit': true,
|
|
137
|
+
'clinic.create': true,
|
|
113
138
|
'reviews.view': true,
|
|
114
139
|
'calendar.view': true,
|
|
140
|
+
'calendar.addEvent': true,
|
|
141
|
+
'calendar.editEvent': true,
|
|
142
|
+
'calendar.deleteEvent': true,
|
|
115
143
|
'appointments.view': true,
|
|
116
144
|
'appointments.confirm': true,
|
|
145
|
+
'appointments.reschedule': true,
|
|
117
146
|
'appointments.cancel': true,
|
|
118
147
|
'messaging': true,
|
|
119
148
|
'procedures.view': true,
|
|
@@ -125,21 +154,37 @@ export const DEFAULT_ROLE_PERMISSIONS: Record<ClinicRole, Record<string, boolean
|
|
|
125
154
|
'resources.edit': true,
|
|
126
155
|
'resources.delete': true,
|
|
127
156
|
'patients.view': true,
|
|
157
|
+
'patients.viewDetails': true,
|
|
158
|
+
'patients.create': true,
|
|
128
159
|
'patients.edit': true,
|
|
160
|
+
'patients.manageTokens': true,
|
|
129
161
|
'providers.view': true,
|
|
130
|
-
'providers.
|
|
162
|
+
'providers.create': true,
|
|
163
|
+
'providers.invite': true,
|
|
164
|
+
'providers.edit': true,
|
|
131
165
|
'analytics.view': true,
|
|
132
|
-
'staff.
|
|
166
|
+
'staff.view': true,
|
|
167
|
+
'staff.edit': true,
|
|
168
|
+
'staff.invite': true,
|
|
169
|
+
'staff.delete': true,
|
|
170
|
+
'staff.viewTokens': true,
|
|
171
|
+
'staff.deleteTokens': true,
|
|
133
172
|
'settings.manage': true,
|
|
173
|
+
'billing.view': true,
|
|
134
174
|
'billing.manage': true,
|
|
135
175
|
},
|
|
136
176
|
[ClinicRole.ADMIN]: {
|
|
137
177
|
'clinic.view': true,
|
|
138
178
|
'clinic.edit': true,
|
|
179
|
+
'clinic.create': false,
|
|
139
180
|
'reviews.view': true,
|
|
140
181
|
'calendar.view': true,
|
|
182
|
+
'calendar.addEvent': true,
|
|
183
|
+
'calendar.editEvent': true,
|
|
184
|
+
'calendar.deleteEvent': true,
|
|
141
185
|
'appointments.view': true,
|
|
142
186
|
'appointments.confirm': true,
|
|
187
|
+
'appointments.reschedule': true,
|
|
143
188
|
'appointments.cancel': true,
|
|
144
189
|
'messaging': true,
|
|
145
190
|
'procedures.view': true,
|
|
@@ -151,21 +196,37 @@ export const DEFAULT_ROLE_PERMISSIONS: Record<ClinicRole, Record<string, boolean
|
|
|
151
196
|
'resources.edit': true,
|
|
152
197
|
'resources.delete': true,
|
|
153
198
|
'patients.view': true,
|
|
199
|
+
'patients.viewDetails': true,
|
|
200
|
+
'patients.create': true,
|
|
154
201
|
'patients.edit': true,
|
|
202
|
+
'patients.manageTokens': true,
|
|
155
203
|
'providers.view': true,
|
|
156
|
-
'providers.
|
|
204
|
+
'providers.create': true,
|
|
205
|
+
'providers.invite': true,
|
|
206
|
+
'providers.edit': true,
|
|
157
207
|
'analytics.view': true,
|
|
158
|
-
'staff.
|
|
208
|
+
'staff.view': true,
|
|
209
|
+
'staff.edit': false,
|
|
210
|
+
'staff.invite': false,
|
|
211
|
+
'staff.delete': false,
|
|
212
|
+
'staff.viewTokens': false,
|
|
213
|
+
'staff.deleteTokens': false,
|
|
159
214
|
'settings.manage': true,
|
|
215
|
+
'billing.view': true,
|
|
160
216
|
'billing.manage': false,
|
|
161
217
|
},
|
|
162
218
|
[ClinicRole.RECEPTIONIST]: {
|
|
163
219
|
'clinic.view': true,
|
|
164
220
|
'clinic.edit': false,
|
|
221
|
+
'clinic.create': false,
|
|
165
222
|
'reviews.view': true,
|
|
166
223
|
'calendar.view': true,
|
|
224
|
+
'calendar.addEvent': true,
|
|
225
|
+
'calendar.editEvent': false,
|
|
226
|
+
'calendar.deleteEvent': false,
|
|
167
227
|
'appointments.view': true,
|
|
168
228
|
'appointments.confirm': true,
|
|
229
|
+
'appointments.reschedule': true,
|
|
169
230
|
'appointments.cancel': false,
|
|
170
231
|
'messaging': true,
|
|
171
232
|
'procedures.view': true,
|
|
@@ -177,21 +238,37 @@ export const DEFAULT_ROLE_PERMISSIONS: Record<ClinicRole, Record<string, boolean
|
|
|
177
238
|
'resources.edit': false,
|
|
178
239
|
'resources.delete': false,
|
|
179
240
|
'patients.view': true,
|
|
241
|
+
'patients.viewDetails': true,
|
|
242
|
+
'patients.create': true,
|
|
180
243
|
'patients.edit': false,
|
|
244
|
+
'patients.manageTokens': false,
|
|
181
245
|
'providers.view': true,
|
|
182
|
-
'providers.
|
|
246
|
+
'providers.create': false,
|
|
247
|
+
'providers.invite': false,
|
|
248
|
+
'providers.edit': false,
|
|
183
249
|
'analytics.view': false,
|
|
184
|
-
'staff.
|
|
250
|
+
'staff.view': false,
|
|
251
|
+
'staff.edit': false,
|
|
252
|
+
'staff.invite': false,
|
|
253
|
+
'staff.delete': false,
|
|
254
|
+
'staff.viewTokens': false,
|
|
255
|
+
'staff.deleteTokens': false,
|
|
185
256
|
'settings.manage': false,
|
|
257
|
+
'billing.view': false,
|
|
186
258
|
'billing.manage': false,
|
|
187
259
|
},
|
|
188
260
|
[ClinicRole.ASSISTANT]: {
|
|
189
261
|
'clinic.view': true,
|
|
190
262
|
'clinic.edit': false,
|
|
263
|
+
'clinic.create': false,
|
|
191
264
|
'reviews.view': true,
|
|
192
265
|
'calendar.view': true,
|
|
266
|
+
'calendar.addEvent': false,
|
|
267
|
+
'calendar.editEvent': false,
|
|
268
|
+
'calendar.deleteEvent': false,
|
|
193
269
|
'appointments.view': true,
|
|
194
270
|
'appointments.confirm': false,
|
|
271
|
+
'appointments.reschedule': false,
|
|
195
272
|
'appointments.cancel': false,
|
|
196
273
|
'messaging': false,
|
|
197
274
|
'procedures.view': true,
|
|
@@ -203,12 +280,23 @@ export const DEFAULT_ROLE_PERMISSIONS: Record<ClinicRole, Record<string, boolean
|
|
|
203
280
|
'resources.edit': false,
|
|
204
281
|
'resources.delete': false,
|
|
205
282
|
'patients.view': true,
|
|
283
|
+
'patients.viewDetails': false,
|
|
284
|
+
'patients.create': false,
|
|
206
285
|
'patients.edit': false,
|
|
286
|
+
'patients.manageTokens': false,
|
|
207
287
|
'providers.view': true,
|
|
208
|
-
'providers.
|
|
288
|
+
'providers.create': false,
|
|
289
|
+
'providers.invite': false,
|
|
290
|
+
'providers.edit': false,
|
|
209
291
|
'analytics.view': false,
|
|
210
|
-
'staff.
|
|
292
|
+
'staff.view': false,
|
|
293
|
+
'staff.edit': false,
|
|
294
|
+
'staff.invite': false,
|
|
295
|
+
'staff.delete': false,
|
|
296
|
+
'staff.viewTokens': false,
|
|
297
|
+
'staff.deleteTokens': false,
|
|
211
298
|
'settings.manage': false,
|
|
299
|
+
'billing.view': false,
|
|
212
300
|
'billing.manage': false,
|
|
213
301
|
},
|
|
214
302
|
};
|
|
@@ -312,28 +400,44 @@ export const PERMISSION_LABELS: Record<
|
|
|
312
400
|
> = {
|
|
313
401
|
'clinic.view': { label: 'View Clinic', description: 'See clinic information and profile', category: 'Clinic' },
|
|
314
402
|
'clinic.edit': { label: 'Edit Clinic', description: 'Modify clinic settings and profile', category: 'Clinic' },
|
|
403
|
+
'clinic.create': { label: 'Create Clinic', description: 'Create new clinic branches', category: 'Clinic' },
|
|
315
404
|
'reviews.view': { label: 'View Reviews', description: 'See patient reviews and ratings', category: 'Clinic' },
|
|
316
405
|
'calendar.view': { label: 'View Calendar', description: 'See the clinic calendar and schedules', category: 'Calendar' },
|
|
406
|
+
'calendar.addEvent': { label: 'Add Events', description: 'Create appointments and blocking events on the calendar', category: 'Calendar' },
|
|
407
|
+
'calendar.editEvent': { label: 'Edit Events', description: 'Edit blocking events on the calendar', category: 'Calendar' },
|
|
408
|
+
'calendar.deleteEvent': { label: 'Delete Events', description: 'Delete blocking events from the calendar', category: 'Calendar' },
|
|
317
409
|
'appointments.view': { label: 'View Appointments', description: 'See appointment list and details', category: 'Appointments' },
|
|
318
|
-
'appointments.confirm': { label: 'Confirm Appointments', description: 'Confirm
|
|
410
|
+
'appointments.confirm': { label: 'Confirm Appointments', description: 'Confirm, reject, check in, and manage appointment status', category: 'Appointments' },
|
|
411
|
+
'appointments.reschedule': { label: 'Reschedule Appointments', description: 'Reschedule confirmed appointments to a new time', category: 'Appointments' },
|
|
319
412
|
'appointments.cancel': { label: 'Cancel Appointments', description: 'Cancel existing appointments', category: 'Appointments' },
|
|
320
413
|
'messaging': { label: 'Messaging', description: 'Send and receive messages with patients', category: 'Messaging' },
|
|
321
414
|
'procedures.view': { label: 'View Procedures', description: 'See the procedures catalog', category: 'Procedures' },
|
|
322
|
-
'procedures.create': { label: 'Create Procedures', description: 'Add new procedures to
|
|
415
|
+
'procedures.create': { label: 'Create Procedures', description: 'Add new procedures and assign to practitioners', category: 'Procedures' },
|
|
323
416
|
'procedures.edit': { label: 'Edit Procedures', description: 'Modify existing procedures', category: 'Procedures' },
|
|
324
417
|
'procedures.delete': { label: 'Delete Procedures', description: 'Remove procedures from the catalog', category: 'Procedures' },
|
|
325
418
|
'resources.view': { label: 'View Resources', description: 'See clinic resources and equipment', category: 'Resources' },
|
|
326
419
|
'resources.create': { label: 'Create Resources', description: 'Add new resources', category: 'Resources' },
|
|
327
|
-
'resources.edit': { label: 'Edit Resources', description: 'Modify existing resources', category: 'Resources' },
|
|
328
|
-
'resources.delete': { label: 'Delete Resources', description: '
|
|
329
|
-
'patients.view': { label: 'View Patients', description: 'See patient list
|
|
330
|
-
'patients.
|
|
420
|
+
'resources.edit': { label: 'Edit Resources', description: 'Modify existing resources and activate instances', category: 'Resources' },
|
|
421
|
+
'resources.delete': { label: 'Delete Resources', description: 'Deactivate resources and delete instances', category: 'Resources' },
|
|
422
|
+
'patients.view': { label: 'View Patients', description: 'See patient list', category: 'Patients' },
|
|
423
|
+
'patients.viewDetails': { label: 'View Patient Details', description: 'Open patient file and detailed profile', category: 'Patients' },
|
|
424
|
+
'patients.create': { label: 'Create Patients', description: 'Add new patients', category: 'Patients' },
|
|
425
|
+
'patients.edit': { label: 'Edit Patients', description: 'Modify patient records and schedule appointments', category: 'Patients' },
|
|
426
|
+
'patients.manageTokens': { label: 'Manage Patient Tokens', description: 'Create and manage patient invitation tokens', category: 'Patients' },
|
|
331
427
|
'providers.view': { label: 'View Providers', description: 'See the practitioners/providers list', category: 'Providers' },
|
|
332
|
-
'providers.
|
|
428
|
+
'providers.create': { label: 'Create Providers', description: 'Add new practitioners to the clinic', category: 'Providers' },
|
|
429
|
+
'providers.invite': { label: 'Invite Providers', description: 'Invite existing practitioners to the clinic', category: 'Providers' },
|
|
430
|
+
'providers.edit': { label: 'Edit Providers', description: 'Edit practitioner profiles and manage tokens', category: 'Providers' },
|
|
333
431
|
'analytics.view': { label: 'View Analytics', description: 'Access analytics dashboards and reports', category: 'Analytics' },
|
|
334
|
-
'staff.
|
|
432
|
+
'staff.view': { label: 'View Staff', description: 'See staff management page and team members', category: 'Staff Management' },
|
|
433
|
+
'staff.edit': { label: 'Edit Staff', description: 'Edit roles, permissions, and clinic assignments', category: 'Staff Management' },
|
|
434
|
+
'staff.invite': { label: 'Invite Staff', description: 'Invite new team members', category: 'Staff Management' },
|
|
435
|
+
'staff.delete': { label: 'Delete Staff', description: 'Remove team members and cancel invitations', category: 'Staff Management' },
|
|
436
|
+
'staff.viewTokens': { label: 'View Tokens', description: 'See registration tokens', category: 'Staff Management' },
|
|
437
|
+
'staff.deleteTokens': { label: 'Delete Tokens', description: 'Delete registration tokens', category: 'Staff Management' },
|
|
335
438
|
'settings.manage': { label: 'Manage Settings', description: 'Modify clinic group settings', category: 'Administration' },
|
|
336
|
-
'billing.
|
|
439
|
+
'billing.view': { label: 'View Billing', description: 'View subscription plans and billing history', category: 'Administration' },
|
|
440
|
+
'billing.manage': { label: 'Manage Billing', description: 'Manage subscriptions, upgrades, and payments', category: 'Administration' },
|
|
337
441
|
};
|
|
338
442
|
|
|
339
443
|
/** All unique permission categories in display order. */
|
|
@@ -347,6 +451,7 @@ export const PERMISSION_CATEGORIES = [
|
|
|
347
451
|
'Patients',
|
|
348
452
|
'Providers',
|
|
349
453
|
'Analytics',
|
|
454
|
+
'Staff Management',
|
|
350
455
|
'Administration',
|
|
351
456
|
] as const;
|
|
352
457
|
|