@iveri/contracts 0.154.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 (40) hide show
  1. package/README.md +4 -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/package.json +1 -1
package/README.md CHANGED
@@ -324,6 +324,10 @@ 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.
327
331
  - Version `0.154.0` lets an agent send a failed Unibox reply again: `Message.resendOfMessageId`,
328
332
  `ResendMessageResponse`, and the `UniboxRefusal` members `reply-not-failed` and `handed-over`.
329
333
  - Version `0.153.0` adds `UserPermission.CONDUIT_DISPATCH_READ_ANY` (`conduit:dispatch:read-any`, a platform
@@ -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. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iveri/contracts",
3
- "version": "0.154.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": {