@deepintel-ltd/farmpro-contracts 1.25.2 → 1.26.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.
Files changed (37) hide show
  1. package/dist/routes/farm-enterprises.routes.d.ts +44 -44
  2. package/dist/routes/farms.routes.d.ts +9 -9
  3. package/dist/routes/geofences.routes.d.ts +2 -2
  4. package/dist/routes/livestock-groups.routes.d.ts +724 -54
  5. package/dist/routes/livestock-groups.routes.d.ts.map +1 -1
  6. package/dist/routes/livestock-groups.routes.js +17 -1
  7. package/dist/routes/livestock.routes.d.ts +3505 -42
  8. package/dist/routes/livestock.routes.d.ts.map +1 -1
  9. package/dist/routes/livestock.routes.js +111 -1
  10. package/dist/routes/organizations.routes.d.ts +112 -14
  11. package/dist/routes/organizations.routes.d.ts.map +1 -1
  12. package/dist/routes/team.routes.d.ts +44 -44
  13. package/dist/routes/trade-cash-events.routes.d.ts +7668 -559
  14. package/dist/routes/trade-cash-events.routes.d.ts.map +1 -1
  15. package/dist/routes/trade-cash-events.routes.js +148 -2
  16. package/dist/schemas/farm-enterprises.schemas.d.ts +58 -58
  17. package/dist/schemas/farm-enterprises.schemas.d.ts.map +1 -1
  18. package/dist/schemas/farm-enterprises.schemas.js +1 -0
  19. package/dist/schemas/farms.schemas.d.ts +12 -12
  20. package/dist/schemas/farms.schemas.js +1 -1
  21. package/dist/schemas/geofences.schemas.d.ts +4 -4
  22. package/dist/schemas/livestock-groups.schemas.d.ts +166 -40
  23. package/dist/schemas/livestock-groups.schemas.d.ts.map +1 -1
  24. package/dist/schemas/livestock-groups.schemas.js +25 -0
  25. package/dist/schemas/livestock.schemas.d.ts +1796 -36
  26. package/dist/schemas/livestock.schemas.d.ts.map +1 -1
  27. package/dist/schemas/livestock.schemas.js +129 -0
  28. package/dist/schemas/organizations.schemas.d.ts +104 -16
  29. package/dist/schemas/organizations.schemas.d.ts.map +1 -1
  30. package/dist/schemas/organizations.schemas.js +8 -1
  31. package/dist/schemas/team.schemas.d.ts +43 -43
  32. package/dist/schemas/team.schemas.d.ts.map +1 -1
  33. package/dist/schemas/team.schemas.js +1 -0
  34. package/dist/schemas/trade-cash-events.schemas.d.ts +2605 -68
  35. package/dist/schemas/trade-cash-events.schemas.d.ts.map +1 -1
  36. package/dist/schemas/trade-cash-events.schemas.js +204 -0
  37. package/package.json +1 -1
@@ -1,10 +1,14 @@
1
1
  import { z } from 'zod';
