sinfactura-types 1.6.23 → 1.6.24
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/cash.d.ts +51 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/invoice.d.ts +3 -0
- package/dist/print.d.ts +27 -0
- package/dist/print.js +1 -0
- package/dist/store.d.ts +2 -0
- package/package.json +1 -1
package/dist/cash.d.ts
CHANGED
|
@@ -15,5 +15,56 @@ declare global {
|
|
|
15
15
|
balanceByCurrency?: Record<string, number>;
|
|
16
16
|
incomeByCurrency?: Record<string, number>;
|
|
17
17
|
}
|
|
18
|
+
type CashShiftStatus = 'OPEN' | 'CLOSED' | 'RECONCILED' | 'REJECTED';
|
|
19
|
+
type CashEventType = 'apertura' | 'cash-in' | 'cash-out' | 'sale' | 'refund' | 'tip' | 'cierre' | 'reconcile';
|
|
20
|
+
/**
|
|
21
|
+
* A cashier's drawer shift — one per cashier per day. PK `STORE#{storeId}`,
|
|
22
|
+
* SK `SHIFT#{shiftId}` where `shiftId = ${date}-${userId}`. State machine:
|
|
23
|
+
* OPEN → CLOSED (blind count) → RECONCILED | REJECTED (manager).
|
|
24
|
+
*/
|
|
25
|
+
interface CashShift {
|
|
26
|
+
shiftId: string;
|
|
27
|
+
storeId: string;
|
|
28
|
+
userId: string;
|
|
29
|
+
date: number;
|
|
30
|
+
status: CashShiftStatus;
|
|
31
|
+
float: number;
|
|
32
|
+
currency: string;
|
|
33
|
+
openedAt: number;
|
|
34
|
+
openedBy: string;
|
|
35
|
+
openedByName?: string;
|
|
36
|
+
closedAt?: number;
|
|
37
|
+
closedBy?: string;
|
|
38
|
+
closedByName?: string;
|
|
39
|
+
declaredCount?: number;
|
|
40
|
+
expectedBalance?: number;
|
|
41
|
+
eventSeq?: number;
|
|
42
|
+
reconciledAt?: number;
|
|
43
|
+
reconciledBy?: string;
|
|
44
|
+
reconciledByName?: string;
|
|
45
|
+
variance?: number;
|
|
46
|
+
reconcileDecision?: 'approved' | 'rejected';
|
|
47
|
+
reconcileNote?: string;
|
|
48
|
+
tipDistribution?: Record<string, number>;
|
|
49
|
+
createdAt: number;
|
|
50
|
+
updatedAt?: number;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Append-only audit row for every drawer movement. PK `SHIFT#{shiftId}`,
|
|
54
|
+
* SK `EVENT#{createdAt}#{eventId}`. Never overwritten or deleted —
|
|
55
|
+
* reconciliation replays it.
|
|
56
|
+
*/
|
|
57
|
+
interface CashEvent {
|
|
58
|
+
eventId: string;
|
|
59
|
+
shiftId: string;
|
|
60
|
+
storeId: string;
|
|
61
|
+
type: CashEventType;
|
|
62
|
+
amount: number;
|
|
63
|
+
direction?: 'income' | 'outcome';
|
|
64
|
+
concept?: string;
|
|
65
|
+
currency: string;
|
|
66
|
+
userId: string;
|
|
67
|
+
createdAt: number;
|
|
68
|
+
}
|
|
18
69
|
}
|
|
19
70
|
export {};
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
package/dist/invoice.d.ts
CHANGED
package/dist/print.d.ts
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
declare global {
|
|
2
|
+
type PrintJobState = 'queued' | 'sent' | 'printed' | 'error';
|
|
3
|
+
type PrintContentType = 'pdf_uri' | 'pdf_base64' | 'raw_uri' | 'raw_base64';
|
|
4
|
+
interface PrintOptions {
|
|
5
|
+
bin?: string;
|
|
6
|
+
collate?: boolean;
|
|
7
|
+
color?: boolean;
|
|
8
|
+
copies?: number;
|
|
9
|
+
dpi?: string;
|
|
10
|
+
duplex?: 'long-edge' | 'short-edge' | 'one-sided';
|
|
11
|
+
fit_to_page?: boolean;
|
|
12
|
+
media?: string;
|
|
13
|
+
nup?: number;
|
|
14
|
+
pages?: string;
|
|
15
|
+
paper?: string;
|
|
16
|
+
rotate?: 0 | 90 | 180 | 270;
|
|
17
|
+
}
|
|
18
|
+
interface PrintJobTransition {
|
|
19
|
+
jobId: string;
|
|
20
|
+
state: PrintJobState;
|
|
21
|
+
ts: number;
|
|
22
|
+
source: 'be' | 'agent';
|
|
23
|
+
detail?: string;
|
|
24
|
+
errorCode?: string;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
export {};
|
package/dist/print.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/store.d.ts
CHANGED