@iveri/contracts 0.153.0 → 0.155.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.
Files changed (50) hide show
  1. package/README.md +6 -0
  2. package/dist/api/chat/chat-limits.constant.d.ts +10 -0
  3. package/dist/api/chat/chat-limits.constant.js +10 -0
  4. package/dist/api/chat/chat-message-kind.enum.d.ts +2 -0
  5. package/dist/api/chat/chat-message-kind.enum.js +2 -0
  6. package/dist/api/chat/chat-message.type.d.ts +82 -0
  7. package/dist/api/chat/chat-refusal.enum.d.ts +4 -0
  8. package/dist/api/chat/chat-refusal.enum.js +4 -0
  9. package/dist/api/clinic/clinic-public.type.d.ts +3 -0
  10. package/dist/api/clinic/clinic-refusal.enum.d.ts +55 -1
  11. package/dist/api/clinic/clinic-refusal.enum.js +54 -0
  12. package/dist/api/clinic/clinic-review-limits.constant.d.ts +2 -0
  13. package/dist/api/clinic/clinic-review-limits.constant.js +2 -0
  14. package/dist/api/clinic/clinic-review-reply.type.d.ts +13 -0
  15. package/dist/api/clinic/clinic-review-reply.type.js +1 -0
  16. package/dist/api/clinic/clinic-review.type.d.ts +3 -0
  17. package/dist/api/clinic/index.d.ts +2 -0
  18. package/dist/api/clinic/index.js +2 -0
  19. package/dist/api/gym/gym-challenge-metric.enum.d.ts +7 -0
  20. package/dist/api/gym/gym-challenge-metric.enum.js +8 -0
  21. package/dist/api/gym/gym-challenge-phase.enum.d.ts +6 -0
  22. package/dist/api/gym/gym-challenge-phase.enum.js +7 -0
  23. package/dist/api/gym/gym-challenge.type.d.ts +94 -0
  24. package/dist/api/gym/gym-challenge.type.js +1 -0
  25. package/dist/api/gym/gym-refusal.enum.d.ts +10 -1
  26. package/dist/api/gym/gym-refusal.enum.js +9 -0
  27. package/dist/api/gym/index.d.ts +3 -0
  28. package/dist/api/gym/index.js +3 -0
  29. package/dist/api/restaurant/restaurant-reservation.type.d.ts +21 -0
  30. package/dist/api/social/index.d.ts +1 -0
  31. package/dist/api/social/index.js +1 -0
  32. package/dist/api/social/social-comment-audience.enum.d.ts +14 -0
  33. package/dist/api/social/social-comment-audience.enum.js +15 -0
  34. package/dist/api/social/social-limits.constant.d.ts +2 -0
  35. package/dist/api/social/social-limits.constant.js +2 -0
  36. package/dist/api/social/social-member.type.d.ts +3 -0
  37. package/dist/api/social/social-post.type.d.ts +13 -0
  38. package/dist/api/social/social-refusal.enum.d.ts +4 -0
  39. package/dist/api/social/social-refusal.enum.js +4 -0
  40. package/dist/api/taxi/index.d.ts +2 -0
  41. package/dist/api/taxi/index.js +2 -0
  42. package/dist/api/taxi/taxi-admin.type.d.ts +37 -1
  43. package/dist/api/taxi/taxi-cancellation-reason.enum.d.ts +13 -0
  44. package/dist/api/taxi/taxi-cancellation-reason.enum.js +14 -0
  45. package/dist/api/taxi/taxi-expiry-kind.enum.d.ts +12 -0
  46. package/dist/api/taxi/taxi-expiry-kind.enum.js +13 -0
  47. package/dist/api/unibox/message.type.d.ts +19 -0
  48. package/dist/api/unibox/unibox-refusal.enum.d.ts +11 -1
  49. package/dist/api/unibox/unibox-refusal.enum.js +10 -0
  50. package/package.json +1 -1
package/README.md CHANGED
@@ -324,6 +324,12 @@ Conduit's outbox.
324
324
  `UniboxAgents` under `@iveri/contracts/unibox`, so the inbox picks agents by name.
325
325
  - Version `0.139.0` adds a trainer's notes on a member: `GymTrainerNote`, `GymTrainerNotes`, `SaveGymTrainerNoteRequest`,
326
326
  `GymMyTrainerNote` and the `GymRefusal` member `not-their-trainer` under `@iveri/contracts/gym`.
327
+ - Version `0.155.0` adds gym-wide challenges (`GymChallenge`, `GymMyChallenge`, standings and three `GymRefusal`
328
+ members), polls in Baasi groups and message forwarding (`ChatMessageKind.POLL`, `ChatPoll`, forwarding shapes and
329
+ refusals), a diner moving their own restaurant booking and a guest's history on the booking book, the clinic's public
330
+ reply to a review and 27 `ClinicRefusal` members, and Ezo's pinned posts and comment audience.
331
+ - Version `0.154.0` lets an agent send a failed Unibox reply again: `Message.resendOfMessageId`,
332
+ `ResendMessageResponse`, and the `UniboxRefusal` members `reply-not-failed` and `handed-over`.
327
333
  - Version `0.153.0` adds `UserPermission.CONDUIT_DISPATCH_READ_ANY` (`conduit:dispatch:read-any`, a platform
328
334
  permission) and `MarkConversationReadBody` under `@iveri/contracts/unibox`.
329
335
  - Version `0.152.0` adds the glossary shapes under `@iveri/contracts/localization` (`GlossaryTerm`,
@@ -10,6 +10,16 @@ export declare const CHAT_GROUP_DESCRIPTION_MAX_LENGTH = 500;
10
10
  export declare const CHAT_MENTIONS_PER_MESSAGE = 50;
11
11
  /** How many messages one conversation can hold pinned at once. */
12
12
  export declare const CHAT_PINNED_MESSAGE_LIMIT = 10;
13
+ /** How many conversations one message can be forwarded to at once. */
14
+ export declare const CHAT_FORWARD_TARGETS = 5;
15
+ /** The longest poll question. */
16
+ export declare const CHAT_POLL_QUESTION_MAX_LENGTH = 300;
17
+ /** The longest poll answer. */
18
+ export declare const CHAT_POLL_OPTION_MAX_LENGTH = 100;
19
+ /** The fewest answers a poll offers. */
20
+ export declare const CHAT_POLL_MIN_OPTIONS = 2;
21
+ /** The most answers a poll offers. */
22
+ export declare const CHAT_POLL_MAX_OPTIONS = 10;
13
23
  /** How long after sending a message its author may still change it. */
14
24
  export declare const CHAT_EDIT_WINDOW_HOURS = 48;
15
25
  /** How long after sending a message its author may still delete it for everyone. */
@@ -10,6 +10,16 @@ export const CHAT_GROUP_DESCRIPTION_MAX_LENGTH = 500;
10
10
  export const CHAT_MENTIONS_PER_MESSAGE = 50;
11
11
  /** How many messages one conversation can hold pinned at once. */
12
12
  export const CHAT_PINNED_MESSAGE_LIMIT = 10;
13
+ /** How many conversations one message can be forwarded to at once. */
14
+ export const CHAT_FORWARD_TARGETS = 5;
15
+ /** The longest poll question. */
16
+ export const CHAT_POLL_QUESTION_MAX_LENGTH = 300;
17
+ /** The longest poll answer. */
18
+ export const CHAT_POLL_OPTION_MAX_LENGTH = 100;
19
+ /** The fewest answers a poll offers. */
20
+ export const CHAT_POLL_MIN_OPTIONS = 2;
21
+ /** The most answers a poll offers. */
22
+ export const CHAT_POLL_MAX_OPTIONS = 10;
13
23
  /** How long after sending a message its author may still change it. */
14
24
  export const CHAT_EDIT_WINDOW_HOURS = 48;
15
25
  /** How long after sending a message its author may still delete it for everyone. */
@@ -4,5 +4,7 @@ export declare enum ChatMessageKind {
4
4
  PHOTO = "photo",
5
5
  FILE = "file",
6
6
  VOICE = "voice",
7
+ /** A question with answers the people in a group choose between; the question is the message's body. */
8
+ POLL = "poll",
7
9
  SYSTEM = "system"
8
10
  }
@@ -5,5 +5,7 @@ export var ChatMessageKind;
5
5
  ChatMessageKind["PHOTO"] = "photo";
6
6
  ChatMessageKind["FILE"] = "file";
7
7
  ChatMessageKind["VOICE"] = "voice";
8
+ /** A question with answers the people in a group choose between; the question is the message's body. */
9
+ ChatMessageKind["POLL"] = "poll";
8
10
  ChatMessageKind["SYSTEM"] = "system";
9
11
  })(ChatMessageKind || (ChatMessageKind = {}));
