@blackcode_sa/metaestetics-api 1.7.23 → 1.7.24

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.
@@ -0,0 +1,91 @@
1
+ import { Timestamp, FieldValue } from "firebase/firestore";
2
+ import { ClinicInfo, PractitionerProfileInfo } from "../profile";
3
+
4
+ export const PRACTITIONER_INVITES_COLLECTION = "practitioner-invites";
5
+
6
+ /**
7
+ * Enum for practitioner invite status
8
+ */
9
+ export enum PractitionerInviteStatus {
10
+ PENDING = "pending",
11
+ ACCEPTED = "accepted",
12
+ REJECTED = "rejected",
13
+ CANCELLED = "cancelled",
14
+ }
15
+
16
+ /**
17
+ * Interface for proposed working hours in practitioner invite
18
+ */
19
+ export interface ProposedWorkingHours {
20
+ monday: { start: string; end: string } | null;
21
+ tuesday: { start: string; end: string } | null;
22
+ wednesday: { start: string; end: string } | null;
23
+ thursday: { start: string; end: string } | null;
24
+ friday: { start: string; end: string } | null;
25
+ saturday: { start: string; end: string } | null;
26
+ sunday: { start: string; end: string } | null;
27
+ }
28
+
29
+ /**
30
+ * Main interface for practitioner invite
31
+ */
32
+ export interface PractitionerInvite {
33
+ id: string;
34
+ practitionerId: string;
35
+ clinicId: string;
36
+ practitionerInfo: PractitionerProfileInfo;
37
+ clinicInfo: ClinicInfo;
38
+ proposedWorkingHours: ProposedWorkingHours;
39
+ status: PractitionerInviteStatus;
40
+ invitedBy: string; // Admin ID who created the invite
41
+ message?: string | null; // Optional message from clinic to practitioner
42
+ rejectionReason?: string | null; // Optional reason for rejection
43
+ cancelReason?: string | null; // Optional reason for cancellation
44
+ createdAt: Timestamp;
45
+ updatedAt: Timestamp;
46
+ acceptedAt?: Timestamp | null;
47
+ rejectedAt?: Timestamp | null;
48
+ cancelledAt?: Timestamp | null;
49
+ }
50
+
51
+ /**
52
+ * Interface for creating a practitioner invite
53
+ */
54
+ export interface CreatePractitionerInviteData {
55
+ practitionerId: string;
56
+ clinicId: string;
57
+ practitionerInfo: PractitionerProfileInfo;
58
+ clinicInfo: ClinicInfo;
59
+ proposedWorkingHours: ProposedWorkingHours;
60
+ invitedBy: string;
61
+ message?: string | null;
62
+ status?: PractitionerInviteStatus;
63
+ }
64
+
65
+ /**
66
+ * Interface for updating a practitioner invite
67
+ */
68
+ export interface UpdatePractitionerInviteData {
69
+ status?: PractitionerInviteStatus;
70
+ rejectionReason?: string | null;
71
+ cancelReason?: string | null;
72
+ updatedAt?: FieldValue;
73
+ acceptedAt?: Timestamp | null;
74
+ rejectedAt?: Timestamp | null;
75
+ cancelledAt?: Timestamp | null;
76
+ }
77
+
78
+ /**
79
+ * Interface for filters when getting invites
80
+ */
81
+ export interface PractitionerInviteFilters {
82
+ status?: PractitionerInviteStatus[];
83
+ practitionerId?: string;
84
+ clinicId?: string;
85
+ invitedBy?: string;
86
+ fromDate?: Timestamp;
87
+ toDate?: Timestamp;
88
+ limit?: number;
89
+ orderBy?: "createdAt" | "updatedAt";
90
+ orderDirection?: "asc" | "desc";
91
+ }