@iveri/contracts 0.138.0 → 0.139.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -317,6 +317,8 @@ Conduit's outbox.
317
317
  - Version `0.138.0` adds `profile:directory:read` and `profile:directory:read-any` with `ProfileDirectoryPage` under
318
318
  `@iveri/contracts/identity` (the names of a company's members who hold a permission), and `UniboxAgent` /
319
319
  `UniboxAgents` under `@iveri/contracts/unibox`, so the inbox picks agents by name.
320
+ - Version `0.139.0` adds a trainer's notes on a member: `GymTrainerNote`, `GymTrainerNotes`, `SaveGymTrainerNoteRequest`,
321
+ `GymMyTrainerNote` and the `GymRefusal` member `not-their-trainer` under `@iveri/contracts/gym`.
320
322
  - Version `0.134.0` adds `delivery:job:create-any`, `delivery:job:read-any` and `delivery:job:operate-any`, so a shop's
321
323
  and a restaurant's operator-workspace keys ask for, confirm and follow a courier in the company a request names.
322
324
  - Version `0.131.0` adds `mobility:dispatch:create-any`, `mobility:dispatch:read-any`, `mobility:dispatch:operate-any`,
@@ -51,5 +51,10 @@ export declare enum GymRefusal {
51
51
  /** This month's free guest visits are used; `details.resetsOn` is the date the count starts again. */
52
52
  GUEST_PASSES_USED = "guest-passes-used",
53
53
  /** Guest visits ride on a membership that is current today, so not a frozen, ended, unpaid or future one. */
54
- GUEST_PASS_NOT_CURRENT = "guest-pass-not-current"
54
+ GUEST_PASS_NOT_CURRENT = "guest-pass-not-current",
55
+ /**
56
+ * Only a trainer who has a personal session with the member (booked, attended or missed) writes notes about them;
57
+ * the screen was stale, for example the only session was called off.
58
+ */
59
+ NOT_THEIR_TRAINER = "not-their-trainer"
55
60
  }
@@ -53,4 +53,9 @@ export var GymRefusal;
53
53
  GymRefusal["GUEST_PASSES_USED"] = "guest-passes-used";
54
54
  /** Guest visits ride on a membership that is current today, so not a frozen, ended, unpaid or future one. */
55
55
  GymRefusal["GUEST_PASS_NOT_CURRENT"] = "guest-pass-not-current";
56
+ /**
57
+ * Only a trainer who has a personal session with the member (booked, attended or missed) writes notes about them;
58
+ * the screen was stale, for example the only session was called off.
59
+ */
60
+ GymRefusal["NOT_THEIR_TRAINER"] = "not-their-trainer";
56
61
  })(GymRefusal || (GymRefusal = {}));
@@ -0,0 +1,43 @@
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
+ /**
5
+ * A dated note a trainer wrote about a member's progress, as the gym's staff read it.
6
+ *
7
+ * Notes are not a secret file: the member reads every note written about them (`GymMyTrainerNote`), so nothing is
8
+ * kept about a person that they cannot see. Plain text, at most 2000 characters, line breaks kept.
9
+ */
10
+ export interface GymTrainerNote {
11
+ id: UUID;
12
+ memberId: UUID;
13
+ /** The staff member who wrote it. */
14
+ trainerId: UUID;
15
+ trainerName: string;
16
+ body: string;
17
+ /** True when the caller wrote it, so may change or remove it. */
18
+ writtenByMe: boolean;
19
+ createdAt: IsoDateTime;
20
+ /** When the text was last changed, or null when it reads as first written. No earlier wording is kept. */
21
+ editedAt: Nullable<IsoDateTime>;
22
+ }
23
+ /** A member's notes, newest first, and whether the caller may add one. */
24
+ export interface GymTrainerNotes {
25
+ notes: GymTrainerNote[];
26
+ /**
27
+ * Whether the caller may write about this member: an active trainer of the gym who has a personal session with
28
+ * them (booked, attended or missed, past or upcoming).
29
+ */
30
+ canWrite: boolean;
31
+ }
32
+ /** Writing or rewriting a note. Plain text, at most 2000 characters, not blank. */
33
+ export interface SaveGymTrainerNoteRequest {
34
+ body: string;
35
+ }
36
+ /** A note as the member it is about reads it, read-only. */
37
+ export interface GymMyTrainerNote {
38
+ id: UUID;
39
+ trainerName: string;
40
+ body: string;
41
+ createdAt: IsoDateTime;
42
+ editedAt: Nullable<IsoDateTime>;
43
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -42,6 +42,7 @@ export * from './gym-session-kind.enum.js';
42
42
  export * from './gym-session-status.enum.js';
43
43
  export * from './gym-signature-method.enum.js';
44
44
  export * from './gym-staff.type.js';
45
+ export * from './gym-trainer-note.type.js';
45
46
  export * from './gym-trainer-time-off.type.js';
46
47
  export * from './gym-training.type.js';
47
48
  export * from './gym-waiver.type.js';
@@ -42,6 +42,7 @@ export * from './gym-session-kind.enum.js';
42
42
  export * from './gym-session-status.enum.js';
43
43
  export * from './gym-signature-method.enum.js';
44
44
  export * from './gym-staff.type.js';
45
+ export * from './gym-trainer-note.type.js';
45
46
  export * from './gym-trainer-time-off.type.js';
46
47
  export * from './gym-training.type.js';
47
48
  export * from './gym-waiver.type.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iveri/contracts",
3
- "version": "0.138.0",
3
+ "version": "0.139.0",
4
4
  "description": "Wire contracts shared by every Iveri backend and frontend. Zero runtime dependencies.",
5
5
  "license": "MIT",
6
6
  "repository": {