@iveri/contracts 0.40.0 → 0.42.0
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/api/clinic/clinic-appointment-status.enum.d.ts +7 -0
- package/dist/api/clinic/clinic-appointment-status.enum.js +8 -0
- package/dist/api/clinic/clinic-appointment.type.d.ts +48 -0
- package/dist/api/clinic/clinic-appointment.type.js +1 -0
- package/dist/api/clinic/clinic-client.type.d.ts +25 -0
- package/dist/api/clinic/clinic-client.type.js +1 -0
- package/dist/api/clinic/clinic-lead-kind.enum.d.ts +4 -0
- package/dist/api/clinic/clinic-lead-kind.enum.js +5 -0
- package/dist/api/clinic/clinic-lead-status.enum.d.ts +4 -0
- package/dist/api/clinic/clinic-lead-status.enum.js +5 -0
- package/dist/api/clinic/clinic-lead.type.d.ts +32 -0
- package/dist/api/clinic/clinic-lead.type.js +1 -0
- package/dist/api/clinic/clinic-my-appointment.type.d.ts +37 -0
- package/dist/api/clinic/clinic-my-appointment.type.js +1 -0
- package/dist/api/clinic/clinic-profile.type.d.ts +32 -0
- package/dist/api/clinic/clinic-profile.type.js +1 -0
- package/dist/api/clinic/clinic-public.type.d.ts +53 -0
- package/dist/api/clinic/clinic-public.type.js +1 -0
- package/dist/api/clinic/clinic-slot.type.d.ts +9 -0
- package/dist/api/clinic/clinic-slot.type.js +1 -0
- package/dist/api/clinic/index.d.ts +10 -0
- package/dist/api/clinic/index.js +10 -0
- package/dist/enum/user-permission.enum.d.ts +13 -1
- package/dist/enum/user-permission.enum.js +12 -0
- package/package.json +1 -1
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export var ClinicAppointmentStatus;
|
|
2
|
+
(function (ClinicAppointmentStatus) {
|
|
3
|
+
ClinicAppointmentStatus["BOOKED"] = "booked";
|
|
4
|
+
ClinicAppointmentStatus["CHECKED_IN"] = "checked-in";
|
|
5
|
+
ClinicAppointmentStatus["COMPLETED"] = "completed";
|
|
6
|
+
ClinicAppointmentStatus["CANCELLED"] = "cancelled";
|
|
7
|
+
ClinicAppointmentStatus["NO_SHOW"] = "no-show";
|
|
8
|
+
})(ClinicAppointmentStatus || (ClinicAppointmentStatus = {}));
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { IsoDateTime } from '../../type/iso-date-time.type.js';
|
|
2
|
+
import type { Nullable } from '../../type/nil.type.js';
|
|
3
|
+
import type { UUID } from '../../type/uuid.type.js';
|
|
4
|
+
import type { ClinicAppointmentStatus } from './clinic-appointment-status.enum.js';
|
|
5
|
+
import type { LocalizedText } from './localized-text.type.js';
|
|
6
|
+
/** One option as it was when the appointment was booked. A later price change does not touch it. */
|
|
7
|
+
export interface ClinicAppointmentLine {
|
|
8
|
+
optionId: UUID;
|
|
9
|
+
name: LocalizedText;
|
|
10
|
+
durationMinutes: number;
|
|
11
|
+
priceMinor: number;
|
|
12
|
+
}
|
|
13
|
+
export interface ClinicAppointment {
|
|
14
|
+
id: UUID;
|
|
15
|
+
locationId: UUID;
|
|
16
|
+
staffMemberId: UUID;
|
|
17
|
+
roomId: UUID;
|
|
18
|
+
deviceId: Nullable<UUID>;
|
|
19
|
+
clientId: UUID;
|
|
20
|
+
clientName: string;
|
|
21
|
+
clientPhone: string;
|
|
22
|
+
treatmentId: UUID;
|
|
23
|
+
treatmentName: LocalizedText;
|
|
24
|
+
status: ClinicAppointmentStatus;
|
|
25
|
+
startsAt: IsoDateTime;
|
|
26
|
+
/** When the treatment itself finishes. */
|
|
27
|
+
endsAt: IsoDateTime;
|
|
28
|
+
/** When the specialist, the room and any machine are free again, which includes the buffer. */
|
|
29
|
+
blockedUntil: IsoDateTime;
|
|
30
|
+
currency: string;
|
|
31
|
+
totalMinor: number;
|
|
32
|
+
lines: ClinicAppointmentLine[];
|
|
33
|
+
note: Nullable<string>;
|
|
34
|
+
createdAt: IsoDateTime;
|
|
35
|
+
updatedAt: IsoDateTime;
|
|
36
|
+
}
|
|
37
|
+
export interface CreateClinicAppointmentRequest {
|
|
38
|
+
locationId: UUID;
|
|
39
|
+
treatmentId: UUID;
|
|
40
|
+
optionIds: UUID[];
|
|
41
|
+
staffMemberId: UUID;
|
|
42
|
+
clientId: UUID;
|
|
43
|
+
startsAt: IsoDateTime;
|
|
44
|
+
note?: Nullable<string>;
|
|
45
|
+
}
|
|
46
|
+
export interface ChangeClinicAppointmentStatusRequest {
|
|
47
|
+
status: ClinicAppointmentStatus;
|
|
48
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { IsoDateTime } from '../../type/iso-date-time.type.js';
|
|
2
|
+
import type { Nullable } from '../../type/nil.type.js';
|
|
3
|
+
import type { UUID } from '../../type/uuid.type.js';
|
|
4
|
+
/** Somebody the clinic treats. They need no account to be booked by reception. */
|
|
5
|
+
export interface ClinicClient {
|
|
6
|
+
id: UUID;
|
|
7
|
+
firstName: string;
|
|
8
|
+
lastName: string;
|
|
9
|
+
phone: string;
|
|
10
|
+
email: Nullable<string>;
|
|
11
|
+
createdAt: IsoDateTime;
|
|
12
|
+
updatedAt: IsoDateTime;
|
|
13
|
+
}
|
|
14
|
+
export interface CreateClinicClientRequest {
|
|
15
|
+
firstName: string;
|
|
16
|
+
lastName: string;
|
|
17
|
+
phone: string;
|
|
18
|
+
email?: Nullable<string>;
|
|
19
|
+
}
|
|
20
|
+
export interface UpdateClinicClientRequest {
|
|
21
|
+
firstName?: string;
|
|
22
|
+
lastName?: string;
|
|
23
|
+
phone?: string;
|
|
24
|
+
email?: Nullable<string>;
|
|
25
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { IsoDateTime } from '../../type/iso-date-time.type.js';
|
|
2
|
+
import type { Nullable } from '../../type/nil.type.js';
|
|
3
|
+
import type { UUID } from '../../type/uuid.type.js';
|
|
4
|
+
import type { ClinicLeadKind } from './clinic-lead-kind.enum.js';
|
|
5
|
+
import type { ClinicLeadStatus } from './clinic-lead-status.enum.js';
|
|
6
|
+
/** Somebody who asked the clinic to call them back, or asked it something. */
|
|
7
|
+
export interface ClinicLead {
|
|
8
|
+
id: UUID;
|
|
9
|
+
kind: ClinicLeadKind;
|
|
10
|
+
status: ClinicLeadStatus;
|
|
11
|
+
name: string;
|
|
12
|
+
phone: string;
|
|
13
|
+
message: Nullable<string>;
|
|
14
|
+
locationId: Nullable<UUID>;
|
|
15
|
+
treatmentId: Nullable<UUID>;
|
|
16
|
+
/** When this person agreed to be contacted. A lead cannot exist without it. */
|
|
17
|
+
consentedAt: IsoDateTime;
|
|
18
|
+
handledAt: Nullable<IsoDateTime>;
|
|
19
|
+
createdAt: IsoDateTime;
|
|
20
|
+
}
|
|
21
|
+
export interface CreateClinicLeadRequest {
|
|
22
|
+
kind: ClinicLeadKind;
|
|
23
|
+
name: string;
|
|
24
|
+
phone: string;
|
|
25
|
+
message?: Nullable<string>;
|
|
26
|
+
locationId?: Nullable<UUID>;
|
|
27
|
+
treatmentId?: Nullable<UUID>;
|
|
28
|
+
hasPrivacyConsent: boolean;
|
|
29
|
+
}
|
|
30
|
+
export interface ChangeClinicLeadStatusRequest {
|
|
31
|
+
status: ClinicLeadStatus;
|
|
32
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { IsoDateTime } from '../../type/iso-date-time.type.js';
|
|
2
|
+
import type { Nullable } from '../../type/nil.type.js';
|
|
3
|
+
import type { UUID } from '../../type/uuid.type.js';
|
|
4
|
+
import type { ClinicAppointmentStatus } from './clinic-appointment-status.enum.js';
|
|
5
|
+
import type { ClinicAppointmentLine } from './clinic-appointment.type.js';
|
|
6
|
+
import type { LocalizedText } from './localized-text.type.js';
|
|
7
|
+
/** A client's own view of a booking, without the room and machine the clinic assigned. */
|
|
8
|
+
export interface MyClinicAppointment {
|
|
9
|
+
id: UUID;
|
|
10
|
+
locationId: UUID;
|
|
11
|
+
specialistName: string;
|
|
12
|
+
treatmentId: UUID;
|
|
13
|
+
treatmentName: LocalizedText;
|
|
14
|
+
status: ClinicAppointmentStatus;
|
|
15
|
+
startsAt: IsoDateTime;
|
|
16
|
+
endsAt: IsoDateTime;
|
|
17
|
+
currency: string;
|
|
18
|
+
totalMinor: number;
|
|
19
|
+
lines: ClinicAppointmentLine[];
|
|
20
|
+
note: Nullable<string>;
|
|
21
|
+
/** Whether the clinic's rules still let this client cancel it themselves. */
|
|
22
|
+
canCancel: boolean;
|
|
23
|
+
}
|
|
24
|
+
export interface BookMyClinicAppointmentRequest {
|
|
25
|
+
locationId: UUID;
|
|
26
|
+
treatmentId: UUID;
|
|
27
|
+
optionIds: UUID[];
|
|
28
|
+
staffMemberId: UUID;
|
|
29
|
+
startsAt: IsoDateTime;
|
|
30
|
+
note?: Nullable<string>;
|
|
31
|
+
}
|
|
32
|
+
export interface SaveMyClinicClientRequest {
|
|
33
|
+
firstName: string;
|
|
34
|
+
lastName: string;
|
|
35
|
+
phone: string;
|
|
36
|
+
email?: Nullable<string>;
|
|
37
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { IsoDateTime } from '../../type/iso-date-time.type.js';
|
|
2
|
+
import type { Nullable } from '../../type/nil.type.js';
|
|
3
|
+
import type { UUID } from '../../type/uuid.type.js';
|
|
4
|
+
import type { LocalizedText } from './localized-text.type.js';
|
|
5
|
+
/** How a clinic presents itself to the public, and the rules for booking online. */
|
|
6
|
+
export interface ClinicProfile {
|
|
7
|
+
id: UUID;
|
|
8
|
+
/** The name its public address and app build use. Unique across every clinic. */
|
|
9
|
+
slug: string;
|
|
10
|
+
name: LocalizedText;
|
|
11
|
+
tagline: Nullable<LocalizedText>;
|
|
12
|
+
phone: Nullable<string>;
|
|
13
|
+
email: Nullable<string>;
|
|
14
|
+
/** Nothing about the clinic is public until this is true. */
|
|
15
|
+
isPublished: boolean;
|
|
16
|
+
/** How long before a booking a client can still cancel it themselves. */
|
|
17
|
+
clientCancelCutoffHours: number;
|
|
18
|
+
/** How far ahead a client can book. */
|
|
19
|
+
bookingHorizonDays: number;
|
|
20
|
+
createdAt: IsoDateTime;
|
|
21
|
+
updatedAt: IsoDateTime;
|
|
22
|
+
}
|
|
23
|
+
export interface SaveClinicProfileRequest {
|
|
24
|
+
slug: string;
|
|
25
|
+
name: LocalizedText;
|
|
26
|
+
tagline?: Nullable<LocalizedText>;
|
|
27
|
+
phone?: Nullable<string>;
|
|
28
|
+
email?: Nullable<string>;
|
|
29
|
+
isPublished: boolean;
|
|
30
|
+
clientCancelCutoffHours: number;
|
|
31
|
+
bookingHorizonDays: number;
|
|
32
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { Nullable } from '../../type/nil.type.js';
|
|
2
|
+
import type { UUID } from '../../type/uuid.type.js';
|
|
3
|
+
import type { LocalizedText } from './localized-text.type.js';
|
|
4
|
+
/**
|
|
5
|
+
* What anybody on the internet may read.
|
|
6
|
+
*
|
|
7
|
+
* Declared apart from the staff shapes on purpose. A field added to one of those does not reach
|
|
8
|
+
* the public until somebody adds it here too.
|
|
9
|
+
*/
|
|
10
|
+
export interface PublicClinic {
|
|
11
|
+
slug: string;
|
|
12
|
+
name: LocalizedText;
|
|
13
|
+
tagline: Nullable<LocalizedText>;
|
|
14
|
+
phone: Nullable<string>;
|
|
15
|
+
email: Nullable<string>;
|
|
16
|
+
bookingHorizonDays: number;
|
|
17
|
+
}
|
|
18
|
+
export interface PublicSpecialty {
|
|
19
|
+
id: UUID;
|
|
20
|
+
slug: string;
|
|
21
|
+
name: LocalizedText;
|
|
22
|
+
}
|
|
23
|
+
export interface PublicBranch {
|
|
24
|
+
id: UUID;
|
|
25
|
+
name: LocalizedText;
|
|
26
|
+
city: LocalizedText;
|
|
27
|
+
address: Nullable<string>;
|
|
28
|
+
phone: Nullable<string>;
|
|
29
|
+
timeZone: string;
|
|
30
|
+
specialtyIds: UUID[];
|
|
31
|
+
}
|
|
32
|
+
export interface PublicTreatmentOption {
|
|
33
|
+
id: UUID;
|
|
34
|
+
name: LocalizedText;
|
|
35
|
+
durationMinutes: number;
|
|
36
|
+
priceMinor: number;
|
|
37
|
+
}
|
|
38
|
+
export interface PublicTreatment {
|
|
39
|
+
id: UUID;
|
|
40
|
+
specialtyId: UUID;
|
|
41
|
+
name: LocalizedText;
|
|
42
|
+
description: Nullable<LocalizedText>;
|
|
43
|
+
currency: string;
|
|
44
|
+
minDaysBetweenSessions: Nullable<number>;
|
|
45
|
+
isBookableOnline: boolean;
|
|
46
|
+
options: PublicTreatmentOption[];
|
|
47
|
+
}
|
|
48
|
+
export interface PublicSpecialist {
|
|
49
|
+
id: UUID;
|
|
50
|
+
displayName: string;
|
|
51
|
+
locationId: UUID;
|
|
52
|
+
treatmentIds: UUID[];
|
|
53
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { IsoDateTime } from '../../type/iso-date-time.type.js';
|
|
2
|
+
import type { UUID } from '../../type/uuid.type.js';
|
|
3
|
+
/** A time one specialist can start this treatment, with a room and any machine free for all of it. */
|
|
4
|
+
export interface ClinicSlot {
|
|
5
|
+
staffMemberId: UUID;
|
|
6
|
+
startsAt: IsoDateTime;
|
|
7
|
+
/** When the treatment itself finishes, without the buffer after it. */
|
|
8
|
+
endsAt: IsoDateTime;
|
|
9
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,7 +1,17 @@
|
|
|
1
|
+
export * from './clinic-appointment-status.enum.js';
|
|
2
|
+
export * from './clinic-appointment.type.js';
|
|
3
|
+
export * from './clinic-client.type.js';
|
|
1
4
|
export * from './clinic-device.type.js';
|
|
5
|
+
export * from './clinic-lead-kind.enum.js';
|
|
6
|
+
export * from './clinic-lead-status.enum.js';
|
|
7
|
+
export * from './clinic-lead.type.js';
|
|
2
8
|
export * from './clinic-location.type.js';
|
|
9
|
+
export * from './clinic-my-appointment.type.js';
|
|
10
|
+
export * from './clinic-profile.type.js';
|
|
11
|
+
export * from './clinic-public.type.js';
|
|
3
12
|
export * from './clinic-resource-status.enum.js';
|
|
4
13
|
export * from './clinic-room.type.js';
|
|
14
|
+
export * from './clinic-slot.type.js';
|
|
5
15
|
export * from './clinic-specialty.type.js';
|
|
6
16
|
export * from './clinic-staff.type.js';
|
|
7
17
|
export * from './clinic-treatment.type.js';
|
package/dist/api/clinic/index.js
CHANGED
|
@@ -1,7 +1,17 @@
|
|
|
1
|
+
export * from './clinic-appointment-status.enum.js';
|
|
2
|
+
export * from './clinic-appointment.type.js';
|
|
3
|
+
export * from './clinic-client.type.js';
|
|
1
4
|
export * from './clinic-device.type.js';
|
|
5
|
+
export * from './clinic-lead-kind.enum.js';
|
|
6
|
+
export * from './clinic-lead-status.enum.js';
|
|
7
|
+
export * from './clinic-lead.type.js';
|
|
2
8
|
export * from './clinic-location.type.js';
|
|
9
|
+
export * from './clinic-my-appointment.type.js';
|
|
10
|
+
export * from './clinic-profile.type.js';
|
|
11
|
+
export * from './clinic-public.type.js';
|
|
3
12
|
export * from './clinic-resource-status.enum.js';
|
|
4
13
|
export * from './clinic-room.type.js';
|
|
14
|
+
export * from './clinic-slot.type.js';
|
|
5
15
|
export * from './clinic-specialty.type.js';
|
|
6
16
|
export * from './clinic-staff.type.js';
|
|
7
17
|
export * from './clinic-treatment.type.js';
|
|
@@ -434,7 +434,19 @@ export declare enum UserPermission {
|
|
|
434
434
|
/** Read a clinic's specialties, locations, rooms, devices, treatments and staff. */
|
|
435
435
|
CLINIC_SETUP_READ = "clinic:setup:read",
|
|
436
436
|
/** Create and change them, including staff working hours. */
|
|
437
|
-
CLINIC_SETUP_MANAGE = "clinic:setup:manage"
|
|
437
|
+
CLINIC_SETUP_MANAGE = "clinic:setup:manage",
|
|
438
|
+
/** Read the appointment calendar and search for free slots. */
|
|
439
|
+
CLINIC_APPOINTMENT_READ = "clinic:appointment:read",
|
|
440
|
+
/** Book appointments and move them through their statuses. */
|
|
441
|
+
CLINIC_APPOINTMENT_MANAGE = "clinic:appointment:manage",
|
|
442
|
+
/** Read a clinic's clients. */
|
|
443
|
+
CLINIC_CLIENT_READ = "clinic:client:read",
|
|
444
|
+
/** Create and change a clinic's clients. */
|
|
445
|
+
CLINIC_CLIENT_MANAGE = "clinic:client:manage",
|
|
446
|
+
/** Read callback requests and questions sent from a clinic's website or app. */
|
|
447
|
+
CLINIC_LEAD_READ = "clinic:lead:read",
|
|
448
|
+
/** Mark those requests as handled. */
|
|
449
|
+
CLINIC_LEAD_MANAGE = "clinic:lead:manage"
|
|
438
450
|
}
|
|
439
451
|
/**
|
|
440
452
|
* Every member, for seeding the owner role and validating custom-role input.
|
|
@@ -497,6 +497,18 @@ export var UserPermission;
|
|
|
497
497
|
UserPermission["CLINIC_SETUP_READ"] = "clinic:setup:read";
|
|
498
498
|
/** Create and change them, including staff working hours. */
|
|
499
499
|
UserPermission["CLINIC_SETUP_MANAGE"] = "clinic:setup:manage";
|
|
500
|
+
/** Read the appointment calendar and search for free slots. */
|
|
501
|
+
UserPermission["CLINIC_APPOINTMENT_READ"] = "clinic:appointment:read";
|
|
502
|
+
/** Book appointments and move them through their statuses. */
|
|
503
|
+
UserPermission["CLINIC_APPOINTMENT_MANAGE"] = "clinic:appointment:manage";
|
|
504
|
+
/** Read a clinic's clients. */
|
|
505
|
+
UserPermission["CLINIC_CLIENT_READ"] = "clinic:client:read";
|
|
506
|
+
/** Create and change a clinic's clients. */
|
|
507
|
+
UserPermission["CLINIC_CLIENT_MANAGE"] = "clinic:client:manage";
|
|
508
|
+
/** Read callback requests and questions sent from a clinic's website or app. */
|
|
509
|
+
UserPermission["CLINIC_LEAD_READ"] = "clinic:lead:read";
|
|
510
|
+
/** Mark those requests as handled. */
|
|
511
|
+
UserPermission["CLINIC_LEAD_MANAGE"] = "clinic:lead:manage";
|
|
500
512
|
})(UserPermission || (UserPermission = {}));
|
|
501
513
|
/**
|
|
502
514
|
* Every member, for seeding the owner role and validating custom-role input.
|