@appcorp/fusion-storybook 0.2.13 → 0.2.14
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/base-modules/admission/context/use-admission-module.d.ts +88 -0
- package/base-modules/admission/context/use-admission-module.js +771 -0
- package/base-modules/admission/context.d.ts +1 -87
- package/base-modules/admission/context.js +3 -769
- package/base-modules/campus/more-actions.js +0 -1
- package/base-modules/class/more-actions.js +1 -6
- package/base-modules/expense/more-actions.js +1 -6
- package/base-modules/fee-structure/more-actions.js +1 -6
- package/base-modules/student-fee/context/shared.d.ts +178 -0
- package/base-modules/student-fee/context/shared.js +59 -0
- package/base-modules/student-fee/context/use-student-fee-module.d.ts +64 -0
- package/base-modules/student-fee/context/use-student-fee-module.js +610 -0
- package/base-modules/student-fee/context.d.ts +21 -235
- package/base-modules/student-fee/context.js +2 -674
- package/base-modules/student-fee/more-actions.js +1 -6
- package/base-modules/student-profile/context/module-base.d.ts +187 -0
- package/base-modules/student-profile/context/module-base.js +50 -0
- package/base-modules/student-profile/context/use-student-profile-module.d.ts +70 -0
- package/base-modules/student-profile/context/use-student-profile-module.js +506 -0
- package/base-modules/student-profile/context.d.ts +20 -256
- package/base-modules/student-profile/context.js +2 -601
- package/base-modules/teacher/avatar-upload.js +1 -4
- package/base-modules/teacher/more-actions.js +1 -6
- package/base-modules/user/context/use-user-module.d.ts +53 -0
- package/base-modules/user/context/use-user-module.js +546 -0
- package/base-modules/user/context.d.ts +1 -52
- package/base-modules/user/context.js +5 -547
- package/base-modules/workspace-user/more-actions.js +1 -6
- package/components/module-error.d.ts +9 -0
- package/components/module-error.js +3 -0
- package/package.json +5 -4
- package/tsconfig.build.tsbuildinfo +1 -1
- package/type.d.ts +3 -1242
- package/type.js +3 -445
- package/types/academics.d.ts +264 -0
- package/types/academics.js +8 -0
- package/types/admission.d.ts +85 -0
- package/types/admission.js +6 -0
- package/types/communication.d.ts +165 -0
- package/types/communication.js +7 -0
- package/types/enums.d.ts +411 -0
- package/types/enums.js +442 -0
- package/types/finance.d.ts +126 -0
- package/types/finance.js +7 -0
- package/types/index.d.ts +12 -0
- package/types/index.js +12 -0
- package/types/user-management.d.ts +236 -0
- package/types/user-management.js +7 -0
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TypeScript Types Generated from Prisma Schema - User Management
|
|
3
|
+
*
|
|
4
|
+
* This file contains TypeScript interfaces for user, workspace, role,
|
|
5
|
+
* permission, plan, school, and campus domain models.
|
|
6
|
+
*/
|
|
7
|
+
import { USER_ROLE, ACCESS_LEVEL, CURRENCY, BILLING_INTERVAL, PLAN_TYPE } from "./enums";
|
|
8
|
+
import type { AdmissionBE } from "./admission";
|
|
9
|
+
import type { AttendanceBE, ClassBE, CourseBE, FamilyBE, GradeBE, ScheduleBE, SectionBE, SubjectBE, TeacherBE } from "./academics";
|
|
10
|
+
import type { ExpenseBE, FeeStructureBE, DiscountCodeBE, StudentFeeBE } from "./finance";
|
|
11
|
+
import type { BlogPostBE, BlogCommentBE, BlogPostClapBE, BlogCommentClapBE, MobileNotificationBE, NotificationPreferenceBE, UserPushTokenBE } from "./communication";
|
|
12
|
+
/**
|
|
13
|
+
* Subscription plan defining usage limits and features for workspaces
|
|
14
|
+
*/
|
|
15
|
+
export interface PlanBE {
|
|
16
|
+
createdAt: string;
|
|
17
|
+
currency: CURRENCY;
|
|
18
|
+
enabled: boolean;
|
|
19
|
+
id: string;
|
|
20
|
+
maxClasses: number;
|
|
21
|
+
maxCourses: number;
|
|
22
|
+
maxFamilies: number;
|
|
23
|
+
maxStaffAccounts: number;
|
|
24
|
+
maxStudents: number;
|
|
25
|
+
maxTeachers: number;
|
|
26
|
+
name: string;
|
|
27
|
+
priceMonthly: number;
|
|
28
|
+
priceYearly: number;
|
|
29
|
+
storageLimitMB: number;
|
|
30
|
+
type: PLAN_TYPE;
|
|
31
|
+
updatedAt: string;
|
|
32
|
+
workspaces?: WorkspaceBE[];
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Workspace represents a tenant in the multi-vendor system
|
|
36
|
+
* Each workspace has exactly ONE school (1:1 relationship)
|
|
37
|
+
*/
|
|
38
|
+
export interface WorkspaceBE {
|
|
39
|
+
agreedCurrency: CURRENCY;
|
|
40
|
+
agreedPrice: number;
|
|
41
|
+
billingDate: number;
|
|
42
|
+
billingInterval: BILLING_INTERVAL;
|
|
43
|
+
classesCount: number;
|
|
44
|
+
coursesCount: number;
|
|
45
|
+
createdAt: string;
|
|
46
|
+
description: string | null;
|
|
47
|
+
dueDateLength: number;
|
|
48
|
+
enabled: boolean;
|
|
49
|
+
familiesCount: number;
|
|
50
|
+
id: string;
|
|
51
|
+
logo: string | null;
|
|
52
|
+
name: string;
|
|
53
|
+
planEndDate: Date | string | null;
|
|
54
|
+
planId: string | null;
|
|
55
|
+
planStartDate: Date | string | null;
|
|
56
|
+
secrets?: any | null;
|
|
57
|
+
staffAccountsCount: number;
|
|
58
|
+
storageUsedMB: number;
|
|
59
|
+
studentsCount: number;
|
|
60
|
+
subdomain: string;
|
|
61
|
+
teachersCount: number;
|
|
62
|
+
updatedAt: string;
|
|
63
|
+
customRoles?: RoleBE[];
|
|
64
|
+
plan?: PlanBE;
|
|
65
|
+
rolePermissions?: RolePermissionBE[];
|
|
66
|
+
school?: SchoolBE;
|
|
67
|
+
users?: WorkspaceUserBE[];
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Join table managing user-workspace relationships and roles
|
|
71
|
+
* Allows users to belong to multiple workspaces with different roles
|
|
72
|
+
*/
|
|
73
|
+
export interface WorkspaceUserBE {
|
|
74
|
+
createdAt: string;
|
|
75
|
+
enabled: boolean;
|
|
76
|
+
id: string;
|
|
77
|
+
roleId: string | null;
|
|
78
|
+
updatedAt: string;
|
|
79
|
+
userId: string;
|
|
80
|
+
workspaceId: string;
|
|
81
|
+
role?: RoleBE;
|
|
82
|
+
user?: UserBE;
|
|
83
|
+
workspace?: WorkspaceBE;
|
|
84
|
+
workspaceUserPermissions?: WorkspaceUserPermissionBE[];
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Role defines a named set of default permissions.
|
|
88
|
+
* System roles (isSystem = true) are seeded once and map 1:1 with UserRole enum values.
|
|
89
|
+
* Workspace custom roles (isSystem = false, workspaceId set) are created by SCHOOL_ADMINs.
|
|
90
|
+
*/
|
|
91
|
+
export interface RoleBE {
|
|
92
|
+
createdAt: string;
|
|
93
|
+
description: string | null;
|
|
94
|
+
id: string;
|
|
95
|
+
isSystem: boolean;
|
|
96
|
+
name: string;
|
|
97
|
+
updatedAt: string;
|
|
98
|
+
userRole: USER_ROLE | null;
|
|
99
|
+
workspaceId: string | null;
|
|
100
|
+
rolePermissions?: RolePermissionBE[];
|
|
101
|
+
workspace?: WorkspaceBE;
|
|
102
|
+
workspaceUsers?: WorkspaceBE[];
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Permission describes a module-level capability and access level (e.g., "courses", READ/READ_WRITE).
|
|
106
|
+
*/
|
|
107
|
+
export interface PermissionBE {
|
|
108
|
+
access: ACCESS_LEVEL;
|
|
109
|
+
createdAt: string;
|
|
110
|
+
description: string | null;
|
|
111
|
+
id: string;
|
|
112
|
+
module: string;
|
|
113
|
+
updatedAt: string;
|
|
114
|
+
rolePermissions?: RolePermissionBE[];
|
|
115
|
+
workspaceUserPermissions?: WorkspaceUserPermissionBE[];
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* RolePermission links a Permission to a Role, with an optional workspace scope.
|
|
119
|
+
* workspaceId IS NULL → global default grant for the role (seeded by system)
|
|
120
|
+
* workspaceId IS SET → workspace-level override set by SCHOOL_ADMIN for their workspace
|
|
121
|
+
* allowed = true → explicitly grant the permission
|
|
122
|
+
* allowed = false → explicitly deny/revoke the permission (overrides the global default)
|
|
123
|
+
*/
|
|
124
|
+
export interface RolePermissionBE {
|
|
125
|
+
allowed: boolean;
|
|
126
|
+
createdAt: string;
|
|
127
|
+
id: string;
|
|
128
|
+
permissionId: string;
|
|
129
|
+
roleId: string;
|
|
130
|
+
updatedAt: string;
|
|
131
|
+
workspaceId: string | null;
|
|
132
|
+
permission?: PermissionBE;
|
|
133
|
+
role?: RoleBE;
|
|
134
|
+
workspace?: WorkspaceBE;
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* WorkspaceUserPermission is a per-user override for a given Permission within a workspace.
|
|
138
|
+
* allowed indicates explicit allow (true) or deny (false); overrides take precedence over role grants.
|
|
139
|
+
*/
|
|
140
|
+
export interface WorkspaceUserPermissionBE {
|
|
141
|
+
allowed: boolean;
|
|
142
|
+
createdAt: string;
|
|
143
|
+
id: string;
|
|
144
|
+
permissionId: string;
|
|
145
|
+
updatedAt: string;
|
|
146
|
+
workspaceUserId: string;
|
|
147
|
+
permission?: PermissionBE;
|
|
148
|
+
workspaceUser?: WorkspaceUserBE;
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* School represents an individual educational institution
|
|
152
|
+
* Has a 1:1 relationship with Workspace (each school is a separate tenant)
|
|
153
|
+
*/
|
|
154
|
+
export interface SchoolBE {
|
|
155
|
+
address: string | null;
|
|
156
|
+
city: string | null;
|
|
157
|
+
code: string;
|
|
158
|
+
country: string | null;
|
|
159
|
+
createdAt: string;
|
|
160
|
+
currency: CURRENCY;
|
|
161
|
+
email: string | null;
|
|
162
|
+
enabled: boolean;
|
|
163
|
+
id: string;
|
|
164
|
+
logo: string | null;
|
|
165
|
+
name: string;
|
|
166
|
+
phone: string | null;
|
|
167
|
+
postalCode: string | null;
|
|
168
|
+
principalId: string | null;
|
|
169
|
+
state: string | null;
|
|
170
|
+
updatedAt: string;
|
|
171
|
+
website: string | null;
|
|
172
|
+
workspaceId: string;
|
|
173
|
+
attendances?: AttendanceBE[];
|
|
174
|
+
blogPosts?: BlogPostBE[];
|
|
175
|
+
classes?: ClassBE[];
|
|
176
|
+
courses?: CourseBE[];
|
|
177
|
+
expenses?: ExpenseBE[];
|
|
178
|
+
families?: FamilyBE[];
|
|
179
|
+
feeStructures?: FeeStructureBE[];
|
|
180
|
+
discountCodes?: DiscountCodeBE[];
|
|
181
|
+
grades?: GradeBE[];
|
|
182
|
+
schedules?: ScheduleBE[];
|
|
183
|
+
sections?: SectionBE[];
|
|
184
|
+
admissions?: AdmissionBE[];
|
|
185
|
+
studentFees?: StudentFeeBE[];
|
|
186
|
+
subjects?: SubjectBE[];
|
|
187
|
+
teachers?: TeacherBE[];
|
|
188
|
+
workspace?: WorkspaceBE;
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Core user model synchronized with Supabase Auth
|
|
192
|
+
* Shared by entire family - parents and students use same login
|
|
193
|
+
*/
|
|
194
|
+
export interface UserBE {
|
|
195
|
+
avatar: string | null;
|
|
196
|
+
createdAt: string;
|
|
197
|
+
email: string;
|
|
198
|
+
enabled: boolean;
|
|
199
|
+
id: string;
|
|
200
|
+
name: string | null;
|
|
201
|
+
phone: string | null;
|
|
202
|
+
updatedAt: string;
|
|
203
|
+
blogCommentClaps?: BlogCommentClapBE[];
|
|
204
|
+
blogComments?: BlogCommentBE[];
|
|
205
|
+
blogPostClaps?: BlogPostClapBE[];
|
|
206
|
+
blogPosts?: BlogPostBE[];
|
|
207
|
+
mobileNotifications?: MobileNotificationBE[];
|
|
208
|
+
notificationPreference?: NotificationPreferenceBE;
|
|
209
|
+
pushTokens?: UserPushTokenBE[];
|
|
210
|
+
teacherProfile?: TeacherBE;
|
|
211
|
+
workspaces?: WorkspaceUserBE[];
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* Campus represents a physical branch/location of a school
|
|
215
|
+
*/
|
|
216
|
+
export interface CampusBE {
|
|
217
|
+
address: string | null;
|
|
218
|
+
campusId?: string | null;
|
|
219
|
+
city: string | null;
|
|
220
|
+
code: string;
|
|
221
|
+
country: string | null;
|
|
222
|
+
createdAt: string;
|
|
223
|
+
enabled: boolean;
|
|
224
|
+
id: string;
|
|
225
|
+
name: string;
|
|
226
|
+
phone: string | null;
|
|
227
|
+
schoolId: string;
|
|
228
|
+
state: string | null;
|
|
229
|
+
updatedAt: string;
|
|
230
|
+
school?: SchoolBE;
|
|
231
|
+
_count?: {
|
|
232
|
+
classes: number;
|
|
233
|
+
teachers: number;
|
|
234
|
+
studentProfiles: number;
|
|
235
|
+
};
|
|
236
|
+
}
|