@adminiumjs/manifest 0.3.78 → 0.3.80
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/dist/change-guards.d.ts +2 -0
- package/dist/change-guards.d.ts.map +1 -1
- package/dist/change-guards.js +7 -2
- package/dist/change-guards.js.map +1 -1
- package/dist/compose.d.ts.map +1 -1
- package/dist/compose.js +3 -0
- package/dist/compose.js.map +1 -1
- package/dist/expiry-notice.d.ts +68 -0
- package/dist/expiry-notice.d.ts.map +1 -0
- package/dist/expiry-notice.js +75 -0
- package/dist/expiry-notice.js.map +1 -0
- package/dist/from-template.d.ts +52 -0
- package/dist/from-template.d.ts.map +1 -0
- package/dist/from-template.js +89 -0
- package/dist/from-template.js.map +1 -0
- package/dist/index.d.ts +11 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11 -2
- package/dist/index.js.map +1 -1
- package/dist/instance.d.ts +2 -1
- package/dist/instance.d.ts.map +1 -1
- package/dist/instance.js +1 -0
- package/dist/instance.js.map +1 -1
- package/dist/leave/away.d.ts +67 -0
- package/dist/leave/away.d.ts.map +1 -0
- package/dist/leave/away.js +74 -0
- package/dist/leave/away.js.map +1 -0
- package/dist/leave/civil.d.ts +35 -0
- package/dist/leave/civil.d.ts.map +1 -0
- package/dist/leave/civil.js +75 -0
- package/dist/leave/civil.js.map +1 -0
- package/dist/leave/close-line.d.ts +91 -0
- package/dist/leave/close-line.d.ts.map +1 -0
- package/dist/leave/close-line.js +90 -0
- package/dist/leave/close-line.js.map +1 -0
- package/dist/leave/count.d.ts +82 -0
- package/dist/leave/count.d.ts.map +1 -0
- package/dist/leave/count.js +129 -0
- package/dist/leave/count.js.map +1 -0
- package/dist/leave/deciders.d.ts +81 -0
- package/dist/leave/deciders.d.ts.map +1 -0
- package/dist/leave/deciders.js +158 -0
- package/dist/leave/deciders.js.map +1 -0
- package/dist/leave/entitlement.d.ts +104 -0
- package/dist/leave/entitlement.d.ts.map +1 -0
- package/dist/leave/entitlement.js +59 -0
- package/dist/leave/entitlement.js.map +1 -0
- package/dist/leave/floors.d.ts +27 -0
- package/dist/leave/floors.d.ts.map +1 -0
- package/dist/leave/floors.js +37 -0
- package/dist/leave/floors.js.map +1 -0
- package/dist/leave/index.d.ts +22 -0
- package/dist/leave/index.d.ts.map +1 -0
- package/dist/leave/index.js +23 -0
- package/dist/leave/index.js.map +1 -0
- package/dist/leave/notice-gate.d.ts +41 -0
- package/dist/leave/notice-gate.d.ts.map +1 -0
- package/dist/leave/notice-gate.js +27 -0
- package/dist/leave/notice-gate.js.map +1 -0
- package/dist/leave/preset-england-wales.d.ts +10 -0
- package/dist/leave/preset-england-wales.d.ts.map +1 -0
- package/dist/leave/preset-england-wales.js +67 -0
- package/dist/leave/preset-england-wales.js.map +1 -0
- package/dist/leave/preset-germany.d.ts +30 -0
- package/dist/leave/preset-germany.d.ts.map +1 -0
- package/dist/leave/preset-germany.js +92 -0
- package/dist/leave/preset-germany.js.map +1 -0
- package/dist/leave/preset-us.d.ts +8 -0
- package/dist/leave/preset-us.d.ts.map +1 -0
- package/dist/leave/preset-us.js +48 -0
- package/dist/leave/preset-us.js.map +1 -0
- package/dist/leave/replay.d.ts +126 -0
- package/dist/leave/replay.d.ts.map +1 -0
- package/dist/leave/replay.js +158 -0
- package/dist/leave/replay.js.map +1 -0
- package/dist/leave/state.d.ts +64 -0
- package/dist/leave/state.d.ts.map +1 -0
- package/dist/leave/state.js +74 -0
- package/dist/leave/state.js.map +1 -0
- package/dist/leave/told.d.ts +32 -0
- package/dist/leave/told.d.ts.map +1 -0
- package/dist/leave/told.js +32 -0
- package/dist/leave/told.js.map +1 -0
- package/dist/leave/units.d.ts +21 -0
- package/dist/leave/units.d.ts.map +1 -0
- package/dist/leave/units.js +21 -0
- package/dist/leave/units.js.map +1 -0
- package/dist/leave-shape.d.ts +324 -0
- package/dist/leave-shape.d.ts.map +1 -0
- package/dist/leave-shape.js +164 -0
- package/dist/leave-shape.js.map +1 -0
- package/dist/leave-word.d.ts +86 -0
- package/dist/leave-word.d.ts.map +1 -0
- package/dist/leave-word.js +235 -0
- package/dist/leave-word.js.map +1 -0
- package/dist/outbox.d.ts +2 -0
- package/dist/outbox.d.ts.map +1 -1
- package/dist/outbox.js +5 -0
- package/dist/outbox.js.map +1 -1
- package/dist/person-import.d.ts +98 -0
- package/dist/person-import.d.ts.map +1 -0
- package/dist/person-import.js +270 -0
- package/dist/person-import.js.map +1 -0
- package/dist/public-access.d.ts +5 -0
- package/dist/public-access.d.ts.map +1 -1
- package/dist/public-access.js +68 -0
- package/dist/public-access.js.map +1 -1
- package/dist/record-classes.d.ts +99 -0
- package/dist/record-classes.d.ts.map +1 -0
- package/dist/record-classes.js +123 -0
- package/dist/record-classes.js.map +1 -0
- package/dist/removal.d.ts +1 -0
- package/dist/removal.d.ts.map +1 -1
- package/dist/removal.js +2 -0
- package/dist/removal.js.map +1 -1
- package/dist/roles.d.ts +23 -1
- package/dist/roles.d.ts.map +1 -1
- package/dist/roles.js +34 -5
- package/dist/roles.js.map +1 -1
- package/dist/schema.d.ts +601 -0
- package/dist/schema.d.ts.map +1 -1
- package/dist/schema.js +174 -14
- package/dist/schema.js.map +1 -1
- package/dist/staff-accounts.d.ts +102 -0
- package/dist/staff-accounts.d.ts.map +1 -0
- package/dist/staff-accounts.js +179 -0
- package/dist/staff-accounts.js.map +1 -0
- package/dist/validate.d.ts +10 -0
- package/dist/validate.d.ts.map +1 -1
- package/dist/validate.js +31 -0
- package/dist/validate.js.map +1 -1
- package/dist/words.d.ts +1 -1
- package/dist/words.d.ts.map +1 -1
- package/dist/words.js +80 -0
- package/dist/words.js.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,324 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The fixed shape of an app's leave tables: their short names in the `leave`
|
|
3
|
+
* word, the columns the engine reads and writes, the states of a request, and
|
|
4
|
+
* the columns only the engine decides.
|
|
5
|
+
*
|
|
6
|
+
* IMPORTS NOTHING. The validator's sync copies this file flat into every app,
|
|
7
|
+
* and the pure core under `./leave/` reads it from there too.
|
|
8
|
+
*/
|
|
9
|
+
/** The first Adminium that reads the leave words. The release round sets the real version here, in this one edit. */
|
|
10
|
+
export declare const LEAVE_MIN = "0.3.80";
|
|
11
|
+
/** The app's own tables the leave rules read: people, their terms, the calendar and the policies. */
|
|
12
|
+
export declare const LEAVE_SETUP_KEYS: readonly ["people", "employment", "terms", "patterns", "patternDays", "positions", "locations", "days", "years", "groups", "types", "policies", "blocked", "limits", "sick", "notes"];
|
|
13
|
+
/** The tables only Adminium writes. */
|
|
14
|
+
export declare const LEAVE_KEPT_KEYS: readonly ["leaveDays", "charges", "lots", "entries", "balances", "events", "notices", "covers", "runs", "runLines", "expiry"];
|
|
15
|
+
/** Every table the `leave` word names. */
|
|
16
|
+
export declare const LEAVE_TABLE_KEYS: readonly ["people", "employment", "terms", "patterns", "patternDays", "positions", "locations", "days", "years", "groups", "types", "policies", "blocked", "limits", "sick", "notes", "leaveDays", "charges", "lots", "entries", "balances", "events", "notices", "covers", "runs", "runLines", "expiry"];
|
|
17
|
+
export type LeaveSetupKey = (typeof LEAVE_SETUP_KEYS)[number];
|
|
18
|
+
export type LeaveKeptKey = (typeof LEAVE_KEPT_KEYS)[number];
|
|
19
|
+
export type LeaveTableKey = (typeof LEAVE_TABLE_KEYS)[number];
|
|
20
|
+
/** What kind of value a fixed column holds. */
|
|
21
|
+
export type LeaveColumnKind = 'key' | 'staff' | 'day' | 'int' | 'flag' | 'word' | 'text' | 'time' | 'json';
|
|
22
|
+
/** The manifest column types each kind may be declared as. */
|
|
23
|
+
export declare const LEAVE_KIND_TYPES: Readonly<Record<LeaveColumnKind, readonly string[]>>;
|
|
24
|
+
/** The columns of the request table, which carries the word. */
|
|
25
|
+
export declare const LEAVE_REQUEST_COLUMNS: {
|
|
26
|
+
readonly id: "key";
|
|
27
|
+
readonly employee_id: "key";
|
|
28
|
+
readonly person_user_id: "staff";
|
|
29
|
+
readonly leave_type_id: "key";
|
|
30
|
+
readonly first_day: "day";
|
|
31
|
+
readonly last_day: "day";
|
|
32
|
+
readonly first_part: "word";
|
|
33
|
+
readonly last_part: "word";
|
|
34
|
+
readonly status: "word";
|
|
35
|
+
readonly step: "int";
|
|
36
|
+
readonly units: "int";
|
|
37
|
+
readonly units_frozen: "int";
|
|
38
|
+
readonly client_key: "text";
|
|
39
|
+
readonly proposal_first_day: "day";
|
|
40
|
+
readonly proposal_last_day: "day";
|
|
41
|
+
readonly proposal_first_part: "word";
|
|
42
|
+
readonly proposal_last_part: "word";
|
|
43
|
+
readonly asked_at: "time";
|
|
44
|
+
readonly updated_at: "time";
|
|
45
|
+
};
|
|
46
|
+
/** The columns of each kept table. */
|
|
47
|
+
export declare const LEAVE_COLUMNS: {
|
|
48
|
+
readonly leaveDays: {
|
|
49
|
+
readonly id: "key";
|
|
50
|
+
readonly request_id: "key";
|
|
51
|
+
readonly employee_id: "key";
|
|
52
|
+
readonly person_user_id: "staff";
|
|
53
|
+
readonly leave_type_id: "key";
|
|
54
|
+
readonly day: "day";
|
|
55
|
+
readonly part: "word";
|
|
56
|
+
readonly units: "int";
|
|
57
|
+
readonly live: "flag";
|
|
58
|
+
readonly state: "word";
|
|
59
|
+
readonly returned_at: "time";
|
|
60
|
+
readonly kind: "word";
|
|
61
|
+
};
|
|
62
|
+
readonly charges: {
|
|
63
|
+
readonly id: "key";
|
|
64
|
+
readonly day_id: "key";
|
|
65
|
+
readonly lot_id: "key";
|
|
66
|
+
readonly person_user_id: "staff";
|
|
67
|
+
readonly units: "int";
|
|
68
|
+
};
|
|
69
|
+
readonly lots: {
|
|
70
|
+
readonly id: "key";
|
|
71
|
+
readonly employee_id: "key";
|
|
72
|
+
readonly person_user_id: "staff";
|
|
73
|
+
readonly leave_type_id: "key";
|
|
74
|
+
readonly balance_id: "key";
|
|
75
|
+
readonly tier: "word";
|
|
76
|
+
readonly source_year: "int";
|
|
77
|
+
readonly usable_from: "day";
|
|
78
|
+
readonly expires_on: "day";
|
|
79
|
+
readonly state: "word";
|
|
80
|
+
readonly amount: "int";
|
|
81
|
+
readonly used: "int";
|
|
82
|
+
readonly moved: "int";
|
|
83
|
+
readonly left: "int";
|
|
84
|
+
readonly earn: "json";
|
|
85
|
+
readonly post_key: "text";
|
|
86
|
+
};
|
|
87
|
+
readonly entries: {
|
|
88
|
+
readonly id: "key";
|
|
89
|
+
readonly lot_id: "key";
|
|
90
|
+
readonly employee_id: "key";
|
|
91
|
+
readonly person_user_id: "staff";
|
|
92
|
+
readonly kind: "word";
|
|
93
|
+
readonly in_units: "int";
|
|
94
|
+
readonly out_units: "int";
|
|
95
|
+
readonly reason: "text";
|
|
96
|
+
readonly run_line_id: "key";
|
|
97
|
+
readonly post_key: "text";
|
|
98
|
+
readonly at: "time";
|
|
99
|
+
};
|
|
100
|
+
readonly balances: {
|
|
101
|
+
readonly id: "key";
|
|
102
|
+
readonly employee_id: "key";
|
|
103
|
+
readonly person_user_id: "staff";
|
|
104
|
+
readonly leave_type_id: "key";
|
|
105
|
+
readonly year: "int";
|
|
106
|
+
readonly granted: "int";
|
|
107
|
+
readonly carried: "int";
|
|
108
|
+
readonly lapsed: "int";
|
|
109
|
+
readonly pending: "int";
|
|
110
|
+
readonly left: "int";
|
|
111
|
+
};
|
|
112
|
+
readonly events: {
|
|
113
|
+
readonly id: "key";
|
|
114
|
+
readonly request_id: "key";
|
|
115
|
+
readonly person_user_id: "staff";
|
|
116
|
+
readonly kind: "word";
|
|
117
|
+
readonly by_user_id: "text";
|
|
118
|
+
readonly as_role: "word";
|
|
119
|
+
readonly from_state: "word";
|
|
120
|
+
readonly to_state: "word";
|
|
121
|
+
readonly data: "json";
|
|
122
|
+
readonly at: "time";
|
|
123
|
+
};
|
|
124
|
+
readonly notices: {
|
|
125
|
+
readonly id: "key";
|
|
126
|
+
readonly employee_id: "key";
|
|
127
|
+
readonly person_user_id: "staff";
|
|
128
|
+
readonly kind: "word";
|
|
129
|
+
readonly request_id: "key";
|
|
130
|
+
readonly step: "int";
|
|
131
|
+
readonly reason: "word";
|
|
132
|
+
readonly post_key: "text";
|
|
133
|
+
readonly outbox_id: "key";
|
|
134
|
+
readonly read_at: "time";
|
|
135
|
+
readonly at: "time";
|
|
136
|
+
};
|
|
137
|
+
readonly covers: {
|
|
138
|
+
readonly id: "key";
|
|
139
|
+
readonly for_user_id: "staff";
|
|
140
|
+
readonly cover_user_id: "staff";
|
|
141
|
+
readonly from_day: "day";
|
|
142
|
+
readonly to_day: "day";
|
|
143
|
+
};
|
|
144
|
+
readonly runs: {
|
|
145
|
+
readonly id: "key";
|
|
146
|
+
readonly kind: "word";
|
|
147
|
+
readonly year: "int";
|
|
148
|
+
readonly state: "word";
|
|
149
|
+
readonly policy_version: "key";
|
|
150
|
+
readonly made_by: "text";
|
|
151
|
+
readonly at: "time";
|
|
152
|
+
};
|
|
153
|
+
readonly runLines: {
|
|
154
|
+
readonly id: "key";
|
|
155
|
+
readonly run_id: "key";
|
|
156
|
+
readonly employee_id: "key";
|
|
157
|
+
readonly leave_type_id: "key";
|
|
158
|
+
readonly hash: "text";
|
|
159
|
+
readonly outcome: "word";
|
|
160
|
+
readonly figures: "json";
|
|
161
|
+
readonly applied_at: "time";
|
|
162
|
+
readonly undone_at: "time";
|
|
163
|
+
readonly error: "text";
|
|
164
|
+
};
|
|
165
|
+
readonly expiry: {
|
|
166
|
+
readonly id: "key";
|
|
167
|
+
readonly employee_id: "key";
|
|
168
|
+
readonly person_user_id: "staff";
|
|
169
|
+
readonly leave_type_id: "key";
|
|
170
|
+
readonly source_year: "int";
|
|
171
|
+
readonly kind: "word";
|
|
172
|
+
readonly generation: "int";
|
|
173
|
+
readonly at_risk: "int";
|
|
174
|
+
readonly carry_units: "int";
|
|
175
|
+
readonly carry_until: "day";
|
|
176
|
+
readonly text: "text";
|
|
177
|
+
readonly language: "word";
|
|
178
|
+
readonly outbox_id: "key";
|
|
179
|
+
readonly seen_at: "time";
|
|
180
|
+
readonly sent_at: "time";
|
|
181
|
+
readonly post_key: "text";
|
|
182
|
+
};
|
|
183
|
+
};
|
|
184
|
+
/**
|
|
185
|
+
* The columns the engine reads of the app's own tables. An app may add more;
|
|
186
|
+
* these it must have, under these names. A key is whatever the app's key is.
|
|
187
|
+
*/
|
|
188
|
+
export declare const LEAVE_SETUP_COLUMNS: {
|
|
189
|
+
readonly people: {
|
|
190
|
+
readonly id: "key";
|
|
191
|
+
readonly name: "text";
|
|
192
|
+
readonly preferred_name: "text";
|
|
193
|
+
readonly user_id: "staff";
|
|
194
|
+
readonly manager_id: "key";
|
|
195
|
+
readonly manager_since: "day";
|
|
196
|
+
readonly left_on: "day";
|
|
197
|
+
readonly position_id: "key";
|
|
198
|
+
readonly location_id: "key";
|
|
199
|
+
readonly listed: "flag";
|
|
200
|
+
};
|
|
201
|
+
readonly employment: {
|
|
202
|
+
readonly employee_id: "key";
|
|
203
|
+
readonly start_date: "day";
|
|
204
|
+
readonly status: "word";
|
|
205
|
+
};
|
|
206
|
+
readonly terms: {
|
|
207
|
+
readonly employee_id: "key";
|
|
208
|
+
readonly valid_from: "day";
|
|
209
|
+
readonly valid_to: "day";
|
|
210
|
+
readonly pattern_id: "key";
|
|
211
|
+
readonly share: "int";
|
|
212
|
+
};
|
|
213
|
+
readonly patterns: {
|
|
214
|
+
readonly id: "key";
|
|
215
|
+
readonly weeks: "int";
|
|
216
|
+
};
|
|
217
|
+
readonly patternDays: {
|
|
218
|
+
readonly pattern_id: "key";
|
|
219
|
+
readonly week: "int";
|
|
220
|
+
readonly weekday: "word";
|
|
221
|
+
readonly hours: "int";
|
|
222
|
+
};
|
|
223
|
+
readonly positions: {
|
|
224
|
+
readonly id: "key";
|
|
225
|
+
readonly department_id: "key";
|
|
226
|
+
};
|
|
227
|
+
readonly locations: {
|
|
228
|
+
readonly id: "key";
|
|
229
|
+
readonly time_zone: "text";
|
|
230
|
+
readonly policy_group_id: "key";
|
|
231
|
+
};
|
|
232
|
+
readonly days: {
|
|
233
|
+
readonly location_id: "key";
|
|
234
|
+
readonly day: "day";
|
|
235
|
+
readonly name: "text";
|
|
236
|
+
readonly kind: "word";
|
|
237
|
+
};
|
|
238
|
+
readonly years: {
|
|
239
|
+
readonly location_id: "key";
|
|
240
|
+
readonly year: "int";
|
|
241
|
+
readonly confirmed_at: "time";
|
|
242
|
+
};
|
|
243
|
+
/** `preset`: `england-wales`, `germany` or `us`. `days_per_year`: the US preset's figure; empty means HR has not confirmed the default. */
|
|
244
|
+
readonly groups: {
|
|
245
|
+
readonly id: "key";
|
|
246
|
+
readonly preset: "word";
|
|
247
|
+
readonly days_per_year: "int";
|
|
248
|
+
};
|
|
249
|
+
/** `code`: `annual`, `sick`, `parental`, `unpaid`, `toil`. `kind`: `balance` or `tracked`. `visibility`: `as booked` or `discreet`. */
|
|
250
|
+
readonly types: {
|
|
251
|
+
readonly id: "key";
|
|
252
|
+
readonly code: "word";
|
|
253
|
+
readonly kind: "word";
|
|
254
|
+
readonly visibility: "word";
|
|
255
|
+
readonly needs_approval: "flag";
|
|
256
|
+
};
|
|
257
|
+
readonly policies: {
|
|
258
|
+
readonly id: "key";
|
|
259
|
+
readonly policy_group_id: "key";
|
|
260
|
+
readonly version: "int";
|
|
261
|
+
readonly valid_from: "day";
|
|
262
|
+
readonly threshold_days: "int";
|
|
263
|
+
readonly min_notice_days: "int";
|
|
264
|
+
readonly grace_days: "int";
|
|
265
|
+
readonly wait_days: "int";
|
|
266
|
+
};
|
|
267
|
+
/** An empty `department_id` is the whole company. */
|
|
268
|
+
readonly blocked: {
|
|
269
|
+
readonly id: "key";
|
|
270
|
+
readonly department_id: "key";
|
|
271
|
+
readonly first_day: "day";
|
|
272
|
+
readonly last_day: "day";
|
|
273
|
+
readonly reason: "text";
|
|
274
|
+
};
|
|
275
|
+
readonly limits: {
|
|
276
|
+
readonly id: "key";
|
|
277
|
+
readonly department_id: "key";
|
|
278
|
+
readonly first_day: "day";
|
|
279
|
+
readonly last_day: "day";
|
|
280
|
+
readonly places: "int";
|
|
281
|
+
readonly requests_close_on: "day";
|
|
282
|
+
};
|
|
283
|
+
/** HR's alone: a certificate, a follow-up and any note about a sickness are kept here and nowhere else. */
|
|
284
|
+
readonly sick: {
|
|
285
|
+
readonly id: "key";
|
|
286
|
+
readonly request_id: "key";
|
|
287
|
+
readonly employee_id: "key";
|
|
288
|
+
readonly certificate_on: "day";
|
|
289
|
+
readonly follow_up_on: "day";
|
|
290
|
+
readonly note: "text";
|
|
291
|
+
};
|
|
292
|
+
readonly notes: {
|
|
293
|
+
readonly id: "key";
|
|
294
|
+
readonly request_id: "key";
|
|
295
|
+
readonly body: "text";
|
|
296
|
+
};
|
|
297
|
+
};
|
|
298
|
+
/** The sets of columns a kept table holds unique, beside the single `post_key` columns below. */
|
|
299
|
+
export declare const LEAVE_UNIQUE_SETS: Readonly<Partial<Record<LeaveKeptKey, readonly (readonly string[])[]>>>;
|
|
300
|
+
/** The kept tables whose rows are posted once, by a key built from what they are. */
|
|
301
|
+
export declare const LEAVE_POST_KEYED: readonly LeaveKeptKey[];
|
|
302
|
+
/** The kept tables with no person of their own: a run belongs to the company. */
|
|
303
|
+
export declare const LEAVE_NO_PERSON: readonly LeaveKeptKey[];
|
|
304
|
+
/** The states of a request. A change is `proposal_*` on an approved row, never a state. */
|
|
305
|
+
export declare const LEAVE_STATES: readonly ["pending", "approved", "declined", "cancelled", "withdrawn", "reported", "recorded", "closed"];
|
|
306
|
+
export type LeaveState = (typeof LEAVE_STATES)[number];
|
|
307
|
+
/** The state a request starts in when nothing else is decided. */
|
|
308
|
+
export declare const LEAVE_INITIAL: LeaveState;
|
|
309
|
+
/** The states a request may be made in, each decided by the engine and never by a writer. */
|
|
310
|
+
export declare const LEAVE_STARTS: readonly LeaveState[];
|
|
311
|
+
/**
|
|
312
|
+
* The moves between them:
|
|
313
|
+
* - waiting: decided, cancelled by the person, or closed when they leave;
|
|
314
|
+
* - approved: withdrawn by whoever approved it or HR, cancelled through a
|
|
315
|
+
* decided change, or closed by the leaving run;
|
|
316
|
+
* - a sick report: ended, or withdrawn as a mistake;
|
|
317
|
+
* - a recorded past absence: withdrawn as a mistake.
|
|
318
|
+
*/
|
|
319
|
+
export declare const LEAVE_MOVES: Readonly<Record<LeaveState, readonly LeaveState[]>>;
|
|
320
|
+
/** The kinds of leave blocked days and limits apply to. Never parental leave or sickness. */
|
|
321
|
+
export declare const LEAVE_LIMITED_CODES: readonly string[];
|
|
322
|
+
/** The columns of a request only the engine decides: anything a client sends for them is dropped. */
|
|
323
|
+
export declare const LEAVE_DECIDED: readonly ["status", "step", "units", "units_frozen", "person_user_id", "proposal_first_day", "proposal_last_day", "proposal_first_part", "proposal_last_part", "asked_at"];
|
|
324
|
+
//# sourceMappingURL=leave-shape.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"leave-shape.d.ts","sourceRoot":"","sources":["../src/leave-shape.ts"],"names":[],"mappings":"AACA;;;;;;;GAOG;AAEH,qHAAqH;AACrH,eAAO,MAAM,SAAS,WAAW,CAAC;AAElC,qGAAqG;AACrG,eAAO,MAAM,gBAAgB,uLAAwL,CAAC;AAEtN,uCAAuC;AACvC,eAAO,MAAM,eAAe,+HAAgI,CAAC;AAE7J,0CAA0C;AAC1C,eAAO,MAAM,gBAAgB,2SAAqD,CAAC;AAEnF,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAC;AAC9D,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC;AAC5D,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE9D,+CAA+C;AAC/C,MAAM,MAAM,eAAe,GAAG,KAAK,GAAG,OAAO,GAAG,KAAK,GAAG,KAAK,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;AAE3G,8DAA8D;AAC9D,eAAO,MAAM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,WAAW,EAAE,QAAQ,CAAC,MAAM,CAAC,UAAU,EAAE,SAAS,UAAU,EAAE,CAAC,CAS3E,CAAC;AAEF,6FAA6F;AAC7F,eAAO,MAAM,mBAAmB,EAAE,SAAS,MAAM,EAAiC,CAAC;AAEnF,qGAAqG;AACrG,eAAO,MAAM,aAAa,4KAA6K,CAAC"}
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
// SPDX-License-Identifier: AGPL-3.0-only
|
|
2
|
+
/**
|
|
3
|
+
* The fixed shape of an app's leave tables: their short names in the `leave`
|
|
4
|
+
* word, the columns the engine reads and writes, the states of a request, and
|
|
5
|
+
* the columns only the engine decides.
|
|
6
|
+
*
|
|
7
|
+
* IMPORTS NOTHING. The validator's sync copies this file flat into every app,
|
|
8
|
+
* and the pure core under `./leave/` reads it from there too.
|
|
9
|
+
*/
|
|
10
|
+
/** The first Adminium that reads the leave words. The release round sets the real version here, in this one edit. */
|
|
11
|
+
export const LEAVE_MIN = '0.3.80';
|
|
12
|
+
/** The app's own tables the leave rules read: people, their terms, the calendar and the policies. */
|
|
13
|
+
export const LEAVE_SETUP_KEYS = ['people', 'employment', 'terms', 'patterns', 'patternDays', 'positions', 'locations', 'days', 'years', 'groups', 'types', 'policies', 'blocked', 'limits', 'sick', 'notes'];
|
|
14
|
+
/** The tables only Adminium writes. */
|
|
15
|
+
export const LEAVE_KEPT_KEYS = ['leaveDays', 'charges', 'lots', 'entries', 'balances', 'events', 'notices', 'covers', 'runs', 'runLines', 'expiry'];
|
|
16
|
+
/** Every table the `leave` word names. */
|
|
17
|
+
export const LEAVE_TABLE_KEYS = [...LEAVE_SETUP_KEYS, ...LEAVE_KEPT_KEYS];
|
|
18
|
+
/** The manifest column types each kind may be declared as. */
|
|
19
|
+
export const LEAVE_KIND_TYPES = {
|
|
20
|
+
key: ['id', 'int', 'bigint', 'uuid', 'text', 'fk'],
|
|
21
|
+
staff: ['text'],
|
|
22
|
+
day: ['date'],
|
|
23
|
+
int: ['int', 'bigint'],
|
|
24
|
+
flag: ['int', 'bool'],
|
|
25
|
+
word: ['text', 'enum'],
|
|
26
|
+
text: ['text'],
|
|
27
|
+
time: ['timestamptz'],
|
|
28
|
+
json: ['json', 'text'],
|
|
29
|
+
};
|
|
30
|
+
/** The columns of the request table, which carries the word. */
|
|
31
|
+
export const LEAVE_REQUEST_COLUMNS = {
|
|
32
|
+
id: 'key',
|
|
33
|
+
employee_id: 'key',
|
|
34
|
+
person_user_id: 'staff',
|
|
35
|
+
leave_type_id: 'key',
|
|
36
|
+
first_day: 'day',
|
|
37
|
+
last_day: 'day',
|
|
38
|
+
first_part: 'word',
|
|
39
|
+
last_part: 'word',
|
|
40
|
+
status: 'word',
|
|
41
|
+
step: 'int',
|
|
42
|
+
units: 'int',
|
|
43
|
+
units_frozen: 'int',
|
|
44
|
+
client_key: 'text',
|
|
45
|
+
proposal_first_day: 'day',
|
|
46
|
+
proposal_last_day: 'day',
|
|
47
|
+
proposal_first_part: 'word',
|
|
48
|
+
proposal_last_part: 'word',
|
|
49
|
+
asked_at: 'time',
|
|
50
|
+
updated_at: 'time',
|
|
51
|
+
};
|
|
52
|
+
/** The columns of each kept table. */
|
|
53
|
+
export const LEAVE_COLUMNS = {
|
|
54
|
+
leaveDays: { id: 'key', request_id: 'key', employee_id: 'key', person_user_id: 'staff', leave_type_id: 'key', day: 'day', part: 'word', units: 'int', live: 'flag', state: 'word', returned_at: 'time', kind: 'word' },
|
|
55
|
+
charges: { id: 'key', day_id: 'key', lot_id: 'key', person_user_id: 'staff', units: 'int' },
|
|
56
|
+
lots: {
|
|
57
|
+
id: 'key',
|
|
58
|
+
employee_id: 'key',
|
|
59
|
+
person_user_id: 'staff',
|
|
60
|
+
leave_type_id: 'key',
|
|
61
|
+
balance_id: 'key',
|
|
62
|
+
tier: 'word',
|
|
63
|
+
source_year: 'int',
|
|
64
|
+
usable_from: 'day',
|
|
65
|
+
expires_on: 'day',
|
|
66
|
+
state: 'word',
|
|
67
|
+
amount: 'int',
|
|
68
|
+
used: 'int',
|
|
69
|
+
moved: 'int',
|
|
70
|
+
left: 'int',
|
|
71
|
+
earn: 'json',
|
|
72
|
+
post_key: 'text',
|
|
73
|
+
},
|
|
74
|
+
entries: { id: 'key', lot_id: 'key', employee_id: 'key', person_user_id: 'staff', kind: 'word', in_units: 'int', out_units: 'int', reason: 'text', run_line_id: 'key', post_key: 'text', at: 'time' },
|
|
75
|
+
balances: { id: 'key', employee_id: 'key', person_user_id: 'staff', leave_type_id: 'key', year: 'int', granted: 'int', carried: 'int', lapsed: 'int', pending: 'int', left: 'int' },
|
|
76
|
+
events: { id: 'key', request_id: 'key', person_user_id: 'staff', kind: 'word', by_user_id: 'text', as_role: 'word', from_state: 'word', to_state: 'word', data: 'json', at: 'time' },
|
|
77
|
+
notices: { id: 'key', employee_id: 'key', person_user_id: 'staff', kind: 'word', request_id: 'key', step: 'int', reason: 'word', post_key: 'text', outbox_id: 'key', read_at: 'time', at: 'time' },
|
|
78
|
+
covers: { id: 'key', for_user_id: 'staff', cover_user_id: 'staff', from_day: 'day', to_day: 'day' },
|
|
79
|
+
runs: { id: 'key', kind: 'word', year: 'int', state: 'word', policy_version: 'key', made_by: 'text', at: 'time' },
|
|
80
|
+
runLines: { id: 'key', run_id: 'key', employee_id: 'key', leave_type_id: 'key', hash: 'text', outcome: 'word', figures: 'json', applied_at: 'time', undone_at: 'time', error: 'text' },
|
|
81
|
+
expiry: {
|
|
82
|
+
id: 'key',
|
|
83
|
+
employee_id: 'key',
|
|
84
|
+
person_user_id: 'staff',
|
|
85
|
+
leave_type_id: 'key',
|
|
86
|
+
source_year: 'int',
|
|
87
|
+
kind: 'word',
|
|
88
|
+
generation: 'int',
|
|
89
|
+
at_risk: 'int',
|
|
90
|
+
carry_units: 'int',
|
|
91
|
+
carry_until: 'day',
|
|
92
|
+
text: 'text',
|
|
93
|
+
language: 'word',
|
|
94
|
+
outbox_id: 'key',
|
|
95
|
+
seen_at: 'time',
|
|
96
|
+
sent_at: 'time',
|
|
97
|
+
post_key: 'text',
|
|
98
|
+
},
|
|
99
|
+
};
|
|
100
|
+
/**
|
|
101
|
+
* The columns the engine reads of the app's own tables. An app may add more;
|
|
102
|
+
* these it must have, under these names. A key is whatever the app's key is.
|
|
103
|
+
*/
|
|
104
|
+
export const LEAVE_SETUP_COLUMNS = {
|
|
105
|
+
people: { id: 'key', name: 'text', preferred_name: 'text', user_id: 'staff', manager_id: 'key', manager_since: 'day', left_on: 'day', position_id: 'key', location_id: 'key', listed: 'flag' },
|
|
106
|
+
employment: { employee_id: 'key', start_date: 'day', status: 'word' },
|
|
107
|
+
terms: { employee_id: 'key', valid_from: 'day', valid_to: 'day', pattern_id: 'key', share: 'int' },
|
|
108
|
+
patterns: { id: 'key', weeks: 'int' },
|
|
109
|
+
patternDays: { pattern_id: 'key', week: 'int', weekday: 'word', hours: 'int' },
|
|
110
|
+
positions: { id: 'key', department_id: 'key' },
|
|
111
|
+
locations: { id: 'key', time_zone: 'text', policy_group_id: 'key' },
|
|
112
|
+
days: { location_id: 'key', day: 'day', name: 'text', kind: 'word' },
|
|
113
|
+
years: { location_id: 'key', year: 'int', confirmed_at: 'time' },
|
|
114
|
+
/** `preset`: `england-wales`, `germany` or `us`. `days_per_year`: the US preset's figure; empty means HR has not confirmed the default. */
|
|
115
|
+
groups: { id: 'key', preset: 'word', days_per_year: 'int' },
|
|
116
|
+
/** `code`: `annual`, `sick`, `parental`, `unpaid`, `toil`. `kind`: `balance` or `tracked`. `visibility`: `as booked` or `discreet`. */
|
|
117
|
+
types: { id: 'key', code: 'word', kind: 'word', visibility: 'word', needs_approval: 'flag' },
|
|
118
|
+
policies: { id: 'key', policy_group_id: 'key', version: 'int', valid_from: 'day', threshold_days: 'int', min_notice_days: 'int', grace_days: 'int', wait_days: 'int' },
|
|
119
|
+
/** An empty `department_id` is the whole company. */
|
|
120
|
+
blocked: { id: 'key', department_id: 'key', first_day: 'day', last_day: 'day', reason: 'text' },
|
|
121
|
+
limits: { id: 'key', department_id: 'key', first_day: 'day', last_day: 'day', places: 'int', requests_close_on: 'day' },
|
|
122
|
+
/** HR's alone: a certificate, a follow-up and any note about a sickness are kept here and nowhere else. */
|
|
123
|
+
sick: { id: 'key', request_id: 'key', employee_id: 'key', certificate_on: 'day', follow_up_on: 'day', note: 'text' },
|
|
124
|
+
notes: { id: 'key', request_id: 'key', body: 'text' },
|
|
125
|
+
};
|
|
126
|
+
/** The sets of columns a kept table holds unique, beside the single `post_key` columns below. */
|
|
127
|
+
export const LEAVE_UNIQUE_SETS = {
|
|
128
|
+
leaveDays: [['employee_id', 'day', 'part', 'live']],
|
|
129
|
+
charges: [['day_id', 'lot_id']],
|
|
130
|
+
balances: [['employee_id', 'leave_type_id', 'year']],
|
|
131
|
+
};
|
|
132
|
+
/** The kept tables whose rows are posted once, by a key built from what they are. */
|
|
133
|
+
export const LEAVE_POST_KEYED = ['lots', 'entries', 'notices', 'expiry'];
|
|
134
|
+
/** The kept tables with no person of their own: a run belongs to the company. */
|
|
135
|
+
export const LEAVE_NO_PERSON = ['runs', 'runLines'];
|
|
136
|
+
/** The states of a request. A change is `proposal_*` on an approved row, never a state. */
|
|
137
|
+
export const LEAVE_STATES = ['pending', 'approved', 'declined', 'cancelled', 'withdrawn', 'reported', 'recorded', 'closed'];
|
|
138
|
+
/** The state a request starts in when nothing else is decided. */
|
|
139
|
+
export const LEAVE_INITIAL = 'pending';
|
|
140
|
+
/** The states a request may be made in, each decided by the engine and never by a writer. */
|
|
141
|
+
export const LEAVE_STARTS = ['approved', 'reported', 'recorded'];
|
|
142
|
+
/**
|
|
143
|
+
* The moves between them:
|
|
144
|
+
* - waiting: decided, cancelled by the person, or closed when they leave;
|
|
145
|
+
* - approved: withdrawn by whoever approved it or HR, cancelled through a
|
|
146
|
+
* decided change, or closed by the leaving run;
|
|
147
|
+
* - a sick report: ended, or withdrawn as a mistake;
|
|
148
|
+
* - a recorded past absence: withdrawn as a mistake.
|
|
149
|
+
*/
|
|
150
|
+
export const LEAVE_MOVES = {
|
|
151
|
+
pending: ['approved', 'declined', 'cancelled', 'closed'],
|
|
152
|
+
approved: ['withdrawn', 'cancelled', 'closed'],
|
|
153
|
+
reported: ['closed', 'withdrawn'],
|
|
154
|
+
recorded: ['withdrawn'],
|
|
155
|
+
declined: [],
|
|
156
|
+
cancelled: [],
|
|
157
|
+
withdrawn: [],
|
|
158
|
+
closed: [],
|
|
159
|
+
};
|
|
160
|
+
/** The kinds of leave blocked days and limits apply to. Never parental leave or sickness. */
|
|
161
|
+
export const LEAVE_LIMITED_CODES = ['annual', 'toil', 'unpaid'];
|
|
162
|
+
/** The columns of a request only the engine decides: anything a client sends for them is dropped. */
|
|
163
|
+
export const LEAVE_DECIDED = ['status', 'step', 'units', 'units_frozen', 'person_user_id', 'proposal_first_day', 'proposal_last_day', 'proposal_first_part', 'proposal_last_part', 'asked_at'];
|
|
164
|
+
//# sourceMappingURL=leave-shape.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"leave-shape.js","sourceRoot":"","sources":["../src/leave-shape.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC;;;;;;;GAOG;AAEH,qHAAqH;AACrH,MAAM,CAAC,MAAM,SAAS,GAAG,QAAQ,CAAC;AAElC,qGAAqG;AACrG,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAU,CAAC;AAEtN,uCAAuC;AACvC,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,CAAU,CAAC;A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AC;IACxD,QAAQ,EAAE,CAAC,WAAW,EAAE,WAAW,EAAE,QAAQ,CAAC;IAC9C,QAAQ,EAAE,CAAC,QAAQ,EAAE,WAAW,CAAC;IACjC,QAAQ,EAAE,CAAC,WAAW,CAAC;IACvB,QAAQ,EAAE,EAAE;IACZ,SAAS,EAAE,EAAE;IACb,SAAS,EAAE,EAAE;IACb,MAAM,EAAE,EAAE;CACX,CAAC;AAEF,6FAA6F;AAC7F,MAAM,CAAC,MAAM,mBAAmB,GAAsB,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC;AAEnF,qGAAqG;AACrG,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,UAAU,CAAU,CAAC"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `table.leave` — the word on an app's request table that makes it a leave
|
|
3
|
+
* table: which of the app's tables are its people, calendar and policies, and
|
|
4
|
+
* which are the kept tables only Adminium writes.
|
|
5
|
+
*
|
|
6
|
+
* Column names are fixed by `leave-shape.ts`, so the word stays small and an
|
|
7
|
+
* app has one list to match. This file imports zod and that shape and NOTHING
|
|
8
|
+
* else: the validator's sync copies `schema.ts`'s imports flat into every app,
|
|
9
|
+
* so an import of `./leave/` here would break the sync in all of them. What it
|
|
10
|
+
* needs of the manifest it is handed, as plain shapes.
|
|
11
|
+
*/
|
|
12
|
+
import { z } from 'zod';
|
|
13
|
+
export declare const leaveSchema: z.ZodObject<{
|
|
14
|
+
version: z.ZodLiteral<1>;
|
|
15
|
+
tables: z.ZodObject<{
|
|
16
|
+
patterns: z.ZodString;
|
|
17
|
+
entries: z.ZodString;
|
|
18
|
+
days: z.ZodString;
|
|
19
|
+
groups: z.ZodString;
|
|
20
|
+
limits: z.ZodString;
|
|
21
|
+
people: z.ZodString;
|
|
22
|
+
employment: z.ZodString;
|
|
23
|
+
terms: z.ZodString;
|
|
24
|
+
patternDays: z.ZodString;
|
|
25
|
+
positions: z.ZodString;
|
|
26
|
+
locations: z.ZodString;
|
|
27
|
+
years: z.ZodString;
|
|
28
|
+
types: z.ZodString;
|
|
29
|
+
policies: z.ZodString;
|
|
30
|
+
blocked: z.ZodString;
|
|
31
|
+
sick: z.ZodString;
|
|
32
|
+
notes: z.ZodString;
|
|
33
|
+
leaveDays: z.ZodString;
|
|
34
|
+
charges: z.ZodString;
|
|
35
|
+
lots: z.ZodString;
|
|
36
|
+
balances: z.ZodString;
|
|
37
|
+
events: z.ZodString;
|
|
38
|
+
notices: z.ZodString;
|
|
39
|
+
covers: z.ZodString;
|
|
40
|
+
runs: z.ZodString;
|
|
41
|
+
runLines: z.ZodString;
|
|
42
|
+
expiry: z.ZodString;
|
|
43
|
+
}, z.core.$strict>;
|
|
44
|
+
sampleAsOf: z.ZodOptional<z.ZodString>;
|
|
45
|
+
}, z.core.$strict>;
|
|
46
|
+
export type LeaveRule = z.infer<typeof leaveSchema>;
|
|
47
|
+
export interface LeaveIssue {
|
|
48
|
+
path: (string | number)[];
|
|
49
|
+
message: string;
|
|
50
|
+
}
|
|
51
|
+
interface ColumnLike {
|
|
52
|
+
ref: string;
|
|
53
|
+
type: string;
|
|
54
|
+
nullable?: boolean | undefined;
|
|
55
|
+
unique?: true | undefined;
|
|
56
|
+
references?: string | undefined;
|
|
57
|
+
rules?: Readonly<Record<string, unknown>> | undefined;
|
|
58
|
+
}
|
|
59
|
+
interface TableLike {
|
|
60
|
+
ref: string;
|
|
61
|
+
columns: readonly ColumnLike[];
|
|
62
|
+
unique?: readonly (readonly string[])[] | undefined;
|
|
63
|
+
belongs?: readonly unknown[] | undefined;
|
|
64
|
+
states?: unknown;
|
|
65
|
+
}
|
|
66
|
+
/** What the word's checks read of the rest of the manifest. */
|
|
67
|
+
export interface LeaveContext {
|
|
68
|
+
tables: readonly TableLike[];
|
|
69
|
+
roles: readonly {
|
|
70
|
+
key: string;
|
|
71
|
+
permissions?: readonly string[] | undefined;
|
|
72
|
+
}[];
|
|
73
|
+
publicAccess: readonly {
|
|
74
|
+
table: string;
|
|
75
|
+
}[];
|
|
76
|
+
automations: readonly {
|
|
77
|
+
trigger?: unknown;
|
|
78
|
+
graph?: unknown;
|
|
79
|
+
}[];
|
|
80
|
+
/** The columns a formula reads (`formula.ts`), handed in so this file imports nothing more. */
|
|
81
|
+
formulaColumns: (expr: never) => readonly string[];
|
|
82
|
+
}
|
|
83
|
+
/** Everything in a `leave` word that the engine could not run, or that would let a write around it. */
|
|
84
|
+
export declare function leaveIssues(table: TableLike, rule: LeaveRule, context: LeaveContext, at: (...rest: (string | number)[]) => (string | number)[]): LeaveIssue[];
|
|
85
|
+
export {};
|
|
86
|
+
//# sourceMappingURL=leave-word.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"leave-word.d.ts","sourceRoot":"","sources":["../src/leave-word.ts"],"names":[],"mappings":"AACA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAkCxB,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAQb,CAAC;AACZ,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AAEpD,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;IAC1B,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,UAAU,UAAU;IAClB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC/B,MAAM,CAAC,EAAE,IAAI,GAAG,SAAS,CAAC;IAC1B,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,KAAK,CA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