2
- export declare const tradeCashEventTypeSchema: z.ZodEnum<["capital_in", "capital_out", "commission_payout", "supplier_payment", "buyer_receipt"]>;
3
- export declare const tradeCashPartyTypeSchema: z.ZodEnum<["investor", "staff", "supplier", "buyer", "broker", "other"]>;
2
+ export declare const tradeCashEventTypeSchema: z.ZodEnum<["capital_in", "capital_out", "commission_payout", "supplier_payment", "buyer_receipt", "advance_disburse", "advance_handoff", "advance_settle", "advance_return", "advance_writeoff"]>;
3
+ export declare const tradeCashPartyTypeSchema: z.ZodEnum<["investor", "staff", "supplier", "buyer", "broker", "other", "company"]>;
4
+ export declare const tradeCashFunderTypeSchema: z.ZodEnum<["company", "staff", "investor", "unattributed"]>;
5
+ export declare const tradeSourcingAdvanceStatusSchema: z.ZodEnum<["pending_receipt", "open", "settled", "written_off", "cancelled"]>;
6
+ export declare const tradeSourcingAdvanceHolderTypeSchema: z.ZodEnum<["staff", "supplier", "other"]>;
7
+ export declare const advanceSettlementOutcomeSchema: z.ZodEnum<["spent", "returned", "written_off", "overspend"]>;
4
8
  export declare const tradeCashEventAttributesSchema: z.ZodObject<{
5
9
  organizationId: z.ZodString;
6
- type: z.ZodEnum<["capital_in", "capital_out", "commission_payout", "supplier_payment", "buyer_receipt"]>;
7
- partyType: z.ZodEnum<["investor", "staff", "supplier", "buyer", "broker", "other"]>;
10
+ type: z.ZodEnum<["capital_in", "capital_out", "commission_payout", "supplier_payment", "buyer_receipt", "advance_disburse", "advance_handoff", "advance_settle", "advance_return", "advance_writeoff"]>;
11
+ partyType: z.ZodEnum<["investor", "staff", "supplier", "buyer", "broker", "other", "company"]>;
8
12
  partyId: z.ZodString;
9
13
  partyName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
10
14
  amount: z.ZodNumber;
@@ -15,33 +19,47 @@ export declare const tradeCashEventAttributesSchema: z.ZodObject<{
15
19
  dealId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
16
20
  invoiceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
17
21
  notes: z.ZodOptional<z.ZodNullable<z.ZodString>>;
22
+ funderType: z.ZodDefault<z.ZodOptional<z.ZodEnum<["company", "staff", "investor", "unattributed"]>>>;
23
+ funderId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
24
+ funderName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
25
+ advanceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
26
+ voidedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
27
+ voidedById: z.ZodOptional<z.ZodNullable<z.ZodString>>;
28
+ voidReason: z.ZodOptional<z.ZodNullable<z.ZodString>>;
18
29
  } & {
19
30
  createdAt: z.ZodString;
20
31
  updatedAt: z.ZodString;
21
32
  }, "strip", z.ZodTypeAny, {
22
- type: "capital_in" | "capital_out" | "commission_payout" | "supplier_payment" | "buyer_receipt";
33
+ type: "capital_in" | "capital_out" | "commission_payout" | "supplier_payment" | "buyer_receipt" | "advance_disburse" | "advance_handoff" | "advance_settle" | "advance_return" | "advance_writeoff";
23
34
  createdAt: string;
24
35
  updatedAt: string;
25
36
  organizationId: string;
26
37
  currency: string;
27
38
  occurredAt: string;
28
39
  amount: number;
29
- partyType: "investor" | "other" | "supplier" | "buyer" | "staff" | "broker";
40
+ partyType: "investor" | "other" | "supplier" | "buyer" | "staff" | "broker" | "company";
30
41
  partyId: string;
42
+ funderType: "investor" | "staff" | "company" | "unattributed";
31
43
  method?: string | null | undefined;
32
44
  notes?: string | null | undefined;
33
45
  invoiceId?: string | null | undefined;
34
46
  reference?: string | null | undefined;
35
47
  dealId?: string | null | undefined;
36
48
  partyName?: string | null | undefined;
49
+ funderId?: string | null | undefined;
50
+ funderName?: string | null | undefined;
51
+ advanceId?: string | null | undefined;
52
+ voidedAt?: string | null | undefined;
53
+ voidedById?: string | null | undefined;
54
+ voidReason?: string | null | undefined;
37
55
  }, {
38
- type: "capital_in" | "capital_out" | "commission_payout" | "supplier_payment" | "buyer_receipt";
56
+ type: "capital_in" | "capital_out" | "commission_payout" | "supplier_payment" | "buyer_receipt" | "advance_disburse" | "advance_handoff" | "advance_settle" | "advance_return" | "advance_writeoff";
39
57
  createdAt: string;
40
58
  updatedAt: string;
41
59
  organizationId: string;
42
60
  occurredAt: string;
43
61
  amount: number;
44
- partyType: "investor" | "other" | "supplier" | "buyer" | "staff" | "broker";
62
+ partyType: "investor" | "other" | "supplier" | "buyer" | "staff" | "broker" | "company";
45
63
  partyId: string;
46
64
  method?: string | null | undefined;
47
65
  currency?: string | undefined;
@@ -50,10 +68,17 @@ export declare const tradeCashEventAttributesSchema: z.ZodObject<{
50
68
  reference?: string | null | undefined;
51
69
  dealId?: string | null | undefined;
52
70
  partyName?: string | null | undefined;
71
+ funderType?: "investor" | "staff" | "company" | "unattributed" | undefined;
72
+ funderId?: string | null | undefined;
73
+ funderName?: string | null | undefined;
74
+ advanceId?: string | null | undefined;
75
+ voidedAt?: string | null | undefined;
76
+ voidedById?: string | null | undefined;
77
+ voidReason?: string | null | undefined;
53
78
  }>;
54
79
  export declare const createTradeCashEventAttributesSchema: z.ZodObject<{
55
- type: z.ZodEnum<["capital_in", "capital_out", "commission_payout", "supplier_payment", "buyer_receipt"]>;
56
- partyType: z.ZodEnum<["investor", "staff", "supplier", "buyer", "broker", "other"]>;
80
+ type: z.ZodEnum<["capital_in", "capital_out", "commission_payout", "supplier_payment", "buyer_receipt", "advance_disburse", "advance_handoff", "advance_settle", "advance_return", "advance_writeoff"]>;
81
+ partyType: z.ZodEnum<["investor", "staff", "supplier", "buyer", "broker", "other", "company"]>;
57
82
  partyId: z.ZodString;
58
83
  partyName: z.ZodNullable<z.ZodOptional<z.ZodString>>;
59
84
  amount: z.ZodNumber;
@@ -64,12 +89,17 @@ export declare const createTradeCashEventAttributesSchema: z.ZodObject<{
64
89
  dealId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
65
90
  invoiceId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
66
91
  notes: z.ZodNullable<z.ZodOptional<z.ZodString>>;
92
+ /** Required for supplier_payment and advance events; derived for capital_in/out. */
93
+ funderType: z.ZodOptional<z.ZodEnum<["company", "staff", "investor", "unattributed"]>>;
94
+ funderId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
95
+ funderName: z.ZodNullable<z.ZodOptional<z.ZodString>>;
96
+ advanceId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
67
97
  }, "strip", z.ZodTypeAny, {
68
- type: "capital_in" | "capital_out" | "commission_payout" | "supplier_payment" | "buyer_receipt";
98
+ type: "capital_in" | "capital_out" | "commission_payout" | "supplier_payment" | "buyer_receipt" | "advance_disburse" | "advance_handoff" | "advance_settle" | "advance_return" | "advance_writeoff";
69
99
  currency: string;
70
100
  occurredAt: string;
71
101
  amount: number;
72
- partyType: "investor" | "other" | "supplier" | "buyer" | "staff" | "broker";
102
+ partyType: "investor" | "other" | "supplier" | "buyer" | "staff" | "broker" | "company";
73
103
  partyId: string;
74
104
  method?: string | null | undefined;
75
105
  notes?: string | null | undefined;
@@ -77,11 +107,15 @@ export declare const createTradeCashEventAttributesSchema: z.ZodObject<{
77
107
  reference?: string | null | undefined;
78
108
  dealId?: string | null | undefined;
79
109
  partyName?: string | null | undefined;
110
+ funderType?: "investor" | "staff" | "company" | "unattributed" | undefined;
111
+ funderId?: string | null | undefined;
112
+ funderName?: string | null | undefined;
113
+ advanceId?: string | null | undefined;
80
114
  }, {
81
- type: "capital_in" | "capital_out" | "commission_payout" | "supplier_payment" | "buyer_receipt";
115
+ type: "capital_in" | "capital_out" | "commission_payout" | "supplier_payment" | "buyer_receipt" | "advance_disburse" | "advance_handoff" | "advance_settle" | "advance_return" | "advance_writeoff";
82
116
  occurredAt: string;
83
117
  amount: number;
84
- partyType: "investor" | "other" | "supplier" | "buyer" | "staff" | "broker";
118
+ partyType: "investor" | "other" | "supplier" | "buyer" | "staff" | "broker" | "company";
85
119
  partyId: string;
86
120
  method?: string | null | undefined;
87
121
  currency?: string | undefined;
@@ -90,14 +124,25 @@ export declare const createTradeCashEventAttributesSchema: z.ZodObject<{
90
124
  reference?: string | null | undefined;
91
125
  dealId?: string | null | undefined;
92
126
  partyName?: string | null | undefined;
127
+ funderType?: "investor" | "staff" | "company" | "unattributed" | undefined;
128
+ funderId?: string | null | undefined;
129
+ funderName?: string | null | undefined;
130
+ advanceId?: string | null | undefined;
131
+ }>;
132
+ export declare const voidTradeCashEventAttributesSchema: z.ZodObject<{
133
+ reason: z.ZodString;
134
+ }, "strip", z.ZodTypeAny, {
135
+ reason: string;
136
+ }, {
137
+ reason: string;
93
138
  }>;
94
139
  export declare const tradeCashEventResourceSchema: z.ZodObject<{
95
140
  type: z.ZodLiteral<string>;
96
141
  id: z.ZodString;
97
142
  attributes: z.ZodObject<{
98
143
  organizationId: z.ZodString;
99
- type: z.ZodEnum<["capital_in", "capital_out", "commission_payout", "supplier_payment", "buyer_receipt"]>;
100
- partyType: z.ZodEnum<["investor", "staff", "supplier", "buyer", "broker", "other"]>;
144
+ type: z.ZodEnum<["capital_in", "capital_out", "commission_payout", "supplier_payment", "buyer_receipt", "advance_disburse", "advance_handoff", "advance_settle", "advance_return", "advance_writeoff"]>;
145
+ partyType: z.ZodEnum<["investor", "staff", "supplier", "buyer", "broker", "other", "company"]>;
101
146
  partyId: z.ZodString;
102
147
  partyName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
103
148
  amount: z.ZodNumber;
@@ -108,33 +153,47 @@ export declare const tradeCashEventResourceSchema: z.ZodObject<{
108
153
  dealId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
109
154
  invoiceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
110
155
  notes: z.ZodOptional<z.ZodNullable<z.ZodString>>;
156
+ funderType: z.ZodDefault<z.ZodOptional<z.ZodEnum<["company", "staff", "investor", "unattributed"]>>>;
157
+ funderId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
158
+ funderName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
159
+ advanceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
160
+ voidedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
161
+ voidedById: z.ZodOptional<z.ZodNullable<z.ZodString>>;
162
+ voidReason: z.ZodOptional<z.ZodNullable<z.ZodString>>;
111
163
  } & {
112
164
  createdAt: z.ZodString;
113
165
  updatedAt: z.ZodString;
114
166
  }, "strip", z.ZodTypeAny, {
115
- type: "capital_in" | "capital_out" | "commission_payout" | "supplier_payment" | "buyer_receipt";
167
+ type: "capital_in" | "capital_out" | "commission_payout" | "supplier_payment" | "buyer_receipt" | "advance_disburse" | "advance_handoff" | "advance_settle" | "advance_return" | "advance_writeoff";
116
168
  createdAt: string;
117
169
  updatedAt: string;
118
170
  organizationId: string;
119
171
  currency: string;
120
172
  occurredAt: string;
121
173
  amount: number;
122
- partyType: "investor" | "other" | "supplier" | "buyer" | "staff" | "broker";
174
+ partyType: "investor" | "other" | "supplier" | "buyer" | "staff" | "broker" | "company";
123
175
  partyId: string;
176
+ funderType: "investor" | "staff" | "company" | "unattributed";
124
177
  method?: string | null | undefined;
125
178
  notes?: string | null | undefined;
126
179
  invoiceId?: string | null | undefined;
127
180
  reference?: string | null | undefined;
128
181
  dealId?: string | null | undefined;
129
182
  partyName?: string | null | undefined;
183
+ funderId?: string | null | undefined;
184
+ funderName?: string | null | undefined;
185
+ advanceId?: string | null | undefined;
186
+ voidedAt?: string | null | undefined;
187
+ voidedById?: string | null | undefined;
188
+ voidReason?: string | null | undefined;
130
189
  }, {
131
- type: "capital_in" | "capital_out" | "commission_payout" | "supplier_payment" | "buyer_receipt";
190
+ type: "capital_in" | "capital_out" | "commission_payout" | "supplier_payment" | "buyer_receipt" | "advance_disburse" | "advance_handoff" | "advance_settle" | "advance_return" | "advance_writeoff";
132
191
  createdAt: string;
133
192
  updatedAt: string;
134
193
  organizationId: string;
135
194
  occurredAt: string;
136
195
  amount: number;
137
- partyType: "investor" | "other" | "supplier" | "buyer" | "staff" | "broker";
196
+ partyType: "investor" | "other" | "supplier" | "buyer" | "staff" | "broker" | "company";
138
197
  partyId: string;
139
198
  method?: string | null | undefined;
140
199
  currency?: string | undefined;
@@ -143,6 +202,13 @@ export declare const tradeCashEventResourceSchema: z.ZodObject<{
143
202
  reference?: string | null | undefined;
144
203
  dealId?: string | null | undefined;
145
204
  partyName?: string | null | undefined;
205
+ funderType?: "investor" | "staff" | "company" | "unattributed" | undefined;
206
+ funderId?: string | null | undefined;
207
+ funderName?: string | null | undefined;
208
+ advanceId?: string | null | undefined;
209
+ voidedAt?: string | null | undefined;
210
+ voidedById?: string | null | undefined;
211
+ voidReason?: string | null | undefined;
146
212
  }>;
147
213
  relationships: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
148
214
  links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
@@ -151,21 +217,28 @@ export declare const tradeCashEventResourceSchema: z.ZodObject<{
151
217
  type: string;
152
218
  id: string;
153
219
  attributes: {
154
- type: "capital_in" | "capital_out" | "commission_payout" | "supplier_payment" | "buyer_receipt";
220
+ type: "capital_in" | "capital_out" | "commission_payout" | "supplier_payment" | "buyer_receipt" | "advance_disburse" | "advance_handoff" | "advance_settle" | "advance_return" | "advance_writeoff";
155
221
  createdAt: string;
156
222
  updatedAt: string;
157
223
  organizationId: string;
158
224
  currency: string;
159
225
  occurredAt: string;
160
226
  amount: number;
161
- partyType: "investor" | "other" | "supplier" | "buyer" | "staff" | "broker";
227
+ partyType: "investor" | "other" | "supplier" | "buyer" | "staff" | "broker" | "company";
162
228
  partyId: string;
229
+ funderType: "investor" | "staff" | "company" | "unattributed";
163
230
  method?: string | null | undefined;
164
231
  notes?: string | null | undefined;
165
232
  invoiceId?: string | null | undefined;
166
233
  reference?: string | null | undefined;
167
234
  dealId?: string | null | undefined;
168
235
  partyName?: string | null | undefined;
236
+ funderId?: string | null | undefined;
237
+ funderName?: string | null | undefined;
238
+ advanceId?: string | null | undefined;
239
+ voidedAt?: string | null | undefined;
240
+ voidedById?: string | null | undefined;
241
+ voidReason?: string | null | undefined;
169
242
  };
170
243
  relationships?: Record<string, unknown> | undefined;
171
244
  links?: Record<string, string> | undefined;
@@ -174,13 +247,13 @@ export declare const tradeCashEventResourceSchema: z.ZodObject<{
174
247
  type: string;
175
248
  id: string;
176
249
  attributes: {
177
- type: "capital_in" | "capital_out" | "commission_payout" | "supplier_payment" | "buyer_receipt";
250
+ type: "capital_in" | "capital_out" | "commission_payout" | "supplier_payment" | "buyer_receipt" | "advance_disburse" | "advance_handoff" | "advance_settle" | "advance_return" | "advance_writeoff";
178
251
  createdAt: string;
179
252
  updatedAt: string;
180
253
  organizationId: string;
181
254
  occurredAt: string;
182
255
  amount: number;
183
- partyType: "investor" | "other" | "supplier" | "buyer" | "staff" | "broker";
256
+ partyType: "investor" | "other" | "supplier" | "buyer" | "staff" | "broker" | "company";
184
257
  partyId: string;
185
258
  method?: string | null | undefined;
186
259
  currency?: string | undefined;
@@ -189,6 +262,13 @@ export declare const tradeCashEventResourceSchema: z.ZodObject<{
189
262
  reference?: string | null | undefined;
190
263
  dealId?: string | null | undefined;
191
264
  partyName?: string | null | undefined;
265
+ funderType?: "investor" | "staff" | "company" | "unattributed" | undefined;
266
+ funderId?: string | null | undefined;
267
+ funderName?: string | null | undefined;
268
+ advanceId?: string | null | undefined;
269
+ voidedAt?: string | null | undefined;
270
+ voidedById?: string | null | undefined;
271
+ voidReason?: string | null | undefined;
192
272
  };
193
273
  relationships?: Record<string, unknown> | undefined;
194
274
  links?: Record<string, string> | undefined;
@@ -200,8 +280,8 @@ export declare const tradeCashEventResponseSchema: z.ZodObject<{
200
280
  id: z.ZodString;
201
281
  attributes: z.ZodObject<{
202
282
  organizationId: z.ZodString;
203
- type: z.ZodEnum<["capital_in", "capital_out", "commission_payout", "supplier_payment", "buyer_receipt"]>;
204
- partyType: z.ZodEnum<["investor", "staff", "supplier", "buyer", "broker", "other"]>;
283
+ type: z.ZodEnum<["capital_in", "capital_out", "commission_payout", "supplier_payment", "buyer_receipt", "advance_disburse", "advance_handoff", "advance_settle", "advance_return", "advance_writeoff"]>;
284
+ partyType: z.ZodEnum<["investor", "staff", "supplier", "buyer", "broker", "other", "company"]>;
205
285
  partyId: z.ZodString;
206
286
  partyName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
207
287
  amount: z.ZodNumber;
@@ -212,33 +292,47 @@ export declare const tradeCashEventResponseSchema: z.ZodObject<{
212
292
  dealId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
213
293
  invoiceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
214
294
  notes: z.ZodOptional<z.ZodNullable<z.ZodString>>;
295
+ funderType: z.ZodDefault<z.ZodOptional<z.ZodEnum<["company", "staff", "investor", "unattributed"]>>>;
296
+ funderId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
297
+ funderName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
298
+ advanceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
299
+ voidedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
300
+ voidedById: z.ZodOptional<z.ZodNullable<z.ZodString>>;
301
+ voidReason: z.ZodOptional<z.ZodNullable<z.ZodString>>;
215
302
  } & {
216
303
  createdAt: z.ZodString;
217
304
  updatedAt: z.ZodString;
218
305
  }, "strip", z.ZodTypeAny, {
219
- type: "capital_in" | "capital_out" | "commission_payout" | "supplier_payment" | "buyer_receipt";
306
+ type: "capital_in" | "capital_out" | "commission_payout" | "supplier_payment" | "buyer_receipt" | "advance_disburse" | "advance_handoff" | "advance_settle" | "advance_return" | "advance_writeoff";
220
307
  createdAt: string;
221
308
  updatedAt: string;
222
309
  organizationId: string;
223
310
  currency: string;
224
311
  occurredAt: string;
225
312
  amount: number;
226
- partyType: "investor" | "other" | "supplier" | "buyer" | "staff" | "broker";
313
+ partyType: "investor" | "other" | "supplier" | "buyer" | "staff" | "broker" | "company";
227
314
  partyId: string;
315
+ funderType: "investor" | "staff" | "company" | "unattributed";
228
316
  method?: string | null | undefined;
229
317
  notes?: string | null | undefined;
230
318
  invoiceId?: string | null | undefined;
231
319
  reference?: string | null | undefined;
232
320
  dealId?: string | null | undefined;
233
321
  partyName?: string | null | undefined;
322
+ funderId?: string | null | undefined;
323
+ funderName?: string | null | undefined;
324
+ advanceId?: string | null | undefined;
325
+ voidedAt?: string | null | undefined;
326
+ voidedById?: string | null | undefined;
327
+ voidReason?: string | null | undefined;
234
328
  }, {
235
- type: "capital_in" | "capital_out" | "commission_payout" | "supplier_payment" | "buyer_receipt";
329
+ type: "capital_in" | "capital_out" | "commission_payout" | "supplier_payment" | "buyer_receipt" | "advance_disburse" | "advance_handoff" | "advance_settle" | "advance_return" | "advance_writeoff";
236
330
  createdAt: string;
237
331
  updatedAt: string;
238
332
  organizationId: string;
239
333
  occurredAt: string;
240
334
  amount: number;
241
- partyType: "investor" | "other" | "supplier" | "buyer" | "staff" | "broker";
335
+ partyType: "investor" | "other" | "supplier" | "buyer" | "staff" | "broker" | "company";
242
336
  partyId: string;
243
337
  method?: string | null | undefined;
244
338
  currency?: string | undefined;
@@ -247,6 +341,13 @@ export declare const tradeCashEventResponseSchema: z.ZodObject<{
247
341
  reference?: string | null | undefined;
248
342
  dealId?: string | null | undefined;
249
343
  partyName?: string | null | undefined;
344
+ funderType?: "investor" | "staff" | "company" | "unattributed" | undefined;
345
+ funderId?: string | null | undefined;
346
+ funderName?: string | null | undefined;
347
+ advanceId?: string | null | undefined;
348
+ voidedAt?: string | null | undefined;
349
+ voidedById?: string | null | undefined;
350
+ voidReason?: string | null | undefined;
250
351
  }>;
251
352
  relationships: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
252
353
  links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
@@ -255,21 +356,28 @@ export declare const tradeCashEventResponseSchema: z.ZodObject<{
255
356
  type: string;
256
357
  id: string;
257
358
  attributes: {
258
- type: "capital_in" | "capital_out" | "commission_payout" | "supplier_payment" | "buyer_receipt";
359
+ type: "capital_in" | "capital_out" | "commission_payout" | "supplier_payment" | "buyer_receipt" | "advance_disburse" | "advance_handoff" | "advance_settle" | "advance_return" | "advance_writeoff";
259
360
  createdAt: string;
260
361
  updatedAt: string;
261
362
  organizationId: string;
262
363
  currency: string;
263
364
  occurredAt: string;
264
365
  amount: number;
265
- partyType: "investor" | "other" | "supplier" | "buyer" | "staff" | "broker";
366
+ partyType: "investor" | "other" | "supplier" | "buyer" | "staff" | "broker" | "company";
266
367
  partyId: string;
368
+ funderType: "investor" | "staff" | "company" | "unattributed";
267
369
  method?: string | null | undefined;
268
370
  notes?: string | null | undefined;
269
371
  invoiceId?: string | null | undefined;
270
372
  reference?: string | null | undefined;
271
373
  dealId?: string | null | undefined;
272
374
  partyName?: string | null | undefined;
375
+ funderId?: string | null | undefined;
376
+ funderName?: string | null | undefined;
377
+ advanceId?: string | null | undefined;
378
+ voidedAt?: string | null | undefined;
379
+ voidedById?: string | null | undefined;
380
+ voidReason?: string | null | undefined;
273
381
  };
274
382
  relationships?: Record<string, unknown> | undefined;
275
383
  links?: Record<string, string> | undefined;
@@ -278,13 +386,13 @@ export declare const tradeCashEventResponseSchema: z.ZodObject<{
278
386
  type: string;
279
387
  id: string;
280
388
  attributes: {
281
- type: "capital_in" | "capital_out" | "commission_payout" | "supplier_payment" | "buyer_receipt";
389
+ type: "capital_in" | "capital_out" | "commission_payout" | "supplier_payment" | "buyer_receipt" | "advance_disburse" | "advance_handoff" | "advance_settle" | "advance_return" | "advance_writeoff";
282
390
  createdAt: string;
283
391
  updatedAt: string;
284
392
  organizationId: string;
285
393
  occurredAt: string;
286
394
  amount: number;
287
- partyType: "investor" | "other" | "supplier" | "buyer" | "staff" | "broker";
395
+ partyType: "investor" | "other" | "supplier" | "buyer" | "staff" | "broker" | "company";
288
396
  partyId: string;
289
397
  method?: string | null | undefined;
290
398
  currency?: string | undefined;
@@ -293,6 +401,13 @@ export declare const tradeCashEventResponseSchema: z.ZodObject<{
293
401
  reference?: string | null | undefined;
294
402
  dealId?: string | null | undefined;
295
403
  partyName?: string | null | undefined;
404
+ funderType?: "investor" | "staff" | "company" | "unattributed" | undefined;
405
+ funderId?: string | null | undefined;
406
+ funderName?: string | null | undefined;
407
+ advanceId?: string | null | undefined;
408
+ voidedAt?: string | null | undefined;
409
+ voidedById?: string | null | undefined;
410
+ voidReason?: string | null | undefined;
296
411
  };
297
412
  relationships?: Record<string, unknown> | undefined;
298
413
  links?: Record<string, string> | undefined;
@@ -327,21 +442,28 @@ export declare const tradeCashEventResponseSchema: z.ZodObject<{
327
442
  type: string;
328
443
  id: string;
329
444
  attributes: {
330
- type: "capital_in" | "capital_out" | "commission_payout" | "supplier_payment" | "buyer_receipt";
445
+ type: "capital_in" | "capital_out" | "commission_payout" | "supplier_payment" | "buyer_receipt" | "advance_disburse" | "advance_handoff" | "advance_settle" | "advance_return" | "advance_writeoff";
331
446
  createdAt: string;
332
447
  updatedAt: string;
333
448
  organizationId: string;
334
449
  currency: string;
335
450
  occurredAt: string;
336
451
  amount: number;
337
- partyType: "investor" | "other" | "supplier" | "buyer" | "staff" | "broker";
452
+ partyType: "investor" | "other" | "supplier" | "buyer" | "staff" | "broker" | "company";
338
453
  partyId: string;
454
+ funderType: "investor" | "staff" | "company" | "unattributed";
339
455
  method?: string | null | undefined;
340
456
  notes?: string | null | undefined;
341
457
  invoiceId?: string | null | undefined;
342
458
  reference?: string | null | undefined;
343
459
  dealId?: string | null | undefined;
344
460
  partyName?: string | null | undefined;
461
+ funderId?: string | null | undefined;
462
+ funderName?: string | null | undefined;
463
+ advanceId?: string | null | undefined;
464
+ voidedAt?: string | null | undefined;
465
+ voidedById?: string | null | undefined;
466
+ voidReason?: string | null | undefined;
345
467
  };
346
468
  relationships?: Record<string, unknown> | undefined;
347
469
  links?: Record<string, string> | undefined;
@@ -362,13 +484,13 @@ export declare const tradeCashEventResponseSchema: z.ZodObject<{
362
484
  type: string;
363
485
  id: string;
364
486
  attributes: {
365
- type: "capital_in" | "capital_out" | "commission_payout" | "supplier_payment" | "buyer_receipt";
487
+ type: "capital_in" | "capital_out" | "commission_payout" | "supplier_payment" | "buyer_receipt" | "advance_disburse" | "advance_handoff" | "advance_settle" | "advance_return" | "advance_writeoff";
366
488
  createdAt: string;
367
489
  updatedAt: string;
368
490
  organizationId: string;
369
491
  occurredAt: string;
370
492
  amount: number;
371
- partyType: "investor" | "other" | "supplier" | "buyer" | "staff" | "broker";
493
+ partyType: "investor" | "other" | "supplier" | "buyer" | "staff" | "broker" | "company";
372
494
  partyId: string;
373
495
  method?: string | null | undefined;
374
496
  currency?: string | undefined;
@@ -377,6 +499,13 @@ export declare const tradeCashEventResponseSchema: z.ZodObject<{
377
499
  reference?: string | null | undefined;
378
500
  dealId?: string | null | undefined;
379
501
  partyName?: string | null | undefined;
502
+ funderType?: "investor" | "staff" | "company" | "unattributed" | undefined;
503
+ funderId?: string | null | undefined;
504
+ funderName?: string | null | undefined;
505
+ advanceId?: string | null | undefined;
506
+ voidedAt?: string | null | undefined;
507
+ voidedById?: string | null | undefined;
508
+ voidReason?: string | null | undefined;
380
509
  };
381
510
  relationships?: Record<string, unknown> | undefined;
382
511
  links?: Record<string, string> | undefined;
@@ -399,8 +528,8 @@ export declare const tradeCashEventListResponseSchema: z.ZodObject<{
399
528
  id: z.ZodString;
400
529
  attributes: z.ZodObject<{
401
530
  organizationId: z.ZodString;
402
- type: z.ZodEnum<["capital_in", "capital_out", "commission_payout", "supplier_payment", "buyer_receipt"]>;
403
- partyType: z.ZodEnum<["investor", "staff", "supplier", "buyer", "broker", "other"]>;
531
+ type: z.ZodEnum<["capital_in", "capital_out", "commission_payout", "supplier_payment", "buyer_receipt", "advance_disburse", "advance_handoff", "advance_settle", "advance_return", "advance_writeoff"]>;
532
+ partyType: z.ZodEnum<["investor", "staff", "supplier", "buyer", "broker", "other", "company"]>;
404
533
  partyId: z.ZodString;
405
534
  partyName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
406
535
  amount: z.ZodNumber;
@@ -411,33 +540,47 @@ export declare const tradeCashEventListResponseSchema: z.ZodObject<{
411
540
  dealId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
412
541
  invoiceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
413
542
  notes: z.ZodOptional<z.ZodNullable<z.ZodString>>;
543
+ funderType: z.ZodDefault<z.ZodOptional<z.ZodEnum<["company", "staff", "investor", "unattributed"]>>>;
544
+ funderId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
545
+ funderName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
546
+ advanceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
547
+ voidedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
548
+ voidedById: z.ZodOptional<z.ZodNullable<z.ZodString>>;
549
+ voidReason: z.ZodOptional<z.ZodNullable<z.ZodString>>;
414
550
  } & {
415
551
  createdAt: z.ZodString;
416
552
  updatedAt: z.ZodString;
417
553
  }, "strip", z.ZodTypeAny, {
418
- type: "capital_in" | "capital_out" | "commission_payout" | "supplier_payment" | "buyer_receipt";
554
+ type: "capital_in" | "capital_out" | "commission_payout" | "supplier_payment" | "buyer_receipt" | "advance_disburse" | "advance_handoff" | "advance_settle" | "advance_return" | "advance_writeoff";
419
555
  createdAt: string;
420
556
  updatedAt: string;
421
557
  organizationId: string;
422
558
  currency: string;
423
559
  occurredAt: string;
424
560
  amount: number;
425
- partyType: "investor" | "other" | "supplier" | "buyer" | "staff" | "broker";
561
+ partyType: "investor" | "other" | "supplier" | "buyer" | "staff" | "broker" | "company";
426
562
  partyId: string;
563
+ funderType: "investor" | "staff" | "company" | "unattributed";
427
564
  method?: string | null | undefined;
428
565
  notes?: string | null | undefined;
429
566
  invoiceId?: string | null | undefined;
430
567
  reference?: string | null | undefined;
431
568
  dealId?: string | null | undefined;
432
569
  partyName?: string | null | undefined;
570
+ funderId?: string | null | undefined;
571
+ funderName?: string | null | undefined;
572
+ advanceId?: string | null | undefined;
573
+ voidedAt?: string | null | undefined;
574
+ voidedById?: string | null | undefined;
575
+ voidReason?: string | null | undefined;
433
576
  }, {
434
- type: "capital_in" | "capital_out" | "commission_payout" | "supplier_payment" | "buyer_receipt";
577
+ type: "capital_in" | "capital_out" | "commission_payout" | "supplier_payment" | "buyer_receipt" | "advance_disburse" | "advance_handoff" | "advance_settle" | "advance_return" | "advance_writeoff";
435
578
  createdAt: string;
436
579
  updatedAt: string;
437
580
  organizationId: string;
438
581
  occurredAt: string;
439
582
  amount: number;
440
- partyType: "investor" | "other" | "supplier" | "buyer" | "staff" | "broker";
583
+ partyType: "investor" | "other" | "supplier" | "buyer" | "staff" | "broker" | "company";
441
584
  partyId: string;
442
585
  method?: string | null | undefined;
443
586
  currency?: string | undefined;
@@ -446,6 +589,13 @@ export declare const tradeCashEventListResponseSchema: z.ZodObject<{
446
589
  reference?: string | null | undefined;
447
590
  dealId?: string | null | undefined;
448
591
  partyName?: string | null | undefined;
592
+ funderType?: "investor" | "staff" | "company" | "unattributed" | undefined;
593
+ funderId?: string | null | undefined;
594
+ funderName?: string | null | undefined;
595
+ advanceId?: string | null | undefined;
596
+ voidedAt?: string | null | undefined;
597
+ voidedById?: string | null | undefined;
598
+ voidReason?: string | null | undefined;
449
599
  }>;
450
600
  relationships: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
451
601
  links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
@@ -454,21 +604,28 @@ export declare const tradeCashEventListResponseSchema: z.ZodObject<{
454
604
  type: string;
455
605
  id: string;
456
606
  attributes: {
457
- type: "capital_in" | "capital_out" | "commission_payout" | "supplier_payment" | "buyer_receipt";
607
+ type: "capital_in" | "capital_out" | "commission_payout" | "supplier_payment" | "buyer_receipt" | "advance_disburse" | "advance_handoff" | "advance_settle" | "advance_return" | "advance_writeoff";
458
608
  createdAt: string;
459
609
  updatedAt: string;
460
610
  organizationId: string;
461
611
  currency: string;
462
612
  occurredAt: string;
463
613
  amount: number;
464
- partyType: "investor" | "other" | "supplier" | "buyer" | "staff" | "broker";
614
+ partyType: "investor" | "other" | "supplier" | "buyer" | "staff" | "broker" | "company";
465
615
  partyId: string;
616
+ funderType: "investor" | "staff" | "company" | "unattributed";
466
617
  method?: string | null | undefined;
467
618
  notes?: string | null | undefined;
468
619
  invoiceId?: string | null | undefined;
469
620
  reference?: string | null | undefined;
470
621
  dealId?: string | null | undefined;
471
622
  partyName?: string | null | undefined;
623
+ funderId?: string | null | undefined;
624
+ funderName?: string | null | undefined;
625
+ advanceId?: string | null | undefined;
626
+ voidedAt?: string | null | undefined;
627
+ voidedById?: string | null | undefined;
628
+ voidReason?: string | null | undefined;
472
629
  };
473
630
  relationships?: Record<string, unknown> | undefined;
474
631
  links?: Record<string, string> | undefined;
@@ -477,13 +634,13 @@ export declare const tradeCashEventListResponseSchema: z.ZodObject<{
477
634
  type: string;
478
635
  id: string;
479
636
  attributes: {
480
- type: "capital_in" | "capital_out" | "commission_payout" | "supplier_payment" | "buyer_receipt";
637
+ type: "capital_in" | "capital_out" | "commission_payout" | "supplier_payment" | "buyer_receipt" | "advance_disburse" | "advance_handoff" | "advance_settle" | "advance_return" | "advance_writeoff";
481
638
  createdAt: string;
482
639
  updatedAt: string;
483
640
  organizationId: string;
484
641
  occurredAt: string;
485
642
  amount: number;
486
- partyType: "investor" | "other" | "supplier" | "buyer" | "staff" | "broker";
643
+ partyType: "investor" | "other" | "supplier" | "buyer" | "staff" | "broker" | "company";
487
644
  partyId: string;
488
645
  method?: string | null | undefined;
489
646
  currency?: string | undefined;
@@ -492,6 +649,13 @@ export declare const tradeCashEventListResponseSchema: z.ZodObject<{
492
649
  reference?: string | null | undefined;
493
650
  dealId?: string | null | undefined;
494
651
  partyName?: string | null | undefined;
652
+ funderType?: "investor" | "staff" | "company" | "unattributed" | undefined;
653
+ funderId?: string | null | undefined;
654
+ funderName?: string | null | undefined;
655
+ advanceId?: string | null | undefined;
656
+ voidedAt?: string | null | undefined;
657
+ voidedById?: string | null | undefined;
658
+ voidReason?: string | null | undefined;
495
659
  };
496
660
  relationships?: Record<string, unknown> | undefined;
497
661
  links?: Record<string, string> | undefined;
@@ -526,21 +690,28 @@ export declare const tradeCashEventListResponseSchema: z.ZodObject<{
526
690
  type: string;
527
691
  id: string;
528
692
  attributes: {
529
- type: "capital_in" | "capital_out" | "commission_payout" | "supplier_payment" | "buyer_receipt";
693
+ type: "capital_in" | "capital_out" | "commission_payout" | "supplier_payment" | "buyer_receipt" | "advance_disburse" | "advance_handoff" | "advance_settle" | "advance_return" | "advance_writeoff";
530
694
  createdAt: string;
531
695
  updatedAt: string;
532
696
  organizationId: string;
533
697
  currency: string;
534
698
  occurredAt: string;
535
699
  amount: number;
536
- partyType: "investor" | "other" | "supplier" | "buyer" | "staff" | "broker";
700
+ partyType: "investor" | "other" | "supplier" | "buyer" | "staff" | "broker" | "company";
537
701
  partyId: string;
702
+ funderType: "investor" | "staff" | "company" | "unattributed";
538
703
  method?: string | null | undefined;
539
704
  notes?: string | null | undefined;
540
705
  invoiceId?: string | null | undefined;
541
706
  reference?: string | null | undefined;
542
707
  dealId?: string | null | undefined;
543
708
  partyName?: string | null | undefined;
709
+ funderId?: string | null | undefined;
710
+ funderName?: string | null | undefined;
711
+ advanceId?: string | null | undefined;
712
+ voidedAt?: string | null | undefined;
713
+ voidedById?: string | null | undefined;
714
+ voidReason?: string | null | undefined;
544
715
  };
545
716
  relationships?: Record<string, unknown> | undefined;
546
717
  links?: Record<string, string> | undefined;
@@ -561,13 +732,13 @@ export declare const tradeCashEventListResponseSchema: z.ZodObject<{
561
732
  type: string;
562
733
  id: string;
563
734
  attributes: {
564
- type: "capital_in" | "capital_out" | "commission_payout" | "supplier_payment" | "buyer_receipt";
735
+ type: "capital_in" | "capital_out" | "commission_payout" | "supplier_payment" | "buyer_receipt" | "advance_disburse" | "advance_handoff" | "advance_settle" | "advance_return" | "advance_writeoff";
565
736
  createdAt: string;
566
737
  updatedAt: string;
567
738
  organizationId: string;
568
739
  occurredAt: string;
569
740
  amount: number;
570
- partyType: "investor" | "other" | "supplier" | "buyer" | "staff" | "broker";
741
+ partyType: "investor" | "other" | "supplier" | "buyer" | "staff" | "broker" | "company";
571
742
  partyId: string;
572
743
  method?: string | null | undefined;
573
744
  currency?: string | undefined;
@@ -576,6 +747,13 @@ export declare const tradeCashEventListResponseSchema: z.ZodObject<{
576
747
  reference?: string | null | undefined;
577
748
  dealId?: string | null | undefined;
578
749
  partyName?: string | null | undefined;
750
+ funderType?: "investor" | "staff" | "company" | "unattributed" | undefined;
751
+ funderId?: string | null | undefined;
752
+ funderName?: string | null | undefined;
753
+ advanceId?: string | null | undefined;
754
+ voidedAt?: string | null | undefined;
755
+ voidedById?: string | null | undefined;
756
+ voidReason?: string | null | undefined;
579
757
  };
580
758
  relationships?: Record<string, unknown> | undefined;
581
759
  links?: Record<string, string> | undefined;
@@ -595,8 +773,8 @@ export declare const tradeCashEventListResponseSchema: z.ZodObject<{
595
773
  export declare const createTradeCashEventSchema: z.ZodObject<{
596
774
  type: z.ZodLiteral<"trade-cash-events">;
597
775
  attributes: z.ZodObject<{
598
- type: z.ZodEnum<["capital_in", "capital_out", "commission_payout", "supplier_payment", "buyer_receipt"]>;
599
- partyType: z.ZodEnum<["investor", "staff", "supplier", "buyer", "broker", "other"]>;
776
+ type: z.ZodEnum<["capital_in", "capital_out", "commission_payout", "supplier_payment", "buyer_receipt", "advance_disburse", "advance_handoff", "advance_settle", "advance_return", "advance_writeoff"]>;
777
+ partyType: z.ZodEnum<["investor", "staff", "supplier", "buyer", "broker", "other", "company"]>;
600
778
  partyId: z.ZodString;
601
779
  partyName: z.ZodNullable<z.ZodOptional<z.ZodString>>;
602
780
  amount: z.ZodNumber;
@@ -607,12 +785,17 @@ export declare const createTradeCashEventSchema: z.ZodObject<{
607
785
  dealId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
608
786
  invoiceId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
609
787
  notes: z.ZodNullable<z.ZodOptional<z.ZodString>>;
788
+ /** Required for supplier_payment and advance events; derived for capital_in/out. */
789
+ funderType: z.ZodOptional<z.ZodEnum<["company", "staff", "investor", "unattributed"]>>;
790
+ funderId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
791
+ funderName: z.ZodNullable<z.ZodOptional<z.ZodString>>;
792
+ advanceId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
610
793
  }, "strip", z.ZodTypeAny, {
611
- type: "capital_in" | "capital_out" | "commission_payout" | "supplier_payment" | "buyer_receipt";
794
+ type: "capital_in" | "capital_out" | "commission_payout" | "supplier_payment" | "buyer_receipt" | "advance_disburse" | "advance_handoff" | "advance_settle" | "advance_return" | "advance_writeoff";
612
795
  currency: string;
613
796
  occurredAt: string;
614
797
  amount: number;
615
- partyType: "investor" | "other" | "supplier" | "buyer" | "staff" | "broker";
798
+ partyType: "investor" | "other" | "supplier" | "buyer" | "staff" | "broker" | "company";
616
799
  partyId: string;
617
800
  method?: string | null | undefined;
618
801
  notes?: string | null | undefined;
@@ -620,11 +803,15 @@ export declare const createTradeCashEventSchema: z.ZodObject<{
620
803
  reference?: string | null | undefined;
621
804
  dealId?: string | null | undefined;
622
805
  partyName?: string | null | undefined;
806
+ funderType?: "investor" | "staff" | "company" | "unattributed" | undefined;
807
+ funderId?: string | null | undefined;
808
+ funderName?: string | null | undefined;
809
+ advanceId?: string | null | undefined;
623
810
  }, {
624
- type: "capital_in" | "capital_out" | "commission_payout" | "supplier_payment" | "buyer_receipt";
811
+ type: "capital_in" | "capital_out" | "commission_payout" | "supplier_payment" | "buyer_receipt" | "advance_disburse" | "advance_handoff" | "advance_settle" | "advance_return" | "advance_writeoff";
625
812
  occurredAt: string;
626
813
  amount: number;
627
- partyType: "investor" | "other" | "supplier" | "buyer" | "staff" | "broker";
814
+ partyType: "investor" | "other" | "supplier" | "buyer" | "staff" | "broker" | "company";
628
815
  partyId: string;
629
816
  method?: string | null | undefined;
630
817
  currency?: string | undefined;
@@ -633,15 +820,19 @@ export declare const createTradeCashEventSchema: z.ZodObject<{
633
820
  reference?: string | null | undefined;
634
821
  dealId?: string | null | undefined;
635
822
  partyName?: string | null | undefined;
823
+ funderType?: "investor" | "staff" | "company" | "unattributed" | undefined;
824
+ funderId?: string | null | undefined;
825
+ funderName?: string | null | undefined;
826
+ advanceId?: string | null | undefined;
636
827
  }>;
637
828
  }, "strip", z.ZodTypeAny, {
638
829
  type: "trade-cash-events";
639
830
  attributes: {
640
- type: "capital_in" | "capital_out" | "commission_payout" | "supplier_payment" | "buyer_receipt";
831
+ type: "capital_in" | "capital_out" | "commission_payout" | "supplier_payment" | "buyer_receipt" | "advance_disburse" | "advance_handoff" | "advance_settle" | "advance_return" | "advance_writeoff";
641
832
  currency: string;
642
833
  occurredAt: string;
643
834
  amount: number;
644
- partyType: "investor" | "other" | "supplier" | "buyer" | "staff" | "broker";
835
+ partyType: "investor" | "other" | "supplier" | "buyer" | "staff" | "broker" | "company";
645
836
  partyId: string;
646
837
  method?: string | null | undefined;
647
838
  notes?: string | null | undefined;
@@ -649,14 +840,18 @@ export declare const createTradeCashEventSchema: z.ZodObject<{
649
840
  reference?: string | null | undefined;
650
841
  dealId?: string | null | undefined;
651
842
  partyName?: string | null | undefined;
843
+ funderType?: "investor" | "staff" | "company" | "unattributed" | undefined;
844
+ funderId?: string | null | undefined;
845
+ funderName?: string | null | undefined;
846
+ advanceId?: string | null | undefined;
652
847
  };
653
848
  }, {
654
849
  type: "trade-cash-events";
655
850
  attributes: {
656
- type: "capital_in" | "capital_out" | "commission_payout" | "supplier_payment" | "buyer_receipt";
851
+ type: "capital_in" | "capital_out" | "commission_payout" | "supplier_payment" | "buyer_receipt" | "advance_disburse" | "advance_handoff" | "advance_settle" | "advance_return" | "advance_writeoff";
657
852
  occurredAt: string;
658
853
  amount: number;
659
- partyType: "investor" | "other" | "supplier" | "buyer" | "staff" | "broker";
854
+ partyType: "investor" | "other" | "supplier" | "buyer" | "staff" | "broker" | "company";
660
855
  partyId: string;
661
856
  method?: string | null | undefined;
662
857
  currency?: string | undefined;
@@ -665,6 +860,30 @@ export declare const createTradeCashEventSchema: z.ZodObject<{
665
860
  reference?: string | null | undefined;
666
861
  dealId?: string | null | undefined;
667
862
  partyName?: string | null | undefined;
863
+ funderType?: "investor" | "staff" | "company" | "unattributed" | undefined;
864
+ funderId?: string | null | undefined;
865
+ funderName?: string | null | undefined;
866
+ advanceId?: string | null | undefined;
867
+ };
868
+ }>;
869
+ export declare const voidTradeCashEventSchema: z.ZodObject<{
870
+ type: z.ZodLiteral<"trade-cash-events">;
871
+ attributes: z.ZodObject<{
872
+ reason: z.ZodString;
873
+ }, "strip", z.ZodTypeAny, {
874
+ reason: string;
875
+ }, {
876
+ reason: string;
877
+ }>;
878
+ }, "strip", z.ZodTypeAny, {
879
+ type: "trade-cash-events";
880
+ attributes: {
881
+ reason: string;
882
+ };
883
+ }, {
884
+ type: "trade-cash-events";
885
+ attributes: {
886
+ reason: string;
668
887
  };
669
888
  }>;
670
889
  export declare const investorBalanceAttributesSchema: z.ZodObject<{
@@ -793,6 +1012,1172 @@ export declare const investorBalancesResponseSchema: z.ZodObject<{
793
1012
  };
794
1013
  };
795
1014
  }>;
1015
+ export declare const funderBreakdownSchema: z.ZodObject<{
1016
+ funderType: z.ZodEnum<["company", "staff", "investor", "unattributed"]>;
1017
+ funderId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1018
+ funderName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1019
+ amount: z.ZodNumber;
1020
+ }, "strip", z.ZodTypeAny, {
1021
+ amount: number;
1022
+ funderType: "investor" | "staff" | "company" | "unattributed";
1023
+ funderId?: string | null | undefined;
1024
+ funderName?: string | null | undefined;
1025
+ }, {
1026
+ amount: number;
1027
+ funderType: "investor" | "staff" | "company" | "unattributed";
1028
+ funderId?: string | null | undefined;
1029
+ funderName?: string | null | undefined;
1030
+ }>;
1031
+ export declare const advancePositionSchema: z.ZodObject<{
1032
+ advanceId: z.ZodString;
1033
+ holderType: z.ZodEnum<["staff", "supplier", "other"]>;
1034
+ holderId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1035
+ holderName: z.ZodString;
1036
+ funderType: z.ZodEnum<["company", "staff", "investor", "unattributed"]>;
1037
+ funderId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1038
+ funderName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1039
+ remaining: z.ZodNumber;
1040
+ amount: z.ZodNumber;
1041
+ status: z.ZodEnum<["pending_receipt", "open", "settled", "written_off", "cancelled"]>;
1042
+ openedAt: z.ZodString;
1043
+ expectedSettleBy: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1044
+ overdue: z.ZodBoolean;
1045
+ ageDays: z.ZodNumber;
1046
+ }, "strip", z.ZodTypeAny, {
1047
+ status: "cancelled" | "open" | "pending_receipt" | "settled" | "written_off";
1048
+ remaining: number;
1049
+ amount: number;
1050
+ overdue: boolean;
1051
+ funderType: "investor" | "staff" | "company" | "unattributed";
1052
+ advanceId: string;
1053
+ holderType: "other" | "supplier" | "staff";
1054
+ holderName: string;
1055
+ openedAt: string;
1056
+ ageDays: number;
1057
+ funderId?: string | null | undefined;
1058
+ funderName?: string | null | undefined;
1059
+ holderId?: string | null | undefined;
1060
+ expectedSettleBy?: string | null | undefined;
1061
+ }, {
1062
+ status: "cancelled" | "open" | "pending_receipt" | "settled" | "written_off";
1063
+ remaining: number;
1064
+ amount: number;
1065
+ overdue: boolean;
1066
+ funderType: "investor" | "staff" | "company" | "unattributed";
1067
+ advanceId: string;
1068
+ holderType: "other" | "supplier" | "staff";
1069
+ holderName: string;
1070
+ openedAt: string;
1071
+ ageDays: number;
1072
+ funderId?: string | null | undefined;
1073
+ funderName?: string | null | undefined;
1074
+ holderId?: string | null | undefined;
1075
+ expectedSettleBy?: string | null | undefined;
1076
+ }>;
1077
+ export declare const tradeTreasuryAttributesSchema: z.ZodObject<{
1078
+ asOf: z.ZodString;
1079
+ computedAt: z.ZodString;
1080
+ currency: z.ZodString;
1081
+ received: z.ZodNumber;
1082
+ returnedToFunders: z.ZodNumber;
1083
+ available: z.ZodNumber;
1084
+ inSourcing: z.ZodNumber;
1085
+ unallocatedSpend: z.ZodNumber;
1086
+ goodsNotDelivered: z.ZodNumber;
1087
+ deliveredUnpaid: z.ZodNumber;
1088
+ receivable: z.ZodNumber;
1089
+ capitalOutstanding: z.ZodNumber;
1090
+ buyerReceipts: z.ZodNumber;
1091
+ /** received − returned vs available + capitalOutstanding */
1092
+ reconciliation: z.ZodObject<{
1093
+ capitalBase: z.ZodNumber;
1094
+ deployedAndHeld: z.ZodNumber;
1095
+ profitLossAndCostsRetained: z.ZodNumber;
1096
+ }, "strip", z.ZodTypeAny, {
1097
+ capitalBase: number;
1098
+ deployedAndHeld: number;
1099
+ profitLossAndCostsRetained: number;
1100
+ }, {
1101
+ capitalBase: number;
1102
+ deployedAndHeld: number;
1103
+ profitLossAndCostsRetained: number;
1104
+ }>;
1105
+ byFunder: z.ZodObject<{
1106
+ received: z.ZodArray<z.ZodObject<{
1107
+ funderType: z.ZodEnum<["company", "staff", "investor", "unattributed"]>;
1108
+ funderId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1109
+ funderName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1110
+ amount: z.ZodNumber;
1111
+ }, "strip", z.ZodTypeAny, {
1112
+ amount: number;
1113
+ funderType: "investor" | "staff" | "company" | "unattributed";
1114
+ funderId?: string | null | undefined;
1115
+ funderName?: string | null | undefined;
1116
+ }, {
1117
+ amount: number;
1118
+ funderType: "investor" | "staff" | "company" | "unattributed";
1119
+ funderId?: string | null | undefined;
1120
+ funderName?: string | null | undefined;
1121
+ }>, "many">;
1122
+ returned: z.ZodArray<z.ZodObject<{
1123
+ funderType: z.ZodEnum<["company", "staff", "investor", "unattributed"]>;
1124
+ funderId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1125
+ funderName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1126
+ amount: z.ZodNumber;
1127
+ }, "strip", z.ZodTypeAny, {
1128
+ amount: number;
1129
+ funderType: "investor" | "staff" | "company" | "unattributed";
1130
+ funderId?: string | null | undefined;
1131
+ funderName?: string | null | undefined;
1132
+ }, {
1133
+ amount: number;
1134
+ funderType: "investor" | "staff" | "company" | "unattributed";
1135
+ funderId?: string | null | undefined;
1136
+ funderName?: string | null | undefined;
1137
+ }>, "many">;
1138
+ inSourcing: z.ZodArray<z.ZodObject<{
1139
+ funderType: z.ZodEnum<["company", "staff", "investor", "unattributed"]>;
1140
+ funderId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1141
+ funderName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1142
+ amount: z.ZodNumber;
1143
+ }, "strip", z.ZodTypeAny, {
1144
+ amount: number;
1145
+ funderType: "investor" | "staff" | "company" | "unattributed";
1146
+ funderId?: string | null | undefined;
1147
+ funderName?: string | null | undefined;
1148
+ }, {
1149
+ amount: number;
1150
+ funderType: "investor" | "staff" | "company" | "unattributed";
1151
+ funderId?: string | null | undefined;
1152
+ funderName?: string | null | undefined;
1153
+ }>, "many">;
1154
+ unallocatedSpend: z.ZodArray<z.ZodObject<{
1155
+ funderType: z.ZodEnum<["company", "staff", "investor", "unattributed"]>;
1156
+ funderId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1157
+ funderName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1158
+ amount: z.ZodNumber;
1159
+ }, "strip", z.ZodTypeAny, {
1160
+ amount: number;
1161
+ funderType: "investor" | "staff" | "company" | "unattributed";
1162
+ funderId?: string | null | undefined;
1163
+ funderName?: string | null | undefined;
1164
+ }, {
1165
+ amount: number;
1166
+ funderType: "investor" | "staff" | "company" | "unattributed";
1167
+ funderId?: string | null | undefined;
1168
+ funderName?: string | null | undefined;
1169
+ }>, "many">;
1170
+ goodsNotDelivered: z.ZodArray<z.ZodObject<{
1171
+ funderType: z.ZodEnum<["company", "staff", "investor", "unattributed"]>;
1172
+ funderId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1173
+ funderName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1174
+ amount: z.ZodNumber;
1175
+ }, "strip", z.ZodTypeAny, {
1176
+ amount: number;
1177
+ funderType: "investor" | "staff" | "company" | "unattributed";
1178
+ funderId?: string | null | undefined;
1179
+ funderName?: string | null | undefined;
1180
+ }, {
1181
+ amount: number;
1182
+ funderType: "investor" | "staff" | "company" | "unattributed";
1183
+ funderId?: string | null | undefined;
1184
+ funderName?: string | null | undefined;
1185
+ }>, "many">;
1186
+ deliveredUnpaid: z.ZodArray<z.ZodObject<{
1187
+ funderType: z.ZodEnum<["company", "staff", "investor", "unattributed"]>;
1188
+ funderId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1189
+ funderName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1190
+ amount: z.ZodNumber;
1191
+ }, "strip", z.ZodTypeAny, {
1192
+ amount: number;
1193
+ funderType: "investor" | "staff" | "company" | "unattributed";
1194
+ funderId?: string | null | undefined;
1195
+ funderName?: string | null | undefined;
1196
+ }, {
1197
+ amount: number;
1198
+ funderType: "investor" | "staff" | "company" | "unattributed";
1199
+ funderId?: string | null | undefined;
1200
+ funderName?: string | null | undefined;
1201
+ }>, "many">;
1202
+ }, "strip", z.ZodTypeAny, {
1203
+ received: {
1204
+ amount: number;
1205
+ funderType: "investor" | "staff" | "company" | "unattributed";
1206
+ funderId?: string | null | undefined;
1207
+ funderName?: string | null | undefined;
1208
+ }[];
1209
+ returned: {
1210
+ amount: number;
1211
+ funderType: "investor" | "staff" | "company" | "unattributed";
1212
+ funderId?: string | null | undefined;
1213
+ funderName?: string | null | undefined;
1214
+ }[];
1215
+ inSourcing: {
1216
+ amount: number;
1217
+ funderType: "investor" | "staff" | "company" | "unattributed";
1218
+ funderId?: string | null | undefined;
1219
+ funderName?: string | null | undefined;
1220
+ }[];
1221
+ unallocatedSpend: {
1222
+ amount: number;
1223
+ funderType: "investor" | "staff" | "company" | "unattributed";
1224
+ funderId?: string | null | undefined;
1225
+ funderName?: string | null | undefined;
1226
+ }[];
1227
+ goodsNotDelivered: {
1228
+ amount: number;
1229
+ funderType: "investor" | "staff" | "company" | "unattributed";
1230
+ funderId?: string | null | undefined;
1231
+ funderName?: string | null | undefined;
1232
+ }[];
1233
+ deliveredUnpaid: {
1234
+ amount: number;
1235
+ funderType: "investor" | "staff" | "company" | "unattributed";
1236
+ funderId?: string | null | undefined;
1237
+ funderName?: string | null | undefined;
1238
+ }[];
1239
+ }, {
1240
+ received: {
1241
+ amount: number;
1242
+ funderType: "investor" | "staff" | "company" | "unattributed";
1243
+ funderId?: string | null | undefined;
1244
+ funderName?: string | null | undefined;
1245
+ }[];
1246
+ returned: {
1247
+ amount: number;
1248
+ funderType: "investor" | "staff" | "company" | "unattributed";
1249
+ funderId?: string | null | undefined;
1250
+ funderName?: string | null | undefined;
1251
+ }[];
1252
+ inSourcing: {
1253
+ amount: number;
1254
+ funderType: "investor" | "staff" | "company" | "unattributed";
1255
+ funderId?: string | null | undefined;
1256
+ funderName?: string | null | undefined;
1257
+ }[];
1258
+ unallocatedSpend: {
1259
+ amount: number;
1260
+ funderType: "investor" | "staff" | "company" | "unattributed";
1261
+ funderId?: string | null | undefined;
1262
+ funderName?: string | null | undefined;
1263
+ }[];
1264
+ goodsNotDelivered: {
1265
+ amount: number;
1266
+ funderType: "investor" | "staff" | "company" | "unattributed";
1267
+ funderId?: string | null | undefined;
1268
+ funderName?: string | null | undefined;
1269
+ }[];
1270
+ deliveredUnpaid: {
1271
+ amount: number;
1272
+ funderType: "investor" | "staff" | "company" | "unattributed";
1273
+ funderId?: string | null | undefined;
1274
+ funderName?: string | null | undefined;
1275
+ }[];
1276
+ }>;
1277
+ openAdvances: z.ZodArray<z.ZodObject<{
1278
+ advanceId: z.ZodString;
1279
+ holderType: z.ZodEnum<["staff", "supplier", "other"]>;
1280
+ holderId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1281
+ holderName: z.ZodString;
1282
+ funderType: z.ZodEnum<["company", "staff", "investor", "unattributed"]>;
1283
+ funderId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1284
+ funderName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1285
+ remaining: z.ZodNumber;
1286
+ amount: z.ZodNumber;
1287
+ status: z.ZodEnum<["pending_receipt", "open", "settled", "written_off", "cancelled"]>;
1288
+ openedAt: z.ZodString;
1289
+ expectedSettleBy: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1290
+ overdue: z.ZodBoolean;
1291
+ ageDays: z.ZodNumber;
1292
+ }, "strip", z.ZodTypeAny, {
1293
+ status: "cancelled" | "open" | "pending_receipt" | "settled" | "written_off";
1294
+ remaining: number;
1295
+ amount: number;
1296
+ overdue: boolean;
1297
+ funderType: "investor" | "staff" | "company" | "unattributed";
1298
+ advanceId: string;
1299
+ holderType: "other" | "supplier" | "staff";
1300
+ holderName: string;
1301
+ openedAt: string;
1302
+ ageDays: number;
1303
+ funderId?: string | null | undefined;
1304
+ funderName?: string | null | undefined;
1305
+ holderId?: string | null | undefined;
1306
+ expectedSettleBy?: string | null | undefined;
1307
+ }, {
1308
+ status: "cancelled" | "open" | "pending_receipt" | "settled" | "written_off";
1309
+ remaining: number;
1310
+ amount: number;
1311
+ overdue: boolean;
1312
+ funderType: "investor" | "staff" | "company" | "unattributed";
1313
+ advanceId: string;
1314
+ holderType: "other" | "supplier" | "staff";
1315
+ holderName: string;
1316
+ openedAt: string;
1317
+ ageDays: number;
1318
+ funderId?: string | null | undefined;
1319
+ funderName?: string | null | undefined;
1320
+ holderId?: string | null | undefined;
1321
+ expectedSettleBy?: string | null | undefined;
1322
+ }>, "many">;
1323
+ }, "strip", z.ZodTypeAny, {
1324
+ received: number;
1325
+ currency: string;
1326
+ available: number;
1327
+ computedAt: string;
1328
+ asOf: string;
1329
+ returnedToFunders: number;
1330
+ inSourcing: number;
1331
+ unallocatedSpend: number;
1332
+ goodsNotDelivered: number;
1333
+ deliveredUnpaid: number;
1334
+ receivable: number;
1335
+ capitalOutstanding: number;
1336
+ buyerReceipts: number;
1337
+ reconciliation: {
1338
+ capitalBase: number;
1339
+ deployedAndHeld: number;
1340
+ profitLossAndCostsRetained: number;
1341
+ };
1342
+ byFunder: {
1343
+ received: {
1344
+ amount: number;
1345
+ funderType: "investor" | "staff" | "company" | "unattributed";
1346
+ funderId?: string | null | undefined;
1347
+ funderName?: string | null | undefined;
1348
+ }[];
1349
+ returned: {
1350
+ amount: number;
1351
+ funderType: "investor" | "staff" | "company" | "unattributed";
1352
+ funderId?: string | null | undefined;
1353
+ funderName?: string | null | undefined;
1354
+ }[];
1355
+ inSourcing: {
1356
+ amount: number;
1357
+ funderType: "investor" | "staff" | "company" | "unattributed";
1358
+ funderId?: string | null | undefined;
1359
+ funderName?: string | null | undefined;
1360
+ }[];
1361
+ unallocatedSpend: {
1362
+ amount: number;
1363
+ funderType: "investor" | "staff" | "company" | "unattributed";
1364
+ funderId?: string | null | undefined;
1365
+ funderName?: string | null | undefined;
1366
+ }[];
1367
+ goodsNotDelivered: {
1368
+ amount: number;
1369
+ funderType: "investor" | "staff" | "company" | "unattributed";
1370
+ funderId?: string | null | undefined;
1371
+ funderName?: string | null | undefined;
1372
+ }[];
1373
+ deliveredUnpaid: {
1374
+ amount: number;
1375
+ funderType: "investor" | "staff" | "company" | "unattributed";
1376
+ funderId?: string | null | undefined;
1377
+ funderName?: string | null | undefined;
1378
+ }[];
1379
+ };
1380
+ openAdvances: {
1381
+ status: "cancelled" | "open" | "pending_receipt" | "settled" | "written_off";
1382
+ remaining: number;
1383
+ amount: number;
1384
+ overdue: boolean;
1385
+ funderType: "investor" | "staff" | "company" | "unattributed";
1386
+ advanceId: string;
1387
+ holderType: "other" | "supplier" | "staff";
1388
+ holderName: string;
1389
+ openedAt: string;
1390
+ ageDays: number;
1391
+ funderId?: string | null | undefined;
1392
+ funderName?: string | null | undefined;
1393
+ holderId?: string | null | undefined;
1394
+ expectedSettleBy?: string | null | undefined;
1395
+ }[];
1396
+ }, {
1397
+ received: number;
1398
+ currency: string;
1399
+ available: number;
1400
+ computedAt: string;
1401
+ asOf: string;
1402
+ returnedToFunders: number;
1403
+ inSourcing: number;
1404
+ unallocatedSpend: number;
1405
+ goodsNotDelivered: number;
1406
+ deliveredUnpaid: number;
1407
+ receivable: number;
1408
+ capitalOutstanding: number;
1409
+ buyerReceipts: number;
1410
+ reconciliation: {
1411
+ capitalBase: number;
1412
+ deployedAndHeld: number;
1413
+ profitLossAndCostsRetained: number;
1414
+ };
1415
+ byFunder: {
1416
+ received: {
1417
+ amount: number;
1418
+ funderType: "investor" | "staff" | "company" | "unattributed";
1419
+ funderId?: string | null | undefined;
1420
+ funderName?: string | null | undefined;
1421
+ }[];
1422
+ returned: {
1423
+ amount: number;
1424
+ funderType: "investor" | "staff" | "company" | "unattributed";
1425
+ funderId?: string | null | undefined;
1426
+ funderName?: string | null | undefined;
1427
+ }[];
1428
+ inSourcing: {
1429
+ amount: number;
1430
+ funderType: "investor" | "staff" | "company" | "unattributed";
1431
+ funderId?: string | null | undefined;
1432
+ funderName?: string | null | undefined;
1433
+ }[];
1434
+ unallocatedSpend: {
1435
+ amount: number;
1436
+ funderType: "investor" | "staff" | "company" | "unattributed";
1437
+ funderId?: string | null | undefined;
1438
+ funderName?: string | null | undefined;
1439
+ }[];
1440
+ goodsNotDelivered: {
1441
+ amount: number;
1442
+ funderType: "investor" | "staff" | "company" | "unattributed";
1443
+ funderId?: string | null | undefined;
1444
+ funderName?: string | null | undefined;
1445
+ }[];
1446
+ deliveredUnpaid: {
1447
+ amount: number;
1448
+ funderType: "investor" | "staff" | "company" | "unattributed";
1449
+ funderId?: string | null | undefined;
1450
+ funderName?: string | null | undefined;
1451
+ }[];
1452
+ };
1453
+ openAdvances: {
1454
+ status: "cancelled" | "open" | "pending_receipt" | "settled" | "written_off";
1455
+ remaining: number;
1456
+ amount: number;
1457
+ overdue: boolean;
1458
+ funderType: "investor" | "staff" | "company" | "unattributed";
1459
+ advanceId: string;
1460
+ holderType: "other" | "supplier" | "staff";
1461
+ holderName: string;
1462
+ openedAt: string;
1463
+ ageDays: number;
1464
+ funderId?: string | null | undefined;
1465
+ funderName?: string | null | undefined;
1466
+ holderId?: string | null | undefined;
1467
+ expectedSettleBy?: string | null | undefined;
1468
+ }[];
1469
+ }>;
1470
+ export declare const tradeTreasuryResponseSchema: z.ZodObject<{
1471
+ data: z.ZodObject<{
1472
+ type: z.ZodLiteral<"trade-treasury">;
1473
+ id: z.ZodString;
1474
+ attributes: z.ZodObject<{
1475
+ asOf: z.ZodString;
1476
+ computedAt: z.ZodString;
1477
+ currency: z.ZodString;
1478
+ received: z.ZodNumber;
1479
+ returnedToFunders: z.ZodNumber;
1480
+ available: z.ZodNumber;
1481
+ inSourcing: z.ZodNumber;
1482
+ unallocatedSpend: z.ZodNumber;
1483
+ goodsNotDelivered: z.ZodNumber;
1484
+ deliveredUnpaid: z.ZodNumber;
1485
+ receivable: z.ZodNumber;
1486
+ capitalOutstanding: z.ZodNumber;
1487
+ buyerReceipts: z.ZodNumber;
1488
+ /** received − returned vs available + capitalOutstanding */
1489
+ reconciliation: z.ZodObject<{
1490
+ capitalBase: z.ZodNumber;
1491
+ deployedAndHeld: z.ZodNumber;
1492
+ profitLossAndCostsRetained: z.ZodNumber;
1493
+ }, "strip", z.ZodTypeAny, {
1494
+ capitalBase: number;
1495
+ deployedAndHeld: number;
1496
+ profitLossAndCostsRetained: number;
1497
+ }, {
1498
+ capitalBase: number;
1499
+ deployedAndHeld: number;
1500
+ profitLossAndCostsRetained: number;
1501
+ }>;
1502
+ byFunder: z.ZodObject<{
1503
+ received: z.ZodArray<z.ZodObject<{
1504
+ funderType: z.ZodEnum<["company", "staff", "investor", "unattributed"]>;
1505
+ funderId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1506
+ funderName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1507
+ amount: z.ZodNumber;
1508
+ }, "strip", z.ZodTypeAny, {
1509
+ amount: number;
1510
+ funderType: "investor" | "staff" | "company" | "unattributed";
1511
+ funderId?: string | null | undefined;
1512
+ funderName?: string | null | undefined;
1513
+ }, {
1514
+ amount: number;
1515
+ funderType: "investor" | "staff" | "company" | "unattributed";
1516
+ funderId?: string | null | undefined;
1517
+ funderName?: string | null | undefined;
1518
+ }>, "many">;
1519
+ returned: z.ZodArray<z.ZodObject<{
1520
+ funderType: z.ZodEnum<["company", "staff", "investor", "unattributed"]>;
1521
+ funderId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1522
+ funderName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1523
+ amount: z.ZodNumber;
1524
+ }, "strip", z.ZodTypeAny, {
1525
+ amount: number;
1526
+ funderType: "investor" | "staff" | "company" | "unattributed";
1527
+ funderId?: string | null | undefined;
1528
+ funderName?: string | null | undefined;
1529
+ }, {
1530
+ amount: number;
1531
+ funderType: "investor" | "staff" | "company" | "unattributed";
1532
+ funderId?: string | null | undefined;
1533
+ funderName?: string | null | undefined;
1534
+ }>, "many">;
1535
+ inSourcing: z.ZodArray<z.ZodObject<{
1536
+ funderType: z.ZodEnum<["company", "staff", "investor", "unattributed"]>;
1537
+ funderId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1538
+ funderName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1539
+ amount: z.ZodNumber;
1540
+ }, "strip", z.ZodTypeAny, {
1541
+ amount: number;
1542
+ funderType: "investor" | "staff" | "company" | "unattributed";
1543
+ funderId?: string | null | undefined;
1544
+ funderName?: string | null | undefined;
1545
+ }, {
1546
+ amount: number;
1547
+ funderType: "investor" | "staff" | "company" | "unattributed";
1548
+ funderId?: string | null | undefined;
1549
+ funderName?: string | null | undefined;
1550
+ }>, "many">;
1551
+ unallocatedSpend: z.ZodArray<z.ZodObject<{
1552
+ funderType: z.ZodEnum<["company", "staff", "investor", "unattributed"]>;
1553
+ funderId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1554
+ funderName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1555
+ amount: z.ZodNumber;
1556
+ }, "strip", z.ZodTypeAny, {
1557
+ amount: number;
1558
+ funderType: "investor" | "staff" | "company" | "unattributed";
1559
+ funderId?: string | null | undefined;
1560
+ funderName?: string | null | undefined;
1561
+ }, {
1562
+ amount: number;
1563
+ funderType: "investor" | "staff" | "company" | "unattributed";
1564
+ funderId?: string | null | undefined;
1565
+ funderName?: string | null | undefined;
1566
+ }>, "many">;
1567
+ goodsNotDelivered: z.ZodArray<z.ZodObject<{
1568
+ funderType: z.ZodEnum<["company", "staff", "investor", "unattributed"]>;
1569
+ funderId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1570
+ funderName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1571
+ amount: z.ZodNumber;
1572
+ }, "strip", z.ZodTypeAny, {
1573
+ amount: number;
1574
+ funderType: "investor" | "staff" | "company" | "unattributed";
1575
+ funderId?: string | null | undefined;
1576
+ funderName?: string | null | undefined;
1577
+ }, {
1578
+ amount: number;
1579
+ funderType: "investor" | "staff" | "company" | "unattributed";
1580
+ funderId?: string | null | undefined;
1581
+ funderName?: string | null | undefined;
1582
+ }>, "many">;
1583
+ deliveredUnpaid: z.ZodArray<z.ZodObject<{
1584
+ funderType: z.ZodEnum<["company", "staff", "investor", "unattributed"]>;
1585
+ funderId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1586
+ funderName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1587
+ amount: z.ZodNumber;
1588
+ }, "strip", z.ZodTypeAny, {
1589
+ amount: number;
1590
+ funderType: "investor" | "staff" | "company" | "unattributed";
1591
+ funderId?: string | null | undefined;
1592
+ funderName?: string | null | undefined;
1593
+ }, {
1594
+ amount: number;
1595
+ funderType: "investor" | "staff" | "company" | "unattributed";
1596
+ funderId?: string | null | undefined;
1597
+ funderName?: string | null | undefined;
1598
+ }>, "many">;
1599
+ }, "strip", z.ZodTypeAny, {
1600
+ received: {
1601
+ amount: number;
1602
+ funderType: "investor" | "staff" | "company" | "unattributed";
1603
+ funderId?: string | null | undefined;
1604
+ funderName?: string | null | undefined;
1605
+ }[];
1606
+ returned: {
1607
+ amount: number;
1608
+ funderType: "investor" | "staff" | "company" | "unattributed";
1609
+ funderId?: string | null | undefined;
1610
+ funderName?: string | null | undefined;
1611
+ }[];
1612
+ inSourcing: {
1613
+ amount: number;
1614
+ funderType: "investor" | "staff" | "company" | "unattributed";
1615
+ funderId?: string | null | undefined;
1616
+ funderName?: string | null | undefined;
1617
+ }[];
1618
+ unallocatedSpend: {
1619
+ amount: number;
1620
+ funderType: "investor" | "staff" | "company" | "unattributed";
1621
+ funderId?: string | null | undefined;
1622
+ funderName?: string | null | undefined;
1623
+ }[];
1624
+ goodsNotDelivered: {
1625
+ amount: number;
1626
+ funderType: "investor" | "staff" | "company" | "unattributed";
1627
+ funderId?: string | null | undefined;
1628
+ funderName?: string | null | undefined;
1629
+ }[];
1630
+ deliveredUnpaid: {
1631
+ amount: number;
1632
+ funderType: "investor" | "staff" | "company" | "unattributed";
1633
+ funderId?: string | null | undefined;
1634
+ funderName?: string | null | undefined;
1635
+ }[];
1636
+ }, {
1637
+ received: {
1638
+ amount: number;
1639
+ funderType: "investor" | "staff" | "company" | "unattributed";
1640
+ funderId?: string | null | undefined;
1641
+ funderName?: string | null | undefined;
1642
+ }[];
1643
+ returned: {
1644
+ amount: number;
1645
+ funderType: "investor" | "staff" | "company" | "unattributed";
1646
+ funderId?: string | null | undefined;
1647
+ funderName?: string | null | undefined;
1648
+ }[];
1649
+ inSourcing: {
1650
+ amount: number;
1651
+ funderType: "investor" | "staff" | "company" | "unattributed";
1652
+ funderId?: string | null | undefined;
1653
+ funderName?: string | null | undefined;
1654
+ }[];
1655
+ unallocatedSpend: {
1656
+ amount: number;
1657
+ funderType: "investor" | "staff" | "company" | "unattributed";
1658
+ funderId?: string | null | undefined;
1659
+ funderName?: string | null | undefined;
1660
+ }[];
1661
+ goodsNotDelivered: {
1662
+ amount: number;
1663
+ funderType: "investor" | "staff" | "company" | "unattributed";
1664
+ funderId?: string | null | undefined;
1665
+ funderName?: string | null | undefined;
1666
+ }[];
1667
+ deliveredUnpaid: {
1668
+ amount: number;
1669
+ funderType: "investor" | "staff" | "company" | "unattributed";
1670
+ funderId?: string | null | undefined;
1671
+ funderName?: string | null | undefined;
1672
+ }[];
1673
+ }>;
1674
+ openAdvances: z.ZodArray<z.ZodObject<{
1675
+ advanceId: z.ZodString;
1676
+ holderType: z.ZodEnum<["staff", "supplier", "other"]>;
1677
+ holderId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1678
+ holderName: z.ZodString;
1679
+ funderType: z.ZodEnum<["company", "staff", "investor", "unattributed"]>;
1680
+ funderId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1681
+ funderName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1682
+ remaining: z.ZodNumber;
1683
+ amount: z.ZodNumber;
1684
+ status: z.ZodEnum<["pending_receipt", "open", "settled", "written_off", "cancelled"]>;
1685
+ openedAt: z.ZodString;
1686
+ expectedSettleBy: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1687
+ overdue: z.ZodBoolean;
1688
+ ageDays: z.ZodNumber;
1689
+ }, "strip", z.ZodTypeAny, {
1690
+ status: "cancelled" | "open" | "pending_receipt" | "settled" | "written_off";
1691
+ remaining: number;
1692
+ amount: number;
1693
+ overdue: boolean;
1694
+ funderType: "investor" | "staff" | "company" | "unattributed";
1695
+ advanceId: string;
1696
+ holderType: "other" | "supplier" | "staff";
1697
+ holderName: string;
1698
+ openedAt: string;
1699
+ ageDays: number;
1700
+ funderId?: string | null | undefined;
1701
+ funderName?: string | null | undefined;
1702
+ holderId?: string | null | undefined;
1703
+ expectedSettleBy?: string | null | undefined;
1704
+ }, {
1705
+ status: "cancelled" | "open" | "pending_receipt" | "settled" | "written_off";
1706
+ remaining: number;
1707
+ amount: number;
1708
+ overdue: boolean;
1709
+ funderType: "investor" | "staff" | "company" | "unattributed";
1710
+ advanceId: string;
1711
+ holderType: "other" | "supplier" | "staff";
1712
+ holderName: string;
1713
+ openedAt: string;
1714
+ ageDays: number;
1715
+ funderId?: string | null | undefined;
1716
+ funderName?: string | null | undefined;
1717
+ holderId?: string | null | undefined;
1718
+ expectedSettleBy?: string | null | undefined;
1719
+ }>, "many">;
1720
+ }, "strip", z.ZodTypeAny, {
1721
+ received: number;
1722
+ currency: string;
1723
+ available: number;
1724
+ computedAt: string;
1725
+ asOf: string;
1726
+ returnedToFunders: number;
1727
+ inSourcing: number;
1728
+ unallocatedSpend: number;
1729
+ goodsNotDelivered: number;
1730
+ deliveredUnpaid: number;
1731
+ receivable: number;
1732
+ capitalOutstanding: number;
1733
+ buyerReceipts: number;
1734
+ reconciliation: {
1735
+ capitalBase: number;
1736
+ deployedAndHeld: number;
1737
+ profitLossAndCostsRetained: number;
1738
+ };
1739
+ byFunder: {
1740
+ received: {
1741
+ amount: number;
1742
+ funderType: "investor" | "staff" | "company" | "unattributed";
1743
+ funderId?: string | null | undefined;
1744
+ funderName?: string | null | undefined;
1745
+ }[];
1746
+ returned: {
1747
+ amount: number;
1748
+ funderType: "investor" | "staff" | "company" | "unattributed";
1749
+ funderId?: string | null | undefined;
1750
+ funderName?: string | null | undefined;
1751
+ }[];
1752
+ inSourcing: {
1753
+ amount: number;
1754
+ funderType: "investor" | "staff" | "company" | "unattributed";
1755
+ funderId?: string | null | undefined;
1756
+ funderName?: string | null | undefined;
1757
+ }[];
1758
+ unallocatedSpend: {
1759
+ amount: number;
1760
+ funderType: "investor" | "staff" | "company" | "unattributed";
1761
+ funderId?: string | null | undefined;
1762
+ funderName?: string | null | undefined;
1763
+ }[];
1764
+ goodsNotDelivered: {
1765
+ amount: number;
1766
+ funderType: "investor" | "staff" | "company" | "unattributed";
1767
+ funderId?: string | null | undefined;
1768
+ funderName?: string | null | undefined;
1769
+ }[];
1770
+ deliveredUnpaid: {
1771
+ amount: number;
1772
+ funderType: "investor" | "staff" | "company" | "unattributed";
1773
+ funderId?: string | null | undefined;
1774
+ funderName?: string | null | undefined;
1775
+ }[];
1776
+ };
1777
+ openAdvances: {
1778
+ status: "cancelled" | "open" | "pending_receipt" | "settled" | "written_off";
1779
+ remaining: number;
1780
+ amount: number;
1781
+ overdue: boolean;
1782
+ funderType: "investor" | "staff" | "company" | "unattributed";
1783
+ advanceId: string;
1784
+ holderType: "other" | "supplier" | "staff";
1785
+ holderName: string;
1786
+ openedAt: string;
1787
+ ageDays: number;
1788
+ funderId?: string | null | undefined;
1789
+ funderName?: string | null | undefined;
1790
+ holderId?: string | null | undefined;
1791
+ expectedSettleBy?: string | null | undefined;
1792
+ }[];
1793
+ }, {
1794
+ received: number;
1795
+ currency: string;
1796
+ available: number;
1797
+ computedAt: string;
1798
+ asOf: string;
1799
+ returnedToFunders: number;
1800
+ inSourcing: number;
1801
+ unallocatedSpend: number;
1802
+ goodsNotDelivered: number;
1803
+ deliveredUnpaid: number;
1804
+ receivable: number;
1805
+ capitalOutstanding: number;
1806
+ buyerReceipts: number;
1807
+ reconciliation: {
1808
+ capitalBase: number;
1809
+ deployedAndHeld: number;
1810
+ profitLossAndCostsRetained: number;
1811
+ };
1812
+ byFunder: {
1813
+ received: {
1814
+ amount: number;
1815
+ funderType: "investor" | "staff" | "company" | "unattributed";
1816
+ funderId?: string | null | undefined;
1817
+ funderName?: string | null | undefined;
1818
+ }[];
1819
+ returned: {
1820
+ amount: number;
1821
+ funderType: "investor" | "staff" | "company" | "unattributed";
1822
+ funderId?: string | null | undefined;
1823
+ funderName?: string | null | undefined;
1824
+ }[];
1825
+ inSourcing: {
1826
+ amount: number;
1827
+ funderType: "investor" | "staff" | "company" | "unattributed";
1828
+ funderId?: string | null | undefined;
1829
+ funderName?: string | null | undefined;
1830
+ }[];
1831
+ unallocatedSpend: {
1832
+ amount: number;
1833
+ funderType: "investor" | "staff" | "company" | "unattributed";
1834
+ funderId?: string | null | undefined;
1835
+ funderName?: string | null | undefined;
1836
+ }[];
1837
+ goodsNotDelivered: {
1838
+ amount: number;
1839
+ funderType: "investor" | "staff" | "company" | "unattributed";
1840
+ funderId?: string | null | undefined;
1841
+ funderName?: string | null | undefined;
1842
+ }[];
1843
+ deliveredUnpaid: {
1844
+ amount: number;
1845
+ funderType: "investor" | "staff" | "company" | "unattributed";
1846
+ funderId?: string | null | undefined;
1847
+ funderName?: string | null | undefined;
1848
+ }[];
1849
+ };
1850
+ openAdvances: {
1851
+ status: "cancelled" | "open" | "pending_receipt" | "settled" | "written_off";
1852
+ remaining: number;
1853
+ amount: number;
1854
+ overdue: boolean;
1855
+ funderType: "investor" | "staff" | "company" | "unattributed";
1856
+ advanceId: string;
1857
+ holderType: "other" | "supplier" | "staff";
1858
+ holderName: string;
1859
+ openedAt: string;
1860
+ ageDays: number;
1861
+ funderId?: string | null | undefined;
1862
+ funderName?: string | null | undefined;
1863
+ holderId?: string | null | undefined;
1864
+ expectedSettleBy?: string | null | undefined;
1865
+ }[];
1866
+ }>;
1867
+ }, "strip", z.ZodTypeAny, {
1868
+ type: "trade-treasury";
1869
+ id: string;
1870
+ attributes: {
1871
+ received: number;
1872
+ currency: string;
1873
+ available: number;
1874
+ computedAt: string;
1875
+ asOf: string;
1876
+ returnedToFunders: number;
1877
+ inSourcing: number;
1878
+ unallocatedSpend: number;
1879
+ goodsNotDelivered: number;
1880
+ deliveredUnpaid: number;
1881
+ receivable: number;
1882
+ capitalOutstanding: number;
1883
+ buyerReceipts: number;
1884
+ reconciliation: {
1885
+ capitalBase: number;
1886
+ deployedAndHeld: number;
1887
+ profitLossAndCostsRetained: number;
1888
+ };
1889
+ byFunder: {
1890
+ received: {
1891
+ amount: number;
1892
+ funderType: "investor" | "staff" | "company" | "unattributed";
1893
+ funderId?: string | null | undefined;
1894
+ funderName?: string | null | undefined;
1895
+ }[];
1896
+ returned: {
1897
+ amount: number;
1898
+ funderType: "investor" | "staff" | "company" | "unattributed";
1899
+ funderId?: string | null | undefined;
1900
+ funderName?: string | null | undefined;
1901
+ }[];
1902
+ inSourcing: {
1903
+ amount: number;
1904
+ funderType: "investor" | "staff" | "company" | "unattributed";
1905
+ funderId?: string | null | undefined;
1906
+ funderName?: string | null | undefined;
1907
+ }[];
1908
+ unallocatedSpend: {
1909
+ amount: number;
1910
+ funderType: "investor" | "staff" | "company" | "unattributed";
1911
+ funderId?: string | null | undefined;
1912
+ funderName?: string | null | undefined;
1913
+ }[];
1914
+ goodsNotDelivered: {
1915
+ amount: number;
1916
+ funderType: "investor" | "staff" | "company" | "unattributed";
1917
+ funderId?: string | null | undefined;
1918
+ funderName?: string | null | undefined;
1919
+ }[];
1920
+ deliveredUnpaid: {
1921
+ amount: number;
1922
+ funderType: "investor" | "staff" | "company" | "unattributed";
1923
+ funderId?: string | null | undefined;
1924
+ funderName?: string | null | undefined;
1925
+ }[];
1926
+ };
1927
+ openAdvances: {
1928
+ status: "cancelled" | "open" | "pending_receipt" | "settled" | "written_off";
1929
+ remaining: number;
1930
+ amount: number;
1931
+ overdue: boolean;
1932
+ funderType: "investor" | "staff" | "company" | "unattributed";
1933
+ advanceId: string;
1934
+ holderType: "other" | "supplier" | "staff";
1935
+ holderName: string;
1936
+ openedAt: string;
1937
+ ageDays: number;
1938
+ funderId?: string | null | undefined;
1939
+ funderName?: string | null | undefined;
1940
+ holderId?: string | null | undefined;
1941
+ expectedSettleBy?: string | null | undefined;
1942
+ }[];
1943
+ };
1944
+ }, {
1945
+ type: "trade-treasury";
1946
+ id: string;
1947
+ attributes: {
1948
+ received: number;
1949
+ currency: string;
1950
+ available: number;
1951
+ computedAt: string;
1952
+ asOf: string;
1953
+ returnedToFunders: number;
1954
+ inSourcing: number;
1955
+ unallocatedSpend: number;
1956
+ goodsNotDelivered: number;
1957
+ deliveredUnpaid: number;
1958
+ receivable: number;
1959
+ capitalOutstanding: number;
1960
+ buyerReceipts: number;
1961
+ reconciliation: {
1962
+ capitalBase: number;
1963
+ deployedAndHeld: number;
1964
+ profitLossAndCostsRetained: number;
1965
+ };
1966
+ byFunder: {
1967
+ received: {
1968
+ amount: number;
1969
+ funderType: "investor" | "staff" | "company" | "unattributed";
1970
+ funderId?: string | null | undefined;
1971
+ funderName?: string | null | undefined;
1972
+ }[];
1973
+ returned: {
1974
+ amount: number;
1975
+ funderType: "investor" | "staff" | "company" | "unattributed";
1976
+ funderId?: string | null | undefined;
1977
+ funderName?: string | null | undefined;
1978
+ }[];
1979
+ inSourcing: {
1980
+ amount: number;
1981
+ funderType: "investor" | "staff" | "company" | "unattributed";
1982
+ funderId?: string | null | undefined;
1983
+ funderName?: string | null | undefined;
1984
+ }[];
1985
+ unallocatedSpend: {
1986
+ amount: number;
1987
+ funderType: "investor" | "staff" | "company" | "unattributed";
1988
+ funderId?: string | null | undefined;
1989
+ funderName?: string | null | undefined;
1990
+ }[];
1991
+ goodsNotDelivered: {
1992
+ amount: number;
1993
+ funderType: "investor" | "staff" | "company" | "unattributed";
1994
+ funderId?: string | null | undefined;
1995
+ funderName?: string | null | undefined;
1996
+ }[];
1997
+ deliveredUnpaid: {
1998
+ amount: number;
1999
+ funderType: "investor" | "staff" | "company" | "unattributed";
2000
+ funderId?: string | null | undefined;
2001
+ funderName?: string | null | undefined;
2002
+ }[];
2003
+ };
2004
+ openAdvances: {
2005
+ status: "cancelled" | "open" | "pending_receipt" | "settled" | "written_off";
2006
+ remaining: number;
2007
+ amount: number;
2008
+ overdue: boolean;
2009
+ funderType: "investor" | "staff" | "company" | "unattributed";
2010
+ advanceId: string;
2011
+ holderType: "other" | "supplier" | "staff";
2012
+ holderName: string;
2013
+ openedAt: string;
2014
+ ageDays: number;
2015
+ funderId?: string | null | undefined;
2016
+ funderName?: string | null | undefined;
2017
+ holderId?: string | null | undefined;
2018
+ expectedSettleBy?: string | null | undefined;
2019
+ }[];
2020
+ };
2021
+ }>;
2022
+ }, "strip", z.ZodTypeAny, {
2023
+ data: {
2024
+ type: "trade-treasury";
2025
+ id: string;
2026
+ attributes: {
2027
+ received: number;
2028
+ currency: string;
2029
+ available: number;
2030
+ computedAt: string;
2031
+ asOf: string;
2032
+ returnedToFunders: number;
2033
+ inSourcing: number;
2034
+ unallocatedSpend: number;
2035
+ goodsNotDelivered: number;
2036
+ deliveredUnpaid: number;
2037
+ receivable: number;
2038
+ capitalOutstanding: number;
2039
+ buyerReceipts: number;
2040
+ reconciliation: {
2041
+ capitalBase: number;
2042
+ deployedAndHeld: number;
2043
+ profitLossAndCostsRetained: number;
2044
+ };
2045
+ byFunder: {
2046
+ received: {
2047
+ amount: number;
2048
+ funderType: "investor" | "staff" | "company" | "unattributed";
2049
+ funderId?: string | null | undefined;
2050
+ funderName?: string | null | undefined;
2051
+ }[];
2052
+ returned: {
2053
+ amount: number;
2054
+ funderType: "investor" | "staff" | "company" | "unattributed";
2055
+ funderId?: string | null | undefined;
2056
+ funderName?: string | null | undefined;
2057
+ }[];
2058
+ inSourcing: {
2059
+ amount: number;
2060
+ funderType: "investor" | "staff" | "company" | "unattributed";
2061
+ funderId?: string | null | undefined;
2062
+ funderName?: string | null | undefined;
2063
+ }[];
2064
+ unallocatedSpend: {
2065
+ amount: number;
2066
+ funderType: "investor" | "staff" | "company" | "unattributed";
2067
+ funderId?: string | null | undefined;
2068
+ funderName?: string | null | undefined;
2069
+ }[];
2070
+ goodsNotDelivered: {
2071
+ amount: number;
2072
+ funderType: "investor" | "staff" | "company" | "unattributed";
2073
+ funderId?: string | null | undefined;
2074
+ funderName?: string | null | undefined;
2075
+ }[];
2076
+ deliveredUnpaid: {
2077
+ amount: number;
2078
+ funderType: "investor" | "staff" | "company" | "unattributed";
2079
+ funderId?: string | null | undefined;
2080
+ funderName?: string | null | undefined;
2081
+ }[];
2082
+ };
2083
+ openAdvances: {
2084
+ status: "cancelled" | "open" | "pending_receipt" | "settled" | "written_off";
2085
+ remaining: number;
2086
+ amount: number;
2087
+ overdue: boolean;
2088
+ funderType: "investor" | "staff" | "company" | "unattributed";
2089
+ advanceId: string;
2090
+ holderType: "other" | "supplier" | "staff";
2091
+ holderName: string;
2092
+ openedAt: string;
2093
+ ageDays: number;
2094
+ funderId?: string | null | undefined;
2095
+ funderName?: string | null | undefined;
2096
+ holderId?: string | null | undefined;
2097
+ expectedSettleBy?: string | null | undefined;
2098
+ }[];
2099
+ };
2100
+ };
2101
+ }, {
2102
+ data: {
2103
+ type: "trade-treasury";
2104
+ id: string;
2105
+ attributes: {
2106
+ received: number;
2107
+ currency: string;
2108
+ available: number;
2109
+ computedAt: string;
2110
+ asOf: string;
2111
+ returnedToFunders: number;
2112
+ inSourcing: number;
2113
+ unallocatedSpend: number;
2114
+ goodsNotDelivered: number;
2115
+ deliveredUnpaid: number;
2116
+ receivable: number;
2117
+ capitalOutstanding: number;
2118
+ buyerReceipts: number;
2119
+ reconciliation: {
2120
+ capitalBase: number;
2121
+ deployedAndHeld: number;
2122
+ profitLossAndCostsRetained: number;
2123
+ };
2124
+ byFunder: {
2125
+ received: {
2126
+ amount: number;
2127
+ funderType: "investor" | "staff" | "company" | "unattributed";
2128
+ funderId?: string | null | undefined;
2129
+ funderName?: string | null | undefined;
2130
+ }[];
2131
+ returned: {
2132
+ amount: number;
2133
+ funderType: "investor" | "staff" | "company" | "unattributed";
2134
+ funderId?: string | null | undefined;
2135
+ funderName?: string | null | undefined;
2136
+ }[];
2137
+ inSourcing: {
2138
+ amount: number;
2139
+ funderType: "investor" | "staff" | "company" | "unattributed";
2140
+ funderId?: string | null | undefined;
2141
+ funderName?: string | null | undefined;
2142
+ }[];
2143
+ unallocatedSpend: {
2144
+ amount: number;
2145
+ funderType: "investor" | "staff" | "company" | "unattributed";
2146
+ funderId?: string | null | undefined;
2147
+ funderName?: string | null | undefined;
2148
+ }[];
2149
+ goodsNotDelivered: {
2150
+ amount: number;
2151
+ funderType: "investor" | "staff" | "company" | "unattributed";
2152
+ funderId?: string | null | undefined;
2153
+ funderName?: string | null | undefined;
2154
+ }[];
2155
+ deliveredUnpaid: {
2156
+ amount: number;
2157
+ funderType: "investor" | "staff" | "company" | "unattributed";
2158
+ funderId?: string | null | undefined;
2159
+ funderName?: string | null | undefined;
2160
+ }[];
2161
+ };
2162
+ openAdvances: {
2163
+ status: "cancelled" | "open" | "pending_receipt" | "settled" | "written_off";
2164
+ remaining: number;
2165
+ amount: number;
2166
+ overdue: boolean;
2167
+ funderType: "investor" | "staff" | "company" | "unattributed";
2168
+ advanceId: string;
2169
+ holderType: "other" | "supplier" | "staff";
2170
+ holderName: string;
2171
+ openedAt: string;
2172
+ ageDays: number;
2173
+ funderId?: string | null | undefined;
2174
+ funderName?: string | null | undefined;
2175
+ holderId?: string | null | undefined;
2176
+ expectedSettleBy?: string | null | undefined;
2177
+ }[];
2178
+ };
2179
+ };
2180
+ }>;
796
2181
  export declare const tradeControlBoardResponseSchema: z.ZodObject<{
797
2182
  data: z.ZodObject<{
798
2183
  type: z.ZodLiteral<"trade-control-board">;
@@ -851,12 +2236,12 @@ export declare const tradeControlBoardResponseSchema: z.ZodObject<{
851
2236
  dealCount: number;
852
2237
  capitalIn: number;
853
2238
  capitalOut: number;
2239
+ buyerReceipts: number;
854
2240
  purchaseTotal: number;
855
2241
  transportTotal: number;
856
2242
  storageTotal: number;
857
2243
  miscellaneousTotal: number;
858
2244
  saleTotal: number;
859
- buyerReceipts: number;
860
2245
  supplierPayments: number;
861
2246
  commissionPayouts: number;
862
2247
  openDealCount: number;
@@ -877,12 +2262,12 @@ export declare const tradeControlBoardResponseSchema: z.ZodObject<{
877
2262
  dealCount: number;
878
2263
  capitalIn: number;
879
2264
  capitalOut: number;
2265
+ buyerReceipts: number;
880
2266
  purchaseTotal: number;
881
2267
  transportTotal: number;
882
2268
  storageTotal: number;
883
2269
  miscellaneousTotal: number;
884
2270
  saleTotal: number;
885
- buyerReceipts: number;
886
2271
  supplierPayments: number;
887
2272
  commissionPayouts: number;
888
2273
  openDealCount: number;
@@ -907,12 +2292,12 @@ export declare const tradeControlBoardResponseSchema: z.ZodObject<{
907
2292
  dealCount: number;
908
2293
  capitalIn: number;
909
2294
  capitalOut: number;
2295
+ buyerReceipts: number;
910
2296
  purchaseTotal: number;
911
2297
  transportTotal: number;
912
2298
  storageTotal: number;
913
2299
  miscellaneousTotal: number;
914
2300
  saleTotal: number;
915
- buyerReceipts: number;
916
2301
  supplierPayments: number;
917
2302
  commissionPayouts: number;
918
2303
  openDealCount: number;
@@ -937,12 +2322,12 @@ export declare const tradeControlBoardResponseSchema: z.ZodObject<{
937
2322
  dealCount: number;
938
2323
  capitalIn: number;
939
2324
  capitalOut: number;
2325
+ buyerReceipts: number;
940
2326
  purchaseTotal: number;
941
2327
  transportTotal: number;
942
2328
  storageTotal: number;
943
2329
  miscellaneousTotal: number;
944
2330
  saleTotal: number;
945
- buyerReceipts: number;
946
2331
  supplierPayments: number;
947
2332
  commissionPayouts: number;
948
2333
  openDealCount: number;
@@ -969,12 +2354,12 @@ export declare const tradeControlBoardResponseSchema: z.ZodObject<{
969
2354
  dealCount: number;
970
2355
  capitalIn: number;
971
2356
  capitalOut: number;
2357
+ buyerReceipts: number;
972
2358
  purchaseTotal: number;
973
2359
  transportTotal: number;
974
2360
  storageTotal: number;
975
2361
  miscellaneousTotal: number;
976
2362
  saleTotal: number;
977
- buyerReceipts: number;
978
2363
  supplierPayments: number;
979
2364
  commissionPayouts: number;
980
2365
  openDealCount: number;
@@ -1001,12 +2386,12 @@ export declare const tradeControlBoardResponseSchema: z.ZodObject<{
1001
2386
  dealCount: number;
1002
2387
  capitalIn: number;
1003
2388
  capitalOut: number;
2389
+ buyerReceipts: number;
1004
2390
  purchaseTotal: number;
1005
2391
  transportTotal: number;
1006
2392
  storageTotal: number;
1007
2393
  miscellaneousTotal: number;
1008
2394
  saleTotal: number;
1009
- buyerReceipts: number;
1010
2395
  supplierPayments: number;
1011
2396
  commissionPayouts: number;
1012
2397
  openDealCount: number;
@@ -1526,6 +2911,1158 @@ export declare const createInvoicePaymentSchema: z.ZodObject<{
1526
2911
  reference?: string | null | undefined;
1527
2912
  };
1528
2913
  }>;
2914
+ export declare const tradeSourcingAdvanceAttributesSchema: z.ZodObject<{
2915
+ organizationId: z.ZodString;
2916
+ holderType: z.ZodEnum<["staff", "supplier", "other"]>;
2917
+ holderId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2918
+ holderName: z.ZodString;
2919
+ funderType: z.ZodEnum<["company", "staff", "investor", "unattributed"]>;
2920
+ funderId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2921
+ funderName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2922
+ parentAdvanceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2923
+ amount: z.ZodNumber;
2924
+ remaining: z.ZodNumber;
2925
+ currency: z.ZodDefault<z.ZodString>;
2926
+ status: z.ZodEnum<["pending_receipt", "open", "settled", "written_off", "cancelled"]>;
2927
+ expectedSettleBy: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2928
+ dealId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2929
+ purchaseOrderId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2930
+ purpose: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2931
+ notes: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2932
+ confirmedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2933
+ overdue: z.ZodOptional<z.ZodBoolean>;
2934
+ } & {
2935
+ createdAt: z.ZodString;
2936
+ updatedAt: z.ZodString;
2937
+ }, "strip", z.ZodTypeAny, {
2938
+ status: "cancelled" | "open" | "pending_receipt" | "settled" | "written_off";
2939
+ createdAt: string;
2940
+ updatedAt: string;
2941
+ organizationId: string;
2942
+ currency: string;
2943
+ remaining: number;
2944
+ amount: number;
2945
+ funderType: "investor" | "staff" | "company" | "unattributed";
2946
+ holderType: "other" | "supplier" | "staff";
2947
+ holderName: string;
2948
+ notes?: string | null | undefined;
2949
+ overdue?: boolean | undefined;
2950
+ dealId?: string | null | undefined;
2951
+ funderId?: string | null | undefined;
2952
+ funderName?: string | null | undefined;
2953
+ holderId?: string | null | undefined;
2954
+ expectedSettleBy?: string | null | undefined;
2955
+ parentAdvanceId?: string | null | undefined;
2956
+ purchaseOrderId?: string | null | undefined;
2957
+ purpose?: string | null | undefined;
2958
+ confirmedAt?: string | null | undefined;
2959
+ }, {
2960
+ status: "cancelled" | "open" | "pending_receipt" | "settled" | "written_off";
2961
+ createdAt: string;
2962
+ updatedAt: string;
2963
+ organizationId: string;
2964
+ remaining: number;
2965
+ amount: number;
2966
+ funderType: "investor" | "staff" | "company" | "unattributed";
2967
+ holderType: "other" | "supplier" | "staff";
2968
+ holderName: string;
2969
+ currency?: string | undefined;
2970
+ notes?: string | null | undefined;
2971
+ overdue?: boolean | undefined;
2972
+ dealId?: string | null | undefined;
2973
+ funderId?: string | null | undefined;
2974
+ funderName?: string | null | undefined;
2975
+ holderId?: string | null | undefined;
2976
+ expectedSettleBy?: string | null | undefined;
2977
+ parentAdvanceId?: string | null | undefined;
2978
+ purchaseOrderId?: string | null | undefined;
2979
+ purpose?: string | null | undefined;
2980
+ confirmedAt?: string | null | undefined;
2981
+ }>;
2982
+ export declare const createSourcingAdvanceAttributesSchema: z.ZodObject<{
2983
+ holderType: z.ZodEnum<["staff", "supplier", "other"]>;
2984
+ holderId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
2985
+ holderName: z.ZodString;
2986
+ funderType: z.ZodEnum<["company", "staff", "investor"]>;
2987
+ funderId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
2988
+ funderName: z.ZodNullable<z.ZodOptional<z.ZodString>>;
2989
+ amount: z.ZodNumber;
2990
+ currency: z.ZodDefault<z.ZodOptional<z.ZodString>>;
2991
+ occurredAt: z.ZodString;
2992
+ expectedSettleBy: z.ZodNullable<z.ZodOptional<z.ZodString>>;
2993
+ dealId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
2994
+ purchaseOrderId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
2995
+ purpose: z.ZodNullable<z.ZodOptional<z.ZodString>>;
2996
+ notes: z.ZodNullable<z.ZodOptional<z.ZodString>>;
2997
+ method: z.ZodNullable<z.ZodOptional<z.ZodString>>;
2998
+ reference: z.ZodNullable<z.ZodOptional<z.ZodString>>;
2999
+ }, "strip", z.ZodTypeAny, {
3000
+ currency: string;
3001
+ occurredAt: string;
3002
+ amount: number;
3003
+ funderType: "investor" | "staff" | "company";
3004
+ holderType: "other" | "supplier" | "staff";
3005
+ holderName: string;
3006
+ method?: string | null | undefined;
3007
+ notes?: string | null | undefined;
3008
+ reference?: string | null | undefined;
3009
+ dealId?: string | null | undefined;
3010
+ funderId?: string | null | undefined;
3011
+ funderName?: string | null | undefined;
3012
+ holderId?: string | null | undefined;
3013
+ expectedSettleBy?: string | null | undefined;
3014
+ purchaseOrderId?: string | null | undefined;
3015
+ purpose?: string | null | undefined;
3016
+ }, {
3017
+ occurredAt: string;
3018
+ amount: number;
3019
+ funderType: "investor" | "staff" | "company";
3020
+ holderType: "other" | "supplier" | "staff";
3021
+ holderName: string;
3022
+ method?: string | null | undefined;
3023
+ currency?: string | undefined;
3024
+ notes?: string | null | undefined;
3025
+ reference?: string | null | undefined;
3026
+ dealId?: string | null | undefined;
3027
+ funderId?: string | null | undefined;
3028
+ funderName?: string | null | undefined;
3029
+ holderId?: string | null | undefined;
3030
+ expectedSettleBy?: string | null | undefined;
3031
+ purchaseOrderId?: string | null | undefined;
3032
+ purpose?: string | null | undefined;
3033
+ }>;
3034
+ export declare const handoffAdvanceAttributesSchema: z.ZodObject<{
3035
+ amount: z.ZodNumber;
3036
+ holderType: z.ZodEnum<["staff", "supplier", "other"]>;
3037
+ holderId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
3038
+ holderName: z.ZodString;
3039
+ occurredAt: z.ZodString;
3040
+ notes: z.ZodNullable<z.ZodOptional<z.ZodString>>;
3041
+ }, "strip", z.ZodTypeAny, {
3042
+ occurredAt: string;
3043
+ amount: number;
3044
+ holderType: "other" | "supplier" | "staff";
3045
+ holderName: string;
3046
+ notes?: string | null | undefined;
3047
+ holderId?: string | null | undefined;
3048
+ }, {
3049
+ occurredAt: string;
3050
+ amount: number;
3051
+ holderType: "other" | "supplier" | "staff";
3052
+ holderName: string;
3053
+ notes?: string | null | undefined;
3054
+ holderId?: string | null | undefined;
3055
+ }>;
3056
+ export declare const advanceSettlementLineSchema: z.ZodObject<{
3057
+ outcome: z.ZodEnum<["spent", "returned", "written_off", "overspend"]>;
3058
+ amount: z.ZodNumber;
3059
+ supplierName: z.ZodNullable<z.ZodOptional<z.ZodString>>;
3060
+ supplierId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
3061
+ dealId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
3062
+ purchaseOrderId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
3063
+ proofRef: z.ZodNullable<z.ZodOptional<z.ZodString>>;
3064
+ notes: z.ZodNullable<z.ZodOptional<z.ZodString>>;
3065
+ }, "strip", z.ZodTypeAny, {
3066
+ amount: number;
3067
+ outcome: "written_off" | "spent" | "returned" | "overspend";
3068
+ notes?: string | null | undefined;
3069
+ supplierId?: string | null | undefined;
3070
+ supplierName?: string | null | undefined;
3071
+ dealId?: string | null | undefined;
3072
+ purchaseOrderId?: string | null | undefined;
3073
+ proofRef?: string | null | undefined;
3074
+ }, {
3075
+ amount: number;
3076
+ outcome: "written_off" | "spent" | "returned" | "overspend";
3077
+ notes?: string | null | undefined;
3078
+ supplierId?: string | null | undefined;
3079
+ supplierName?: string | null | undefined;
3080
+ dealId?: string | null | undefined;
3081
+ purchaseOrderId?: string | null | undefined;
3082
+ proofRef?: string | null | undefined;
3083
+ }>;
3084
+ export declare const submitAdvanceSettlementAttributesSchema: z.ZodObject<{
3085
+ lines: z.ZodArray<z.ZodObject<{
3086
+ outcome: z.ZodEnum<["spent", "returned", "written_off", "overspend"]>;
3087
+ amount: z.ZodNumber;
3088
+ supplierName: z.ZodNullable<z.ZodOptional<z.ZodString>>;
3089
+ supplierId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
3090
+ dealId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
3091
+ purchaseOrderId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
3092
+ proofRef: z.ZodNullable<z.ZodOptional<z.ZodString>>;
3093
+ notes: z.ZodNullable<z.ZodOptional<z.ZodString>>;
3094
+ }, "strip", z.ZodTypeAny, {
3095
+ amount: number;
3096
+ outcome: "written_off" | "spent" | "returned" | "overspend";
3097
+ notes?: string | null | undefined;
3098
+ supplierId?: string | null | undefined;
3099
+ supplierName?: string | null | undefined;
3100
+ dealId?: string | null | undefined;
3101
+ purchaseOrderId?: string | null | undefined;
3102
+ proofRef?: string | null | undefined;
3103
+ }, {
3104
+ amount: number;
3105
+ outcome: "written_off" | "spent" | "returned" | "overspend";
3106
+ notes?: string | null | undefined;
3107
+ supplierId?: string | null | undefined;
3108
+ supplierName?: string | null | undefined;
3109
+ dealId?: string | null | undefined;
3110
+ purchaseOrderId?: string | null | undefined;
3111
+ proofRef?: string | null | undefined;
3112
+ }>, "many">;
3113
+ notes: z.ZodNullable<z.ZodOptional<z.ZodString>>;
3114
+ }, "strip", z.ZodTypeAny, {
3115
+ lines: {
3116
+ amount: number;
3117
+ outcome: "written_off" | "spent" | "returned" | "overspend";
3118
+ notes?: string | null | undefined;
3119
+ supplierId?: string | null | undefined;
3120
+ supplierName?: string | null | undefined;
3121
+ dealId?: string | null | undefined;
3122
+ purchaseOrderId?: string | null | undefined;
3123
+ proofRef?: string | null | undefined;
3124
+ }[];
3125
+ notes?: string | null | undefined;
3126
+ }, {
3127
+ lines: {
3128
+ amount: number;
3129
+ outcome: "written_off" | "spent" | "returned" | "overspend";
3130
+ notes?: string | null | undefined;
3131
+ supplierId?: string | null | undefined;
3132
+ supplierName?: string | null | undefined;
3133
+ dealId?: string | null | undefined;
3134
+ purchaseOrderId?: string | null | undefined;
3135
+ proofRef?: string | null | undefined;
3136
+ }[];
3137
+ notes?: string | null | undefined;
3138
+ }>;
3139
+ export declare const approveAdvanceSettlementAttributesSchema: z.ZodObject<{
3140
+ occurredAt: z.ZodString;
3141
+ notes: z.ZodNullable<z.ZodOptional<z.ZodString>>;
3142
+ }, "strip", z.ZodTypeAny, {
3143
+ occurredAt: string;
3144
+ notes?: string | null | undefined;
3145
+ }, {
3146
+ occurredAt: string;
3147
+ notes?: string | null | undefined;
3148
+ }>;
3149
+ export declare const writeoffAdvanceAttributesSchema: z.ZodObject<{
3150
+ amount: z.ZodNumber;
3151
+ reason: z.ZodString;
3152
+ occurredAt: z.ZodString;
3153
+ }, "strip", z.ZodTypeAny, {
3154
+ reason: string;
3155
+ occurredAt: string;
3156
+ amount: number;
3157
+ }, {
3158
+ reason: string;
3159
+ occurredAt: string;
3160
+ amount: number;
3161
+ }>;
3162
+ export declare const tradeSourcingAdvanceResourceSchema: z.ZodObject<{
3163
+ type: z.ZodLiteral<string>;
3164
+ id: z.ZodString;
3165
+ attributes: z.ZodObject<{
3166
+ organizationId: z.ZodString;
3167
+ holderType: z.ZodEnum<["staff", "supplier", "other"]>;
3168
+ holderId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3169
+ holderName: z.ZodString;
3170
+ funderType: z.ZodEnum<["company", "staff", "investor", "unattributed"]>;
3171
+ funderId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3172
+ funderName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3173
+ parentAdvanceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3174
+ amount: z.ZodNumber;
3175
+ remaining: z.ZodNumber;
3176
+ currency: z.ZodDefault<z.ZodString>;
3177
+ status: z.ZodEnum<["pending_receipt", "open", "settled", "written_off", "cancelled"]>;
3178
+ expectedSettleBy: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3179
+ dealId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3180
+ purchaseOrderId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3181
+ purpose: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3182
+ notes: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3183
+ confirmedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3184
+ overdue: z.ZodOptional<z.ZodBoolean>;
3185
+ } & {
3186
+ createdAt: z.ZodString;
3187
+ updatedAt: z.ZodString;
3188
+ }, "strip", z.ZodTypeAny, {
3189
+ status: "cancelled" | "open" | "pending_receipt" | "settled" | "written_off";
3190
+ createdAt: string;
3191
+ updatedAt: string;
3192
+ organizationId: string;
3193
+ currency: string;
3194
+ remaining: number;
3195
+ amount: number;
3196
+ funderType: "investor" | "staff" | "company" | "unattributed";
3197
+ holderType: "other" | "supplier" | "staff";
3198
+ holderName: string;
3199
+ notes?: string | null | undefined;
3200
+ overdue?: boolean | undefined;
3201
+ dealId?: string | null | undefined;
3202
+ funderId?: string | null | undefined;
3203
+ funderName?: string | null | undefined;
3204
+ holderId?: string | null | undefined;
3205
+ expectedSettleBy?: string | null | undefined;
3206
+ parentAdvanceId?: string | null | undefined;
3207
+ purchaseOrderId?: string | null | undefined;
3208
+ purpose?: string | null | undefined;
3209
+ confirmedAt?: string | null | undefined;
3210
+ }, {
3211
+ status: "cancelled" | "open" | "pending_receipt" | "settled" | "written_off";
3212
+ createdAt: string;
3213
+ updatedAt: string;
3214
+ organizationId: string;
3215
+ remaining: number;
3216
+ amount: number;
3217
+ funderType: "investor" | "staff" | "company" | "unattributed";
3218
+ holderType: "other" | "supplier" | "staff";
3219
+ holderName: string;
3220
+ currency?: string | undefined;
3221
+ notes?: string | null | undefined;
3222
+ overdue?: boolean | undefined;
3223
+ dealId?: string | null | undefined;
3224
+ funderId?: string | null | undefined;
3225
+ funderName?: string | null | undefined;
3226
+ holderId?: string | null | undefined;
3227
+ expectedSettleBy?: string | null | undefined;
3228
+ parentAdvanceId?: string | null | undefined;
3229
+ purchaseOrderId?: string | null | undefined;
3230
+ purpose?: string | null | undefined;
3231
+ confirmedAt?: string | null | undefined;
3232
+ }>;
3233
+ relationships: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
3234
+ links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
3235
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
3236
+ }, "strip", z.ZodTypeAny, {
3237
+ type: string;
3238
+ id: string;
3239
+ attributes: {
3240
+ status: "cancelled" | "open" | "pending_receipt" | "settled" | "written_off";
3241
+ createdAt: string;
3242
+ updatedAt: string;
3243
+ organizationId: string;
3244
+ currency: string;
3245
+ remaining: number;
3246
+ amount: number;
3247
+ funderType: "investor" | "staff" | "company" | "unattributed";
3248
+ holderType: "other" | "supplier" | "staff";
3249
+ holderName: string;
3250
+ notes?: string | null | undefined;
3251
+ overdue?: boolean | undefined;
3252
+ dealId?: string | null | undefined;
3253
+ funderId?: string | null | undefined;
3254
+ funderName?: string | null | undefined;
3255
+ holderId?: string | null | undefined;
3256
+ expectedSettleBy?: string | null | undefined;
3257
+ parentAdvanceId?: string | null | undefined;
3258
+ purchaseOrderId?: string | null | undefined;
3259
+ purpose?: string | null | undefined;
3260
+ confirmedAt?: string | null | undefined;
3261
+ };
3262
+ relationships?: Record<string, unknown> | undefined;
3263
+ links?: Record<string, string> | undefined;
3264
+ meta?: Record<string, unknown> | undefined;
3265
+ }, {
3266
+ type: string;
3267
+ id: string;
3268
+ attributes: {
3269
+ status: "cancelled" | "open" | "pending_receipt" | "settled" | "written_off";
3270
+ createdAt: string;
3271
+ updatedAt: string;
3272
+ organizationId: string;
3273
+ remaining: number;
3274
+ amount: number;
3275
+ funderType: "investor" | "staff" | "company" | "unattributed";
3276
+ holderType: "other" | "supplier" | "staff";
3277
+ holderName: string;
3278
+ currency?: string | undefined;
3279
+ notes?: string | null | undefined;
3280
+ overdue?: boolean | undefined;
3281
+ dealId?: string | null | undefined;
3282
+ funderId?: string | null | undefined;
3283
+ funderName?: string | null | undefined;
3284
+ holderId?: string | null | undefined;
3285
+ expectedSettleBy?: string | null | undefined;
3286
+ parentAdvanceId?: string | null | undefined;
3287
+ purchaseOrderId?: string | null | undefined;
3288
+ purpose?: string | null | undefined;
3289
+ confirmedAt?: string | null | undefined;
3290
+ };
3291
+ relationships?: Record<string, unknown> | undefined;
3292
+ links?: Record<string, string> | undefined;
3293
+ meta?: Record<string, unknown> | undefined;
3294
+ }>;
3295
+ export declare const tradeSourcingAdvanceResponseSchema: z.ZodObject<{
3296
+ data: z.ZodObject<{
3297
+ type: z.ZodLiteral<string>;
3298
+ id: z.ZodString;
3299
+ attributes: z.ZodObject<{
3300
+ organizationId: z.ZodString;
3301
+ holderType: z.ZodEnum<["staff", "supplier", "other"]>;
3302
+ holderId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3303
+ holderName: z.ZodString;
3304
+ funderType: z.ZodEnum<["company", "staff", "investor", "unattributed"]>;
3305
+ funderId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3306
+ funderName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3307
+ parentAdvanceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3308
+ amount: z.ZodNumber;
3309
+ remaining: z.ZodNumber;
3310
+ currency: z.ZodDefault<z.ZodString>;
3311
+ status: z.ZodEnum<["pending_receipt", "open", "settled", "written_off", "cancelled"]>;
3312
+ expectedSettleBy: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3313
+ dealId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3314
+ purchaseOrderId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3315
+ purpose: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3316
+ notes: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3317
+ confirmedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3318
+ overdue: z.ZodOptional<z.ZodBoolean>;
3319
+ } & {
3320
+ createdAt: z.ZodString;
3321
+ updatedAt: z.ZodString;
3322
+ }, "strip", z.ZodTypeAny, {
3323
+ status: "cancelled" | "open" | "pending_receipt" | "settled" | "written_off";
3324
+ createdAt: string;
3325
+ updatedAt: string;
3326
+ organizationId: string;
3327
+ currency: string;
3328
+ remaining: number;
3329
+ amount: number;
3330
+ funderType: "investor" | "staff" | "company" | "unattributed";
3331
+ holderType: "other" | "supplier" | "staff";
3332
+ holderName: string;
3333
+ notes?: string | null | undefined;
3334
+ overdue?: boolean | undefined;
3335
+ dealId?: string | null | undefined;
3336
+ funderId?: string | null | undefined;
3337
+ funderName?: string | null | undefined;
3338
+ holderId?: string | null | undefined;
3339
+ expectedSettleBy?: string | null | undefined;
3340
+ parentAdvanceId?: string | null | undefined;
3341
+ purchaseOrderId?: string | null | undefined;
3342
+ purpose?: string | null | undefined;
3343
+ confirmedAt?: string | null | undefined;
3344
+ }, {
3345
+ status: "cancelled" | "open" | "pending_receipt" | "settled" | "written_off";
3346
+ createdAt: string;
3347
+ updatedAt: string;
3348
+ organizationId: string;
3349
+ remaining: number;
3350
+ amount: number;
3351
+ funderType: "investor" | "staff" | "company" | "unattributed";
3352
+ holderType: "other" | "supplier" | "staff";
3353
+ holderName: string;
3354
+ currency?: string | undefined;
3355
+ notes?: string | null | undefined;
3356
+ overdue?: boolean | undefined;
3357
+ dealId?: string | null | undefined;
3358
+ funderId?: string | null | undefined;
3359
+ funderName?: string | null | undefined;
3360
+ holderId?: string | null | undefined;
3361
+ expectedSettleBy?: string | null | undefined;
3362
+ parentAdvanceId?: string | null | undefined;
3363
+ purchaseOrderId?: string | null | undefined;
3364
+ purpose?: string | null | undefined;
3365
+ confirmedAt?: string | null | undefined;
3366
+ }>;
3367
+ relationships: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
3368
+ links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
3369
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
3370
+ }, "strip", z.ZodTypeAny, {
3371
+ type: string;
3372
+ id: string;
3373
+ attributes: {
3374
+ status: "cancelled" | "open" | "pending_receipt" | "settled" | "written_off";
3375
+ createdAt: string;
3376
+ updatedAt: string;
3377
+ organizationId: string;
3378
+ currency: string;
3379
+ remaining: number;
3380
+ amount: number;
3381
+ funderType: "investor" | "staff" | "company" | "unattributed";
3382
+ holderType: "other" | "supplier" | "staff";
3383
+ holderName: string;
3384
+ notes?: string | null | undefined;
3385
+ overdue?: boolean | undefined;
3386
+ dealId?: string | null | undefined;
3387
+ funderId?: string | null | undefined;
3388
+ funderName?: string | null | undefined;
3389
+ holderId?: string | null | undefined;
3390
+ expectedSettleBy?: string | null | undefined;
3391
+ parentAdvanceId?: string | null | undefined;
3392
+ purchaseOrderId?: string | null | undefined;
3393
+ purpose?: string | null | undefined;
3394
+ confirmedAt?: string | null | undefined;
3395
+ };
3396
+ relationships?: Record<string, unknown> | undefined;
3397
+ links?: Record<string, string> | undefined;
3398
+ meta?: Record<string, unknown> | undefined;
3399
+ }, {
3400
+ type: string;
3401
+ id: string;
3402
+ attributes: {
3403
+ status: "cancelled" | "open" | "pending_receipt" | "settled" | "written_off";
3404
+ createdAt: string;
3405
+ updatedAt: string;
3406
+ organizationId: string;
3407
+ remaining: number;
3408
+ amount: number;
3409
+ funderType: "investor" | "staff" | "company" | "unattributed";
3410
+ holderType: "other" | "supplier" | "staff";
3411
+ holderName: string;
3412
+ currency?: string | undefined;
3413
+ notes?: string | null | undefined;
3414
+ overdue?: boolean | undefined;
3415
+ dealId?: string | null | undefined;
3416
+ funderId?: string | null | undefined;
3417
+ funderName?: string | null | undefined;
3418
+ holderId?: string | null | undefined;
3419
+ expectedSettleBy?: string | null | undefined;
3420
+ parentAdvanceId?: string | null | undefined;
3421
+ purchaseOrderId?: string | null | undefined;
3422
+ purpose?: string | null | undefined;
3423
+ confirmedAt?: string | null | undefined;
3424
+ };
3425
+ relationships?: Record<string, unknown> | undefined;
3426
+ links?: Record<string, string> | undefined;
3427
+ meta?: Record<string, unknown> | undefined;
3428
+ }>;
3429
+ included: z.ZodOptional<z.ZodArray<z.ZodObject<{
3430
+ type: z.ZodString;
3431
+ id: z.ZodString;
3432
+ attributes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
3433
+ relationships: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
3434
+ links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
3435
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
3436
+ }, "strip", z.ZodTypeAny, {
3437
+ type: string;
3438
+ id: string;
3439
+ attributes?: Record<string, unknown> | undefined;
3440
+ relationships?: Record<string, unknown> | undefined;
3441
+ links?: Record<string, string> | undefined;
3442
+ meta?: Record<string, unknown> | undefined;
3443
+ }, {
3444
+ type: string;
3445
+ id: string;
3446
+ attributes?: Record<string, unknown> | undefined;
3447
+ relationships?: Record<string, unknown> | undefined;
3448
+ links?: Record<string, string> | undefined;
3449
+ meta?: Record<string, unknown> | undefined;
3450
+ }>, "many">>;
3451
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
3452
+ links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
3453
+ }, "strip", z.ZodTypeAny, {
3454
+ data: {
3455
+ type: string;
3456
+ id: string;
3457
+ attributes: {
3458
+ status: "cancelled" | "open" | "pending_receipt" | "settled" | "written_off";
3459
+ createdAt: string;
3460
+ updatedAt: string;
3461
+ organizationId: string;
3462
+ currency: string;
3463
+ remaining: number;
3464
+ amount: number;
3465
+ funderType: "investor" | "staff" | "company" | "unattributed";
3466
+ holderType: "other" | "supplier" | "staff";
3467
+ holderName: string;
3468
+ notes?: string | null | undefined;
3469
+ overdue?: boolean | undefined;
3470
+ dealId?: string | null | undefined;
3471
+ funderId?: string | null | undefined;
3472
+ funderName?: string | null | undefined;
3473
+ holderId?: string | null | undefined;
3474
+ expectedSettleBy?: string | null | undefined;
3475
+ parentAdvanceId?: string | null | undefined;
3476
+ purchaseOrderId?: string | null | undefined;
3477
+ purpose?: string | null | undefined;
3478
+ confirmedAt?: string | null | undefined;
3479
+ };
3480
+ relationships?: Record<string, unknown> | undefined;
3481
+ links?: Record<string, string> | undefined;
3482
+ meta?: Record<string, unknown> | undefined;
3483
+ };
3484
+ links?: Record<string, string> | undefined;
3485
+ meta?: Record<string, unknown> | undefined;
3486
+ included?: {
3487
+ type: string;
3488
+ id: string;
3489
+ attributes?: Record<string, unknown> | undefined;
3490
+ relationships?: Record<string, unknown> | undefined;
3491
+ links?: Record<string, string> | undefined;
3492
+ meta?: Record<string, unknown> | undefined;
3493
+ }[] | undefined;
3494
+ }, {
3495
+ data: {
3496
+ type: string;
3497
+ id: string;
3498
+ attributes: {
3499
+ status: "cancelled" | "open" | "pending_receipt" | "settled" | "written_off";
3500
+ createdAt: string;
3501
+ updatedAt: string;
3502
+ organizationId: string;
3503
+ remaining: number;
3504
+ amount: number;
3505
+ funderType: "investor" | "staff" | "company" | "unattributed";
3506
+ holderType: "other" | "supplier" | "staff";
3507
+ holderName: string;
3508
+ currency?: string | undefined;
3509
+ notes?: string | null | undefined;
3510
+ overdue?: boolean | undefined;
3511
+ dealId?: string | null | undefined;
3512
+ funderId?: string | null | undefined;
3513
+ funderName?: string | null | undefined;
3514
+ holderId?: string | null | undefined;
3515
+ expectedSettleBy?: string | null | undefined;
3516
+ parentAdvanceId?: string | null | undefined;
3517
+ purchaseOrderId?: string | null | undefined;
3518
+ purpose?: string | null | undefined;
3519
+ confirmedAt?: string | null | undefined;
3520
+ };
3521
+ relationships?: Record<string, unknown> | undefined;
3522
+ links?: Record<string, string> | undefined;
3523
+ meta?: Record<string, unknown> | undefined;
3524
+ };
3525
+ links?: Record<string, string> | undefined;
3526
+ meta?: Record<string, unknown> | undefined;
3527
+ included?: {
3528
+ type: string;
3529
+ id: string;
3530
+ attributes?: Record<string, unknown> | undefined;
3531
+ relationships?: Record<string, unknown> | undefined;
3532
+ links?: Record<string, string> | undefined;
3533
+ meta?: Record<string, unknown> | undefined;
3534
+ }[] | undefined;
3535
+ }>;
3536
+ export declare const tradeSourcingAdvanceListResponseSchema: z.ZodObject<{
3537
+ data: z.ZodArray<z.ZodObject<{
3538
+ type: z.ZodLiteral<string>;
3539
+ id: z.ZodString;
3540
+ attributes: z.ZodObject<{
3541
+ organizationId: z.ZodString;
3542
+ holderType: z.ZodEnum<["staff", "supplier", "other"]>;
3543
+ holderId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3544
+ holderName: z.ZodString;
3545
+ funderType: z.ZodEnum<["company", "staff", "investor", "unattributed"]>;
3546
+ funderId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3547
+ funderName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3548
+ parentAdvanceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3549
+ amount: z.ZodNumber;
3550
+ remaining: z.ZodNumber;
3551
+ currency: z.ZodDefault<z.ZodString>;
3552
+ status: z.ZodEnum<["pending_receipt", "open", "settled", "written_off", "cancelled"]>;
3553
+ expectedSettleBy: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3554
+ dealId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3555
+ purchaseOrderId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3556
+ purpose: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3557
+ notes: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3558
+ confirmedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3559
+ overdue: z.ZodOptional<z.ZodBoolean>;
3560
+ } & {
3561
+ createdAt: z.ZodString;
3562
+ updatedAt: z.ZodString;
3563
+ }, "strip", z.ZodTypeAny, {
3564
+ status: "cancelled" | "open" | "pending_receipt" | "settled" | "written_off";
3565
+ createdAt: string;
3566
+ updatedAt: string;
3567
+ organizationId: string;
3568
+ currency: string;
3569
+ remaining: number;
3570
+ amount: number;
3571
+ funderType: "investor" | "staff" | "company" | "unattributed";
3572
+ holderType: "other" | "supplier" | "staff";
3573
+ holderName: string;
3574
+ notes?: string | null | undefined;
3575
+ overdue?: boolean | undefined;
3576
+ dealId?: string | null | undefined;
3577
+ funderId?: string | null | undefined;
3578
+ funderName?: string | null | undefined;
3579
+ holderId?: string | null | undefined;
3580
+ expectedSettleBy?: string | null | undefined;
3581
+ parentAdvanceId?: string | null | undefined;
3582
+ purchaseOrderId?: string | null | undefined;
3583
+ purpose?: string | null | undefined;
3584
+ confirmedAt?: string | null | undefined;
3585
+ }, {
3586
+ status: "cancelled" | "open" | "pending_receipt" | "settled" | "written_off";
3587
+ createdAt: string;
3588
+ updatedAt: string;
3589
+ organizationId: string;
3590
+ remaining: number;
3591
+ amount: number;
3592
+ funderType: "investor" | "staff" | "company" | "unattributed";
3593
+ holderType: "other" | "supplier" | "staff";
3594
+ holderName: string;
3595
+ currency?: string | undefined;
3596
+ notes?: string | null | undefined;
3597
+ overdue?: boolean | undefined;
3598
+ dealId?: string | null | undefined;
3599
+ funderId?: string | null | undefined;
3600
+ funderName?: string | null | undefined;
3601
+ holderId?: string | null | undefined;
3602
+ expectedSettleBy?: string | null | undefined;
3603
+ parentAdvanceId?: string | null | undefined;
3604
+ purchaseOrderId?: string | null | undefined;
3605
+ purpose?: string | null | undefined;
3606
+ confirmedAt?: string | null | undefined;
3607
+ }>;
3608
+ relationships: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
3609
+ links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
3610
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
3611
+ }, "strip", z.ZodTypeAny, {
3612
+ type: string;
3613
+ id: string;
3614
+ attributes: {
3615
+ status: "cancelled" | "open" | "pending_receipt" | "settled" | "written_off";
3616
+ createdAt: string;
3617
+ updatedAt: string;
3618
+ organizationId: string;
3619
+ currency: string;
3620
+ remaining: number;
3621
+ amount: number;
3622
+ funderType: "investor" | "staff" | "company" | "unattributed";
3623
+ holderType: "other" | "supplier" | "staff";
3624
+ holderName: string;
3625
+ notes?: string | null | undefined;
3626
+ overdue?: boolean | undefined;
3627
+ dealId?: string | null | undefined;
3628
+ funderId?: string | null | undefined;
3629
+ funderName?: string | null | undefined;
3630
+ holderId?: string | null | undefined;
3631
+ expectedSettleBy?: string | null | undefined;
3632
+ parentAdvanceId?: string | null | undefined;
3633
+ purchaseOrderId?: string | null | undefined;
3634
+ purpose?: string | null | undefined;
3635
+ confirmedAt?: string | null | undefined;
3636
+ };
3637
+ relationships?: Record<string, unknown> | undefined;
3638
+ links?: Record<string, string> | undefined;
3639
+ meta?: Record<string, unknown> | undefined;
3640
+ }, {
3641
+ type: string;
3642
+ id: string;
3643
+ attributes: {
3644
+ status: "cancelled" | "open" | "pending_receipt" | "settled" | "written_off";
3645
+ createdAt: string;
3646
+ updatedAt: string;
3647
+ organizationId: string;
3648
+ remaining: number;
3649
+ amount: number;
3650
+ funderType: "investor" | "staff" | "company" | "unattributed";
3651
+ holderType: "other" | "supplier" | "staff";
3652
+ holderName: string;
3653
+ currency?: string | undefined;
3654
+ notes?: string | null | undefined;
3655
+ overdue?: boolean | undefined;
3656
+ dealId?: string | null | undefined;
3657
+ funderId?: string | null | undefined;
3658
+ funderName?: string | null | undefined;
3659
+ holderId?: string | null | undefined;
3660
+ expectedSettleBy?: string | null | undefined;
3661
+ parentAdvanceId?: string | null | undefined;
3662
+ purchaseOrderId?: string | null | undefined;
3663
+ purpose?: string | null | undefined;
3664
+ confirmedAt?: string | null | undefined;
3665
+ };
3666
+ relationships?: Record<string, unknown> | undefined;
3667
+ links?: Record<string, string> | undefined;
3668
+ meta?: Record<string, unknown> | undefined;
3669
+ }>, "many">;
3670
+ included: z.ZodOptional<z.ZodArray<z.ZodObject<{
3671
+ type: z.ZodString;
3672
+ id: z.ZodString;
3673
+ attributes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
3674
+ relationships: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
3675
+ links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
3676
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
3677
+ }, "strip", z.ZodTypeAny, {
3678
+ type: string;
3679
+ id: string;
3680
+ attributes?: Record<string, unknown> | undefined;
3681
+ relationships?: Record<string, unknown> | undefined;
3682
+ links?: Record<string, string> | undefined;
3683
+ meta?: Record<string, unknown> | undefined;
3684
+ }, {
3685
+ type: string;
3686
+ id: string;
3687
+ attributes?: Record<string, unknown> | undefined;
3688
+ relationships?: Record<string, unknown> | undefined;
3689
+ links?: Record<string, string> | undefined;
3690
+ meta?: Record<string, unknown> | undefined;
3691
+ }>, "many">>;
3692
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
3693
+ links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
3694
+ }, "strip", z.ZodTypeAny, {
3695
+ data: {
3696
+ type: string;
3697
+ id: string;
3698
+ attributes: {
3699
+ status: "cancelled" | "open" | "pending_receipt" | "settled" | "written_off";
3700
+ createdAt: string;
3701
+ updatedAt: string;
3702
+ organizationId: string;
3703
+ currency: string;
3704
+ remaining: number;
3705
+ amount: number;
3706
+ funderType: "investor" | "staff" | "company" | "unattributed";
3707
+ holderType: "other" | "supplier" | "staff";
3708
+ holderName: string;
3709
+ notes?: string | null | undefined;
3710
+ overdue?: boolean | undefined;
3711
+ dealId?: string | null | undefined;
3712
+ funderId?: string | null | undefined;
3713
+ funderName?: string | null | undefined;
3714
+ holderId?: string | null | undefined;
3715
+ expectedSettleBy?: string | null | undefined;
3716
+ parentAdvanceId?: string | null | undefined;
3717
+ purchaseOrderId?: string | null | undefined;
3718
+ purpose?: string | null | undefined;
3719
+ confirmedAt?: string | null | undefined;
3720
+ };
3721
+ relationships?: Record<string, unknown> | undefined;
3722
+ links?: Record<string, string> | undefined;
3723
+ meta?: Record<string, unknown> | undefined;
3724
+ }[];
3725
+ links?: Record<string, string> | undefined;
3726
+ meta?: Record<string, unknown> | undefined;
3727
+ included?: {
3728
+ type: string;
3729
+ id: string;
3730
+ attributes?: Record<string, unknown> | undefined;
3731
+ relationships?: Record<string, unknown> | undefined;
3732
+ links?: Record<string, string> | undefined;
3733
+ meta?: Record<string, unknown> | undefined;
3734
+ }[] | undefined;
3735
+ }, {
3736
+ data: {
3737
+ type: string;
3738
+ id: string;
3739
+ attributes: {
3740
+ status: "cancelled" | "open" | "pending_receipt" | "settled" | "written_off";
3741
+ createdAt: string;
3742
+ updatedAt: string;
3743
+ organizationId: string;
3744
+ remaining: number;
3745
+ amount: number;
3746
+ funderType: "investor" | "staff" | "company" | "unattributed";
3747
+ holderType: "other" | "supplier" | "staff";
3748
+ holderName: string;
3749
+ currency?: string | undefined;
3750
+ notes?: string | null | undefined;
3751
+ overdue?: boolean | undefined;
3752
+ dealId?: string | null | undefined;
3753
+ funderId?: string | null | undefined;
3754
+ funderName?: string | null | undefined;
3755
+ holderId?: string | null | undefined;
3756
+ expectedSettleBy?: string | null | undefined;
3757
+ parentAdvanceId?: string | null | undefined;
3758
+ purchaseOrderId?: string | null | undefined;
3759
+ purpose?: string | null | undefined;
3760
+ confirmedAt?: string | null | undefined;
3761
+ };
3762
+ relationships?: Record<string, unknown> | undefined;
3763
+ links?: Record<string, string> | undefined;
3764
+ meta?: Record<string, unknown> | undefined;
3765
+ }[];
3766
+ links?: Record<string, string> | undefined;
3767
+ meta?: Record<string, unknown> | undefined;
3768
+ included?: {
3769
+ type: string;
3770
+ id: string;
3771
+ attributes?: Record<string, unknown> | undefined;
3772
+ relationships?: Record<string, unknown> | undefined;
3773
+ links?: Record<string, string> | undefined;
3774
+ meta?: Record<string, unknown> | undefined;
3775
+ }[] | undefined;
3776
+ }>;
3777
+ export declare const createSourcingAdvanceSchema: z.ZodObject<{
3778
+ type: z.ZodLiteral<"trade-sourcing-advances">;
3779
+ attributes: z.ZodObject<{
3780
+ holderType: z.ZodEnum<["staff", "supplier", "other"]>;
3781
+ holderId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
3782
+ holderName: z.ZodString;
3783
+ funderType: z.ZodEnum<["company", "staff", "investor"]>;
3784
+ funderId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
3785
+ funderName: z.ZodNullable<z.ZodOptional<z.ZodString>>;
3786
+ amount: z.ZodNumber;
3787
+ currency: z.ZodDefault<z.ZodOptional<z.ZodString>>;
3788
+ occurredAt: z.ZodString;
3789
+ expectedSettleBy: z.ZodNullable<z.ZodOptional<z.ZodString>>;
3790
+ dealId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
3791
+ purchaseOrderId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
3792
+ purpose: z.ZodNullable<z.ZodOptional<z.ZodString>>;
3793
+ notes: z.ZodNullable<z.ZodOptional<z.ZodString>>;
3794
+ method: z.ZodNullable<z.ZodOptional<z.ZodString>>;
3795
+ reference: z.ZodNullable<z.ZodOptional<z.ZodString>>;
3796
+ }, "strip", z.ZodTypeAny, {
3797
+ currency: string;
3798
+ occurredAt: string;
3799
+ amount: number;
3800
+ funderType: "investor" | "staff" | "company";
3801
+ holderType: "other" | "supplier" | "staff";
3802
+ holderName: string;
3803
+ method?: string | null | undefined;
3804
+ notes?: string | null | undefined;
3805
+ reference?: string | null | undefined;
3806
+ dealId?: string | null | undefined;
3807
+ funderId?: string | null | undefined;
3808
+ funderName?: string | null | undefined;
3809
+ holderId?: string | null | undefined;
3810
+ expectedSettleBy?: string | null | undefined;
3811
+ purchaseOrderId?: string | null | undefined;
3812
+ purpose?: string | null | undefined;
3813
+ }, {
3814
+ occurredAt: string;
3815
+ amount: number;
3816
+ funderType: "investor" | "staff" | "company";
3817
+ holderType: "other" | "supplier" | "staff";
3818
+ holderName: string;
3819
+ method?: string | null | undefined;
3820
+ currency?: string | undefined;
3821
+ notes?: string | null | undefined;
3822
+ reference?: string | null | undefined;
3823
+ dealId?: string | null | undefined;
3824
+ funderId?: string | null | undefined;
3825
+ funderName?: string | null | undefined;
3826
+ holderId?: string | null | undefined;
3827
+ expectedSettleBy?: string | null | undefined;
3828
+ purchaseOrderId?: string | null | undefined;
3829
+ purpose?: string | null | undefined;
3830
+ }>;
3831
+ }, "strip", z.ZodTypeAny, {
3832
+ type: "trade-sourcing-advances";
3833
+ attributes: {
3834
+ currency: string;
3835
+ occurredAt: string;
3836
+ amount: number;
3837
+ funderType: "investor" | "staff" | "company";
3838
+ holderType: "other" | "supplier" | "staff";
3839
+ holderName: string;
3840
+ method?: string | null | undefined;
3841
+ notes?: string | null | undefined;
3842
+ reference?: string | null | undefined;
3843
+ dealId?: string | null | undefined;
3844
+ funderId?: string | null | undefined;
3845
+ funderName?: string | null | undefined;
3846
+ holderId?: string | null | undefined;
3847
+ expectedSettleBy?: string | null | undefined;
3848
+ purchaseOrderId?: string | null | undefined;
3849
+ purpose?: string | null | undefined;
3850
+ };
3851
+ }, {
3852
+ type: "trade-sourcing-advances";
3853
+ attributes: {
3854
+ occurredAt: string;
3855
+ amount: number;
3856
+ funderType: "investor" | "staff" | "company";
3857
+ holderType: "other" | "supplier" | "staff";
3858
+ holderName: string;
3859
+ method?: string | null | undefined;
3860
+ currency?: string | undefined;
3861
+ notes?: string | null | undefined;
3862
+ reference?: string | null | undefined;
3863
+ dealId?: string | null | undefined;
3864
+ funderId?: string | null | undefined;
3865
+ funderName?: string | null | undefined;
3866
+ holderId?: string | null | undefined;
3867
+ expectedSettleBy?: string | null | undefined;
3868
+ purchaseOrderId?: string | null | undefined;
3869
+ purpose?: string | null | undefined;
3870
+ };
3871
+ }>;
3872
+ export declare const handoffAdvanceSchema: z.ZodObject<{
3873
+ type: z.ZodLiteral<"trade-sourcing-advances">;
3874
+ attributes: z.ZodObject<{
3875
+ amount: z.ZodNumber;
3876
+ holderType: z.ZodEnum<["staff", "supplier", "other"]>;
3877
+ holderId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
3878
+ holderName: z.ZodString;
3879
+ occurredAt: z.ZodString;
3880
+ notes: z.ZodNullable<z.ZodOptional<z.ZodString>>;
3881
+ }, "strip", z.ZodTypeAny, {
3882
+ occurredAt: string;
3883
+ amount: number;
3884
+ holderType: "other" | "supplier" | "staff";
3885
+ holderName: string;
3886
+ notes?: string | null | undefined;
3887
+ holderId?: string | null | undefined;
3888
+ }, {
3889
+ occurredAt: string;
3890
+ amount: number;
3891
+ holderType: "other" | "supplier" | "staff";
3892
+ holderName: string;
3893
+ notes?: string | null | undefined;
3894
+ holderId?: string | null | undefined;
3895
+ }>;
3896
+ }, "strip", z.ZodTypeAny, {
3897
+ type: "trade-sourcing-advances";
3898
+ attributes: {
3899
+ occurredAt: string;
3900
+ amount: number;
3901
+ holderType: "other" | "supplier" | "staff";
3902
+ holderName: string;
3903
+ notes?: string | null | undefined;
3904
+ holderId?: string | null | undefined;
3905
+ };
3906
+ }, {
3907
+ type: "trade-sourcing-advances";
3908
+ attributes: {
3909
+ occurredAt: string;
3910
+ amount: number;
3911
+ holderType: "other" | "supplier" | "staff";
3912
+ holderName: string;
3913
+ notes?: string | null | undefined;
3914
+ holderId?: string | null | undefined;
3915
+ };
3916
+ }>;
3917
+ export declare const submitAdvanceSettlementSchema: z.ZodObject<{
3918
+ type: z.ZodLiteral<"trade-sourcing-settlement-requests">;
3919
+ attributes: z.ZodObject<{
3920
+ lines: z.ZodArray<z.ZodObject<{
3921
+ outcome: z.ZodEnum<["spent", "returned", "written_off", "overspend"]>;
3922
+ amount: z.ZodNumber;
3923
+ supplierName: z.ZodNullable<z.ZodOptional<z.ZodString>>;
3924
+ supplierId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
3925
+ dealId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
3926
+ purchaseOrderId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
3927
+ proofRef: z.ZodNullable<z.ZodOptional<z.ZodString>>;
3928
+ notes: z.ZodNullable<z.ZodOptional<z.ZodString>>;
3929
+ }, "strip", z.ZodTypeAny, {
3930
+ amount: number;
3931
+ outcome: "written_off" | "spent" | "returned" | "overspend";
3932
+ notes?: string | null | undefined;
3933
+ supplierId?: string | null | undefined;
3934
+ supplierName?: string | null | undefined;
3935
+ dealId?: string | null | undefined;
3936
+ purchaseOrderId?: string | null | undefined;
3937
+ proofRef?: string | null | undefined;
3938
+ }, {
3939
+ amount: number;
3940
+ outcome: "written_off" | "spent" | "returned" | "overspend";
3941
+ notes?: string | null | undefined;
3942
+ supplierId?: string | null | undefined;
3943
+ supplierName?: string | null | undefined;
3944
+ dealId?: string | null | undefined;
3945
+ purchaseOrderId?: string | null | undefined;
3946
+ proofRef?: string | null | undefined;
3947
+ }>, "many">;
3948
+ notes: z.ZodNullable<z.ZodOptional<z.ZodString>>;
3949
+ }, "strip", z.ZodTypeAny, {
3950
+ lines: {
3951
+ amount: number;
3952
+ outcome: "written_off" | "spent" | "returned" | "overspend";
3953
+ notes?: string | null | undefined;
3954
+ supplierId?: string | null | undefined;
3955
+ supplierName?: string | null | undefined;
3956
+ dealId?: string | null | undefined;
3957
+ purchaseOrderId?: string | null | undefined;
3958
+ proofRef?: string | null | undefined;
3959
+ }[];
3960
+ notes?: string | null | undefined;
3961
+ }, {
3962
+ lines: {
3963
+ amount: number;
3964
+ outcome: "written_off" | "spent" | "returned" | "overspend";
3965
+ notes?: string | null | undefined;
3966
+ supplierId?: string | null | undefined;
3967
+ supplierName?: string | null | undefined;
3968
+ dealId?: string | null | undefined;
3969
+ purchaseOrderId?: string | null | undefined;
3970
+ proofRef?: string | null | undefined;
3971
+ }[];
3972
+ notes?: string | null | undefined;
3973
+ }>;
3974
+ }, "strip", z.ZodTypeAny, {
3975
+ type: "trade-sourcing-settlement-requests";
3976
+ attributes: {
3977
+ lines: {
3978
+ amount: number;
3979
+ outcome: "written_off" | "spent" | "returned" | "overspend";
3980
+ notes?: string | null | undefined;
3981
+ supplierId?: string | null | undefined;
3982
+ supplierName?: string | null | undefined;
3983
+ dealId?: string | null | undefined;
3984
+ purchaseOrderId?: string | null | undefined;
3985
+ proofRef?: string | null | undefined;
3986
+ }[];
3987
+ notes?: string | null | undefined;
3988
+ };
3989
+ }, {
3990
+ type: "trade-sourcing-settlement-requests";
3991
+ attributes: {
3992
+ lines: {
3993
+ amount: number;
3994
+ outcome: "written_off" | "spent" | "returned" | "overspend";
3995
+ notes?: string | null | undefined;
3996
+ supplierId?: string | null | undefined;
3997
+ supplierName?: string | null | undefined;
3998
+ dealId?: string | null | undefined;
3999
+ purchaseOrderId?: string | null | undefined;
4000
+ proofRef?: string | null | undefined;
4001
+ }[];
4002
+ notes?: string | null | undefined;
4003
+ };
4004
+ }>;
4005
+ export declare const approveAdvanceSettlementSchema: z.ZodObject<{
4006
+ type: z.ZodLiteral<"trade-sourcing-settlement-requests">;
4007
+ attributes: z.ZodObject<{
4008
+ occurredAt: z.ZodString;
4009
+ notes: z.ZodNullable<z.ZodOptional<z.ZodString>>;
4010
+ }, "strip", z.ZodTypeAny, {
4011
+ occurredAt: string;
4012
+ notes?: string | null | undefined;
4013
+ }, {
4014
+ occurredAt: string;
4015
+ notes?: string | null | undefined;
4016
+ }>;
4017
+ }, "strip", z.ZodTypeAny, {
4018
+ type: "trade-sourcing-settlement-requests";
4019
+ attributes: {
4020
+ occurredAt: string;
4021
+ notes?: string | null | undefined;
4022
+ };
4023
+ }, {
4024
+ type: "trade-sourcing-settlement-requests";
4025
+ attributes: {
4026
+ occurredAt: string;
4027
+ notes?: string | null | undefined;
4028
+ };
4029
+ }>;
4030
+ export declare const writeoffAdvanceSchema: z.ZodObject<{
4031
+ type: z.ZodLiteral<"trade-sourcing-advances">;
4032
+ attributes: z.ZodObject<{
4033
+ amount: z.ZodNumber;
4034
+ reason: z.ZodString;
4035
+ occurredAt: z.ZodString;
4036
+ }, "strip", z.ZodTypeAny, {
4037
+ reason: string;
4038
+ occurredAt: string;
4039
+ amount: number;
4040
+ }, {
4041
+ reason: string;
4042
+ occurredAt: string;
4043
+ amount: number;
4044
+ }>;
4045
+ }, "strip", z.ZodTypeAny, {
4046
+ type: "trade-sourcing-advances";
4047
+ attributes: {
4048
+ reason: string;
4049
+ occurredAt: string;
4050
+ amount: number;
4051
+ };
4052
+ }, {
4053
+ type: "trade-sourcing-advances";
4054
+ attributes: {
4055
+ reason: string;
4056
+ occurredAt: string;
4057
+ amount: number;
4058
+ };
4059
+ }>;
1529
4060
  export type CreateTradeCashEventAttributes = z.infer<typeof createTradeCashEventAttributesSchema>;
1530
4061
  export type CreateInvoicePaymentAttributes = z.infer<typeof createInvoicePaymentAttributesSchema>;
4062
+ export type CreateSourcingAdvanceAttributes = z.infer<typeof createSourcingAdvanceAttributesSchema>;
4063
+ export type HandoffAdvanceAttributes = z.infer<typeof handoffAdvanceAttributesSchema>;
4064
+ export type SubmitAdvanceSettlementAttributes = z.infer<typeof submitAdvanceSettlementAttributesSchema>;
4065
+ export type ApproveAdvanceSettlementAttributes = z.infer<typeof approveAdvanceSettlementAttributesSchema>;
4066
+ export type WriteoffAdvanceAttributes = z.infer<typeof writeoffAdvanceAttributesSchema>;
4067
+ export type AdvanceSettlementLine = z.infer<typeof advanceSettlementLineSchema>;
1531
4068
  //# sourceMappingURL=trade-cash-events.schemas.d.ts.map