@temboplus/tembo-dashboard 0.0.26-beta.6 → 0.0.26-beta.7

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.
@@ -0,0 +1,132 @@
1
+ export declare const transactionContract: {
2
+ localTransfer: {
3
+ summary: "Local transfer";
4
+ description: "Transfer funds locally between wallets.";
5
+ method: "POST";
6
+ body: import("zod").ZodObject<{
7
+ amount: import("zod").ZodNumber;
8
+ from: import("zod").ZodString;
9
+ to: import("zod").ZodString;
10
+ description: import("zod").ZodString;
11
+ }, "strip", import("zod").ZodTypeAny, {
12
+ description: string;
13
+ amount: number;
14
+ from: string;
15
+ to: string;
16
+ }, {
17
+ description: string;
18
+ amount: number;
19
+ from: string;
20
+ to: string;
21
+ }>;
22
+ path: "/local-transfer";
23
+ responses: {
24
+ 200: import("zod").ZodObject<{
25
+ transactionId: import("zod").ZodString;
26
+ from: import("zod").ZodString;
27
+ to: import("zod").ZodString;
28
+ transactionDate: import("zod").ZodString;
29
+ narration: import("zod").ZodString;
30
+ amount: import("zod").ZodNumber;
31
+ transactionRef: import("zod").ZodString;
32
+ }, "strip", import("zod").ZodTypeAny, {
33
+ narration: string;
34
+ transactionDate: string;
35
+ amount: number;
36
+ transactionId: string;
37
+ transactionRef: string;
38
+ from: string;
39
+ to: string;
40
+ }, {
41
+ narration: string;
42
+ transactionDate: string;
43
+ amount: number;
44
+ transactionId: string;
45
+ transactionRef: string;
46
+ from: string;
47
+ to: string;
48
+ }>;
49
+ 400: import("zod").ZodObject<{
50
+ reason: import("zod").ZodOptional<import("zod").ZodString>;
51
+ error: import("zod").ZodOptional<import("zod").ZodString>;
52
+ details: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>>;
53
+ message: import("zod").ZodOptional<import("zod").ZodString>;
54
+ } & {
55
+ statusCode: import("zod").ZodLiteral<400>;
56
+ }, "strip", import("zod").ZodTypeAny, {
57
+ statusCode: 400;
58
+ message?: string | undefined;
59
+ error?: string | undefined;
60
+ details?: Record<string, unknown> | undefined;
61
+ reason?: string | undefined;
62
+ }, {
63
+ statusCode: 400;
64
+ message?: string | undefined;
65
+ error?: string | undefined;
66
+ details?: Record<string, unknown> | undefined;
67
+ reason?: string | undefined;
68
+ }>;
69
+ 401: import("zod").ZodObject<{
70
+ reason: import("zod").ZodOptional<import("zod").ZodString>;
71
+ error: import("zod").ZodOptional<import("zod").ZodString>;
72
+ details: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>>;
73
+ message: import("zod").ZodOptional<import("zod").ZodString>;
74
+ } & {
75
+ statusCode: import("zod").ZodLiteral<401>;
76
+ }, "strip", import("zod").ZodTypeAny, {
77
+ statusCode: 401;
78
+ message?: string | undefined;
79
+ error?: string | undefined;
80
+ details?: Record<string, unknown> | undefined;
81
+ reason?: string | undefined;
82
+ }, {
83
+ statusCode: 401;
84
+ message?: string | undefined;
85
+ error?: string | undefined;
86
+ details?: Record<string, unknown> | undefined;
87
+ reason?: string | undefined;
88
+ }>;
89
+ 404: import("zod").ZodObject<{
90
+ reason: import("zod").ZodOptional<import("zod").ZodString>;
91
+ error: import("zod").ZodOptional<import("zod").ZodString>;
92
+ details: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>>;
93
+ message: import("zod").ZodOptional<import("zod").ZodString>;
94
+ } & {
95
+ statusCode: import("zod").ZodLiteral<404>;
96
+ }, "strip", import("zod").ZodTypeAny, {
97
+ statusCode: 404;
98
+ message?: string | undefined;
99
+ error?: string | undefined;
100
+ details?: Record<string, unknown> | undefined;
101
+ reason?: string | undefined;
102
+ }, {
103
+ statusCode: 404;
104
+ message?: string | undefined;
105
+ error?: string | undefined;
106
+ details?: Record<string, unknown> | undefined;
107
+ reason?: string | undefined;
108
+ }>;
109
+ 500: import("zod").ZodObject<{
110
+ reason: import("zod").ZodOptional<import("zod").ZodString>;
111
+ error: import("zod").ZodOptional<import("zod").ZodString>;
112
+ details: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>>;
113
+ message: import("zod").ZodOptional<import("zod").ZodString>;
114
+ } & {
115
+ statusCode: import("zod").ZodLiteral<500>;
116
+ }, "strip", import("zod").ZodTypeAny, {
117
+ statusCode: 500;
118
+ message?: string | undefined;
119
+ error?: string | undefined;
120
+ details?: Record<string, unknown> | undefined;
121
+ reason?: string | undefined;
122
+ }, {
123
+ statusCode: 500;
124
+ message?: string | undefined;
125
+ error?: string | undefined;
126
+ details?: Record<string, unknown> | undefined;
127
+ reason?: string | undefined;
128
+ }>;
129
+ };
130
+ };
131
+ };
132
+ export type TransactionContract = typeof transactionContract;
@@ -0,0 +1,10 @@
1
+ import { BaseRepository } from "../../lib/api";
2
+ import { transactionContract } from "./transaction.api-contract";
3
+ import { LocalTransferRequestDTO, LocalTransferResponseDTO } from "./transaction.types";
4
+ export declare class TransactionRepository extends BaseRepository<typeof transactionContract> {
5
+ constructor(options?: {
6
+ token?: string;
7
+ root?: string;
8
+ });
9
+ localTransfer(input: LocalTransferRequestDTO): Promise<LocalTransferResponseDTO>;
10
+ }
@@ -0,0 +1,46 @@
1
+ import { z } from "zod";
2
+ export declare const TransactionDTOSchemas: {
3
+ localTransferRequest: z.ZodObject<{
4
+ amount: z.ZodNumber;
5
+ from: z.ZodString;
6
+ to: z.ZodString;
7
+ description: z.ZodString;
8
+ }, "strip", z.ZodTypeAny, {
9
+ description: string;
10
+ amount: number;
11
+ from: string;
12
+ to: string;
13
+ }, {
14
+ description: string;
15
+ amount: number;
16
+ from: string;
17
+ to: string;
18
+ }>;
19
+ localTransferResponse: z.ZodObject<{
20
+ transactionId: z.ZodString;
21
+ from: z.ZodString;
22
+ to: z.ZodString;
23
+ transactionDate: z.ZodString;
24
+ narration: z.ZodString;
25
+ amount: z.ZodNumber;
26
+ transactionRef: z.ZodString;
27
+ }, "strip", z.ZodTypeAny, {
28
+ narration: string;
29
+ transactionDate: string;
30
+ amount: number;
31
+ transactionId: string;
32
+ transactionRef: string;
33
+ from: string;
34
+ to: string;
35
+ }, {
36
+ narration: string;
37
+ transactionDate: string;
38
+ amount: number;
39
+ transactionId: string;
40
+ transactionRef: string;
41
+ from: string;
42
+ to: string;
43
+ }>;
44
+ };
45
+ export type LocalTransferRequestDTO = z.infer<typeof TransactionDTOSchemas.localTransferRequest>;
46
+ export type LocalTransferResponseDTO = z.infer<typeof TransactionDTOSchemas.localTransferResponse>;
@@ -434,134 +434,5 @@ export declare const walletContract: {
434
434
  }>;
