@aibrains/shared-types 0.9.2 → 0.10.1

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 (41) hide show
  1. package/dist/index.d.ts +1 -0
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.js +6 -1
  4. package/dist/index.js.map +1 -1
  5. package/dist/schemas/finance/common.d.ts +41 -0
  6. package/dist/schemas/finance/common.d.ts.map +1 -0
  7. package/dist/schemas/finance/common.js +105 -0
  8. package/dist/schemas/finance/common.js.map +1 -0
  9. package/dist/schemas/finance/fee-structure.schema.d.ts +163 -0
  10. package/dist/schemas/finance/fee-structure.schema.d.ts.map +1 -0
  11. package/dist/schemas/finance/fee-structure.schema.js +78 -0
  12. package/dist/schemas/finance/fee-structure.schema.js.map +1 -0
  13. package/dist/schemas/finance/index.d.ts +12 -0
  14. package/dist/schemas/finance/index.d.ts.map +1 -0
  15. package/dist/schemas/finance/index.js +28 -0
  16. package/dist/schemas/finance/index.js.map +1 -0
  17. package/dist/schemas/finance/invoice.schema.d.ts +301 -0
  18. package/dist/schemas/finance/invoice.schema.d.ts.map +1 -0
  19. package/dist/schemas/finance/invoice.schema.js +107 -0
  20. package/dist/schemas/finance/invoice.schema.js.map +1 -0
  21. package/dist/schemas/finance/payment-gateway.schema.d.ts +84 -0
  22. package/dist/schemas/finance/payment-gateway.schema.d.ts.map +1 -0
  23. package/dist/schemas/finance/payment-gateway.schema.js +41 -0
  24. package/dist/schemas/finance/payment-gateway.schema.js.map +1 -0
  25. package/dist/schemas/finance/payment.schema.d.ts +794 -0
  26. package/dist/schemas/finance/payment.schema.d.ts.map +1 -0
  27. package/dist/schemas/finance/payment.schema.js +170 -0
  28. package/dist/schemas/finance/payment.schema.js.map +1 -0
  29. package/dist/schemas/finance/student-account.schema.d.ts +89 -0
  30. package/dist/schemas/finance/student-account.schema.d.ts.map +1 -0
  31. package/dist/schemas/finance/student-account.schema.js +50 -0
  32. package/dist/schemas/finance/student-account.schema.js.map +1 -0
  33. package/dist/schemas/index.d.ts +1 -0
  34. package/dist/schemas/index.d.ts.map +1 -1
  35. package/dist/schemas/index.js +1 -0
  36. package/dist/schemas/index.js.map +1 -1
  37. package/dist/utils/currency.d.ts +23 -0
  38. package/dist/utils/currency.d.ts.map +1 -0
  39. package/dist/utils/currency.js +45 -0
  40. package/dist/utils/currency.js.map +1 -0
  41. package/package.json +1 -1