@@ -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 { ChatAttachment, ChatImage } from './chat-attachment.type.js';
5
5
  import type { ChatMessageKind } from './chat-message-kind.enum.js';
6
+ import type { ChatRefusal } from './chat-refusal.enum.js';
6
7
  export interface ChatMessageSender {
7
8
  userId: UUID;
8
9
  /** The name this conversation shows: a product's label for an embedded one. */
@@ -30,6 +31,28 @@ export interface ChatMention {
30
31
  userId: UUID;
31
32
  displayName: string;
32
33
  }
34
+ /** One answer of a poll, as one reader sees it. */
35
+ export interface ChatPollOption {
36
+ /** Its place in the poll, from 0. A vote names answers by it. */
37
+ index: number;
38
+ text: string;
39
+ voteCount: number;
40
+ isMine: boolean;
41
+ }
42
+ /** A poll in a group. The question is the message's `body`. */
43
+ export interface ChatPoll {
44
+ options: ChatPollOption[];
45
+ /** Whether somebody may choose more than one answer. */
46
+ allowsMultiple: boolean;
47
+ /** Nobody, its author included, can see who chose what: only the counts. Chosen when the poll is made. */
48
+ isAnonymous: boolean;
49
+ /** How many people have voted, each counted once however many answers they chose. */
50
+ voterCount: number;
51
+ /** Set once its author, or a group owner or admin, closed it. A closed poll keeps its votes and takes no more. */
52
+ closedAt: Nullable<IsoDateTime>;
53
+ /** Whether this reader may close it: its author while it is open, or a group owner or admin. */
54
+ canClose: boolean;
55
+ }
33
56
  export interface ChatReactionSummary {
34
57
  emoji: string;
35
58
  count: number;
@@ -58,6 +81,13 @@ export interface ChatMessage {
58
81
  * `@` and the name as typed; a client draws each `@displayName` it finds here as a mention.
59
82
  */
60
83
  mentions: ChatMention[];
84
+ /** A poll's answers and votes when `kind` is `poll` and it is not deleted, otherwise null. */
85
+ poll: Nullable<ChatPoll>;
86
+ /**
87
+ * Somebody forwarded it here from another conversation. Who first wrote it is never carried: the people here may
88
+ * not know them, and they did not choose to speak here.
89
+ */
90
+ isForwarded: boolean;
61
91
  /** Set while the message is pinned at the top of its conversation. */
62
92
  pinnedAt: Nullable<IsoDateTime>;
63
93
  isOwn: boolean;
@@ -84,6 +114,58 @@ export interface SendChatMessageRequest {
84
114
  * name somebody left with does not fail the send. At most `CHAT_MENTIONS_PER_MESSAGE`.
85
115
  */
86
116
  mentionUserIds?: UUID[];
117
+ /** A poll in a group people made themselves, with no body and no attachments. */
118
+ poll?: CreateChatPollRequest;
119
+ }
120
+ /** A poll to send, in place of a body and attachments. */
121
+ export interface CreateChatPollRequest {
122
+ /** At most `CHAT_POLL_QUESTION_MAX_LENGTH`. */
123
+ question: string;
124
+ /** `CHAT_POLL_MIN_OPTIONS` to `CHAT_POLL_MAX_OPTIONS` answers, each at most `CHAT_POLL_OPTION_MAX_LENGTH`, no two alike. */
125
+ options: string[];
126
+ allowsMultiple?: boolean;
127
+ /** Defaults to true: nobody sees who chose what unless the author asks for it. */
128
+ isAnonymous?: boolean;
129
+ }
130
+ /** A vote, replacing any earlier one. An empty list takes the vote back. */
131
+ export interface VoteChatPollRequest {
132
+ /** The answers chosen, by `ChatPollOption.index`; one unless the poll allows several. */
133
+ optionIndexes: number[];
134
+ }
135
+ /** Who chose each answer of a poll that is not anonymous. */
136
+ export interface ChatPollVoters {
137
+ options: ChatPollOptionVoters[];
138
+ }
139
+ export interface ChatPollOptionVoters {
140
+ index: number;
141
+ voters: ChatPollVoter[];
142
+ }
143
+ export interface ChatPollVoter {
144
+ userId: UUID;
145
+ displayName: string;
146
+ avatar: Nullable<ChatImage>;
147
+ /** See {@link ChatMessageSender.isErased}. */
148
+ isErased: boolean;
149
+ }
150
+ /** One conversation to forward a message into. */
151
+ export interface ForwardChatMessageTarget {
152
+ conversationId: UUID;
153
+ /** Chosen by the client per target, so a retry forwards nothing twice. */
154
+ clientMessageId: UUID;
155
+ }
156
+ /** Forward a message into up to `CHAT_FORWARD_TARGETS` conversations, each a direct or group conversation. */
157
+ export interface ForwardChatMessageRequest {
158
+ targets: ForwardChatMessageTarget[];
159
+ }
160
+ /** What happened in each conversation, in the order asked. One refused target leaves the others sent. */
161
+ export interface ForwardChatMessageResult {
162
+ results: ForwardChatMessageOutcome[];
163
+ }
164
+ export interface ForwardChatMessageOutcome {
165
+ conversationId: UUID;
166
+ /** The new message, or the first one again on a retry; null when refused. */
167
+ message: Nullable<ChatMessage>;
168
+ refusal: Nullable<ChatRefusal>;
87
169
  }
88
170
  export interface EditChatMessageRequest {
89
171
  body: string;
@@ -15,6 +15,10 @@ export declare enum ChatRefusal {
15
15
  MESSAGE_PIN_LIMIT = "message-pin-limit",
16
16
  /** Only the group's owners and admins write here. */
17
17
  ADMINS_ONLY = "admins-only",
18
+ /** The poll is closed and takes no more votes. */
19
+ POLL_CLOSED = "poll-closed",
20
+ /** Polls are for groups people made themselves, and forwarding is between conversations people started. */
21
+ NOT_IN_THIS_CONVERSATION = "not-in-this-conversation",
18
22
  LAST_OWNER = "last-owner",
19
23
  INVITATION_EXPIRED = "invitation-expired",
20
24
  SUSPENDED = "suspended",
@@ -16,6 +16,10 @@ export var ChatRefusal;
16
16
  ChatRefusal["MESSAGE_PIN_LIMIT"] = "message-pin-limit";
17
17
  /** Only the group's owners and admins write here. */
18
18
  ChatRefusal["ADMINS_ONLY"] = "admins-only";
19
+ /** The poll is closed and takes no more votes. */
20
+ ChatRefusal["POLL_CLOSED"] = "poll-closed";
21
+ /** Polls are for groups people made themselves, and forwarding is between conversations people started. */
22
+ ChatRefusal["NOT_IN_THIS_CONVERSATION"] = "not-in-this-conversation";
19
23
  ChatRefusal["LAST_OWNER"] = "last-owner";
20
24
  ChatRefusal["INVITATION_EXPIRED"] = "invitation-expired";
21
25
  ChatRefusal["SUSPENDED"] = "suspended";
@@ -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 { ClinicMediaImage } from './clinic-media.type.js';
5
5
  import type { ClinicSocialLinks } from './clinic-profile.type.js';
6
+ import type { ClinicReviewReply } from './clinic-review-reply.type.js';
6
7
  import type { ClinicWorkingPeriod } from './clinic-staff.type.js';
7
8
  import type { ClinicTreatmentContent } from './clinic-treatment.type.js';
8
9
  import type { LocalizedText } from './localized-text.type.js';
@@ -109,6 +110,8 @@ export interface PublicReview {
109
110
  staffMemberId: UUID;
110
111
  specialistName: string;
111
112
  createdAt: IsoDateTime;
113
+ /** The clinic's answer, or null. */
114
+ reply: Nullable<ClinicReviewReply>;
112
115
  }
113
116
  /** The newest published reviews, and what all of those matching the filter add up to. */
114
117
  export interface PublicReviewList {
@@ -18,5 +18,59 @@ export declare enum ClinicRefusal {
18
18
  /** This clinic cannot give online payments back from here; the money goes back from the payment provider. */
19
19
  ONLINE_REFUND_UNAVAILABLE = "online-refund-unavailable",
20
20
  /** The date is further ahead than the clinic takes bookings; `details.bookingHorizonDays` says how far. */
21
- BEYOND_BOOKING_HORIZON = "beyond-booking-horizon"
21
+ BEYOND_BOOKING_HORIZON = "beyond-booking-horizon",
22
+ /** The visit can no longer be cancelled online (too close to its time, or no longer booked); the clinic can. */
23
+ CANCEL_CLOSED = "cancel-closed",
24
+ /** The visit can no longer be moved online (too close to its time, or no longer booked); the clinic can. */
25
+ MOVE_CLOSED = "move-closed",
26
+ /** This visit has already been reviewed; there is one review per visit. */
27
+ ALREADY_REVIEWED = "already-reviewed",
28
+ /** The consent form changed while it was being read; the new version has to be read before signing. */
29
+ CONSENT_CHANGED = "consent-changed",
30
+ /** The visit is not waiting for a deposit any more (paid, or the time was released). */
31
+ DEPOSIT_NOT_DUE = "deposit-not-due",
32
+ /** Somebody changed the visit first; `details.currentStatus` is what it is now. */
33
+ VISIT_MOVED_ON = "visit-moved-on",
34
+ /** A session is written up only once the client has checked in. */
35
+ NOT_CHECKED_IN = "not-checked-in",
36
+ /** This session has already been written up; correct the entry instead. */
37
+ SESSION_LOGGED = "session-logged",
38
+ /** This entry has already been corrected; correct the newest one. */
39
+ ENTRY_CORRECTED = "entry-corrected",
40
+ /** The screening questions have not been answered for this visit. */
41
+ SCREENING_MISSING = "screening-missing",
42
+ /** The treatment's current consent form has not been signed for this visit. */
43
+ CONSENT_MISSING = "consent-missing",
44
+ /** The visit was cancelled or nobody came, so nothing can be paid towards it. */
45
+ VISIT_NOT_HELD = "visit-not-held",
46
+ /** The visit is already paid in full. */
47
+ VISIT_PAID = "visit-paid",
48
+ /** The amount is more than the visit still owes; `details.dueMinor` is what it owes. */
49
+ MORE_THAN_DUE = "more-than-due",
50
+ /** The course has no sessions left. */
51
+ COURSE_USED_UP = "course-used-up",
52
+ /** The course covers nothing on this visit. */
53
+ COURSE_NOT_APPLICABLE = "course-not-applicable",
54
+ /** The part of the visit the course covers is already paid for. */
55
+ COURSE_PART_SETTLED = "course-part-settled",
56
+ /** The course is no longer sold. */
57
+ COURSE_RETIRED = "course-retired",
58
+ /** This payment has already been given back in full. */
59
+ ALREADY_REFUNDED = "already-refunded",
60
+ /** The amount is more than is left to give back; `details.remainingMinor` is what is left. */
61
+ MORE_THAN_REFUNDABLE = "more-than-refundable",
62
+ /** The client does not hold that much bonus. */
63
+ BONUS_INSUFFICIENT = "bonus-insufficient",
64
+ /** A treatment keeps at least one option, so its last one cannot be removed. */
65
+ LAST_OPTION = "last-option",
66
+ /** This clinic does not take payments online, so it cannot ask for a deposit or set a rule for one. */
67
+ DEPOSITS_UNAVAILABLE = "deposits-unavailable",
68
+ /** The clinic's public address changes only while it is unpublished. */
69
+ UNPUBLISH_FIRST = "unpublish-first",
70
+ /** Another article already uses this address. */
71
+ ARTICLE_ADDRESS_TAKEN = "article-address-taken",
72
+ /** The picture is larger than allowed; `details.maxMegabytes` says how large it may be. */
73
+ PICTURE_TOO_LARGE = "picture-too-large",
74
+ /** The picture is not a JPEG, PNG or WebP, or could not be read. */
75
+ PICTURE_UNREADABLE = "picture-unreadable"
22
76
  }
@@ -20,4 +20,58 @@ export var ClinicRefusal;
20
20
  ClinicRefusal["ONLINE_REFUND_UNAVAILABLE"] = "online-refund-unavailable";
21
21
  /** The date is further ahead than the clinic takes bookings; `details.bookingHorizonDays` says how far. */
22
22
  ClinicRefusal["BEYOND_BOOKING_HORIZON"] = "beyond-booking-horizon";
23
+ /** The visit can no longer be cancelled online (too close to its time, or no longer booked); the clinic can. */
24
+ ClinicRefusal["CANCEL_CLOSED"] = "cancel-closed";
25
+ /** The visit can no longer be moved online (too close to its time, or no longer booked); the clinic can. */
26
+ ClinicRefusal["MOVE_CLOSED"] = "move-closed";
27
+ /** This visit has already been reviewed; there is one review per visit. */
28
+ ClinicRefusal["ALREADY_REVIEWED"] = "already-reviewed";
29
+ /** The consent form changed while it was being read; the new version has to be read before signing. */
30
+ ClinicRefusal["CONSENT_CHANGED"] = "consent-changed";
31
+ /** The visit is not waiting for a deposit any more (paid, or the time was released). */
32
+ ClinicRefusal["DEPOSIT_NOT_DUE"] = "deposit-not-due";
33
+ /** Somebody changed the visit first; `details.currentStatus` is what it is now. */
34
+ ClinicRefusal["VISIT_MOVED_ON"] = "visit-moved-on";
35
+ /** A session is written up only once the client has checked in. */
36
+ ClinicRefusal["NOT_CHECKED_IN"] = "not-checked-in";
37
+ /** This session has already been written up; correct the entry instead. */
38
+ ClinicRefusal["SESSION_LOGGED"] = "session-logged";
39
+ /** This entry has already been corrected; correct the newest one. */
40
+ ClinicRefusal["ENTRY_CORRECTED"] = "entry-corrected";
41
+ /** The screening questions have not been answered for this visit. */
42
+ ClinicRefusal["SCREENING_MISSING"] = "screening-missing";
43
+ /** The treatment's current consent form has not been signed for this visit. */
44
+ ClinicRefusal["CONSENT_MISSING"] = "consent-missing";
45
+ /** The visit was cancelled or nobody came, so nothing can be paid towards it. */
46
+ ClinicRefusal["VISIT_NOT_HELD"] = "visit-not-held";
47
+ /** The visit is already paid in full. */
48
+ ClinicRefusal["VISIT_PAID"] = "visit-paid";
49
+ /** The amount is more than the visit still owes; `details.dueMinor` is what it owes. */
50
+ ClinicRefusal["MORE_THAN_DUE"] = "more-than-due";
51
+ /** The course has no sessions left. */
52
+ ClinicRefusal["COURSE_USED_UP"] = "course-used-up";
53
+ /** The course covers nothing on this visit. */
54
+ ClinicRefusal["COURSE_NOT_APPLICABLE"] = "course-not-applicable";
55
+ /** The part of the visit the course covers is already paid for. */
56
+ ClinicRefusal["COURSE_PART_SETTLED"] = "course-part-settled";
57
+ /** The course is no longer sold. */
58
+ ClinicRefusal["COURSE_RETIRED"] = "course-retired";
59
+ /** This payment has already been given back in full. */
60
+ ClinicRefusal["ALREADY_REFUNDED"] = "already-refunded";
61
+ /** The amount is more than is left to give back; `details.remainingMinor` is what is left. */
62
+ ClinicRefusal["MORE_THAN_REFUNDABLE"] = "more-than-refundable";
63
+ /** The client does not hold that much bonus. */
64
+ ClinicRefusal["BONUS_INSUFFICIENT"] = "bonus-insufficient";
65
+ /** A treatment keeps at least one option, so its last one cannot be removed. */
66
+ ClinicRefusal["LAST_OPTION"] = "last-option";
67
+ /** This clinic does not take payments online, so it cannot ask for a deposit or set a rule for one. */
68
+ ClinicRefusal["DEPOSITS_UNAVAILABLE"] = "deposits-unavailable";
69
+ /** The clinic's public address changes only while it is unpublished. */
70
+ ClinicRefusal["UNPUBLISH_FIRST"] = "unpublish-first";
71
+ /** Another article already uses this address. */
72
+ ClinicRefusal["ARTICLE_ADDRESS_TAKEN"] = "article-address-taken";
73
+ /** The picture is larger than allowed; `details.maxMegabytes` says how large it may be. */
74
+ ClinicRefusal["PICTURE_TOO_LARGE"] = "picture-too-large";
75
+ /** The picture is not a JPEG, PNG or WebP, or could not be read. */
76
+ ClinicRefusal["PICTURE_UNREADABLE"] = "picture-unreadable";
23
77
  })(ClinicRefusal || (ClinicRefusal = {}));
@@ -0,0 +1,2 @@
1
+ /** The longest the clinic's public answer to a review may be, after trimming. */
2
+ export declare const CLINIC_REVIEW_REPLY_MAX_LENGTH = 2000;
@@ -0,0 +1,2 @@
1
+ /** The longest the clinic's public answer to a review may be, after trimming. */
2
+ export const CLINIC_REVIEW_REPLY_MAX_LENGTH = 2000;
@@ -0,0 +1,13 @@
1
+ import type { IsoDateTime } from '../../type/iso-date-time.type.js';
2
+ /**
3
+ * The clinic's one public answer to a review, shown under it once the review is published. It names no member of staff:
4
+ * it is the clinic speaking. Plain text, written in whichever language the clinic answers in.
5
+ */
6
+ export interface ClinicReviewReply {
7
+ body: string;
8
+ repliedAt: IsoDateTime;
9
+ }
10
+ /** The clinic's answer to a review, written or replaced. Plain text, trimmed, at most 2000 characters. */
11
+ export interface ClinicReviewReplyBody {
12
+ body: string;
13
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -1,6 +1,7 @@
1
1
  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
+ import type { ClinicReviewReply } from './clinic-review-reply.type.js';
4
5
  import type { ClinicReviewStatus } from './clinic-review-status.enum.js';
5
6
  import type { LocalizedText } from './localized-text.type.js';
6
7
  /** A client's review of a visit they actually had, as the clinic's staff read it. */
@@ -18,6 +19,8 @@ export interface ClinicReview {
18
19
  /** Whether the client agreed to be named once this is published. */
19
20
  isNamePublic: boolean;
20
21
  status: ClinicReviewStatus;
22
+ /** The clinic's public answer, or null. It can be written whatever the status, and the public sees it only once the review is published. */
23
+ reply: Nullable<ClinicReviewReply>;
21
24
  createdAt: IsoDateTime;
22
25
  }
23
26
  export interface ChangeClinicReviewStatusRequest {
@@ -31,6 +31,8 @@ export * from './clinic-record-method.enum.js';
31
31
  export * from './clinic-refusal.enum.js';
32
32
  export * from './clinic-record.type.js';
33
33
  export * from './clinic-resource-status.enum.js';
34
+ export * from './clinic-review-limits.constant.js';
35
+ export * from './clinic-review-reply.type.js';
34
36
  export * from './clinic-review-status.enum.js';
35
37
  export * from './clinic-review.type.js';
36
38
  export * from './clinic-room.type.js';
@@ -31,6 +31,8 @@ export * from './clinic-record-method.enum.js';
31
31
  export * from './clinic-refusal.enum.js';
32
32
  export * from './clinic-record.type.js';
33
33
  export * from './clinic-resource-status.enum.js';
34
+ export * from './clinic-review-limits.constant.js';
35
+ export * from './clinic-review-reply.type.js';
34
36
  export * from './clinic-review-status.enum.js';
35
37
  export * from './clinic-review.type.js';
36
38
  export * from './clinic-room.type.js';
@@ -0,0 +1,7 @@
1
+ /** What a challenge counts. Both are read from what the gym already records, never typed in by a member. */
2
+ export declare enum GymChallengeMetric {
3
+ /** Days the member came in or logged a workout, once each however many times, in the gym's own calendar. */
4
+ ACTIVE_DAYS = "active-days",
5
+ /** Classes the member was marked as attending. Personal training is not a class. */
6
+ CLASSES = "classes"
7
+ }
@@ -0,0 +1,8 @@
1
+ /** What a challenge counts. Both are read from what the gym already records, never typed in by a member. */
2
+ export var GymChallengeMetric;
3
+ (function (GymChallengeMetric) {
4
+ /** Days the member came in or logged a workout, once each however many times, in the gym's own calendar. */
5
+ GymChallengeMetric["ACTIVE_DAYS"] = "active-days";
6
+ /** Classes the member was marked as attending. Personal training is not a class. */
7
+ GymChallengeMetric["CLASSES"] = "classes";
8
+ })(GymChallengeMetric || (GymChallengeMetric = {}));
@@ -0,0 +1,6 @@
1
+ /** Where a challenge stands on the member's own calendar today. */
2
+ export declare enum GymChallengePhase {
3
+ UPCOMING = "upcoming",
4
+ RUNNING = "running",
5
+ ENDED = "ended"
6
+ }
@@ -0,0 +1,7 @@
1
+ /** Where a challenge stands on the member's own calendar today. */
2
+ export var GymChallengePhase;
3
+ (function (GymChallengePhase) {
4
+ GymChallengePhase["UPCOMING"] = "upcoming";
5
+ GymChallengePhase["RUNNING"] = "running";
6
+ GymChallengePhase["ENDED"] = "ended";
7
+ })(GymChallengePhase || (GymChallengePhase = {}));
@@ -0,0 +1,94 @@
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 '../clinic/localized-text.type.js';
5
+ import type { GymChallengeMetric } from './gym-challenge-metric.enum.js';
6
+ import type { GymChallengePhase } from './gym-challenge-phase.enum.js';
7
+ import type { GymResourceStatus } from './gym-resource-status.enum.js';
8
+ /**
9
+ * A gym-wide challenge as its staff see it: count something between two dates and reach a target.
10
+ *
11
+ * Every member takes part; nobody joins. Progress is read from the door, the workout log and class attendance, so a
12
+ * member cannot claim it and the desk never types it in. Members see only their own progress, never anybody else's.
13
+ */
14
+ export interface GymChallenge {
15
+ id: UUID;
16
+ title: LocalizedText;
17
+ description: Nullable<LocalizedText>;
18
+ /** What the desk hands to somebody who finished, in the gym's words. Null when there is nothing to hand out. */
19
+ reward: Nullable<LocalizedText>;
20
+ metric: GymChallengeMetric;
21
+ target: number;
22
+ /** First counted day, in the gym's own calendar. */
23
+ startsOn: string;
24
+ /** Last counted day, inclusive. */
25
+ endsOn: string;
26
+ /** An inactive challenge is hidden from members and no longer counted in their screens. */
27
+ status: GymResourceStatus;
28
+ /** Members who have reached the target so far. */
29
+ completedCount: number;
30
+ /** Of those, how many have been given the reward at the desk. */
31
+ rewardsGivenCount: number;
32
+ createdAt: IsoDateTime;
33
+ updatedAt: IsoDateTime;
34
+ }
35
+ /**
36
+ * Adding a challenge. `target` is 1 to 500; for `active-days` it may not exceed the number of days the challenge runs.
37
+ * A challenge runs at most 366 days.
38
+ */
39
+ export interface CreateGymChallengeRequest {
40
+ title: LocalizedText;
41
+ description?: Nullable<LocalizedText>;
42
+ reward?: Nullable<LocalizedText>;
43
+ metric: GymChallengeMetric;
44
+ target: number;
45
+ startsOn: string;
46
+ endsOn: string;
47
+ }
48
+ /**
49
+ * Changing a challenge. The wording and the status may always change; the metric, target and dates only before the
50
+ * first counted day, so nobody's finish is moved under them (`challenge-started`).
51
+ */
52
+ export interface UpdateGymChallengeRequest {
53
+ title?: LocalizedText;
54
+ description?: Nullable<LocalizedText>;
55
+ reward?: Nullable<LocalizedText>;
56
+ metric?: GymChallengeMetric;
57
+ target?: number;
58
+ startsOn?: string;
59
+ endsOn?: string;
60
+ status?: GymResourceStatus;
61
+ }
62
+ /** One member's progress in a challenge, as the staff see it. Only members who have counted anything are listed. */
63
+ export interface GymChallengeStanding {
64
+ memberId: UUID;
65
+ /** The short number on the member's card. */
66
+ memberCode: string;
67
+ displayName: string;
68
+ progress: number;
69
+ /** The day the member reached the target, or null while they have not. */
70
+ completedOn: Nullable<string>;
71
+ /** When the desk recorded handing over the reward, or null. */
72
+ rewardGivenAt: Nullable<IsoDateTime>;
73
+ }
74
+ /** Everybody who has counted anything, finished first (earliest finish first), then by progress. */
75
+ export interface GymChallengeStandings {
76
+ challenge: GymChallenge;
77
+ standings: GymChallengeStanding[];
78
+ }
79
+ /** A challenge as the member reads it: only their own progress. */
80
+ export interface GymMyChallenge {
81
+ id: UUID;
82
+ title: LocalizedText;
83
+ description: Nullable<LocalizedText>;
84
+ reward: Nullable<LocalizedText>;
85
+ metric: GymChallengeMetric;
86
+ target: number;
87
+ startsOn: string;
88
+ endsOn: string;
89
+ phase: GymChallengePhase;
90
+ /** Never above the target: what is left to do is what matters to the member. */
91
+ progress: number;
92
+ completedOn: Nullable<string>;
93
+ rewardGivenAt: Nullable<IsoDateTime>;
94
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -61,5 +61,14 @@ export declare enum GymRefusal {
61
61
  * Somebody else holds that numbered place in the class (or took it a moment ago). The member or the desk picks
62
62
  * another; the class itself may still have room.
63
63
  */
64
- PLACE_TAKEN = "place-taken"
64
+ PLACE_TAKEN = "place-taken",
65
+ /**
66
+ * The challenge has started, so its metric, target and dates are fixed: changing them would move somebody's finish
67
+ * under them. The wording, the reward and archiving still change.
68
+ */
69
+ CHALLENGE_STARTED = "challenge-started",
70
+ /** The member has not reached the challenge's target (yet), so there is no reward to hand over. */
71
+ CHALLENGE_NOT_COMPLETED = "challenge-not-completed",
72
+ /** The challenge names no reward, so there is nothing to record as handed over. */
73
+ CHALLENGE_NO_REWARD = "challenge-no-reward"
65
74
  }
@@ -63,4 +63,13 @@ export var GymRefusal;
63
63
  * another; the class itself may still have room.
64
64
  */
65
65
  GymRefusal["PLACE_TAKEN"] = "place-taken";
66
+ /**
67
+ * The challenge has started, so its metric, target and dates are fixed: changing them would move somebody's finish
68
+ * under them. The wording, the reward and archiving still change.
69
+ */
70
+ GymRefusal["CHALLENGE_STARTED"] = "challenge-started";
71
+ /** The member has not reached the challenge's target (yet), so there is no reward to hand over. */
72
+ GymRefusal["CHALLENGE_NOT_COMPLETED"] = "challenge-not-completed";
73
+ /** The challenge names no reward, so there is nothing to record as handed over. */
74
+ GymRefusal["CHALLENGE_NO_REWARD"] = "challenge-no-reward";
66
75
  })(GymRefusal || (GymRefusal = {}));
@@ -2,6 +2,9 @@ export * from './gym-booking-refusal.enum.js';
2
2
  export * from './gym-booking-status.enum.js';
3
3
  export * from './gym-branch.type.js';
4
4
  export * from './gym-busy-level.enum.js';
5
+ export * from './gym-challenge-metric.enum.js';
6
+ export * from './gym-challenge-phase.enum.js';
7
+ export * from './gym-challenge.type.js';
5
8
  export * from './gym-check-in-outcome.enum.js';
6
9
  export * from './gym-check-in-refusal.enum.js';
7
10
  export * from './gym-class-access.enum.js';
@@ -2,6 +2,9 @@ export * from './gym-booking-refusal.enum.js';
2
2
  export * from './gym-booking-status.enum.js';
3
3
  export * from './gym-branch.type.js';
4
4
  export * from './gym-busy-level.enum.js';
5
+ export * from './gym-challenge-metric.enum.js';
6
+ export * from './gym-challenge-phase.enum.js';
7
+ export * from './gym-challenge.type.js';
5
8
  export * from './gym-check-in-outcome.enum.js';
6
9
  export * from './gym-check-in-refusal.enum.js';
7
10
  export * from './gym-class-access.enum.js';
@@ -8,6 +8,14 @@ export interface RestaurantReservationTable {
8
8
  label: string;
9
9
  seats: number;
10
10
  }
11
+ /**
12
+ * How the same diner's other bookings at this restaurant ended, so the book can tell a regular from somebody who has
13
+ * not come twice. Counted across every branch, and never including the booking it is shown on.
14
+ */
15
+ export interface RestaurantReservationGuestHistory {
16
+ completed: number;
17
+ noShows: number;
18
+ }
11
19
  export interface RestaurantReservation {
12
20
  id: UUID;
13
21
  branchId: UUID;
@@ -25,6 +33,8 @@ export interface RestaurantReservation {
25
33
  completedAt: IsoDateTime | null;
26
34
  cancelledAt: IsoDateTime | null;
27
35
  cancelReason: string | null;
36
+ /** Null for a booking staff took for somebody with no account here, whose earlier visits cannot be told apart. */
37
+ guestHistory: RestaurantReservationGuestHistory | null;
28
38
  createdAt: IsoDateTime;
29
39
  version: number;
30
40
  }
@@ -81,4 +91,15 @@ export interface MyRestaurantReservation {
81
91
  partySize: number;
82
92
  note: string | null;
83
93
  canCancel: boolean;
94
+ /** Whether the diner can still move it to another time or party size online. */
95
+ canMove: boolean;
96
+ }
97
+ /**
98
+ * A diner moving their own booking. It stays the same booking, so the restaurant keeps its note and history, and the
99
+ * new time must be one the booking's own slots offered. Left out, the party size and the note stay as they were.
100
+ */
101
+ export interface MoveMyRestaurantReservationRequest {
102
+ startsAt: IsoDateTime;
103
+ partySize?: number;
104
+ note?: string | null;
84
105
  }
@@ -4,6 +4,7 @@ export * from './social-activity.type.js';
4
4
  export * from './social-appeal-status.enum.js';
5
5
  export * from './social-case-decision.enum.js';
6
6
  export * from './social-case-status.enum.js';
7
+ export * from './social-comment-audience.enum.js';
7
8
  export * from './social-conversation.type.js';
8
9
  export * from './social-export-status.enum.js';
9
10
  export * from './social-follow-state.enum.js';
@@ -4,6 +4,7 @@ export * from './social-activity.type.js';
4
4
  export * from './social-appeal-status.enum.js';
5
5
  export * from './social-case-decision.enum.js';
6
6
  export * from './social-case-status.enum.js';
7
+ export * from './social-comment-audience.enum.js';
7
8
  export * from './social-conversation.type.js';
8
9
  export * from './social-export-status.enum.js';
9
10
  export * from './social-follow-state.enum.js';
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Who may comment on a member's posts, chosen once for all of them.
3
+ *
4
+ * Turning comments off on one post (`commentsDisabled`) still applies on top of this, and the author
5
+ * may always comment on their own post.
6
+ */
7
+ export declare enum SocialCommentAudience {
8
+ /** Anybody who can see the post. */
9
+ EVERYONE = "everyone",
10
+ /** People who follow the author. */
11
+ FOLLOWERS = "followers",
12
+ /** People the author follows. */
13
+ FOLLOWING = "following"
14
+ }
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Who may comment on a member's posts, chosen once for all of them.
3
+ *
4
+ * Turning comments off on one post (`commentsDisabled`) still applies on top of this, and the author
5
+ * may always comment on their own post.
6
+ */
7
+ export var SocialCommentAudience;
8
+ (function (SocialCommentAudience) {
9
+ /** Anybody who can see the post. */
10
+ SocialCommentAudience["EVERYONE"] = "everyone";
11
+ /** People who follow the author. */
12
+ SocialCommentAudience["FOLLOWERS"] = "followers";
13
+ /** People the author follows. */
14
+ SocialCommentAudience["FOLLOWING"] = "following";
15
+ })(SocialCommentAudience || (SocialCommentAudience = {}));
@@ -25,6 +25,8 @@ export declare const SOCIAL_LIMITS: {
25
25
  /** Seven days. */
26
26
  readonly POLL_HOURS_MAX: 168;
27
27
  readonly POLL_HOURS_DEFAULT: 24;
28
+ /** Posts pinned to the top of one profile. */
29
+ readonly PINNED_POSTS_MAX: 3;
28
30
  readonly MINIMUM_AGE: 16;
29
31
  };
30
32
  /** The characters a handle may use, in the form they are stored. */
@@ -25,6 +25,8 @@ export const SOCIAL_LIMITS = {
25
25
  /** Seven days. */
26
26
  POLL_HOURS_MAX: 168,
27
27
  POLL_HOURS_DEFAULT: 24,
28
+ /** Posts pinned to the top of one profile. */
29
+ PINNED_POSTS_MAX: 3,
28
30
  MINIMUM_AGE: 16,
29
31
  };
30
32
  /** The characters a handle may use, in the form they are stored. */
@@ -1,6 +1,7 @@
1
1
  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
+ import type { SocialCommentAudience } from './social-comment-audience.enum.js';
4
5
  import type { SocialFollowState } from './social-follow-state.enum.js';
5
6
  import type { SocialMemberStatus } from './social-member-status.enum.js';
6
7
  /** The smallest face of a person: what appears beside a post, a comment or a message. */
@@ -74,4 +75,6 @@ export interface SocialPreferences {
74
75
  emailOnComment: boolean;
75
76
  /** Whether somebody you do not follow can start a conversation at all. */
76
77
  allowMessageRequests: boolean;
78
+ /** Who may comment on this member's posts. */
79
+ commentAudience: SocialCommentAudience;
77
80
  }
@@ -1,6 +1,7 @@
1
1
  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
+ import type { SocialCommentAudience } from './social-comment-audience.enum.js';
4
5
  import type { SocialImage } from './social-image.type.js';
5
6
  import type { SocialMemberCard } from './social-member.type.js';
6
7
  import type { CreateSocialPollRequest, SocialPoll } from './social-poll.type.js';
@@ -15,6 +16,18 @@ export interface SocialPost {
15
16
  /** A post with a poll carries no photograph or video. */
16
17
  poll: Nullable<SocialPoll>;
17
18
  commentsDisabled: boolean;
19
+ /** Who the author lets comment on their posts. */
20
+ commentAudience: SocialCommentAudience;
21
+ /**
22
+ * Whether this reader may comment here now: comments are on, and the reader is the author or in
23
+ * the author's audience. Always false for a visitor with no account.
24
+ */
25
+ viewerCanComment: boolean;
26
+ /**
27
+ * When the author pinned it to the top of their profile, if they did. A profile shows at most
28
+ * `SOCIAL_LIMITS.PINNED_POSTS_MAX`, the most recently pinned first.
29
+ */
30
+ pinnedAt: Nullable<IsoDateTime>;
18
31
  likeCount: number;
19
32
  commentCount: number;
20
33
  viewerLiked: boolean;
@@ -37,6 +37,10 @@ export declare enum SocialRefusal {
37
37
  /** Nobody votes in their own poll. */
38
38
  POLL_OWN = "poll-own",
39
39
  COMMENTS_DISABLED = "comments-disabled",
40
+ /** The author lets only their followers, or only people they follow, comment, and this member is neither. */
41
+ COMMENTS_LIMITED = "comments-limited",
42
+ /** A profile already has as many pinned posts as it may; one has to be unpinned first. */
43
+ PIN_LIMIT = "pin-limit",
40
44
  CANNOT_FOLLOW_SELF = "cannot-follow-self",
41
45
  CANNOT_MESSAGE = "cannot-message",
42
46
  /** Messages are held by Baasi, which this deployment cannot reach or is not configured for. */
@@ -38,6 +38,10 @@ export var SocialRefusal;
38
38
  /** Nobody votes in their own poll. */
39
39
  SocialRefusal["POLL_OWN"] = "poll-own";
40
40
  SocialRefusal["COMMENTS_DISABLED"] = "comments-disabled";
41
+ /** The author lets only their followers, or only people they follow, comment, and this member is neither. */
42
+ SocialRefusal["COMMENTS_LIMITED"] = "comments-limited";
43
+ /** A profile already has as many pinned posts as it may; one has to be unpinned first. */
44
+ SocialRefusal["PIN_LIMIT"] = "pin-limit";
41
45
  SocialRefusal["CANNOT_FOLLOW_SELF"] = "cannot-follow-self";
42
46
  SocialRefusal["CANNOT_MESSAGE"] = "cannot-message";
43
47
  /** Messages are held by Baasi, which this deployment cannot reach or is not configured for. */
@@ -1,3 +1,5 @@
1
1
  export * from './taxi-admin.type.js';
2
+ export * from './taxi-cancellation-reason.enum.js';
3
+ export * from './taxi-expiry-kind.enum.js';
2
4
  export * from './taxi-refusal.enum.js';
3
5
  export * from './taxi-ride-status.enum.js';
@@ -1,3 +1,5 @@
1
1
  export * from './taxi-admin.type.js';
2
+ export * from './taxi-cancellation-reason.enum.js';
3
+ export * from './taxi-expiry-kind.enum.js';
2
4
  export * from './taxi-refusal.enum.js';
3
5
  export * from './taxi-ride-status.enum.js';
@@ -2,6 +2,8 @@ import type { IsoDateTime } from '../../type/iso-date-time.type.js';
2
2
  import type { Nullable } from '../../type/nil.type.js';
3
3
  import type { Paginated } from '../../type/paginated.type.js';
4
4
  import type { UUID } from '../../type/uuid.type.js';
5
+ import type { TaxiCancellationReason } from './taxi-cancellation-reason.enum.js';
6
+ import type { TaxiExpiryKind } from './taxi-expiry-kind.enum.js';
5
7
  import type { TaxiRideStatus } from './taxi-ride-status.enum.js';
6
8
  /** A place as the passenger gave it. There is no address search, so it is coordinates only. */
7
9
  export interface TaxiPoint {
@@ -36,7 +38,19 @@ export interface TaxiBoardRide {
36
38
  startedAt: Nullable<IsoDateTime>;
37
39
  completedAt: Nullable<IsoDateTime>;
38
40
  cancelledAt: Nullable<IsoDateTime>;
41
+ /** Where exactly the passenger said they would wait; null when they said nothing or past the retention window. */
42
+ pickupNote: Nullable<string>;
43
+ /** Why the passenger cancelled, when they said; null on any other ride. */
44
+ cancellationReason: Nullable<TaxiCancellationReason>;
45
+ /** Why an expired ride ended without a trip; null on any other ride. */
46
+ expiryKind: Nullable<TaxiExpiryKind>;
39
47
  }
48
+ /**
49
+ * `GET /company/rides?status=&passengerUserId=&driverUserId=&from=&to=&limit=&offset=`: every ride the company was
50
+ * asked for, newest first, for finding the one a passenger or driver is calling about. `from` and `to` are instants
51
+ * bounding when the ride was asked for. Waiting quotes are listed too, since a passenger may call about one.
52
+ */
53
+ export type TaxiCompanyRidesPage = Paginated<TaxiBoardRide>;
40
54
  /**
41
55
  * `GET /company/board?since=`: what is happening now, and what finished since `since` (the start of the company's
42
56
  * day, which only the panel knows). Each list is capped and newest first.
@@ -109,10 +123,32 @@ export interface TaxiDailyTotals {
109
123
  /** Sum of the quoted fares of that day's completed rides, per currency. */
110
124
  completedQuotedFares: TaxiQuotedFareTotal[];
111
125
  }
112
- /** `GET /company/reports/daily?days=&timeZone=`: oldest day first, every day present, zeroes included. */
126
+ /** How many of the period's cancelled rides gave one reason; `reason` null counts those that gave none. */
127
+ export interface TaxiCancellationCount {
128
+ reason: Nullable<TaxiCancellationReason>;
129
+ rides: number;
130
+ }
131
+ /** How many of the period's expired rides ended one way. */
132
+ export interface TaxiExpiryCount {
133
+ kind: TaxiExpiryKind;
134
+ rides: number;
135
+ }
136
+ /**
137
+ * Why the period's rides ended without a trip. Every reason and kind is present, zeroes included, so the counts add up
138
+ * to the days' `cancelled` and `expired`.
139
+ */
140
+ export interface TaxiLostRides {
141
+ cancellations: TaxiCancellationCount[];
142
+ expiries: TaxiExpiryCount[];
143
+ }
144
+ /**
145
+ * `GET /company/reports/daily?days=&timeZone=`: oldest day first, every day present, zeroes included. A ride no driver
146
+ * was ever sent to keeps counting after its row is deleted (24 hours after it ended): only its count is kept.
147
+ */
113
148
  export interface TaxiDailyReport {
114
149
  timeZone: string;
115
150
  from: string;
116
151
  to: string;
117
152
  days: TaxiDailyTotals[];
153
+ lostRides: TaxiLostRides;
118
154
  }
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Why a passenger called a ride off, when they said. A closed set, because a company reads these as counts and free
3
+ * text would be another unbounded place a passenger's words are kept. `driver-asked` exists because a driver cannot
4
+ * cancel; one who needs to asks the passenger.
5
+ */
6
+ export declare enum TaxiCancellationReason {
7
+ CHANGED_PLANS = "changed-plans",
8
+ WAITED_TOO_LONG = "waited-too-long",
9
+ WRONG_PICKUP = "wrong-pickup",
10
+ FOUND_ANOTHER_RIDE = "found-another-ride",
11
+ DRIVER_ASKED = "driver-asked",
12
+ OTHER = "other"
13
+ }
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Why a passenger called a ride off, when they said. A closed set, because a company reads these as counts and free
3
+ * text would be another unbounded place a passenger's words are kept. `driver-asked` exists because a driver cannot
4
+ * cancel; one who needs to asks the passenger.
5
+ */
6
+ export var TaxiCancellationReason;
7
+ (function (TaxiCancellationReason) {
8
+ TaxiCancellationReason["CHANGED_PLANS"] = "changed-plans";
9
+ TaxiCancellationReason["WAITED_TOO_LONG"] = "waited-too-long";
10
+ TaxiCancellationReason["WRONG_PICKUP"] = "wrong-pickup";
11
+ TaxiCancellationReason["FOUND_ANOTHER_RIDE"] = "found-another-ride";
12
+ TaxiCancellationReason["DRIVER_ASKED"] = "driver-asked";
13
+ TaxiCancellationReason["OTHER"] = "other";
14
+ })(TaxiCancellationReason || (TaxiCancellationReason = {}));
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Why an `expired` ride ended without a trip. The status alone cannot say, and the three have nothing in common:
3
+ * the passenger's choice, the company's drivers, or the service's own dispatch.
4
+ */
5
+ export declare enum TaxiExpiryKind {
6
+ /** The passenger never accepted the fare before it ran out. */
7
+ QUOTE_NOT_ACCEPTED = "quote-not-accepted",
8
+ /** The search ran and no driver took the ride: too few drivers on shift near the pickup. */
9
+ NO_DRIVER_FOUND = "no-driver-found",
10
+ /** The search could not be started at all, so no driver was ever asked. */
11
+ DISPATCH_FAILED = "dispatch-failed"
12
+ }
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Why an `expired` ride ended without a trip. The status alone cannot say, and the three have nothing in common:
3
+ * the passenger's choice, the company's drivers, or the service's own dispatch.
4
+ */
5
+ export var TaxiExpiryKind;
6
+ (function (TaxiExpiryKind) {
7
+ /** The passenger never accepted the fare before it ran out. */
8
+ TaxiExpiryKind["QUOTE_NOT_ACCEPTED"] = "quote-not-accepted";
9
+ /** The search ran and no driver took the ride: too few drivers on shift near the pickup. */
10
+ TaxiExpiryKind["NO_DRIVER_FOUND"] = "no-driver-found";
11
+ /** The search could not be started at all, so no driver was ever asked. */
12
+ TaxiExpiryKind["DISPATCH_FAILED"] = "dispatch-failed";
13
+ })(TaxiExpiryKind || (TaxiExpiryKind = {}));
@@ -69,6 +69,15 @@ export interface Message {
69
69
  * the other end.
70
70
  */
71
71
  dispatchId: Nullable<UUID>;
72
+ /**
73
+ * The failed reply this one sends again, set only by `POST /conversations/:id/messages/:messageId/resend`.
74
+ *
75
+ * Sending again writes a **new** message rather than re-dispatching the failed one: the failed row stays in the thread
76
+ * as the record of what did not go out and why, and the contact receives the words now, after anything said since.
77
+ * At most one message sends a given reply again, so a client shows "Sent again" on a failed reply that one points at
78
+ * and offers Send again only on a failed reply none does.
79
+ */
80
+ resendOfMessageId: Nullable<UUID>;
72
81
  /**
73
82
  * When the message was said, according to the provider — not when we stored it.
74
83
  *
@@ -115,6 +124,16 @@ export interface SendMessageBody {
115
124
  */
116
125
  idempotencyKey?: Nullable<string>;
117
126
  }
127
+ /**
128
+ * `POST /api/v1/conversations/:id/messages/:messageId/resend` takes no body and answers the new {@link Message}.
129
+ *
130
+ * Only a failed reply can be sent again (`reply-not-failed` otherwise). The new message carries the same words,
131
+ * attachments and author, goes through the channel exactly as a reply does, and is dispatched to Conduit under its own
132
+ * id: the failed reply's key would only give back the dispatch that already failed. Asking twice answers the message
133
+ * the first call wrote. The AI agent's reply is not sent again once a person has taken the conversation over
134
+ * (`handed-over`).
135
+ */
136
+ export type ResendMessageResponse = Message;
118
137
  /**
119
138
  * `POST /api/v1/conversations/:id/notes` — a private note in the thread.
120
139
  *
@@ -25,5 +25,15 @@ export declare enum UniboxRefusal {
25
25
  /** Conduit would not take the reply, which is the channel's connection or operation, not the reply itself. */
26
26
  DISPATCH_REFUSED = "dispatch-refused",
27
27
  /** Conduit could not be reached, so the reply was not handed over. Trying again may work. */
28
- DISPATCH_UNAVAILABLE = "dispatch-unavailable"
28
+ DISPATCH_UNAVAILABLE = "dispatch-unavailable",
29
+ /**
30
+ * Send again was asked of a message that is not a failed reply: it was sent after all, is still on its way, or is
31
+ * not a reply. Carries `currentStatus`.
32
+ */
33
+ REPLY_NOT_FAILED = "reply-not-failed",
34
+ /**
35
+ * Send again was asked of the AI agent's reply in a conversation a person has taken over since, where the AI agent
36
+ * no longer speaks.
37
+ */
38
+ HANDED_OVER = "handed-over"
29
39
  }
@@ -27,4 +27,14 @@ export var UniboxRefusal;
27
27
  UniboxRefusal["DISPATCH_REFUSED"] = "dispatch-refused";
28
28
  /** Conduit could not be reached, so the reply was not handed over. Trying again may work. */
29
29
  UniboxRefusal["DISPATCH_UNAVAILABLE"] = "dispatch-unavailable";
30
+ /**
31
+ * Send again was asked of a message that is not a failed reply: it was sent after all, is still on its way, or is
32
+ * not a reply. Carries `currentStatus`.
33
+ */
34
+ UniboxRefusal["REPLY_NOT_FAILED"] = "reply-not-failed";
35
+ /**
36
+ * Send again was asked of the AI agent's reply in a conversation a person has taken over since, where the AI agent
37
+ * no longer speaks.
38
+ */
39
+ UniboxRefusal["HANDED_OVER"] = "handed-over";
30
40
  })(UniboxRefusal || (UniboxRefusal = {}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iveri/contracts",
3
- "version": "0.153.0",
3
+ "version": "0.155.0",
4
4
  "description": "Wire contracts shared by every Iveri backend and frontend. Zero runtime dependencies.",
5
5
  "license": "MIT",
6
6
  "repository": {