@iveri/contracts 0.109.0 → 0.111.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
@@ -8,6 +8,10 @@ entry offers exactly `types` and `default`. The CommonJS build and the `typesVer
8
8
  gone, so a consumer resolves the subpaths under `moduleResolution` `nodenext` or `bundler` — and
9
9
  under Node 26 a CommonJS consumer still loads it, through `require`. See `CHANGELOG.md`.
10
10
 
11
+ Release `0.111.0` adds a gym trainer's time off to `@iveri/contracts/gym`: `GymTrainerTimeOff`, the sessions
12
+ the trainer still holds inside it (`GymTrainerTimeOffSession`), `CreateGymTrainerTimeOffRequest` and
13
+ `ListGymTrainerTimeOffQuery`. Additions only.
14
+
11
15
  Release `0.106.0` adds `RealtimeResourceType.GYM_PERSON` (`gym.person`) and
12
16
  `RealtimeEventType.GYM_PERSON_UPDATED`: a gym member's or trainer's own room, keyed by their
13
17
  identity user id, so their apps learn at once that a conversation with the person they train with
@@ -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
+ import type { LocalizedText } from '../clinic/localized-text.type.js';
5
+ import type { GymSessionKind } from './gym-session-kind.enum.js';
6
+ /**
7
+ * A session the trainer still holds inside their time off: a class that needs somebody to cover it, or a personal
8
+ * session to move. Recording time off never cancels anything by itself.
9
+ */
10
+ export interface GymTrainerTimeOffSession {
11
+ id: UUID;
12
+ kind: GymSessionKind;
13
+ branchId: UUID;
14
+ /** The class's name, or null for personal training. */
15
+ className: Nullable<LocalizedText>;
16
+ startsAt: IsoDateTime;
17
+ endsAt: IsoDateTime;
18
+ bookedCount: number;
19
+ }
20
+ /** A stretch of time a trainer is away. Nobody can book them for personal training inside it. */
21
+ export interface GymTrainerTimeOff {
22
+ id: UUID;
23
+ trainerId: UUID;
24
+ trainerName: string;
25
+ startsAt: IsoDateTime;
26
+ endsAt: IsoDateTime;
27
+ note: Nullable<string>;
28
+ sessionsToCover: GymTrainerTimeOffSession[];
29
+ createdAt: IsoDateTime;
30
+ }
31
+ /** Recording time off. A trainer may record their own; anybody else's needs `gym:schedule:manage`. */
32
+ export interface CreateGymTrainerTimeOffRequest {
33
+ trainerId: UUID;
34
+ startsAt: IsoDateTime;
35
+ endsAt: IsoDateTime;
36
+ note?: Nullable<string>;
37
+ }
38
+ /** Which time off to list: whatever overlaps `from` to `to`, for one trainer or for everybody. */
39
+ export interface ListGymTrainerTimeOffQuery {
40
+ from: IsoDateTime;
41
+ to: IsoDateTime;
42
+ trainerId?: UUID;
43
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -40,5 +40,6 @@ export * from './gym-session-kind.enum.js';
40
40
  export * from './gym-session-status.enum.js';
41
41
  export * from './gym-signature-method.enum.js';
42
42
  export * from './gym-staff.type.js';
43
+ export * from './gym-trainer-time-off.type.js';
43
44
  export * from './gym-training.type.js';
44
45
  export * from './gym-waiver.type.js';
@@ -40,5 +40,6 @@ export * from './gym-session-kind.enum.js';
40
40
  export * from './gym-session-status.enum.js';
41
41
  export * from './gym-signature-method.enum.js';
42
42
  export * from './gym-staff.type.js';
43
+ export * from './gym-trainer-time-off.type.js';
43
44
  export * from './gym-training.type.js';
44
45
  export * from './gym-waiver.type.js';
@@ -0,0 +1,35 @@
1
+ import type { IsoDateTime } from '../../type/iso-date-time.type.js';
2
+ import type { Nullable } from '../../type/nil.type.js';
3
+ /**
4
+ * Where a company's HR posts to Slack: one channel, through an incoming webhook the company's own Slack admin made.
5
+ *
6
+ * **The webhook address is never returned**, not masked and not truncated: it is the credential that posts into the
7
+ * channel. `webhookHost` answers the only question an HR person has about it, which service it points at.
8
+ */
9
+ export interface HrSlackChannel {
10
+ isConnected: boolean;
11
+ webhookHost: Nullable<string>;
12
+ /** The language posts are written in: everybody in a channel reads the same message. */
13
+ localeCode: string;
14
+ /** A post when somebody's time off is agreed: who and when, never why. */
15
+ postsApprovedTimeOff: boolean;
16
+ /** A post every working morning naming who is away that day, or saying everybody is in. */
17
+ postsDailyAbsences: boolean;
18
+ /** `HH:mm` in the company's own time zone. */
19
+ dailyPostTime: string;
20
+ /** The last day a morning post went out, `YYYY-MM-DD` in the company's time zone. */
21
+ lastDailyPostOn: Nullable<string>;
22
+ /** When Slack last refused a post, so HR can tell a channel that stopped working from a quiet one. */
23
+ lastFailedAt: Nullable<IsoDateTime>;
24
+ }
25
+ /**
26
+ * Every field is optional and an omitted one keeps its value. `webhookUrl: null` disconnects the channel, and a new
27
+ * address replaces the old one.
28
+ */
29
+ export interface HrUpdateSlackChannelRequest {
30
+ webhookUrl?: Nullable<string>;
31
+ localeCode?: string;
32
+ postsApprovedTimeOff?: boolean;
33
+ postsDailyAbsences?: boolean;
34
+ dailyPostTime?: string;
35
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -58,6 +58,7 @@ export * from './hr-resource-status.enum.js';
58
58
  export * from './hr-review-cycle-status.enum.js';
59
59
  export * from './hr-review-question-kind.enum.js';
60
60
  export * from './hr-review-status.enum.js';
61
+ export * from './hr-slack-channel.type.js';
61
62
  export * from './hr-stand-in.type.js';
62
63
  export * from './hr-survey-audience.enum.js';
63
64
  export * from './hr-survey-group-kind.enum.js';
@@ -58,6 +58,7 @@ export * from './hr-resource-status.enum.js';
58
58
  export * from './hr-review-cycle-status.enum.js';
59
59
  export * from './hr-review-question-kind.enum.js';
60
60
  export * from './hr-review-status.enum.js';
61
+ export * from './hr-slack-channel.type.js';
61
62
  export * from './hr-stand-in.type.js';
62
63
  export * from './hr-survey-audience.enum.js';
63
64
  export * from './hr-survey-group-kind.enum.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iveri/contracts",
3
- "version": "0.109.0",
3
+ "version": "0.111.0",
4
4
  "description": "Wire contracts shared by every Iveri backend and frontend. Zero runtime dependencies.",
5
5
  "license": "MIT",
6
6
  "repository": {