@iveri/contracts 0.105.0 → 0.107.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/README.md +6 -0
- package/dist/api/clinic/clinic-appointment.type.d.ts +8 -0
- package/dist/api/clinic/clinic-deposit-status.enum.d.ts +22 -0
- package/dist/api/clinic/clinic-deposit-status.enum.js +23 -0
- package/dist/api/clinic/clinic-deposit.type.d.ts +19 -0
- package/dist/api/clinic/clinic-deposit.type.js +1 -0
- package/dist/api/clinic/clinic-my-appointment.type.d.ts +8 -0
- package/dist/api/clinic/clinic-payment-method.enum.d.ts +6 -2
- package/dist/api/clinic/clinic-payment-method.enum.js +5 -1
- package/dist/api/clinic/clinic-payment.type.d.ts +3 -0
- package/dist/api/clinic/clinic-public.type.d.ts +5 -0
- package/dist/api/clinic/clinic-treatment.type.d.ts +7 -0
- package/dist/api/clinic/index.d.ts +2 -0
- package/dist/api/clinic/index.js +2 -0
- package/dist/api/realtime/realtime-event-type.enum.d.ts +7 -1
- package/dist/api/realtime/realtime-event-type.enum.js +6 -0
- package/dist/api/realtime/realtime-resource-type.enum.d.ts +7 -1
- package/dist/api/realtime/realtime-resource-type.enum.js +6 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -8,6 +8,12 @@ entry offers exactly `types` and `default`. The CommonJS build and the `typesVer
|
|
|
8
8
|
gone, so a consumer resolves the subpaths under `moduleResolution` `nodenext` or `bundler` — and
|
|
9
9
|
under Node 26 a CommonJS consumer still loads it, through `require`. See `CHANGELOG.md`.
|
|
10
10
|
|
|
11
|
+
Release `0.106.0` adds `RealtimeResourceType.GYM_PERSON` (`gym.person`) and
|
|
12
|
+
`RealtimeEventType.GYM_PERSON_UPDATED`: a gym member's or trainer's own room, keyed by their
|
|
13
|
+
identity user id, so their apps learn at once that a conversation with the person they train with
|
|
14
|
+
opened. A gateway on an older release refuses the event, so `iveri-realtime` takes this release
|
|
15
|
+
before `gym-api` publishes it.
|
|
16
|
+
|
|
11
17
|
Release `0.21.0` adds the shared realtime contract under `@iveri/contracts/realtime`: closed
|
|
12
18
|
resource and event vocabularies, identifier-only publish messages, and short-lived subscription
|
|
13
19
|
grants bound to one tenant, person and resource. It also separates permission to issue a grant
|
|
@@ -2,6 +2,7 @@ import type { IsoDateTime } from '../../type/iso-date-time.type.js';
|
|
|
2
2
|
import type { Nullable } from '../../type/nil.type.js';
|
|
3
3
|
import type { UUID } from '../../type/uuid.type.js';
|
|
4
4
|
import type { ClinicAppointmentStatus } from './clinic-appointment-status.enum.js';
|
|
5
|
+
import type { ClinicDepositStatus } from './clinic-deposit-status.enum.js';
|
|
5
6
|
import type { LocalizedText } from './localized-text.type.js';
|
|
6
7
|
/** One option as it was when the appointment was booked. A later price change does not touch it. */
|
|
7
8
|
export interface ClinicAppointmentLine {
|
|
@@ -33,6 +34,13 @@ export interface ClinicAppointment {
|
|
|
33
34
|
/** How much a promotion took off, as it stood when this was booked. */
|
|
34
35
|
discountMinor: number;
|
|
35
36
|
promotionName: Nullable<LocalizedText>;
|
|
37
|
+
/** Whether an online deposit holds this visit, and where it stands. */
|
|
38
|
+
depositStatus: ClinicDepositStatus;
|
|
39
|
+
/** What was asked online, in minor units of `currency`. Zero when nothing was. */
|
|
40
|
+
depositMinor: number;
|
|
41
|
+
/** Until when the slot is held for an unpaid deposit. */
|
|
42
|
+
depositExpiresAt: Nullable<IsoDateTime>;
|
|
43
|
+
depositPaidAt: Nullable<IsoDateTime>;
|
|
36
44
|
lines: ClinicAppointmentLine[];
|
|
37
45
|
note: Nullable<string>;
|
|
38
46
|
createdAt: IsoDateTime;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where the online deposit for a visit stands.
|
|
3
|
+
*
|
|
4
|
+
* It is its own field rather than a member of the appointment's status, because a visit can be
|
|
5
|
+
* **cancelled and paid**: the slot is released when a payment window runs out, and the money can land a
|
|
6
|
+
* moment later. One enum would have to drop one of those two facts, and the clinic needs both to give
|
|
7
|
+
* the money back.
|
|
8
|
+
*
|
|
9
|
+
* - `not_required`: nothing was asked for online. Every visit booked at the desk, and any treatment
|
|
10
|
+
* with no deposit.
|
|
11
|
+
* - `pending`: the slot is held while the client pays, until `depositExpiresAt`.
|
|
12
|
+
* - `paid`: the money arrived and is a line in the clinic's ledger.
|
|
13
|
+
* - `failed`: the bank refused it, and the slot was released.
|
|
14
|
+
* - `expired`: nobody paid in time, and the slot was released.
|
|
15
|
+
*/
|
|
16
|
+
export declare enum ClinicDepositStatus {
|
|
17
|
+
NOT_REQUIRED = "not_required",
|
|
18
|
+
PENDING = "pending",
|
|
19
|
+
PAID = "paid",
|
|
20
|
+
FAILED = "failed",
|
|
21
|
+
EXPIRED = "expired"
|
|
22
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where the online deposit for a visit stands.
|
|
3
|
+
*
|
|
4
|
+
* It is its own field rather than a member of the appointment's status, because a visit can be
|
|
5
|
+
* **cancelled and paid**: the slot is released when a payment window runs out, and the money can land a
|
|
6
|
+
* moment later. One enum would have to drop one of those two facts, and the clinic needs both to give
|
|
7
|
+
* the money back.
|
|
8
|
+
*
|
|
9
|
+
* - `not_required`: nothing was asked for online. Every visit booked at the desk, and any treatment
|
|
10
|
+
* with no deposit.
|
|
11
|
+
* - `pending`: the slot is held while the client pays, until `depositExpiresAt`.
|
|
12
|
+
* - `paid`: the money arrived and is a line in the clinic's ledger.
|
|
13
|
+
* - `failed`: the bank refused it, and the slot was released.
|
|
14
|
+
* - `expired`: nobody paid in time, and the slot was released.
|
|
15
|
+
*/
|
|
16
|
+
export var ClinicDepositStatus;
|
|
17
|
+
(function (ClinicDepositStatus) {
|
|
18
|
+
ClinicDepositStatus["NOT_REQUIRED"] = "not_required";
|
|
19
|
+
ClinicDepositStatus["PENDING"] = "pending";
|
|
20
|
+
ClinicDepositStatus["PAID"] = "paid";
|
|
21
|
+
ClinicDepositStatus["FAILED"] = "failed";
|
|
22
|
+
ClinicDepositStatus["EXPIRED"] = "expired";
|
|
23
|
+
})(ClinicDepositStatus || (ClinicDepositStatus = {}));
|
|
@@ -0,0 +1,19 @@
|
|
|
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 { ClinicDepositStatus } from './clinic-deposit-status.enum.js';
|
|
5
|
+
/**
|
|
6
|
+
* The deposit on one of a client's own visits, and where to pay it.
|
|
7
|
+
*
|
|
8
|
+
* `checkoutUrl` is the bank's hosted page, present only while the deposit is still `pending`. Coming
|
|
9
|
+
* back from that page proves nothing: a client's app reads this again, and the clinic asks the bank.
|
|
10
|
+
*/
|
|
11
|
+
export interface MyClinicDeposit {
|
|
12
|
+
appointmentId: UUID;
|
|
13
|
+
depositStatus: ClinicDepositStatus;
|
|
14
|
+
depositMinor: number;
|
|
15
|
+
currency: string;
|
|
16
|
+
checkoutUrl: Nullable<string>;
|
|
17
|
+
depositExpiresAt: Nullable<IsoDateTime>;
|
|
18
|
+
depositPaidAt: Nullable<IsoDateTime>;
|
|
19
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -3,6 +3,7 @@ import type { Nullable } from '../../type/nil.type.js';
|
|
|
3
3
|
import type { UUID } from '../../type/uuid.type.js';
|
|
4
4
|
import type { ClinicAppointmentStatus } from './clinic-appointment-status.enum.js';
|
|
5
5
|
import type { ClinicAppointmentLine } from './clinic-appointment.type.js';
|
|
6
|
+
import type { ClinicDepositStatus } from './clinic-deposit-status.enum.js';
|
|
6
7
|
import type { ClinicScreeningAnswerRequest, SignClinicConsentRequest } from './clinic-record.type.js';
|
|
7
8
|
import type { LocalizedText } from './localized-text.type.js';
|
|
8
9
|
/** A client's own view of a booking, without the room and machine the clinic assigned. */
|
|
@@ -19,6 +20,13 @@ export interface MyClinicAppointment {
|
|
|
19
20
|
totalMinor: number;
|
|
20
21
|
discountMinor: number;
|
|
21
22
|
promotionName: Nullable<LocalizedText>;
|
|
23
|
+
/** Whether an online deposit holds this visit, and where it stands. */
|
|
24
|
+
depositStatus: ClinicDepositStatus;
|
|
25
|
+
/** What was asked online, in minor units of `currency`. Zero when nothing was. */
|
|
26
|
+
depositMinor: number;
|
|
27
|
+
/** Until when the slot is held for an unpaid deposit. */
|
|
28
|
+
depositExpiresAt: Nullable<IsoDateTime>;
|
|
29
|
+
depositPaidAt: Nullable<IsoDateTime>;
|
|
22
30
|
lines: ClinicAppointmentLine[];
|
|
23
31
|
note: Nullable<string>;
|
|
24
32
|
/** Whether the clinic's rules still let this client cancel it themselves. */
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* How a visit was paid for.
|
|
2
|
+
* How a visit was paid for. `cash`, `card`, `transfer` and `online` are money the clinic received.
|
|
3
|
+
*
|
|
4
|
+
* `online` is a deposit a client paid on the bank's hosted page when they booked. Nobody at the desk
|
|
5
|
+
* recorded it, so its line names no person.
|
|
3
6
|
*
|
|
4
7
|
* `course` and `bonus` settle a visit without any money changing hands that day, so a day's takings
|
|
5
8
|
* keep them apart: the money for a course came in on the day it was sold.
|
|
@@ -9,5 +12,6 @@ export declare enum ClinicPaymentMethod {
|
|
|
9
12
|
CARD = "card",
|
|
10
13
|
TRANSFER = "transfer",
|
|
11
14
|
COURSE = "course",
|
|
12
|
-
BONUS = "bonus"
|
|
15
|
+
BONUS = "bonus",
|
|
16
|
+
ONLINE = "online"
|
|
13
17
|
}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* How a visit was paid for.
|
|
2
|
+
* How a visit was paid for. `cash`, `card`, `transfer` and `online` are money the clinic received.
|
|
3
|
+
*
|
|
4
|
+
* `online` is a deposit a client paid on the bank's hosted page when they booked. Nobody at the desk
|
|
5
|
+
* recorded it, so its line names no person.
|
|
3
6
|
*
|
|
4
7
|
* `course` and `bonus` settle a visit without any money changing hands that day, so a day's takings
|
|
5
8
|
* keep them apart: the money for a course came in on the day it was sold.
|
|
@@ -11,4 +14,5 @@ export var ClinicPaymentMethod;
|
|
|
11
14
|
ClinicPaymentMethod["TRANSFER"] = "transfer";
|
|
12
15
|
ClinicPaymentMethod["COURSE"] = "course";
|
|
13
16
|
ClinicPaymentMethod["BONUS"] = "bonus";
|
|
17
|
+
ClinicPaymentMethod["ONLINE"] = "online";
|
|
14
18
|
})(ClinicPaymentMethod || (ClinicPaymentMethod = {}));
|
|
@@ -25,6 +25,7 @@ export interface ClinicPayment {
|
|
|
25
25
|
note: Nullable<string>;
|
|
26
26
|
/** How much of this can still be given back. Always zero on a refund. */
|
|
27
27
|
refundableMinor: number;
|
|
28
|
+
/** Who took it at the desk, or `null` for a deposit paid online, which nobody recorded by hand. */
|
|
28
29
|
recordedByName: Nullable<string>;
|
|
29
30
|
createdAt: IsoDateTime;
|
|
30
31
|
}
|
|
@@ -82,6 +83,8 @@ export interface ClinicTakingsLine {
|
|
|
82
83
|
cashMinor: number;
|
|
83
84
|
cardMinor: number;
|
|
84
85
|
transferMinor: number;
|
|
86
|
+
/** Deposits paid online when a visit was booked. Money taken, and never in the drawer. */
|
|
87
|
+
onlineMinor: number;
|
|
85
88
|
netMinor: number;
|
|
86
89
|
refundedMinor: number;
|
|
87
90
|
courseRedeemedMinor: number;
|
|
@@ -64,6 +64,11 @@ export interface PublicTreatment {
|
|
|
64
64
|
currency: string;
|
|
65
65
|
minDaysBetweenSessions: Nullable<number>;
|
|
66
66
|
isBookableOnline: boolean;
|
|
67
|
+
/**
|
|
68
|
+
* What booking online asks to be paid first, or `null` when nothing is. A visit costing less is
|
|
69
|
+
* asked for its whole price.
|
|
70
|
+
*/
|
|
71
|
+
depositMinor: Nullable<number>;
|
|
67
72
|
options: PublicTreatmentOption[];
|
|
68
73
|
promotion: Nullable<PublicTreatmentPromotion>;
|
|
69
74
|
content: ClinicTreatmentContent;
|
|
@@ -40,6 +40,11 @@ export interface ClinicTreatment {
|
|
|
40
40
|
/** The shortest gap a client may leave between sessions, or `null` when any gap is safe. */
|
|
41
41
|
minDaysBetweenSessions: Nullable<number>;
|
|
42
42
|
isBookableOnline: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* What a client pays online to hold a time, in minor units of `currency`, or `null` for none.
|
|
45
|
+
* A visit costing less is asked for its whole price. Reception's bookings are never asked.
|
|
46
|
+
*/
|
|
47
|
+
depositMinor: Nullable<number>;
|
|
43
48
|
status: ClinicResourceStatus;
|
|
44
49
|
options: ClinicTreatmentOption[];
|
|
45
50
|
content: ClinicTreatmentContent;
|
|
@@ -67,6 +72,7 @@ export interface CreateClinicTreatmentRequest {
|
|
|
67
72
|
requiredDeviceType?: Nullable<string>;
|
|
68
73
|
minDaysBetweenSessions?: Nullable<number>;
|
|
69
74
|
isBookableOnline?: boolean;
|
|
75
|
+
depositMinor?: Nullable<number>;
|
|
70
76
|
options: CreateClinicTreatmentOptionRequest[];
|
|
71
77
|
content?: ClinicTreatmentContent;
|
|
72
78
|
}
|
|
@@ -78,6 +84,7 @@ export interface UpdateClinicTreatmentRequest {
|
|
|
78
84
|
requiredDeviceType?: Nullable<string>;
|
|
79
85
|
minDaysBetweenSessions?: Nullable<number>;
|
|
80
86
|
isBookableOnline?: boolean;
|
|
87
|
+
depositMinor?: Nullable<number>;
|
|
81
88
|
status?: ClinicResourceStatus;
|
|
82
89
|
content?: ClinicTreatmentContent;
|
|
83
90
|
}
|
|
@@ -3,6 +3,8 @@ export * from './clinic-appointment.type.js';
|
|
|
3
3
|
export * from './clinic-client.type.js';
|
|
4
4
|
export * from './clinic-consent-form.type.js';
|
|
5
5
|
export * from './clinic-course.type.js';
|
|
6
|
+
export * from './clinic-deposit-status.enum.js';
|
|
7
|
+
export * from './clinic-deposit.type.js';
|
|
6
8
|
export * from './clinic-device.type.js';
|
|
7
9
|
export * from './clinic-lead-kind.enum.js';
|
|
8
10
|
export * from './clinic-lead-status.enum.js';
|
package/dist/api/clinic/index.js
CHANGED
|
@@ -3,6 +3,8 @@ export * from './clinic-appointment.type.js';
|
|
|
3
3
|
export * from './clinic-client.type.js';
|
|
4
4
|
export * from './clinic-consent-form.type.js';
|
|
5
5
|
export * from './clinic-course.type.js';
|
|
6
|
+
export * from './clinic-deposit-status.enum.js';
|
|
7
|
+
export * from './clinic-deposit.type.js';
|
|
6
8
|
export * from './clinic-device.type.js';
|
|
7
9
|
export * from './clinic-lead-kind.enum.js';
|
|
8
10
|
export * from './clinic-lead-status.enum.js';
|
|
@@ -35,5 +35,11 @@ export declare enum RealtimeEventType {
|
|
|
35
35
|
/** Something new happened to a member, so their activity list and its count are stale. */
|
|
36
36
|
SOCIAL_ACTIVITY_UPDATED = "social.activity.updated",
|
|
37
37
|
/** Somebody came through a branch's door or a class changed, so staff screens refetch. */
|
|
38
|
-
GYM_BRANCH_UPDATED = "gym.branch.updated"
|
|
38
|
+
GYM_BRANCH_UPDATED = "gym.branch.updated",
|
|
39
|
+
/**
|
|
40
|
+
* Something a member or a trainer reads about themselves changed, such as the conversation with
|
|
41
|
+
* the person they train with opening, so their bookings or sessions refetch. Carried on the
|
|
42
|
+
* person, while the version is that of whatever moved.
|
|
43
|
+
*/
|
|
44
|
+
GYM_PERSON_UPDATED = "gym.person.updated"
|
|
39
45
|
}
|
|
@@ -37,4 +37,10 @@ export var RealtimeEventType;
|
|
|
37
37
|
RealtimeEventType["SOCIAL_ACTIVITY_UPDATED"] = "social.activity.updated";
|
|
38
38
|
/** Somebody came through a branch's door or a class changed, so staff screens refetch. */
|
|
39
39
|
RealtimeEventType["GYM_BRANCH_UPDATED"] = "gym.branch.updated";
|
|
40
|
+
/**
|
|
41
|
+
* Something a member or a trainer reads about themselves changed, such as the conversation with
|
|
42
|
+
* the person they train with opening, so their bookings or sessions refetch. Carried on the
|
|
43
|
+
* person, while the version is that of whatever moved.
|
|
44
|
+
*/
|
|
45
|
+
RealtimeEventType["GYM_PERSON_UPDATED"] = "gym.person.updated";
|
|
40
46
|
})(RealtimeEventType || (RealtimeEventType = {}));
|
|
@@ -16,5 +16,11 @@ export declare enum RealtimeResourceType {
|
|
|
16
16
|
* message or a like has happened, and the events on it say what became stale.
|
|
17
17
|
*/
|
|
18
18
|
SOCIAL_MEMBER = "social.member",
|
|
19
|
-
GYM_BRANCH = "gym.branch"
|
|
19
|
+
GYM_BRANCH = "gym.branch",
|
|
20
|
+
/**
|
|
21
|
+
* One person's own room at a gym, a member or a trainer, keyed by their identity user id. They
|
|
22
|
+
* subscribe to themselves, the one thing they can name before a conversation with their trainer
|
|
23
|
+
* or member exists, and the events on it say what of their own became stale.
|
|
24
|
+
*/
|
|
25
|
+
GYM_PERSON = "gym.person"
|
|
20
26
|
}
|
|
@@ -18,4 +18,10 @@ export var RealtimeResourceType;
|
|
|
18
18
|
*/
|
|
19
19
|
RealtimeResourceType["SOCIAL_MEMBER"] = "social.member";
|
|
20
20
|
RealtimeResourceType["GYM_BRANCH"] = "gym.branch";
|
|
21
|
+
/**
|
|
22
|
+
* One person's own room at a gym, a member or a trainer, keyed by their identity user id. They
|
|
23
|
+
* subscribe to themselves, the one thing they can name before a conversation with their trainer
|
|
24
|
+
* or member exists, and the events on it say what of their own became stale.
|
|
25
|
+
*/
|
|
26
|
+
RealtimeResourceType["GYM_PERSON"] = "gym.person";
|
|
21
27
|
})(RealtimeResourceType || (RealtimeResourceType = {}));
|