sinfactura-types 1.10.413 → 1.10.415
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/attendance.d.ts +124 -1
- package/dist/attendance.js +22 -1
- package/dist/cjs/attendance.js +23 -0
- package/dist/customer.d.ts +15 -0
- package/package.json +1 -1
package/dist/attendance.d.ts
CHANGED
|
@@ -187,5 +187,128 @@ declare global {
|
|
|
187
187
|
/** Opaque. Feed it back as `?startKey=`; absent means the range is exhausted. */
|
|
188
188
|
LastEvaluatedKey?: string;
|
|
189
189
|
}
|
|
190
|
+
/** One of {@link ATTENDANCE_PAY_PERIOD_CADENCES}. */
|
|
191
|
+
type AttendancePayPeriodCadence = (typeof ATTENDANCE_PAY_PERIOD_CADENCES)[number];
|
|
192
|
+
/**
|
|
193
|
+
* A store's pay-period schedule for the attendance export. One row per store.
|
|
194
|
+
*
|
|
195
|
+
* - `MONTHLY` — the calendar month.
|
|
196
|
+
* - `QUINCENAL` — the 1st–15th, then the 16th to the month's last day.
|
|
197
|
+
* - `ANCHORED` — from `anchorDay` of one month to the day before `anchorDay` of
|
|
198
|
+
* the next. `anchorDay` is 2–28 and is required for this cadence only.
|
|
199
|
+
*
|
|
200
|
+
* Bounds are Buenos Aires calendar days; the timezone is not configurable.
|
|
201
|
+
*/
|
|
202
|
+
interface AttendanceExportConfig {
|
|
203
|
+
storeId: string;
|
|
204
|
+
cadence: AttendancePayPeriodCadence;
|
|
205
|
+
anchorDay?: number;
|
|
206
|
+
/** `false` stops the scheduled run. Manual runs still work. */
|
|
207
|
+
enabled: boolean;
|
|
208
|
+
updatedAt?: number;
|
|
209
|
+
updatedBy?: string;
|
|
210
|
+
}
|
|
211
|
+
/** `POST /attendance/exports/config`. `storeId` comes from the token. */
|
|
212
|
+
interface AttendanceExportConfigRequest {
|
|
213
|
+
cadence: AttendancePayPeriodCadence;
|
|
214
|
+
anchorDay?: number;
|
|
215
|
+
enabled: boolean;
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* `GET` and `POST /attendance/exports/config`. `data` is `null` when the store
|
|
219
|
+
* has never configured a pay period, which also means no scheduled run.
|
|
220
|
+
*/
|
|
221
|
+
interface AttendanceExportConfigResponse {
|
|
222
|
+
message: string;
|
|
223
|
+
data: AttendanceExportConfig | null;
|
|
224
|
+
}
|
|
225
|
+
/**
|
|
226
|
+
* `COMPLETE` means every roll-up in the period was read. `INCOMPLETE` means the
|
|
227
|
+
* read hit its page budget first; the files then say so on their first line and
|
|
228
|
+
* must not be treated as the whole period.
|
|
229
|
+
*/
|
|
230
|
+
type AttendanceExportStatus = 'COMPLETE' | 'INCOMPLETE';
|
|
231
|
+
type AttendanceExportTrigger = 'SCHEDULED' | 'MANUAL';
|
|
232
|
+
/**
|
|
233
|
+
* One generated version of one pay period's export.
|
|
234
|
+
*
|
|
235
|
+
* ⚠️ Versions are never overwritten. A run whose data matches the latest
|
|
236
|
+
* version writes nothing; a run whose data differs (a late correction, say)
|
|
237
|
+
* writes version + 1 beside it. Every earlier version stays readable until it
|
|
238
|
+
* expires.
|
|
239
|
+
*
|
|
240
|
+
* ⚠️ A convenience export generated from the attendance roll-ups, NOT a
|
|
241
|
+
* certified or legally reviewed record. Both files carry that disclaimer.
|
|
242
|
+
*/
|
|
243
|
+
interface AttendanceExport {
|
|
244
|
+
/** `${periodStart}#${periodEnd}#${version}` — `#`-joined, not URL-safe. */
|
|
245
|
+
exportId: string;
|
|
246
|
+
storeId: string;
|
|
247
|
+
/** YYYYMMDD, Buenos Aires, inclusive. */
|
|
248
|
+
periodStart: number;
|
|
249
|
+
/** YYYYMMDD, Buenos Aires, inclusive. */
|
|
250
|
+
periodEnd: number;
|
|
251
|
+
/** 1-based, per period. */
|
|
252
|
+
version: number;
|
|
253
|
+
status: AttendanceExportStatus;
|
|
254
|
+
trigger: AttendanceExportTrigger;
|
|
255
|
+
/** SHA-256 of the exported rows. Equal digests mean equal data. */
|
|
256
|
+
digest: string;
|
|
257
|
+
shiftCount: number;
|
|
258
|
+
employeeCount: number;
|
|
259
|
+
/** Rows still `OPEN` or `FLAGGED` when the export ran. */
|
|
260
|
+
needsReviewCount: number;
|
|
261
|
+
generatedAt: number;
|
|
262
|
+
/** The admin who asked for a MANUAL run. Absent on SCHEDULED runs. */
|
|
263
|
+
generatedBy?: string;
|
|
264
|
+
/** ms epoch. The files and this record are removed after this. */
|
|
265
|
+
expiresAt: number;
|
|
266
|
+
}
|
|
267
|
+
/** An {@link AttendanceExport} with short-lived (15 min) download links. */
|
|
268
|
+
interface AttendanceExportWithUrls extends AttendanceExport {
|
|
269
|
+
csvUrl: string;
|
|
270
|
+
pdfUrl: string;
|
|
271
|
+
}
|
|
272
|
+
/**
|
|
273
|
+
* `GET /attendance/exports?from&to` — every version whose period STARTS inside
|
|
274
|
+
* the window, newest period first and newest version first within a period.
|
|
275
|
+
* `from`/`to` are YYYYMMDD and required.
|
|
276
|
+
*/
|
|
277
|
+
interface AttendanceExportListResponse {
|
|
278
|
+
message: string;
|
|
279
|
+
data: AttendanceExportWithUrls[];
|
|
280
|
+
/** `true` when more versions exist than one response returns. Narrow the window. */
|
|
281
|
+
truncated?: boolean;
|
|
282
|
+
}
|
|
283
|
+
/**
|
|
284
|
+
* `POST /attendance/exports` — run the export now for the CLOSED pay period
|
|
285
|
+
* containing `date` (YYYYMMDD). Omit `date` for the most recent closed period.
|
|
286
|
+
*/
|
|
287
|
+
interface AttendanceExportRunRequest {
|
|
288
|
+
date?: number;
|
|
289
|
+
}
|
|
290
|
+
/** `created: false` means the data matched the latest version, which is returned. */
|
|
291
|
+
interface AttendanceExportRunResponse {
|
|
292
|
+
message: string;
|
|
293
|
+
data: AttendanceExportWithUrls;
|
|
294
|
+
created: boolean;
|
|
295
|
+
}
|
|
190
296
|
}
|
|
191
|
-
|
|
297
|
+
/**
|
|
298
|
+
* The pay-period cadences a store can configure — the single source for
|
|
299
|
+
* {@link AttendancePayPeriodCadence}. A runtime tuple so a request can be checked
|
|
300
|
+
* for membership against the same list the type is built from.
|
|
301
|
+
*/
|
|
302
|
+
export declare const ATTENDANCE_PAY_PERIOD_CADENCES: readonly ["MONTHLY", "QUINCENAL", "ANCHORED"];
|
|
303
|
+
/**
|
|
304
|
+
* Error codes the attendance export routes send, beside the shared range codes
|
|
305
|
+
* (`RANGE_REQUIRED`, `RANGE_MALFORMED`, `RANGE_INVERTED`, `RANGE_TOO_WIDE`).
|
|
306
|
+
*
|
|
307
|
+
* - `EXPORT_NOT_CONFIGURED` (409) — the store has no pay-period config.
|
|
308
|
+
* - `PERIOD_NOT_CLOSED` (409) — the requested date's period has not ended yet.
|
|
309
|
+
* - `ANCHOR_DAY_REQUIRED` (400) — `ANCHORED` without a valid `anchorDay`.
|
|
310
|
+
* - `EXPORT_CONFLICT` (409) — another run wrote a different version at the same
|
|
311
|
+
* moment. Retrying reads the new latest version.
|
|
312
|
+
*/
|
|
313
|
+
export declare const ATTENDANCE_EXPORT_ERROR_CODES: readonly ["EXPORT_NOT_CONFIGURED", "PERIOD_NOT_CLOSED", "ANCHOR_DAY_REQUIRED", "EXPORT_CONFLICT"];
|
|
314
|
+
export type AttendanceExportErrorCode = (typeof ATTENDANCE_EXPORT_ERROR_CODES)[number];
|
package/dist/attendance.js
CHANGED
|
@@ -1 +1,22 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* The pay-period cadences a store can configure — the single source for
|
|
3
|
+
* {@link AttendancePayPeriodCadence}. A runtime tuple so a request can be checked
|
|
4
|
+
* for membership against the same list the type is built from.
|
|
5
|
+
*/
|
|
6
|
+
export const ATTENDANCE_PAY_PERIOD_CADENCES = ['MONTHLY', 'QUINCENAL', 'ANCHORED'];
|
|
7
|
+
/**
|
|
8
|
+
* Error codes the attendance export routes send, beside the shared range codes
|
|
9
|
+
* (`RANGE_REQUIRED`, `RANGE_MALFORMED`, `RANGE_INVERTED`, `RANGE_TOO_WIDE`).
|
|
10
|
+
*
|
|
11
|
+
* - `EXPORT_NOT_CONFIGURED` (409) — the store has no pay-period config.
|
|
12
|
+
* - `PERIOD_NOT_CLOSED` (409) — the requested date's period has not ended yet.
|
|
13
|
+
* - `ANCHOR_DAY_REQUIRED` (400) — `ANCHORED` without a valid `anchorDay`.
|
|
14
|
+
* - `EXPORT_CONFLICT` (409) — another run wrote a different version at the same
|
|
15
|
+
* moment. Retrying reads the new latest version.
|
|
16
|
+
*/
|
|
17
|
+
export const ATTENDANCE_EXPORT_ERROR_CODES = [
|
|
18
|
+
'EXPORT_NOT_CONFIGURED',
|
|
19
|
+
'PERIOD_NOT_CLOSED',
|
|
20
|
+
'ANCHOR_DAY_REQUIRED',
|
|
21
|
+
'EXPORT_CONFLICT',
|
|
22
|
+
];
|
package/dist/cjs/attendance.js
CHANGED
|
@@ -1,2 +1,25 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ATTENDANCE_EXPORT_ERROR_CODES = exports.ATTENDANCE_PAY_PERIOD_CADENCES = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* The pay-period cadences a store can configure — the single source for
|
|
6
|
+
* {@link AttendancePayPeriodCadence}. A runtime tuple so a request can be checked
|
|
7
|
+
* for membership against the same list the type is built from.
|
|
8
|
+
*/
|
|
9
|
+
exports.ATTENDANCE_PAY_PERIOD_CADENCES = ['MONTHLY', 'QUINCENAL', 'ANCHORED'];
|
|
10
|
+
/**
|
|
11
|
+
* Error codes the attendance export routes send, beside the shared range codes
|
|
12
|
+
* (`RANGE_REQUIRED`, `RANGE_MALFORMED`, `RANGE_INVERTED`, `RANGE_TOO_WIDE`).
|
|
13
|
+
*
|
|
14
|
+
* - `EXPORT_NOT_CONFIGURED` (409) — the store has no pay-period config.
|
|
15
|
+
* - `PERIOD_NOT_CLOSED` (409) — the requested date's period has not ended yet.
|
|
16
|
+
* - `ANCHOR_DAY_REQUIRED` (400) — `ANCHORED` without a valid `anchorDay`.
|
|
17
|
+
* - `EXPORT_CONFLICT` (409) — another run wrote a different version at the same
|
|
18
|
+
* moment. Retrying reads the new latest version.
|
|
19
|
+
*/
|
|
20
|
+
exports.ATTENDANCE_EXPORT_ERROR_CODES = [
|
|
21
|
+
'EXPORT_NOT_CONFIGURED',
|
|
22
|
+
'PERIOD_NOT_CLOSED',
|
|
23
|
+
'ANCHOR_DAY_REQUIRED',
|
|
24
|
+
'EXPORT_CONFLICT',
|
|
25
|
+
];
|
package/dist/customer.d.ts
CHANGED
|
@@ -130,6 +130,21 @@ declare global {
|
|
|
130
130
|
emailVerified?: boolean;
|
|
131
131
|
/** ms-epoch of the OTP verification. Absent whenever `emailVerified` is not `true`. */
|
|
132
132
|
emailVerifiedAt?: number;
|
|
133
|
+
/**
|
|
134
|
+
* Set ONLY by the customer's own phone verification (an SMS code they ask
|
|
135
|
+
* for from their account page — never sent at sign-up). A trust signal:
|
|
136
|
+
* nothing gates on it.
|
|
137
|
+
*
|
|
138
|
+
* ⚠️ UNDEFINED MEANS **NOT** VERIFIED, exactly as `emailVerified`. It is a
|
|
139
|
+
* claim about ONE number: every write that changes `phone` removes it.
|
|
140
|
+
*/
|
|
141
|
+
phoneVerified?: boolean;
|
|
142
|
+
/**
|
|
143
|
+
* ms-epoch of the phone verification. Load-bearing, not decorative:
|
|
144
|
+
* Argentine mobile numbers are recycled, so the flag is evidence as of this
|
|
145
|
+
* date, never identity.
|
|
146
|
+
*/
|
|
147
|
+
phoneVerifiedAt?: number;
|
|
133
148
|
/**
|
|
134
149
|
* The Apple **Hide My Email** relay address this customer signs in with, if
|
|
135
150
|
* they have linked one — `<opaque>@privaterelay.appleid.com`.
|