435
435
  };
436
436
  };
437
- transferLocal: {
438
- summary: "Transfer between disbursement wallets";
439
- description: "Transfer funds between disbursement wallets. Both wallets must be in the same currency.";
440
- method: "POST";
441
- body: z.ZodObject<{
442
- amount: z.ZodNumber;
443
- from: z.ZodString;
444
- to: z.ZodString;
445
- description: z.ZodString;
446
- }, "strip", z.ZodTypeAny, {
447
- description: string;
448
- amount: number;
449
- from: string;
450
- to: string;
451
- }, {
452
- description: string;
453
- amount: number;
454
- from: string;
455
- to: string;
456
- }>;
457
- path: "/transfer-local";
458
- responses: {
459
- 200: z.ZodObject<{
460
- transactionId: z.ZodString;
461
- from: z.ZodString;
462
- to: z.ZodString;
463
- transactionDate: z.ZodString;
464
- narration: z.ZodString;
465
- amount: z.ZodNumber;
466
- transactionRef: z.ZodString;
467
- }, "strip", z.ZodTypeAny, {
468
- narration: string;
469
- transactionDate: string;
470
- amount: number;
471
- transactionId: string;
472
- transactionRef: string;
473
- from: string;
474
- to: string;
475
- }, {
476
- narration: string;
477
- transactionDate: string;
478
- amount: number;
479
- transactionId: string;
480
- transactionRef: string;
481
- from: string;
482
- to: string;
483
- }>;
484
- 400: z.ZodObject<{
485
- reason: z.ZodOptional<z.ZodString>;
486
- error: z.ZodOptional<z.ZodString>;
487
- details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
488
- message: z.ZodOptional<z.ZodString>;
489
- } & {
490
- statusCode: z.ZodLiteral<400>;
491
- }, "strip", z.ZodTypeAny, {
492
- statusCode: 400;
493
- message?: string | undefined;
494
- error?: string | undefined;
495
- details?: Record<string, unknown> | undefined;
496
- reason?: string | undefined;
497
- }, {
498
- statusCode: 400;
499
- message?: string | undefined;
500
- error?: string | undefined;
501
- details?: Record<string, unknown> | undefined;
502
- reason?: string | undefined;
503
- }>;
504
- 401: z.ZodObject<{
505
- reason: z.ZodOptional<z.ZodString>;
506
- error: z.ZodOptional<z.ZodString>;
507
- details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
508
- message: z.ZodOptional<z.ZodString>;
509
- } & {
510
- statusCode: z.ZodLiteral<401>;
511
- }, "strip", z.ZodTypeAny, {
512
- statusCode: 401;
513
- message?: string | undefined;
514
- error?: string | undefined;
515
- details?: Record<string, unknown> | undefined;
516
- reason?: string | undefined;
517
- }, {
518
- statusCode: 401;
519
- message?: string | undefined;
520
- error?: string | undefined;
521
- details?: Record<string, unknown> | undefined;
522
- reason?: string | undefined;
523
- }>;
524
- 404: z.ZodObject<{
525
- reason: z.ZodOptional<z.ZodString>;
526
- error: z.ZodOptional<z.ZodString>;
527
- details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
528
- message: z.ZodOptional<z.ZodString>;
529
- } & {
530
- statusCode: z.ZodLiteral<404>;
531
- }, "strip", z.ZodTypeAny, {
532
- statusCode: 404;
533
- message?: string | undefined;
534
- error?: string | undefined;
535
- details?: Record<string, unknown> | undefined;
536
- reason?: string | undefined;
537
- }, {
538
- statusCode: 404;
539
- message?: string | undefined;
540
- error?: string | undefined;
541
- details?: Record<string, unknown> | undefined;
542
- reason?: string | undefined;
543
- }>;
544
- 500: z.ZodObject<{
545
- reason: z.ZodOptional<z.ZodString>;
546
- error: z.ZodOptional<z.ZodString>;
547
- details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
548
- message: z.ZodOptional<z.ZodString>;
549
- } & {
550
- statusCode: z.ZodLiteral<500>;
551
- }, "strip", z.ZodTypeAny, {
552
- statusCode: 500;
553
- message?: string | undefined;
554
- error?: string | undefined;
555
- details?: Record<string, unknown> | undefined;
556
- reason?: string | undefined;
557
- }, {
558
- statusCode: 500;
559
- message?: string | undefined;
560
- error?: string | undefined;
561
- details?: Record<string, unknown> | undefined;
562
- reason?: string | undefined;
563
- }>;
564
- };
565
- };
566
437
  };
