@iveri/contracts 0.135.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
|
@@ -308,6 +308,12 @@ Conduit's outbox.
|
|
|
308
308
|
- Version `0.135.0` adds `conduit:dispatch:send-any` and `unibox:realtime:publish-any`, and an optional `tenantId` on
|
|
309
309
|
`SubmitDispatchBody` and `PublishConversationEventBody`, so Unibox sends replies and inbox hints for the company a
|
|
310
310
|
request names.
|
|
311
|
+
- Version `0.136.0` adds `Principal.emailVerifiedAt` (required, null until the address is confirmed) and the email
|
|
312
|
+
confirmation bodies `RegisterShopperBody`, `RequestEmailConfirmationBody` and `ConfirmEmailBody` under
|
|
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`.
|
|
311
317
|
- Version `0.134.0` adds `delivery:job:create-any`, `delivery:job:read-any` and `delivery:job:operate-any`, so a shop's
|
|
312
318
|
and a restaurant's operator-workspace keys ask for, confirm and follow a courier in the company a request names.
|
|
313
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 = {}));
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { UserPermission } from '../../enum/user-permission.enum.js';
|
|
2
|
+
import type { IsoDateTime } from '../../type/iso-date-time.type.js';
|
|
2
3
|
import type { Nullable } from '../../type/nil.type.js';
|
|
3
4
|
import type { UUID } from '../../type/uuid.type.js';
|
|
4
5
|
import type { MembershipStatus } from './membership-status.enum.js';
|
|
@@ -25,6 +26,42 @@ export interface LoginBody {
|
|
|
25
26
|
email: string;
|
|
26
27
|
password: string;
|
|
27
28
|
}
|
|
29
|
+
/**
|
|
30
|
+
* `POST /auth/register` — somebody creates their own account in a company that opened registration (a shopper, a
|
|
31
|
+
* diner). There is deliberately no role field: the request cannot name one.
|
|
32
|
+
*
|
|
33
|
+
* Registering emails a link that confirms the address, in `localeCode`'s language. Until it is used the address is an
|
|
34
|
+
* identifier and not a proven contact: see {@link Principal.emailVerifiedAt}.
|
|
35
|
+
*/
|
|
36
|
+
export interface RegisterShopperBody {
|
|
37
|
+
tenantSlug: string;
|
|
38
|
+
email: string;
|
|
39
|
+
password: string;
|
|
40
|
+
firstName: string;
|
|
41
|
+
lastName: string;
|
|
42
|
+
/** The language of the confirmation email. Unset falls back to the workspace's source locale. */
|
|
43
|
+
localeCode?: Nullable<string>;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* `POST /auth/me/email-confirmation` — the signed-in person asks for a new confirmation link for their own address.
|
|
47
|
+
* Answered 202 with no body. A spent or expired link is replaced by asking here; a newer link spends the older ones.
|
|
48
|
+
* Asking when the address is already confirmed sends nothing and still answers 202.
|
|
49
|
+
*/
|
|
50
|
+
export interface RequestEmailConfirmationBody {
|
|
51
|
+
/** The language of the email. Unset falls back to the workspace's source locale. */
|
|
52
|
+
localeCode?: Nullable<string>;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* `POST /auth/email-confirmation/confirm` — confirm an address from the emailed link. Public: the link may be opened
|
|
56
|
+
* on another device, signed out. Answered 204. Every bad link (unknown, spent by a newer one, expired, or for an
|
|
57
|
+
* address the account no longer has) is one 401, except a link whose address is already confirmed, which answers
|
|
58
|
+
* 204 again, so pressing the link twice is not an error.
|
|
59
|
+
*/
|
|
60
|
+
export interface ConfirmEmailBody {
|
|
61
|
+
/** The workspace the link names. Resolves the tenant before the token is looked up within it. */
|
|
62
|
+
tenantSlug: string;
|
|
63
|
+
confirmationToken: string;
|
|
64
|
+
}
|
|
28
65
|
/** `POST /auth/refresh` and `POST /auth/logout`. */
|
|
29
66
|
export interface RefreshTokenBody {
|
|
30
67
|
refreshToken: string;
|
|
@@ -108,6 +145,16 @@ export interface Principal {
|
|
|
108
145
|
/** Null for an API-key principal. */
|
|
109
146
|
userId: Nullable<UUID>;
|
|
110
147
|
email: Nullable<string>;
|
|
148
|
+
/**
|
|
149
|
+
* When the person proved they receive mail at {@link email}, or null while they have not (and for an API key).
|
|
150
|
+
*
|
|
151
|
+
* Set by using an emailed confirmation link, by accepting an invitation (somebody in the company typed the address,
|
|
152
|
+
* and the person holds the link), and by completing an emailed password reset. **Until it is set the address is an
|
|
153
|
+
* identifier, not a contact**: anybody may register with an address that is not theirs, so nothing may send an
|
|
154
|
+
* order confirmation, a receipt or anything else personal to it. Read from the database on every `GET /auth/me`,
|
|
155
|
+
* so it changes without signing in again; the copy inside a session is as of when it was issued.
|
|
156
|
+
*/
|
|
157
|
+
emailVerifiedAt: Nullable<IsoDateTime>;
|
|
111
158
|
firstName: Nullable<string>;
|
|
112
159
|
lastName: Nullable<string>;
|
|
113
160
|
/**
|