@iveri/contracts 0.141.0 → 0.143.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 +4 -0
- package/dist/api/chat/chat-conversation.type.d.ts +7 -0
- package/dist/api/chat/chat-message.type.d.ts +7 -0
- package/dist/api/chat/chat-person.type.d.ts +5 -0
- package/dist/api/clinic/clinic-online-refund-status.enum.d.ts +13 -0
- package/dist/api/clinic/clinic-online-refund-status.enum.js +14 -0
- package/dist/api/clinic/clinic-payment.type.d.ts +24 -1
- package/dist/api/clinic/clinic-refusal.enum.d.ts +7 -1
- package/dist/api/clinic/clinic-refusal.enum.js +6 -0
- package/dist/api/clinic/index.d.ts +1 -0
- package/dist/api/clinic/index.js +1 -0
- package/dist/api/commerce/commerce-refusal.enum.d.ts +7 -1
- package/dist/api/commerce/commerce-refusal.enum.js +6 -0
- package/dist/enum/user-permission.enum.d.ts +13 -1
- package/dist/enum/user-permission.enum.js +13 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -322,6 +322,10 @@ Conduit's outbox.
|
|
|
322
322
|
`UniboxAgents` under `@iveri/contracts/unibox`, so the inbox picks agents by name.
|
|
323
323
|
- Version `0.139.0` adds a trainer's notes on a member: `GymTrainerNote`, `GymTrainerNotes`, `SaveGymTrainerNoteRequest`,
|
|
324
324
|
`GymMyTrainerNote` and the `GymRefusal` member `not-their-trainer` under `@iveri/contracts/gym`.
|
|
325
|
+
- Version `0.143.0` adds `billing:payment:refund` (moved off `billing:payment:manage`), `ClinicOnlineRefund`,
|
|
326
|
+
`ClinicOnlineRefundStatus` and `ClinicVisitPayments.onlineRefunds`, and refund members of `ClinicRefusal` and `CommerceRefusal`.
|
|
327
|
+
- Version `0.142.0` adds `isErased` on `ChatPersonCard`, `ChatParticipant` and `ChatMessageSender`, and
|
|
328
|
+
`senderIsErased` on `ChatLastMessagePreview` and `ChatReplyPreview`, so a client can say "Deleted account".
|
|
325
329
|
- Version `0.141.0` adds `TranslationMemory`, `TranslationMemorySuggestion`, `TranslationUse`, the
|
|
326
330
|
`TranslationConsistencyPage`/`Group`/`Variant` shapes and the `TranslationMatchKind` enum under
|
|
327
331
|
`@iveri/contracts/localization`, for translation memory and the consistency report.
|
|
@@ -35,6 +35,8 @@ export interface ChatLastMessagePreview {
|
|
|
35
35
|
*/
|
|
36
36
|
systemVariables: Nullable<Record<string, string>>;
|
|
37
37
|
senderName: Nullable<string>;
|
|
38
|
+
/** The sender deleted their Baasi account, so `senderName` is empty; see {@link ChatPersonCard.isErased}. */
|
|
39
|
+
senderIsErased: boolean;
|
|
38
40
|
isOwn: boolean;
|
|
39
41
|
isDeleted: boolean;
|
|
40
42
|
sentAt: IsoDateTime;
|
|
@@ -96,6 +98,11 @@ export interface ChatParticipant {
|
|
|
96
98
|
lastReadSeq: Nullable<number>;
|
|
97
99
|
lastActiveAt: Nullable<IsoDateTime>;
|
|
98
100
|
isMe: boolean;
|
|
101
|
+
/**
|
|
102
|
+
* They deleted their Baasi account: their name and photograph are gone, so `displayName` is empty and a client says
|
|
103
|
+
* "Deleted account" in its own words. Never true of an outside app's user, whose app may bring the same id back.
|
|
104
|
+
*/
|
|
105
|
+
isErased: boolean;
|
|
99
106
|
}
|
|
100
107
|
export interface ChatConversation extends ChatConversationSummary {
|
|
101
108
|
participants: ChatParticipant[];
|
|
@@ -8,12 +8,19 @@ export interface ChatMessageSender {
|
|
|
8
8
|
/** The name this conversation shows: a product's label for an embedded one. */
|
|
9
9
|
displayName: string;
|
|
10
10
|
avatar: Nullable<ChatImage>;
|
|
11
|
+
/**
|
|
12
|
+
* They deleted their Baasi account: their name and photograph are gone, so `displayName` is empty and a client says
|
|
13
|
+
* "Deleted account" in its own words. Never true of an outside app's user, whose app may bring the same id back.
|
|
14
|
+
*/
|
|
15
|
+
isErased: boolean;
|
|
11
16
|
}
|
|
12
17
|
/** The message a reply points at, enough to draw the quote above it. */
|
|
13
18
|
export interface ChatReplyPreview {
|
|
14
19
|
id: UUID;
|
|
15
20
|
seq: number;
|
|
16
21
|
senderName: Nullable<string>;
|
|
22
|
+
/** The sender deleted their Baasi account, so `senderName` is empty; see {@link ChatMessageSender.isErased}. */
|
|
23
|
+
senderIsErased: boolean;
|
|
17
24
|
kind: ChatMessageKind;
|
|
18
25
|
excerpt: Nullable<string>;
|
|
19
26
|
isDeleted: boolean;
|
|
@@ -14,6 +14,11 @@ export interface ChatPersonCard {
|
|
|
14
14
|
avatar: Nullable<ChatImage>;
|
|
15
15
|
/** Null when they hide it, or when the reader shares no conversation with them. */
|
|
16
16
|
lastActiveAt: Nullable<IsoDateTime>;
|
|
17
|
+
/**
|
|
18
|
+
* They deleted their Baasi account: their name and photograph are gone, so `displayName` is empty and a client says
|
|
19
|
+
* "Deleted account" in its own words. Never true of an outside app's user, whose app may bring the same id back.
|
|
20
|
+
*/
|
|
21
|
+
isErased: boolean;
|
|
17
22
|
}
|
|
18
23
|
export interface ChatSettings {
|
|
19
24
|
/** Whether people who share a conversation with me can see when I was last active. */
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where giving an online payment back through the bank stands.
|
|
3
|
+
*
|
|
4
|
+
* - `pending`: asked of the bank and not yet confirmed. Nothing is in the ledger yet, and the clinic asks again on its
|
|
5
|
+
* own until the bank answers.
|
|
6
|
+
* - `succeeded`: the bank gave the money back, and the ledger holds a negative `online` line for it.
|
|
7
|
+
* - `failed`: the bank refused or could not; nothing was given back and nothing recorded.
|
|
8
|
+
*/
|
|
9
|
+
export declare enum ClinicOnlineRefundStatus {
|
|
10
|
+
PENDING = "pending",
|
|
11
|
+
SUCCEEDED = "succeeded",
|
|
12
|
+
FAILED = "failed"
|
|
13
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where giving an online payment back through the bank stands.
|
|
3
|
+
*
|
|
4
|
+
* - `pending`: asked of the bank and not yet confirmed. Nothing is in the ledger yet, and the clinic asks again on its
|
|
5
|
+
* own until the bank answers.
|
|
6
|
+
* - `succeeded`: the bank gave the money back, and the ledger holds a negative `online` line for it.
|
|
7
|
+
* - `failed`: the bank refused or could not; nothing was given back and nothing recorded.
|
|
8
|
+
*/
|
|
9
|
+
export var ClinicOnlineRefundStatus;
|
|
10
|
+
(function (ClinicOnlineRefundStatus) {
|
|
11
|
+
ClinicOnlineRefundStatus["PENDING"] = "pending";
|
|
12
|
+
ClinicOnlineRefundStatus["SUCCEEDED"] = "succeeded";
|
|
13
|
+
ClinicOnlineRefundStatus["FAILED"] = "failed";
|
|
14
|
+
})(ClinicOnlineRefundStatus || (ClinicOnlineRefundStatus = {}));
|
|
@@ -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 { ClinicCourse, MyClinicCourse } from './clinic-course.type.js';
|
|
6
|
+
import type { ClinicOnlineRefundStatus } from './clinic-online-refund-status.enum.js';
|
|
6
7
|
import type { ClinicPaymentMethod } from './clinic-payment-method.enum.js';
|
|
7
8
|
import type { LocalizedText } from './localized-text.type.js';
|
|
8
9
|
/** One line in the clinic's ledger. It is never edited: money given back is a new line pointing at it. */
|
|
@@ -23,7 +24,7 @@ export interface ClinicPayment {
|
|
|
23
24
|
/** Why money was given back. Only a refund has one. */
|
|
24
25
|
reason: Nullable<string>;
|
|
25
26
|
note: Nullable<string>;
|
|
26
|
-
/** How much of this can still be given back. Always zero on a refund. */
|
|
27
|
+
/** How much of this can still be given back. Always zero on a refund; less any online refund still pending. */
|
|
27
28
|
refundableMinor: number;
|
|
28
29
|
/** Who took it at the desk, or `null` for a deposit paid online, which nobody recorded by hand. */
|
|
29
30
|
recordedByName: Nullable<string>;
|
|
@@ -46,6 +47,26 @@ export interface ClinicBonusBalance {
|
|
|
46
47
|
currency: string;
|
|
47
48
|
amountMinor: number;
|
|
48
49
|
}
|
|
50
|
+
/**
|
|
51
|
+
* Money a client paid online, being given back through the bank. Only `succeeded` puts a line in the ledger; until then
|
|
52
|
+
* it is this, so the desk can see a refund on its way or one the bank refused.
|
|
53
|
+
*/
|
|
54
|
+
export interface ClinicOnlineRefund {
|
|
55
|
+
id: UUID;
|
|
56
|
+
/** The `online` ledger line being given back. */
|
|
57
|
+
paymentId: UUID;
|
|
58
|
+
/** Positive: how much is being given back. */
|
|
59
|
+
amountMinor: number;
|
|
60
|
+
currency: string;
|
|
61
|
+
status: ClinicOnlineRefundStatus;
|
|
62
|
+
reason: string;
|
|
63
|
+
/** The ledger's negative line, once the bank confirmed. */
|
|
64
|
+
refundPaymentId: Nullable<UUID>;
|
|
65
|
+
requestedByName: Nullable<string>;
|
|
66
|
+
createdAt: IsoDateTime;
|
|
67
|
+
/** When the bank's answer was recorded, either way. */
|
|
68
|
+
settledAt: Nullable<IsoDateTime>;
|
|
69
|
+
}
|
|
49
70
|
/** What reception needs at the desk for one visit. */
|
|
50
71
|
export interface ClinicVisitPayments {
|
|
51
72
|
appointmentId: UUID;
|
|
@@ -59,6 +80,8 @@ export interface ClinicVisitPayments {
|
|
|
59
80
|
paidMinor: number;
|
|
60
81
|
dueMinor: number;
|
|
61
82
|
payments: ClinicPayment[];
|
|
83
|
+
/** Online payments of this visit being given back through the bank, newest first, whatever their state. */
|
|
84
|
+
onlineRefunds: ClinicOnlineRefund[];
|
|
62
85
|
/** This client's bonus in the visit's currency. */
|
|
63
86
|
bonusBalanceMinor: number;
|
|
64
87
|
/** This client's courses that can pay for a line of this visit. */
|
|
@@ -10,5 +10,11 @@ export declare enum ClinicRefusal {
|
|
|
10
10
|
/** Too close to another session of the same treatment; `details.minDaysBetweenSessions` says how far apart. */
|
|
11
11
|
SESSION_GAP = "session-gap",
|
|
12
12
|
/** The chosen specialist does not perform this treatment at this branch. */
|
|
13
|
-
SPECIALIST_INELIGIBLE = "specialist-ineligible"
|
|
13
|
+
SPECIALIST_INELIGIBLE = "specialist-ineligible",
|
|
14
|
+
/** The bank refused to give the online payment back, or could not; nothing was returned and nothing recorded. */
|
|
15
|
+
ONLINE_REFUND_FAILED = "online-refund-failed",
|
|
16
|
+
/** A refund of this online payment is still being confirmed with the bank; wait for it before asking again. */
|
|
17
|
+
ONLINE_REFUND_PENDING = "online-refund-pending",
|
|
18
|
+
/** This clinic cannot give online payments back from here; the money goes back from the payment provider. */
|
|
19
|
+
ONLINE_REFUND_UNAVAILABLE = "online-refund-unavailable"
|
|
14
20
|
}
|
|
@@ -12,4 +12,10 @@ export var ClinicRefusal;
|
|
|
12
12
|
ClinicRefusal["SESSION_GAP"] = "session-gap";
|
|
13
13
|
/** The chosen specialist does not perform this treatment at this branch. */
|
|
14
14
|
ClinicRefusal["SPECIALIST_INELIGIBLE"] = "specialist-ineligible";
|
|
15
|
+
/** The bank refused to give the online payment back, or could not; nothing was returned and nothing recorded. */
|
|
16
|
+
ClinicRefusal["ONLINE_REFUND_FAILED"] = "online-refund-failed";
|
|
17
|
+
/** A refund of this online payment is still being confirmed with the bank; wait for it before asking again. */
|
|
18
|
+
ClinicRefusal["ONLINE_REFUND_PENDING"] = "online-refund-pending";
|
|
19
|
+
/** This clinic cannot give online payments back from here; the money goes back from the payment provider. */
|
|
20
|
+
ClinicRefusal["ONLINE_REFUND_UNAVAILABLE"] = "online-refund-unavailable";
|
|
15
21
|
})(ClinicRefusal || (ClinicRefusal = {}));
|
|
@@ -17,6 +17,7 @@ export * from './clinic-gallery.type.js';
|
|
|
17
17
|
export * from './clinic-media.type.js';
|
|
18
18
|
export * from './clinic-newsletter-channel.enum.js';
|
|
19
19
|
export * from './clinic-newsletter.type.js';
|
|
20
|
+
export * from './clinic-online-refund-status.enum.js';
|
|
20
21
|
export * from './clinic-payment-method.enum.js';
|
|
21
22
|
export * from './clinic-payment.type.js';
|
|
22
23
|
export * from './clinic-profile.type.js';
|
package/dist/api/clinic/index.js
CHANGED
|
@@ -17,6 +17,7 @@ export * from './clinic-gallery.type.js';
|
|
|
17
17
|
export * from './clinic-media.type.js';
|
|
18
18
|
export * from './clinic-newsletter-channel.enum.js';
|
|
19
19
|
export * from './clinic-newsletter.type.js';
|
|
20
|
+
export * from './clinic-online-refund-status.enum.js';
|
|
20
21
|
export * from './clinic-payment-method.enum.js';
|
|
21
22
|
export * from './clinic-payment.type.js';
|
|
22
23
|
export * from './clinic-profile.type.js';
|
|
@@ -43,5 +43,11 @@ export declare enum CommerceRefusal {
|
|
|
43
43
|
* The order, or its shipment, cannot make that move from where it is now, usually because somebody else moved it
|
|
44
44
|
* first; `details.currentStatus` says where it is (merchant only).
|
|
45
45
|
*/
|
|
46
|
-
ORDER_MOVED_ON = "order-moved-on"
|
|
46
|
+
ORDER_MOVED_ON = "order-moved-on",
|
|
47
|
+
/** Only a cancelled order that was paid online can be refunded here, and only once. */
|
|
48
|
+
NOT_REFUNDABLE = "not-refundable",
|
|
49
|
+
/** The bank refused to give the money back, or could not; nothing was returned. Asking again tries once more. */
|
|
50
|
+
REFUND_FAILED = "refund-failed",
|
|
51
|
+
/** A refund of this order is still being confirmed with the bank; it finishes on its own. */
|
|
52
|
+
REFUND_PENDING = "refund-pending"
|
|
47
53
|
}
|
|
@@ -45,4 +45,10 @@ export var CommerceRefusal;
|
|
|
45
45
|
* first; `details.currentStatus` says where it is (merchant only).
|
|
46
46
|
*/
|
|
47
47
|
CommerceRefusal["ORDER_MOVED_ON"] = "order-moved-on";
|
|
48
|
+
/** Only a cancelled order that was paid online can be refunded here, and only once. */
|
|
49
|
+
CommerceRefusal["NOT_REFUNDABLE"] = "not-refundable";
|
|
50
|
+
/** The bank refused to give the money back, or could not; nothing was returned. Asking again tries once more. */
|
|
51
|
+
CommerceRefusal["REFUND_FAILED"] = "refund-failed";
|
|
52
|
+
/** A refund of this order is still being confirmed with the bank; it finishes on its own. */
|
|
53
|
+
CommerceRefusal["REFUND_PENDING"] = "refund-pending";
|
|
48
54
|
})(CommerceRefusal || (CommerceRefusal = {}));
|
|
@@ -305,7 +305,19 @@ export declare enum UserPermission {
|
|
|
305
305
|
*/
|
|
306
306
|
BILLING_PAYMENT_CHECKOUT = "billing:payment:checkout",
|
|
307
307
|
/**
|
|
308
|
-
*
|
|
308
|
+
* Give money back from a verified payment, in full or in part. **Separate from `manage` for the same reason as
|
|
309
|
+
* `checkout`:** a clinic giving a deposit back, or a shop refunding an order it cancelled, needs this one thing,
|
|
310
|
+
* and `manage` would also let it charge a saved card again and read or write the merchant's bank credentials.
|
|
311
|
+
*
|
|
312
|
+
* **Moved rather than added**, like `checkout`: nothing outside billing called the refund route before this, so
|
|
313
|
+
* narrowing it cost no backfill. `manage` no longer opens it. It carries no read; the refund's own answer is the
|
|
314
|
+
* outcome, and `billing:payment:read` still reads the session it belongs to.
|
|
315
|
+
*/
|
|
316
|
+
BILLING_PAYMENT_REFUND = "billing:payment:refund",
|
|
317
|
+
/**
|
|
318
|
+
* Operate recurring authorizations and charges, reconciliation, and merchant credentials.
|
|
319
|
+
*
|
|
320
|
+
* Refunds moved to {@link UserPermission.BILLING_PAYMENT_REFUND} on the same terms.
|
|
309
321
|
*
|
|
310
322
|
* Creating a payment session moved to {@link UserPermission.BILLING_PAYMENT_CHECKOUT}. That was
|
|
311
323
|
* affordable as a move rather than an addition because **nothing in the fleet called that route
|
|
@@ -358,7 +358,19 @@ export var UserPermission;
|
|
|
358
358
|
*/
|
|
359
359
|
UserPermission["BILLING_PAYMENT_CHECKOUT"] = "billing:payment:checkout";
|
|
360
360
|
/**
|
|
361
|
-
*
|
|
361
|
+
* Give money back from a verified payment, in full or in part. **Separate from `manage` for the same reason as
|
|
362
|
+
* `checkout`:** a clinic giving a deposit back, or a shop refunding an order it cancelled, needs this one thing,
|
|
363
|
+
* and `manage` would also let it charge a saved card again and read or write the merchant's bank credentials.
|
|
364
|
+
*
|
|
365
|
+
* **Moved rather than added**, like `checkout`: nothing outside billing called the refund route before this, so
|
|
366
|
+
* narrowing it cost no backfill. `manage` no longer opens it. It carries no read; the refund's own answer is the
|
|
367
|
+
* outcome, and `billing:payment:read` still reads the session it belongs to.
|
|
368
|
+
*/
|
|
369
|
+
UserPermission["BILLING_PAYMENT_REFUND"] = "billing:payment:refund";
|
|
370
|
+
/**
|
|
371
|
+
* Operate recurring authorizations and charges, reconciliation, and merchant credentials.
|
|
372
|
+
*
|
|
373
|
+
* Refunds moved to {@link UserPermission.BILLING_PAYMENT_REFUND} on the same terms.
|
|
362
374
|
*
|
|
363
375
|
* Creating a payment session moved to {@link UserPermission.BILLING_PAYMENT_CHECKOUT}. That was
|
|
364
376
|
* affordable as a move rather than an addition because **nothing in the fleet called that route
|