@iveri/contracts 0.39.0 → 0.40.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-device.type.d.ts +23 -0
- package/dist/api/clinic/clinic-device.type.js +1 -0
- package/dist/api/clinic/clinic-location.type.d.ts +36 -0
- package/dist/api/clinic/clinic-location.type.js +1 -0
- package/dist/api/clinic/clinic-resource-status.enum.d.ts +5 -0
- package/dist/api/clinic/clinic-resource-status.enum.js +6 -0
- package/dist/api/clinic/clinic-room.type.d.ts +19 -0
- package/dist/api/clinic/clinic-room.type.js +1 -0
- package/dist/api/clinic/clinic-specialty.type.d.ts +24 -0
- package/dist/api/clinic/clinic-specialty.type.js +1 -0
- package/dist/api/clinic/clinic-staff.type.d.ts +55 -0
- package/dist/api/clinic/clinic-staff.type.js +1 -0
- package/dist/api/clinic/clinic-treatment.type.d.ts +64 -0
- package/dist/api/clinic/clinic-treatment.type.js +1 -0
- package/dist/api/clinic/index.d.ts +8 -0
- package/dist/api/clinic/index.js +8 -0
- package/dist/api/clinic/localized-text.type.d.ts +7 -0
- package/dist/api/clinic/localized-text.type.js +1 -0
- package/dist/enum/user-permission.enum.d.ts +5 -1
- package/dist/enum/user-permission.enum.js +5 -0
- package/package.json +5 -1
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { IsoDateTime } from '../../type/iso-date-time.type.js';
|
|
2
|
+
import type { UUID } from '../../type/uuid.type.js';
|
|
3
|
+
import type { ClinicResourceStatus } from './clinic-resource-status.enum.js';
|
|
4
|
+
export interface ClinicDevice {
|
|
5
|
+
id: UUID;
|
|
6
|
+
locationId: UUID;
|
|
7
|
+
name: string;
|
|
8
|
+
/** A clinic-chosen key such as `co2-laser`, which a treatment names when it needs one. */
|
|
9
|
+
deviceType: string;
|
|
10
|
+
status: ClinicResourceStatus;
|
|
11
|
+
createdAt: IsoDateTime;
|
|
12
|
+
updatedAt: IsoDateTime;
|
|
13
|
+
}
|
|
14
|
+
export interface CreateClinicDeviceRequest {
|
|
15
|
+
locationId: UUID;
|
|
16
|
+
name: string;
|
|
17
|
+
deviceType: string;
|
|
18
|
+
}
|
|
19
|
+
export interface UpdateClinicDeviceRequest {
|
|
20
|
+
name?: string;
|
|
21
|
+
deviceType?: string;
|
|
22
|
+
status?: ClinicResourceStatus;
|
|
23
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,36 @@
|
|
|
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 { ClinicResourceStatus } from './clinic-resource-status.enum.js';
|
|
5
|
+
import type { LocalizedText } from './localized-text.type.js';
|
|
6
|
+
export interface ClinicLocation {
|
|
7
|
+
id: UUID;
|
|
8
|
+
name: LocalizedText;
|
|
9
|
+
city: LocalizedText;
|
|
10
|
+
address: Nullable<string>;
|
|
11
|
+
phone: Nullable<string>;
|
|
12
|
+
/** An IANA zone such as `Asia/Tbilisi`. Times are stored in UTC and shown in this zone. */
|
|
13
|
+
timeZone: string;
|
|
14
|
+
/** The specialties this branch offers, which clients filter branches by. */
|
|
15
|
+
specialtyIds: UUID[];
|
|
16
|
+
status: ClinicResourceStatus;
|
|
17
|
+
createdAt: IsoDateTime;
|
|
18
|
+
updatedAt: IsoDateTime;
|
|
19
|
+
}
|
|
20
|
+
export interface CreateClinicLocationRequest {
|
|
21
|
+
name: LocalizedText;
|
|
22
|
+
city: LocalizedText;
|
|
23
|
+
address?: Nullable<string>;
|
|
24
|
+
phone?: Nullable<string>;
|
|
25
|
+
timeZone: string;
|
|
26
|
+
specialtyIds?: UUID[];
|
|
27
|
+
}
|
|
28
|
+
export interface UpdateClinicLocationRequest {
|
|
29
|
+
name?: LocalizedText;
|
|
30
|
+
city?: LocalizedText;
|
|
31
|
+
address?: Nullable<string>;
|
|
32
|
+
phone?: Nullable<string>;
|
|
33
|
+
timeZone?: string;
|
|
34
|
+
specialtyIds?: UUID[];
|
|
35
|
+
status?: ClinicResourceStatus;
|
|
36
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** Whether a location, room, device, treatment or staff member can be booked. */
|
|
2
|
+
export var ClinicResourceStatus;
|
|
3
|
+
(function (ClinicResourceStatus) {
|
|
4
|
+
ClinicResourceStatus["ACTIVE"] = "active";
|
|
5
|
+
ClinicResourceStatus["INACTIVE"] = "inactive";
|
|
6
|
+
})(ClinicResourceStatus || (ClinicResourceStatus = {}));
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { IsoDateTime } from '../../type/iso-date-time.type.js';
|
|
2
|
+
import type { UUID } from '../../type/uuid.type.js';
|
|
3
|
+
import type { ClinicResourceStatus } from './clinic-resource-status.enum.js';
|
|
4
|
+
export interface ClinicRoom {
|
|
5
|
+
id: UUID;
|
|
6
|
+
locationId: UUID;
|
|
7
|
+
name: string;
|
|
8
|
+
status: ClinicResourceStatus;
|
|
9
|
+
createdAt: IsoDateTime;
|
|
10
|
+
updatedAt: IsoDateTime;
|
|
11
|
+
}
|
|
12
|
+
export interface CreateClinicRoomRequest {
|
|
13
|
+
locationId: UUID;
|
|
14
|
+
name: string;
|
|
15
|
+
}
|
|
16
|
+
export interface UpdateClinicRoomRequest {
|
|
17
|
+
name?: string;
|
|
18
|
+
status?: ClinicResourceStatus;
|
|
19
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { IsoDateTime } from '../../type/iso-date-time.type.js';
|
|
2
|
+
import type { UUID } from '../../type/uuid.type.js';
|
|
3
|
+
import type { ClinicResourceStatus } from './clinic-resource-status.enum.js';
|
|
4
|
+
import type { LocalizedText } from './localized-text.type.js';
|
|
5
|
+
/** A line of work such as cosmetology or laser epilation, which a clinic organises treatments by. */
|
|
6
|
+
export interface ClinicSpecialty {
|
|
7
|
+
id: UUID;
|
|
8
|
+
name: LocalizedText;
|
|
9
|
+
/** Fixed after creation, because a public address names it. */
|
|
10
|
+
slug: string;
|
|
11
|
+
sortOrder: number;
|
|
12
|
+
status: ClinicResourceStatus;
|
|
13
|
+
createdAt: IsoDateTime;
|
|
14
|
+
updatedAt: IsoDateTime;
|
|
15
|
+
}
|
|
16
|
+
export interface CreateClinicSpecialtyRequest {
|
|
17
|
+
name: LocalizedText;
|
|
18
|
+
slug: string;
|
|
19
|
+
}
|
|
20
|
+
export interface UpdateClinicSpecialtyRequest {
|
|
21
|
+
name?: LocalizedText;
|
|
22
|
+
sortOrder?: number;
|
|
23
|
+
status?: ClinicResourceStatus;
|
|
24
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,55 @@
|
|
|
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 { ClinicResourceStatus } from './clinic-resource-status.enum.js';
|
|
5
|
+
/** One stretch of a weekly schedule, read in the location's own time zone. */
|
|
6
|
+
export interface ClinicWorkingPeriod {
|
|
7
|
+
/** ISO weekday: 1 is Monday and 7 is Sunday. */
|
|
8
|
+
dayOfWeek: number;
|
|
9
|
+
/** 24-hour `HH:mm`. */
|
|
10
|
+
startTime: string;
|
|
11
|
+
/** 24-hour `HH:mm`, later than `startTime`. */
|
|
12
|
+
endTime: string;
|
|
13
|
+
}
|
|
14
|
+
export interface ClinicStaffMember {
|
|
15
|
+
id: UUID;
|
|
16
|
+
/** The identity account this person signs in with. */
|
|
17
|
+
userId: UUID;
|
|
18
|
+
locationId: UUID;
|
|
19
|
+
displayName: string;
|
|
20
|
+
status: ClinicResourceStatus;
|
|
21
|
+
/** The treatments this person may perform. */
|
|
22
|
+
treatmentIds: UUID[];
|
|
23
|
+
workingHours: ClinicWorkingPeriod[];
|
|
24
|
+
createdAt: IsoDateTime;
|
|
25
|
+
updatedAt: IsoDateTime;
|
|
26
|
+
}
|
|
27
|
+
export interface CreateClinicStaffMemberRequest {
|
|
28
|
+
userId: UUID;
|
|
29
|
+
locationId: UUID;
|
|
30
|
+
displayName: string;
|
|
31
|
+
}
|
|
32
|
+
export interface UpdateClinicStaffMemberRequest {
|
|
33
|
+
locationId?: UUID;
|
|
34
|
+
displayName?: string;
|
|
35
|
+
status?: ClinicResourceStatus;
|
|
36
|
+
}
|
|
37
|
+
export interface ReplaceClinicStaffTreatmentsRequest {
|
|
38
|
+
treatmentIds: UUID[];
|
|
39
|
+
}
|
|
40
|
+
export interface ReplaceClinicWorkingHoursRequest {
|
|
41
|
+
periods: ClinicWorkingPeriod[];
|
|
42
|
+
}
|
|
43
|
+
export interface ClinicTimeOff {
|
|
44
|
+
id: UUID;
|
|
45
|
+
staffMemberId: UUID;
|
|
46
|
+
startsAt: IsoDateTime;
|
|
47
|
+
endsAt: IsoDateTime;
|
|
48
|
+
reason: Nullable<string>;
|
|
49
|
+
createdAt: IsoDateTime;
|
|
50
|
+
}
|
|
51
|
+
export interface CreateClinicTimeOffRequest {
|
|
52
|
+
startsAt: IsoDateTime;
|
|
53
|
+
endsAt: IsoDateTime;
|
|
54
|
+
reason?: Nullable<string>;
|
|
55
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,64 @@
|
|
|
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 { ClinicResourceStatus } from './clinic-resource-status.enum.js';
|
|
5
|
+
import type { LocalizedText } from './localized-text.type.js';
|
|
6
|
+
/** One way of buying a treatment. A laser zone is an option; a treatment that does not vary has one. */
|
|
7
|
+
export interface ClinicTreatmentOption {
|
|
8
|
+
id: UUID;
|
|
9
|
+
name: LocalizedText;
|
|
10
|
+
durationMinutes: number;
|
|
11
|
+
/** Integer minor units of the treatment's currency. */
|
|
12
|
+
priceMinor: number;
|
|
13
|
+
sortOrder: number;
|
|
14
|
+
}
|
|
15
|
+
export interface ClinicTreatment {
|
|
16
|
+
id: UUID;
|
|
17
|
+
specialtyId: UUID;
|
|
18
|
+
name: LocalizedText;
|
|
19
|
+
description: Nullable<LocalizedText>;
|
|
20
|
+
currency: string;
|
|
21
|
+
/** Rest time held after the treatment, for cleaning a room or cooling a device. */
|
|
22
|
+
bufferMinutes: number;
|
|
23
|
+
/** The device type this treatment occupies, or `null` when it needs none. */
|
|
24
|
+
requiredDeviceType: Nullable<string>;
|
|
25
|
+
/** The shortest gap a client may leave between sessions, or `null` when any gap is safe. */
|
|
26
|
+
minDaysBetweenSessions: Nullable<number>;
|
|
27
|
+
isBookableOnline: boolean;
|
|
28
|
+
status: ClinicResourceStatus;
|
|
29
|
+
options: ClinicTreatmentOption[];
|
|
30
|
+
createdAt: IsoDateTime;
|
|
31
|
+
updatedAt: IsoDateTime;
|
|
32
|
+
}
|
|
33
|
+
export interface CreateClinicTreatmentOptionRequest {
|
|
34
|
+
name: LocalizedText;
|
|
35
|
+
durationMinutes: number;
|
|
36
|
+
priceMinor: number;
|
|
37
|
+
}
|
|
38
|
+
export interface UpdateClinicTreatmentOptionRequest {
|
|
39
|
+
name?: LocalizedText;
|
|
40
|
+
durationMinutes?: number;
|
|
41
|
+
priceMinor?: number;
|
|
42
|
+
sortOrder?: number;
|
|
43
|
+
}
|
|
44
|
+
export interface CreateClinicTreatmentRequest {
|
|
45
|
+
specialtyId: UUID;
|
|
46
|
+
name: LocalizedText;
|
|
47
|
+
description?: Nullable<LocalizedText>;
|
|
48
|
+
currency: string;
|
|
49
|
+
bufferMinutes?: number;
|
|
50
|
+
requiredDeviceType?: Nullable<string>;
|
|
51
|
+
minDaysBetweenSessions?: Nullable<number>;
|
|
52
|
+
isBookableOnline?: boolean;
|
|
53
|
+
options: CreateClinicTreatmentOptionRequest[];
|
|
54
|
+
}
|
|
55
|
+
export interface UpdateClinicTreatmentRequest {
|
|
56
|
+
specialtyId?: UUID;
|
|
57
|
+
name?: LocalizedText;
|
|
58
|
+
description?: Nullable<LocalizedText>;
|
|
59
|
+
bufferMinutes?: number;
|
|
60
|
+
requiredDeviceType?: Nullable<string>;
|
|
61
|
+
minDaysBetweenSessions?: Nullable<number>;
|
|
62
|
+
isBookableOnline?: boolean;
|
|
63
|
+
status?: ClinicResourceStatus;
|
|
64
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from './clinic-device.type.js';
|
|
2
|
+
export * from './clinic-location.type.js';
|
|
3
|
+
export * from './clinic-resource-status.enum.js';
|
|
4
|
+
export * from './clinic-room.type.js';
|
|
5
|
+
export * from './clinic-specialty.type.js';
|
|
6
|
+
export * from './clinic-staff.type.js';
|
|
7
|
+
export * from './clinic-treatment.type.js';
|
|
8
|
+
export * from './localized-text.type.js';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from './clinic-device.type.js';
|
|
2
|
+
export * from './clinic-location.type.js';
|
|
3
|
+
export * from './clinic-resource-status.enum.js';
|
|
4
|
+
export * from './clinic-room.type.js';
|
|
5
|
+
export * from './clinic-specialty.type.js';
|
|
6
|
+
export * from './clinic-staff.type.js';
|
|
7
|
+
export * from './clinic-treatment.type.js';
|
|
8
|
+
export * from './localized-text.type.js';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Clinic-written text in each language it has been written in, keyed by locale.
|
|
3
|
+
*
|
|
4
|
+
* This is the clinic's own content, so it lives on the row it describes rather than in the
|
|
5
|
+
* localization service, which holds strings the product's authors wrote.
|
|
6
|
+
*/
|
|
7
|
+
export type LocalizedText = Record<string, string>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -430,7 +430,11 @@ export declare enum UserPermission {
|
|
|
430
430
|
/** Confirm or cancel a delivery job; operator actions on another sender's job require this grant. */
|
|
431
431
|
DELIVERY_JOB_OPERATE = "delivery:job:operate",
|
|
432
432
|
/** Read and advance only jobs assigned to the caller's own courier worker. */
|
|
433
|
-
DELIVERY_JOB_DELIVER = "delivery:job:deliver"
|
|
433
|
+
DELIVERY_JOB_DELIVER = "delivery:job:deliver",
|
|
434
|
+
/** Read a clinic's specialties, locations, rooms, devices, treatments and staff. */
|
|
435
|
+
CLINIC_SETUP_READ = "clinic:setup:read",
|
|
436
|
+
/** Create and change them, including staff working hours. */
|
|
437
|
+
CLINIC_SETUP_MANAGE = "clinic:setup:manage"
|
|
434
438
|
}
|
|
435
439
|
/**
|
|
436
440
|
* Every member, for seeding the owner role and validating custom-role input.
|
|
@@ -492,6 +492,11 @@ export var UserPermission;
|
|
|
492
492
|
UserPermission["DELIVERY_JOB_OPERATE"] = "delivery:job:operate";
|
|
493
493
|
/** Read and advance only jobs assigned to the caller's own courier worker. */
|
|
494
494
|
UserPermission["DELIVERY_JOB_DELIVER"] = "delivery:job:deliver";
|
|
495
|
+
// Clinic
|
|
496
|
+
/** Read a clinic's specialties, locations, rooms, devices, treatments and staff. */
|
|
497
|
+
UserPermission["CLINIC_SETUP_READ"] = "clinic:setup:read";
|
|
498
|
+
/** Create and change them, including staff working hours. */
|
|
499
|
+
UserPermission["CLINIC_SETUP_MANAGE"] = "clinic:setup:manage";
|
|
495
500
|
})(UserPermission || (UserPermission = {}));
|
|
496
501
|
/**
|
|
497
502
|
* Every member, for seeding the owner role and validating custom-role input.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@iveri/contracts",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.40.0",
|
|
4
4
|
"description": "Wire contracts shared by every Iveri backend and frontend. Zero runtime dependencies.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -48,6 +48,10 @@
|
|
|
48
48
|
"types": "./dist/api/realtime/index.d.ts",
|
|
49
49
|
"default": "./dist/api/realtime/index.js"
|
|
50
50
|
},
|
|
51
|
+
"./clinic": {
|
|
52
|
+
"types": "./dist/api/clinic/index.d.ts",
|
|
53
|
+
"default": "./dist/api/clinic/index.js"
|
|
54
|
+
},
|
|
51
55
|
"./mobility": {
|
|
52
56
|
"types": "./dist/api/mobility/index.d.ts",
|
|
53
57
|
"default": "./dist/api/mobility/index.js"
|