567
438
  export type WalletContract = typeof walletContract;
@@ -2,7 +2,6 @@ import { BaseRepository } from "../../lib/api";
2
2
  import { StatementEntry, WalletInfo } from "../../lib/models";
3
3
  import { Wallet } from "./wallet.model";
4
4
  import { walletContract } from "./wallet.api-contract";
5
- import { TransferRequestDTO, TransferResponseDTO } from "./wallet.types";
6
5
  export interface WalletStatementInput {
7
6
  accountNo: string;
8
7
  startDate: Date | string;
@@ -17,6 +16,5 @@ export declare class WalletRepository extends BaseRepository<typeof walletContra
17
16
  getWalletInfo(accountNo: string): Promise<Wallet>;
18
17
  getWalletBalance(accountNo: string): Promise<WalletInfo>;
19
18
  getWalletStatement(input: WalletStatementInput): Promise<StatementEntry[]>;
20
- transferLocal(input: TransferRequestDTO): Promise<TransferResponseDTO>;
21
19
  private formatStatementDate;
22
20
  }
@@ -93,51 +93,8 @@ export declare const WalletDTOSchemas: {
93
93
  startDate: string;
94
94
  endDate: string;
95
95
  }>;
96
- transferRequest: z.ZodObject<{
97
- amount: z.ZodNumber;
98
- from: z.ZodString;
99
- to: z.ZodString;
100
- description: z.ZodString;
101
- }, "strip", z.ZodTypeAny, {
102
- description: string;
103
- amount: number;
104
- from: string;
105
- to: string;
106
- }, {
107
- description: string;
108
- amount: number;
109
- from: string;
110
- to: string;
111
- }>;
112
- transferResponse: z.ZodObject<{
113
- transactionId: z.ZodString;
114
- from: z.ZodString;
115
- to: z.ZodString;
116
- transactionDate: z.ZodString;
117
- narration: z.ZodString;
118
- amount: z.ZodNumber;
119
- transactionRef: z.ZodString;
120
- }, "strip", z.ZodTypeAny, {
121
- narration: string;
122
- transactionDate: string;
123
- amount: number;
124
- transactionId: string;
125
- transactionRef: string;
126
- from: string;
127
- to: string;
128
- }, {
129
- narration: string;
130
- transactionDate: string;
131
- amount: number;
132
- transactionId: string;
133
- transactionRef: string;
134
- from: string;
135
- to: string;
136
- }>;
137
96
  };
138
97
  export type WalletDTO = z.infer<typeof WalletDTOSchemas.wallet>;
139
98
  export type WalletPathParamsDTO = z.infer<typeof WalletDTOSchemas.walletPathParams>;
140
99
  export type WalletBalanceDTO = z.infer<typeof WalletDTOSchemas.walletBalance>;
141
100
  export type WalletStatementQueryDTO = z.infer<typeof WalletDTOSchemas.walletStatementQuery>;
142
- export type TransferRequestDTO = z.infer<typeof WalletDTOSchemas.transferRequest>;
143
- export type TransferResponseDTO = z.infer<typeof WalletDTOSchemas.transferResponse>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@temboplus/tembo-dashboard",
3
- "version": "0.0.26-beta.6",
3
+ "version": "0.0.26-beta.7",
4
4
  "description": "A foundational library for Temboplus-Dashboard projects providing type-safe data layer abstraction with API contracts, domain models, and repositories.",
5
5
  "main": "./dist/index.cjs.js",
6
6
  "module": "./dist/index.esm.js",