@simonarcher/fika-types 1.0.50 → 1.0.52
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/shop.d.ts +56 -3
- package/dist/user.d.ts +17 -0
- package/package.json +1 -1
package/dist/shop.d.ts
CHANGED
|
@@ -34,10 +34,10 @@ export interface NewMenuItem {
|
|
|
34
34
|
}
|
|
35
35
|
export interface StaffMember {
|
|
36
36
|
id: string;
|
|
37
|
-
userId
|
|
37
|
+
userId?: string;
|
|
38
38
|
profilePicture?: string;
|
|
39
|
-
membershipId
|
|
40
|
-
role:
|
|
39
|
+
membershipId?: string;
|
|
40
|
+
role: "owner" | "manager" | "staff";
|
|
41
41
|
shopId: string;
|
|
42
42
|
name?: string;
|
|
43
43
|
bio?: string;
|
|
@@ -45,6 +45,7 @@ export interface StaffMember {
|
|
|
45
45
|
email?: string;
|
|
46
46
|
isWorking: boolean;
|
|
47
47
|
shiftStart?: number;
|
|
48
|
+
isAuthenticated: boolean;
|
|
48
49
|
createdAt: Date;
|
|
49
50
|
updatedAt: Date;
|
|
50
51
|
}
|
|
@@ -52,6 +53,7 @@ export interface StaffMemberInvite {
|
|
|
52
53
|
id: string;
|
|
53
54
|
shopId: string;
|
|
54
55
|
invitedEmail: string;
|
|
56
|
+
alternateEmail?: string;
|
|
55
57
|
token: string;
|
|
56
58
|
role: "owner" | "staff";
|
|
57
59
|
status: "pending" | "accepted" | "declined";
|
|
@@ -59,6 +61,57 @@ export interface StaffMemberInvite {
|
|
|
59
61
|
createdAt: AdminTimestamp;
|
|
60
62
|
updatedAt: AdminTimestamp;
|
|
61
63
|
}
|
|
64
|
+
export interface CreateStaffAccountRequest {
|
|
65
|
+
email: string;
|
|
66
|
+
displayName: string;
|
|
67
|
+
password: string;
|
|
68
|
+
role: "owner" | "manager" | "staff";
|
|
69
|
+
profilePicture?: string;
|
|
70
|
+
}
|
|
71
|
+
export interface CreateStaffAccountResponse {
|
|
72
|
+
success: boolean;
|
|
73
|
+
user?: {
|
|
74
|
+
uid: string;
|
|
75
|
+
email: string;
|
|
76
|
+
displayName: string;
|
|
77
|
+
};
|
|
78
|
+
staffMember?: StaffMember;
|
|
79
|
+
message?: string;
|
|
80
|
+
}
|
|
81
|
+
export interface StaffAccountCreationAuditLog {
|
|
82
|
+
id: string;
|
|
83
|
+
action: "staff_account_created" | "staff_account_creation_failed";
|
|
84
|
+
adminUserId: string;
|
|
85
|
+
shopId: string;
|
|
86
|
+
targetEmail: string;
|
|
87
|
+
targetUserId?: string;
|
|
88
|
+
role: string;
|
|
89
|
+
success: boolean;
|
|
90
|
+
errorMessage?: string;
|
|
91
|
+
timestamp: AdminTimestamp;
|
|
92
|
+
}
|
|
93
|
+
export interface Membership {
|
|
94
|
+
id: string;
|
|
95
|
+
shopId: string;
|
|
96
|
+
userId: string;
|
|
97
|
+
role: "owner" | "manager" | "staff";
|
|
98
|
+
status: "active" | "suspended" | "terminated";
|
|
99
|
+
createdAt: AdminTimestamp;
|
|
100
|
+
updatedAt: AdminTimestamp;
|
|
101
|
+
}
|
|
102
|
+
export type StaffRole = "owner" | "manager" | "staff";
|
|
103
|
+
export type StaffAccountType = "invitation" | "manual" | "anonymous";
|
|
104
|
+
export type StaffCreationMethod = "invite" | "create_account" | "add_team_member";
|
|
105
|
+
export interface StaffValidationError {
|
|
106
|
+
field: string;
|
|
107
|
+
message: string;
|
|
108
|
+
code: string;
|
|
109
|
+
}
|
|
110
|
+
export interface StaffCreationError {
|
|
111
|
+
type: "validation" | "authentication" | "authorization" | "database" | "unknown";
|
|
112
|
+
message: string;
|
|
113
|
+
details?: StaffValidationError[];
|
|
114
|
+
}
|
|
62
115
|
export type ShopOpeningTimes = {
|
|
63
116
|
monday?: {
|
|
64
117
|
open: string;
|
package/dist/user.d.ts
CHANGED
|
@@ -46,3 +46,20 @@ export interface PublicUser {
|
|
|
46
46
|
createdAt: Date;
|
|
47
47
|
shopLists?: string[];
|
|
48
48
|
}
|
|
49
|
+
export interface CreateUserAccountRequest {
|
|
50
|
+
email: string;
|
|
51
|
+
displayName: string;
|
|
52
|
+
password: string;
|
|
53
|
+
photoURL?: string;
|
|
54
|
+
role?: 'user' | 'admin';
|
|
55
|
+
}
|
|
56
|
+
export interface CreateUserAccountResponse {
|
|
57
|
+
success: boolean;
|
|
58
|
+
user?: {
|
|
59
|
+
uid: string;
|
|
60
|
+
email: string;
|
|
61
|
+
displayName: string;
|
|
62
|
+
photoURL?: string;
|
|
63
|
+
};
|
|
64
|
+
message?: string;
|
|
65
|
+
}
|