@iveri/contracts 0.136.0 → 0.137.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
@@ -311,6 +311,9 @@ Conduit's outbox.
311
311
  - Version `0.136.0` adds `Principal.emailVerifiedAt` (required, null until the address is confirmed) and the email
312
312
  confirmation bodies `RegisterShopperBody`, `RequestEmailConfirmationBody` and `ConfirmEmailBody` under
313
313
  `@iveri/contracts/identity`.
314
+ - Version `0.137.0` adds a gym plan's free guest visits: `GymPlan.guestVisitsPerMonth`, the membership's guest
315
+ counters, `GymGuestVisit`, `RecordGymGuestVisitRequest`, and the `GymRefusal` members `guest-passes-used` and
316
+ `guest-pass-not-current`.
314
317
  - Version `0.134.0` adds `delivery:job:create-any`, `delivery:job:read-any` and `delivery:job:operate-any`, so a shop's
315
318
  and a restaurant's operator-workspace keys ask for, confirm and follow a courier in the company a request names.
316
319
  - Version `0.131.0` adds `mobility:dispatch:create-any`, `mobility:dispatch:read-any`, `mobility:dispatch:operate-any`,
@@ -40,6 +40,12 @@ export interface GymMembership {
40
40
  freezeDaysAllowed: number;
41
41
  freezeDaysUsed: number;
42
42
  memberCanFreeze: boolean;
43
+ /** Copied from the plan when sold: free guest visits each calendar month on the club's clock. 0 means none. */
44
+ guestVisitsPerMonth: number;
45
+ /** Guest visits recorded against this membership in the current calendar month. */
46
+ guestVisitsUsedThisMonth: number;
47
+ /** The calendar date the guest count starts again (the first of next month), or null when there is no allowance. */
48
+ guestVisitsResetOn: Nullable<string>;
43
49
  freezes: GymMembershipFreeze[];
44
50
  currency: string;
45
51
  priceMinor: number;
@@ -91,3 +97,19 @@ export interface GymExpiringMembership {
91
97
  name: LocalizedText;
92
98
  endsOn: string;
93
99
  }
100
+ /**
101
+ * A guest a member brought, recorded by the desk against the member's membership. It counts against the membership's
102
+ * monthly guest allowance. Nothing else about the guest is kept: they have agreed to nothing.
103
+ */
104
+ export interface GymGuestVisit {
105
+ id: UUID;
106
+ membershipId: UUID;
107
+ /** The calendar date of the visit, on the club's clock. */
108
+ visitedOn: string;
109
+ /** Optional, and cleared after a retention window; the visit itself stays, because it is the count. */
110
+ guestFirstName: Nullable<string>;
111
+ createdAt: IsoDateTime;
112
+ }
113
+ export interface RecordGymGuestVisitRequest {
114
+ guestFirstName?: Nullable<string>;
115
+ }
@@ -37,6 +37,11 @@ export interface GymPlan {
37
37
  freezeDaysAllowed: number;
38
38
  /** Whether a member may freeze this themselves or has to ask at the desk. */
39
39
  memberCanFreeze: boolean;
40
+ /**
41
+ * Free guest visits a member on this plan may bring each calendar month, on the club's clock. 0 means none. Unused
42
+ * visits do not carry over, and nothing is charged for them.
43
+ */
44
+ guestVisitsPerMonth: number;
40
45
  activation: GymPlanActivation;
41
46
  /** Whether it is on the website and in the app. A staff-only plan can still be sold at the desk. */
42
47
  isPublic: boolean;
@@ -62,6 +67,7 @@ export interface CreateGymPlanRequest {
62
67
  accessHours?: Nullable<GymWeeklyPeriod[]>;
63
68
  freezeDaysAllowed?: number;
64
69
  memberCanFreeze?: boolean;
70
+ guestVisitsPerMonth?: number;
65
71
  activation?: GymPlanActivation;
66
72
  isPublic?: boolean;
67
73
  isFeatured?: boolean;
@@ -47,5 +47,9 @@ export declare enum GymRefusal {
47
47
  /** The email confirmation link is too old; a new one is sent from the account. */
48
48
  LINK_EXPIRED = "link-expired",
49
49
  /** The member has already signed this version of the waiver. */
50
- WAIVER_SIGNED = "waiver-signed"
50
+ WAIVER_SIGNED = "waiver-signed",
51
+ /** This month's free guest visits are used; `details.resetsOn` is the date the count starts again. */
52
+ GUEST_PASSES_USED = "guest-passes-used",
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"
51
55
  }
@@ -49,4 +49,8 @@ export var GymRefusal;
49
49
  GymRefusal["LINK_EXPIRED"] = "link-expired";
50
50
  /** The member has already signed this version of the waiver. */
51
51
  GymRefusal["WAIVER_SIGNED"] = "waiver-signed";
52
+ /** This month's free guest visits are used; `details.resetsOn` is the date the count starts again. */
53
+ GymRefusal["GUEST_PASSES_USED"] = "guest-passes-used";
54
+ /** Guest visits ride on a membership that is current today, so not a frozen, ended, unpaid or future one. */
55
+ GymRefusal["GUEST_PASS_NOT_CURRENT"] = "guest-pass-not-current";
52
56
  })(GymRefusal || (GymRefusal = {}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iveri/contracts",
3
- "version": "0.136.0",
3
+ "version": "0.137.0",
4
4
  "description": "Wire contracts shared by every Iveri backend and frontend. Zero runtime dependencies.",
5
5
  "license": "MIT",
6
6
  "repository": {