@@ -0,0 +1,794 @@
1
+ /**
2
+ * Payment & Receipt Schemas
3
+ *
4
+ * Gateway-agnostic payment types supporting eSewa, Khalti, and manual methods.
5
+ * The frontend NEVER handles gateway credentials — all secrets stay server-side.
6
+ *
7
+ * Payment lifecycle: pending → processing → completed | failed | cancelled → refunded
8
+ */
9
+ import { z } from 'zod';
10
+ export declare const refundResponseSchema: z.ZodObject<{
11
+ id: z.ZodString;
12
+ paymentId: z.ZodString;
13
+ amount: z.ZodNumber;
14
+ reason: z.ZodString;
15
+ gatewayRefundId: z.ZodOptional<z.ZodString>;
16
+ status: z.ZodEnum<["pending", "completed", "failed"]>;
17
+ refundedAt: z.ZodNullable<z.ZodString>;
18
+ createdAt: z.ZodString;
19
+ }, "strip", z.ZodTypeAny, {
20
+ status: "completed" | "pending" | "failed";
21
+ createdAt: string;
22
+ reason: string;
23
+ id: string;
24
+ amount: number;
25
+ paymentId: string;
26
+ refundedAt: string | null;
27
+ gatewayRefundId?: string | undefined;
28
+ }, {
29
+ status: "completed" | "pending" | "failed";
30
+ createdAt: string;
31
+ reason: string;
32
+ id: string;
33
+ amount: number;
34
+ paymentId: string;
35
+ refundedAt: string | null;
36
+ gatewayRefundId?: string | undefined;
37
+ }>;
38
+ export type Refund = z.infer<typeof refundResponseSchema>;
39
+ export declare const paymentResponseSchema: z.ZodObject<{
40
+ id: z.ZodString;
41
+ invoiceId: z.ZodString;
42
+ studentAccountId: z.ZodString;
43
+ schoolId: z.ZodString;
44
+ amount: z.ZodNumber;
45
+ currency: z.ZodEnum<["NPR"]>;
46
+ gateway: z.ZodEnum<["esewa", "khalti", "fonepay", "connectips", "stripe", "cash", "bank_transfer", "cheque"]>;
47
+ gatewayTransactionId: z.ZodOptional<z.ZodString>;
48
+ gatewaySessionId: z.ZodOptional<z.ZodString>;
49
+ status: z.ZodEnum<["pending", "processing", "completed", "failed", "cancelled", "refunded", "partially_refunded"]>;
50
+ paidAt: z.ZodNullable<z.ZodString>;
51
+ paidBy: z.ZodNullable<z.ZodString>;
52
+ receiptNumber: z.ZodNullable<z.ZodString>;
53
+ metadata: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
54
+ refunds: z.ZodDefault<z.ZodArray<z.ZodObject<{
55
+ id: z.ZodString;
56
+ paymentId: z.ZodString;
57
+ amount: z.ZodNumber;
58
+ reason: z.ZodString;
59
+ gatewayRefundId: z.ZodOptional<z.ZodString>;
60
+ status: z.ZodEnum<["pending", "completed", "failed"]>;
61
+ refundedAt: z.ZodNullable<z.ZodString>;
62
+ createdAt: z.ZodString;
63
+ }, "strip", z.ZodTypeAny, {
64
+ status: "completed" | "pending" | "failed";
65
+ createdAt: string;
66
+ reason: string;
67
+ id: string;
68
+ amount: number;
69
+ paymentId: string;
70
+ refundedAt: string | null;
71
+ gatewayRefundId?: string | undefined;
72
+ }, {
73
+ status: "completed" | "pending" | "failed";
74
+ createdAt: string;
75
+ reason: string;
76
+ id: string;
77
+ amount: number;
78
+ paymentId: string;
79
+ refundedAt: string | null;
80
+ gatewayRefundId?: string | undefined;
81
+ }>, "many">>;
82
+ createdAt: z.ZodString;
83
+ updatedAt: z.ZodString;
84
+ }, "strip", z.ZodTypeAny, {
85
+ status: "completed" | "pending" | "failed" | "cancelled" | "processing" | "refunded" | "partially_refunded";
86
+ createdAt: string;
87
+ updatedAt: string;
88
+ schoolId: string;
89
+ id: string;
90
+ amount: number;
91
+ currency: "NPR";
92
+ studentAccountId: string;
93
+ invoiceId: string;
94
+ gateway: "esewa" | "khalti" | "fonepay" | "connectips" | "stripe" | "cash" | "bank_transfer" | "cheque";
95
+ paidAt: string | null;
96
+ paidBy: string | null;
97
+ receiptNumber: string | null;
98
+ metadata: Record<string, unknown>;
99
+ refunds: {
100
+ status: "completed" | "pending" | "failed";
101
+ createdAt: string;
102
+ reason: string;
103
+ id: string;
104
+ amount: number;
105
+ paymentId: string;
106
+ refundedAt: string | null;
107
+ gatewayRefundId?: string | undefined;
108
+ }[];
109
+ gatewayTransactionId?: string | undefined;
110
+ gatewaySessionId?: string | undefined;
111
+ }, {
112
+ status: "completed" | "pending" | "failed" | "cancelled" | "processing" | "refunded" | "partially_refunded";
113
+ createdAt: string;
114
+ updatedAt: string;
115
+ schoolId: string;
116
+ id: string;
117
+ amount: number;
118
+ currency: "NPR";
119
+ studentAccountId: string;
120
+ invoiceId: string;
121
+ gateway: "esewa" | "khalti" | "fonepay" | "connectips" | "stripe" | "cash" | "bank_transfer" | "cheque";
122
+ paidAt: string | null;
123
+ paidBy: string | null;
124
+ receiptNumber: string | null;
125
+ gatewayTransactionId?: string | undefined;
126
+ gatewaySessionId?: string | undefined;
127
+ metadata?: Record<string, unknown> | undefined;
128
+ refunds?: {
129
+ status: "completed" | "pending" | "failed";
130
+ createdAt: string;
131
+ reason: string;
132
+ id: string;
133
+ amount: number;
134
+ paymentId: string;
135
+ refundedAt: string | null;
136
+ gatewayRefundId?: string | undefined;
137
+ }[] | undefined;
138
+ }>;
139
+ export type Payment = z.infer<typeof paymentResponseSchema>;
140
+ /** Frontend sends this to initiate a gateway payment */
141
+ export declare const initiatePaymentSchema: z.ZodObject<{
142
+ invoiceId: z.ZodString;
143
+ gateway: z.ZodEnum<["esewa", "khalti", "fonepay", "connectips", "stripe", "cash", "bank_transfer", "cheque"]>;
144
+ amount: z.ZodNumber;
145
+ currency: z.ZodDefault<z.ZodEnum<["NPR"]>>;
146
+ returnUrl: z.ZodString;
147
+ cancelUrl: z.ZodString;
148
+ }, "strip", z.ZodTypeAny, {
149
+ amount: number;
150
+ currency: "NPR";
151
+ invoiceId: string;
152
+ gateway: "esewa" | "khalti" | "fonepay" | "connectips" | "stripe" | "cash" | "bank_transfer" | "cheque";
153
+ returnUrl: string;
154
+ cancelUrl: string;
155
+ }, {
156
+ amount: number;
157
+ invoiceId: string;
158
+ gateway: "esewa" | "khalti" | "fonepay" | "connectips" | "stripe" | "cash" | "bank_transfer" | "cheque";
159
+ returnUrl: string;
160
+ cancelUrl: string;
161
+ currency?: "NPR" | undefined;
162
+ }>;
163
+ export type InitiatePaymentRequest = z.infer<typeof initiatePaymentSchema>;
164
+ /** Backend responds with redirect URL to gateway payment page */
165
+ export declare const initiatePaymentResponseSchema: z.ZodObject<{
166
+ paymentSessionId: z.ZodString;
167
+ redirectUrl: z.ZodString;
168
+ expiresAt: z.ZodString;
169
+ /** For form_post gateways (eSewa), the form fields to auto-submit */
170
+ formData: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
171
+ /** 'redirect' for simple URL redirect, 'form_post' for hidden form auto-submit */
172
+ method: z.ZodDefault<z.ZodEnum<["redirect", "form_post"]>>;
173
+ }, "strip", z.ZodTypeAny, {
174
+ expiresAt: string;
175
+ paymentSessionId: string;
176
+ redirectUrl: string;
177
+ method: "redirect" | "form_post";
178
+ formData?: Record<string, string> | undefined;
179
+ }, {
180
+ expiresAt: string;
181
+ paymentSessionId: string;
182
+ redirectUrl: string;
183
+ formData?: Record<string, string> | undefined;
184
+ method?: "redirect" | "form_post" | undefined;
185
+ }>;
186
+ export type InitiatePaymentResponse = z.infer<typeof initiatePaymentResponseSchema>;
187
+ export declare const recordManualPaymentSchema: z.ZodObject<{
188
+ invoiceId: z.ZodString;
189
+ gateway: z.ZodEnum<["cash", "bank_transfer", "cheque"]>;
190
+ amount: z.ZodNumber;
191
+ currency: z.ZodDefault<z.ZodEnum<["NPR"]>>;
192
+ referenceNumber: z.ZodOptional<z.ZodString>;
193
+ notes: z.ZodOptional<z.ZodString>;
194
+ paidDate: z.ZodOptional<z.ZodString>;
195
+ idempotencyKey: z.ZodOptional<z.ZodString>;
196
+ }, "strip", z.ZodTypeAny, {
197
+ amount: number;
198
+ currency: "NPR";
199
+ invoiceId: string;
200
+ gateway: "cash" | "bank_transfer" | "cheque";
201
+ notes?: string | undefined;
202
+ referenceNumber?: string | undefined;
203
+ paidDate?: string | undefined;
204
+ idempotencyKey?: string | undefined;
205
+ }, {
206
+ amount: number;
207
+ invoiceId: string;
208
+ gateway: "cash" | "bank_transfer" | "cheque";
209
+ notes?: string | undefined;
210
+ currency?: "NPR" | undefined;
211
+ referenceNumber?: string | undefined;
212
+ paidDate?: string | undefined;
213
+ idempotencyKey?: string | undefined;
214
+ }>;
215
+ export type RecordManualPaymentDto = z.infer<typeof recordManualPaymentSchema>;
216
+ export declare const verifyPaymentResponseSchema: z.ZodObject<{
217
+ payment: z.ZodObject<{
218
+ id: z.ZodString;
219
+ invoiceId: z.ZodString;
220
+ studentAccountId: z.ZodString;
221
+ schoolId: z.ZodString;
222
+ amount: z.ZodNumber;
223
+ currency: z.ZodEnum<["NPR"]>;
224
+ gateway: z.ZodEnum<["esewa", "khalti", "fonepay", "connectips", "stripe", "cash", "bank_transfer", "cheque"]>;
225
+ gatewayTransactionId: z.ZodOptional<z.ZodString>;
226
+ gatewaySessionId: z.ZodOptional<z.ZodString>;
227
+ status: z.ZodEnum<["pending", "processing", "completed", "failed", "cancelled", "refunded", "partially_refunded"]>;
228
+ paidAt: z.ZodNullable<z.ZodString>;
229
+ paidBy: z.ZodNullable<z.ZodString>;
230
+ receiptNumber: z.ZodNullable<z.ZodString>;
231
+ metadata: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
232
+ refunds: z.ZodDefault<z.ZodArray<z.ZodObject<{
233
+ id: z.ZodString;
234
+ paymentId: z.ZodString;
235
+ amount: z.ZodNumber;
236
+ reason: z.ZodString;
237
+ gatewayRefundId: z.ZodOptional<z.ZodString>;
238
+ status: z.ZodEnum<["pending", "completed", "failed"]>;
239
+ refundedAt: z.ZodNullable<z.ZodString>;
240
+ createdAt: z.ZodString;
241
+ }, "strip", z.ZodTypeAny, {
242
+ status: "completed" | "pending" | "failed";
243
+ createdAt: string;
244
+ reason: string;
245
+ id: string;
246
+ amount: number;
247
+ paymentId: string;
248
+ refundedAt: string | null;
249
+ gatewayRefundId?: string | undefined;
250
+ }, {
251
+ status: "completed" | "pending" | "failed";
252
+ createdAt: string;
253
+ reason: string;
254
+ id: string;
255
+ amount: number;
256
+ paymentId: string;
257
+ refundedAt: string | null;
258
+ gatewayRefundId?: string | undefined;
259
+ }>, "many">>;
260
+ createdAt: z.ZodString;
261
+ updatedAt: z.ZodString;
262
+ }, "strip", z.ZodTypeAny, {
263
+ status: "completed" | "pending" | "failed" | "cancelled" | "processing" | "refunded" | "partially_refunded";
264
+ createdAt: string;
265
+ updatedAt: string;
266
+ schoolId: string;
267
+ id: string;
268
+ amount: number;
269
+ currency: "NPR";
270
+ studentAccountId: string;
271
+ invoiceId: string;
272
+ gateway: "esewa" | "khalti" | "fonepay" | "connectips" | "stripe" | "cash" | "bank_transfer" | "cheque";
273
+ paidAt: string | null;
274
+ paidBy: string | null;
275
+ receiptNumber: string | null;
276
+ metadata: Record<string, unknown>;
277
+ refunds: {
278
+ status: "completed" | "pending" | "failed";
279
+ createdAt: string;
280
+ reason: string;
281
+ id: string;
282
+ amount: number;
283
+ paymentId: string;
284
+ refundedAt: string | null;
285
+ gatewayRefundId?: string | undefined;
286
+ }[];
287
+ gatewayTransactionId?: string | undefined;
288
+ gatewaySessionId?: string | undefined;
289
+ }, {
290
+ status: "completed" | "pending" | "failed" | "cancelled" | "processing" | "refunded" | "partially_refunded";
291
+ createdAt: string;
292
+ updatedAt: string;
293
+ schoolId: string;
294
+ id: string;
295
+ amount: number;
296
+ currency: "NPR";
297
+ studentAccountId: string;
298
+ invoiceId: string;
299
+ gateway: "esewa" | "khalti" | "fonepay" | "connectips" | "stripe" | "cash" | "bank_transfer" | "cheque";
300
+ paidAt: string | null;
301
+ paidBy: string | null;
302
+ receiptNumber: string | null;
303
+ gatewayTransactionId?: string | undefined;
304
+ gatewaySessionId?: string | undefined;
305
+ metadata?: Record<string, unknown> | undefined;
306
+ refunds?: {
307
+ status: "completed" | "pending" | "failed";
308
+ createdAt: string;
309
+ reason: string;
310
+ id: string;
311
+ amount: number;
312
+ paymentId: string;
313
+ refundedAt: string | null;
314
+ gatewayRefundId?: string | undefined;
315
+ }[] | undefined;
316
+ }>;
317
+ invoice: z.ZodObject<{
318
+ id: z.ZodString;
319
+ invoiceNumber: z.ZodString;
320
+ status: z.ZodString;
321
+ amountDue: z.ZodNumber;
322
+ grandTotal: z.ZodNumber;
323
+ }, "strip", z.ZodTypeAny, {
324
+ status: string;
325
+ id: string;
326
+ invoiceNumber: string;
327
+ grandTotal: number;
328
+ amountDue: number;
329
+ }, {
330
+ status: string;
331
+ id: string;
332
+ invoiceNumber: string;
333
+ grandTotal: number;
334
+ amountDue: number;
335
+ }>;
336
+ receipt: z.ZodNullable<z.ZodLazy<z.ZodObject<{
337
+ receiptNumber: z.ZodString;
338
+ paymentId: z.ZodString;
339
+ invoiceNumber: z.ZodString;
340
+ transactionId: z.ZodString;
341
+ studentName: z.ZodString;
342
+ studentId: z.ZodString;
343
+ schoolName: z.ZodString;
344
+ schoolAddress: z.ZodOptional<z.ZodString>;
345
+ schoolPhone: z.ZodOptional<z.ZodString>;
346
+ paidDate: z.ZodString;
347
+ amount: z.ZodNumber;
348
+ currency: z.ZodEnum<["NPR"]>;
349
+ gateway: z.ZodEnum<["esewa", "khalti", "fonepay", "connectips", "stripe", "cash", "bank_transfer", "cheque"]>;
350
+ gatewayDisplayName: z.ZodString;
351
+ lineItems: z.ZodArray<z.ZodObject<{
352
+ description: z.ZodString;
353
+ amount: z.ZodNumber;
354
+ taxAmount: z.ZodNumber;
355
+ total: z.ZodNumber;
356
+ }, "strip", z.ZodTypeAny, {
357
+ total: number;
358
+ description: string;
359
+ amount: number;
360
+ taxAmount: number;
361
+ }, {
362
+ total: number;
363
+ description: string;
364
+ amount: number;
365
+ taxAmount: number;
366
+ }>, "many">;
367
+ subtotal: z.ZodNumber;
368
+ taxTotal: z.ZodNumber;
369
+ discountTotal: z.ZodNumber;
370
+ grandTotal: z.ZodNumber;
371
+ taxBreakdown: z.ZodObject<{
372
+ panNumber: z.ZodOptional<z.ZodString>;
373
+ vatNumber: z.ZodOptional<z.ZodString>;
374
+ taxableAmount: z.ZodNumber;
375
+ taxAmount: z.ZodNumber;
376
+ }, "strip", z.ZodTypeAny, {
377
+ taxAmount: number;
378
+ taxableAmount: number;
379
+ panNumber?: string | undefined;
380
+ vatNumber?: string | undefined;
381
+ }, {
382
+ taxAmount: number;
383
+ taxableAmount: number;
384
+ panNumber?: string | undefined;
385
+ vatNumber?: string | undefined;
386
+ }>;
387
+ paidBy: z.ZodString;
388
+ notes: z.ZodOptional<z.ZodString>;
389
+ }, "strip", z.ZodTypeAny, {
390
+ schoolName: string;
391
+ studentId: string;
392
+ studentName: string;
393
+ amount: number;
394
+ currency: "NPR";
395
+ invoiceNumber: string;
396
+ lineItems: {
397
+ total: number;
398
+ description: string;
399
+ amount: number;
400
+ taxAmount: number;
401
+ }[];
402
+ subtotal: number;
403
+ taxTotal: number;
404
+ discountTotal: number;
405
+ grandTotal: number;
406
+ paymentId: string;
407
+ gateway: "esewa" | "khalti" | "fonepay" | "connectips" | "stripe" | "cash" | "bank_transfer" | "cheque";
408
+ paidBy: string;
409
+ receiptNumber: string;
410
+ paidDate: string;
411
+ transactionId: string;
412
+ gatewayDisplayName: string;
413
+ taxBreakdown: {
414
+ taxAmount: number;
415
+ taxableAmount: number;
416
+ panNumber?: string | undefined;
417
+ vatNumber?: string | undefined;
418
+ };
419
+ notes?: string | undefined;
420
+ schoolAddress?: string | undefined;
421
+ schoolPhone?: string | undefined;
422
+ }, {
423
+ schoolName: string;
424
+ studentId: string;
425
+ studentName: string;
426
+ amount: number;
427
+ currency: "NPR";
428
+ invoiceNumber: string;
429
+ lineItems: {
430
+ total: number;
431
+ description: string;
432
+ amount: number;
433
+ taxAmount: number;
434
+ }[];
435
+ subtotal: number;
436
+ taxTotal: number;
437
+ discountTotal: number;
438
+ grandTotal: number;
439
+ paymentId: string;
440
+ gateway: "esewa" | "khalti" | "fonepay" | "connectips" | "stripe" | "cash" | "bank_transfer" | "cheque";
441
+ paidBy: string;
442
+ receiptNumber: string;
443
+ paidDate: string;
444
+ transactionId: string;
445
+ gatewayDisplayName: string;
446
+ taxBreakdown: {
447
+ taxAmount: number;
448
+ taxableAmount: number;
449
+ panNumber?: string | undefined;
450
+ vatNumber?: string | undefined;
451
+ };
452
+ notes?: string | undefined;
453
+ schoolAddress?: string | undefined;
454
+ schoolPhone?: string | undefined;
455
+ }>>>;
456
+ status: z.ZodEnum<["completed", "failed", "cancelled"]>;
457
+ }, "strip", z.ZodTypeAny, {
458
+ status: "completed" | "failed" | "cancelled";
459
+ invoice: {
460
+ status: string;
461
+ id: string;
462
+ invoiceNumber: string;
463
+ grandTotal: number;
464
+ amountDue: number;
465
+ };
466
+ payment: {
467
+ status: "completed" | "pending" | "failed" | "cancelled" | "processing" | "refunded" | "partially_refunded";
468
+ createdAt: string;
469
+ updatedAt: string;
470
+ schoolId: string;
471
+ id: string;
472
+ amount: number;
473
+ currency: "NPR";
474
+ studentAccountId: string;
475
+ invoiceId: string;
476
+ gateway: "esewa" | "khalti" | "fonepay" | "connectips" | "stripe" | "cash" | "bank_transfer" | "cheque";
477
+ paidAt: string | null;
478
+ paidBy: string | null;
479
+ receiptNumber: string | null;
480
+ metadata: Record<string, unknown>;
481
+ refunds: {
482
+ status: "completed" | "pending" | "failed";
483
+ createdAt: string;
484
+ reason: string;
485
+ id: string;
486
+ amount: number;
487
+ paymentId: string;
488
+ refundedAt: string | null;
489
+ gatewayRefundId?: string | undefined;
490
+ }[];
491
+ gatewayTransactionId?: string | undefined;
492
+ gatewaySessionId?: string | undefined;
493
+ };
494
+ receipt: {
495
+ schoolName: string;
496
+ studentId: string;
497
+ studentName: string;
498
+ amount: number;
499
+ currency: "NPR";
500
+ invoiceNumber: string;
501
+ lineItems: {
502
+ total: number;
503
+ description: string;
504
+ amount: number;
505
+ taxAmount: number;
506
+ }[];
507
+ subtotal: number;
508
+ taxTotal: number;
509
+ discountTotal: number;
510
+ grandTotal: number;
511
+ paymentId: string;
512
+ gateway: "esewa" | "khalti" | "fonepay" | "connectips" | "stripe" | "cash" | "bank_transfer" | "cheque";
513
+ paidBy: string;
514
+ receiptNumber: string;
515
+ paidDate: string;
516
+ transactionId: string;
517
+ gatewayDisplayName: string;
518
+ taxBreakdown: {
519
+ taxAmount: number;
520
+ taxableAmount: number;
521
+ panNumber?: string | undefined;
522
+ vatNumber?: string | undefined;
523
+ };
524
+ notes?: string | undefined;
525
+ schoolAddress?: string | undefined;
526
+ schoolPhone?: string | undefined;
527
+ } | null;
528
+ }, {
529
+ status: "completed" | "failed" | "cancelled";
530
+ invoice: {
531
+ status: string;
532
+ id: string;
533
+ invoiceNumber: string;
534
+ grandTotal: number;
535
+ amountDue: number;
536
+ };
537
+ payment: {
538
+ status: "completed" | "pending" | "failed" | "cancelled" | "processing" | "refunded" | "partially_refunded";
539
+ createdAt: string;
540
+ updatedAt: string;
541
+ schoolId: string;
542
+ id: string;
543
+ amount: number;
544
+ currency: "NPR";
545
+ studentAccountId: string;
546
+ invoiceId: string;
547
+ gateway: "esewa" | "khalti" | "fonepay" | "connectips" | "stripe" | "cash" | "bank_transfer" | "cheque";
548
+ paidAt: string | null;
549
+ paidBy: string | null;
550
+ receiptNumber: string | null;
551
+ gatewayTransactionId?: string | undefined;
552
+ gatewaySessionId?: string | undefined;
553
+ metadata?: Record<string, unknown> | undefined;
554
+ refunds?: {
555
+ status: "completed" | "pending" | "failed";
556
+ createdAt: string;
557
+ reason: string;
558
+ id: string;
559
+ amount: number;
560
+ paymentId: string;
561
+ refundedAt: string | null;
562
+ gatewayRefundId?: string | undefined;
563
+ }[] | undefined;
564
+ };
565
+ receipt: {
566
+ schoolName: string;
567
+ studentId: string;
568
+ studentName: string;
569
+ amount: number;
570
+ currency: "NPR";
571
+ invoiceNumber: string;
572
+ lineItems: {
573
+ total: number;
574
+ description: string;
575
+ amount: number;
576
+ taxAmount: number;
577
+ }[];
578
+ subtotal: number;
579
+ taxTotal: number;
580
+ discountTotal: number;
581
+ grandTotal: number;
582
+ paymentId: string;
583
+ gateway: "esewa" | "khalti" | "fonepay" | "connectips" | "stripe" | "cash" | "bank_transfer" | "cheque";
584
+ paidBy: string;
585
+ receiptNumber: string;
586
+ paidDate: string;
587
+ transactionId: string;
588
+ gatewayDisplayName: string;
589
+ taxBreakdown: {
590
+ taxAmount: number;
591
+ taxableAmount: number;
592
+ panNumber?: string | undefined;
593
+ vatNumber?: string | undefined;
594
+ };
595
+ notes?: string | undefined;
596
+ schoolAddress?: string | undefined;
597
+ schoolPhone?: string | undefined;
598
+ } | null;
599
+ }>;
600
+ export type VerifyPaymentResponse = z.infer<typeof verifyPaymentResponseSchema>;
601
+ export declare const voidPaymentSchema: z.ZodObject<{
602
+ reason: z.ZodString;
603
+ }, "strip", z.ZodTypeAny, {
604
+ reason: string;
605
+ }, {
606
+ reason: string;
607
+ }>;
608
+ export type VoidPaymentDto = z.infer<typeof voidPaymentSchema>;
609
+ export declare const createRefundSchema: z.ZodObject<{
610
+ amount: z.ZodNumber;
611
+ reason: z.ZodString;
612
+ }, "strip", z.ZodTypeAny, {
613
+ reason: string;
614
+ amount: number;
615
+ }, {
616
+ reason: string;
617
+ amount: number;
618
+ }>;
619
+ export type CreateRefundDto = z.infer<typeof createRefundSchema>;
620
+ export declare const receiptLineItemSchema: z.ZodObject<{
621
+ description: z.ZodString;
622
+ amount: z.ZodNumber;
623
+ taxAmount: z.ZodNumber;
624
+ total: z.ZodNumber;
625
+ }, "strip", z.ZodTypeAny, {
626
+ total: number;
627
+ description: string;
628
+ amount: number;
629
+ taxAmount: number;
630
+ }, {
631
+ total: number;
632
+ description: string;
633
+ amount: number;
634
+ taxAmount: number;
635
+ }>;
636
+ export declare const receiptSchema: z.ZodObject<{
637
+ receiptNumber: z.ZodString;
638
+ paymentId: z.ZodString;
639
+ invoiceNumber: z.ZodString;
640
+ transactionId: z.ZodString;
641
+ studentName: z.ZodString;
642
+ studentId: z.ZodString;
643
+ schoolName: z.ZodString;
644
+ schoolAddress: z.ZodOptional<z.ZodString>;
645
+ schoolPhone: z.ZodOptional<z.ZodString>;
646
+ paidDate: z.ZodString;
647
+ amount: z.ZodNumber;
648
+ currency: z.ZodEnum<["NPR"]>;
649
+ gateway: z.ZodEnum<["esewa", "khalti", "fonepay", "connectips", "stripe", "cash", "bank_transfer", "cheque"]>;
650
+ gatewayDisplayName: z.ZodString;
651
+ lineItems: z.ZodArray<z.ZodObject<{
652
+ description: z.ZodString;
653
+ amount: z.ZodNumber;
654
+ taxAmount: z.ZodNumber;
655
+ total: z.ZodNumber;
656
+ }, "strip", z.ZodTypeAny, {
657
+ total: number;
658
+ description: string;
659
+ amount: number;
660
+ taxAmount: number;
661
+ }, {
662
+ total: number;
663
+ description: string;
664
+ amount: number;
665
+ taxAmount: number;
666
+ }>, "many">;
667
+ subtotal: z.ZodNumber;
668
+ taxTotal: z.ZodNumber;
669
+ discountTotal: z.ZodNumber;
670
+ grandTotal: z.ZodNumber;
671
+ taxBreakdown: z.ZodObject<{
672
+ panNumber: z.ZodOptional<z.ZodString>;
673
+ vatNumber: z.ZodOptional<z.ZodString>;
674
+ taxableAmount: z.ZodNumber;
675
+ taxAmount: z.ZodNumber;
676
+ }, "strip", z.ZodTypeAny, {
677
+ taxAmount: number;
678
+ taxableAmount: number;
679
+ panNumber?: string | undefined;
680
+ vatNumber?: string | undefined;
681
+ }, {
682
+ taxAmount: number;
683
+ taxableAmount: number;
684
+ panNumber?: string | undefined;
685
+ vatNumber?: string | undefined;
686
+ }>;
687
+ paidBy: z.ZodString;
688
+ notes: z.ZodOptional<z.ZodString>;
689
+ }, "strip", z.ZodTypeAny, {
690
+ schoolName: string;
691
+ studentId: string;
692
+ studentName: string;
693
+ amount: number;
694
+ currency: "NPR";
695
+ invoiceNumber: string;
696
+ lineItems: {
697
+ total: number;
698
+ description: string;
699
+ amount: number;
700
+ taxAmount: number;
701
+ }[];
702
+ subtotal: number;
703
+ taxTotal: number;
704
+ discountTotal: number;
705
+ grandTotal: number;
706
+ paymentId: string;
707
+ gateway: "esewa" | "khalti" | "fonepay" | "connectips" | "stripe" | "cash" | "bank_transfer" | "cheque";
708
+ paidBy: string;
709
+ receiptNumber: string;
710
+ paidDate: string;
711
+ transactionId: string;
712
+ gatewayDisplayName: string;
713
+ taxBreakdown: {
714
+ taxAmount: number;
715
+ taxableAmount: number;
716
+ panNumber?: string | undefined;
717
+ vatNumber?: string | undefined;
718
+ };
719
+ notes?: string | undefined;
720
+ schoolAddress?: string | undefined;
721
+ schoolPhone?: string | undefined;
722
+ }, {
723
+ schoolName: string;
724
+ studentId: string;
725
+ studentName: string;
726
+ amount: number;
727
+ currency: "NPR";
728
+ invoiceNumber: string;
729
+ lineItems: {
730
+ total: number;
731
+ description: string;
732
+ amount: number;
733
+ taxAmount: number;
734
+ }[];
735
+ subtotal: number;
736
+ taxTotal: number;
737
+ discountTotal: number;
738
+ grandTotal: number;
739
+ paymentId: string;
740
+ gateway: "esewa" | "khalti" | "fonepay" | "connectips" | "stripe" | "cash" | "bank_transfer" | "cheque";
741
+ paidBy: string;
742
+ receiptNumber: string;
743
+ paidDate: string;
744
+ transactionId: string;
745
+ gatewayDisplayName: string;
746
+ taxBreakdown: {
747
+ taxAmount: number;
748
+ taxableAmount: number;
749
+ panNumber?: string | undefined;
750
+ vatNumber?: string | undefined;
751
+ };
752
+ notes?: string | undefined;
753
+ schoolAddress?: string | undefined;
754
+ schoolPhone?: string | undefined;
755
+ }>;
756
+ export type Receipt = z.infer<typeof receiptSchema>;
757
+ export declare const paymentFilterSchema: z.ZodObject<{
758
+ status: z.ZodOptional<z.ZodUnion<[z.ZodEnum<["pending", "processing", "completed", "failed", "cancelled", "refunded", "partially_refunded"]>, z.ZodArray<z.ZodEnum<["pending", "processing", "completed", "failed", "cancelled", "refunded", "partially_refunded"]>, "many">]>>;
759
+ gateway: z.ZodOptional<z.ZodEnum<["esewa", "khalti", "fonepay", "connectips", "stripe", "cash", "bank_transfer", "cheque"]>>;
760
+ invoiceId: z.ZodOptional<z.ZodString>;
761
+ studentId: z.ZodOptional<z.ZodString>;
762
+ dateFrom: z.ZodOptional<z.ZodString>;
763
+ dateTo: z.ZodOptional<z.ZodString>;
764
+ }, "strip", z.ZodTypeAny, {
765
+ status?: "completed" | "pending" | "failed" | "cancelled" | "processing" | "refunded" | "partially_refunded" | ("completed" | "pending" | "failed" | "cancelled" | "processing" | "refunded" | "partially_refunded")[] | undefined;
766
+ studentId?: string | undefined;
767
+ dateFrom?: string | undefined;
768
+ dateTo?: string | undefined;
769
+ invoiceId?: string | undefined;
770
+ gateway?: "esewa" | "khalti" | "fonepay" | "connectips" | "stripe" | "cash" | "bank_transfer" | "cheque" | undefined;
771
+ }, {
772
+ status?: "completed" | "pending" | "failed" | "cancelled" | "processing" | "refunded" | "partially_refunded" | ("completed" | "pending" | "failed" | "cancelled" | "processing" | "refunded" | "partially_refunded")[] | undefined;
773
+ studentId?: string | undefined;
774
+ dateFrom?: string | undefined;
775
+ dateTo?: string | undefined;
776
+ invoiceId?: string | undefined;
777
+ gateway?: "esewa" | "khalti" | "fonepay" | "connectips" | "stripe" | "cash" | "bank_transfer" | "cheque" | undefined;
778
+ }>;
779
+ export type PaymentFilterDto = z.infer<typeof paymentFilterSchema>;
780
+ export declare const currencyFormatOptionsSchema: z.ZodObject<{
781
+ locale: z.ZodDefault<z.ZodEnum<["en", "ne"]>>;
782
+ showSymbol: z.ZodDefault<z.ZodBoolean>;
783
+ decimals: z.ZodDefault<z.ZodNumber>;
784
+ }, "strip", z.ZodTypeAny, {
785
+ locale: "en" | "ne";
786
+ showSymbol: boolean;
787
+ decimals: number;
788
+ }, {
789
+ locale?: "en" | "ne" | undefined;
790
+ showSymbol?: boolean | undefined;
791
+ decimals?: number | undefined;
792
+ }>;
793
+ export type CurrencyFormatOptions = z.infer<typeof currencyFormatOptionsSchema>;
794
+ //# sourceMappingURL=payment.schema.d.ts.map