resurgence-data 1.1.57 → 1.1.58

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,23 @@
1
+ export declare enum CURRENCY {
2
+ USD = "USD",
3
+ CAD = "CAD",
4
+ GBP = "GBP",
5
+ CNY = "CNY",
6
+ EUR = "EUR",
7
+ NGN = "NGN"
8
+ }
9
+ export declare enum TRANSACTION_STATUS {
10
+ PENDING = "PENDING",
11
+ SUCCESSFUL = "SUCCESSFUL",
12
+ FAILED = "FAILED",
13
+ REVERSED = "REVERSED"
14
+ }
15
+ export declare enum TRANSACTION_TYPE {
16
+ INFLOW = "INFLOW",
17
+ REVERSAL = "REVERSAL",
18
+ OUTFLOW = "OUTFLOW"
19
+ }
20
+ export declare enum TRANSACTION_DIRECTION {
21
+ DEBIT = "DEBIT",
22
+ CREDIT = "CREDIT"
23
+ }
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TRANSACTION_DIRECTION = exports.TRANSACTION_TYPE = exports.TRANSACTION_STATUS = exports.CURRENCY = void 0;
4
+ var CURRENCY;
5
+ (function (CURRENCY) {
6
+ CURRENCY["USD"] = "USD";
7
+ CURRENCY["CAD"] = "CAD";
8
+ CURRENCY["GBP"] = "GBP";
9
+ CURRENCY["CNY"] = "CNY";
10
+ CURRENCY["EUR"] = "EUR";
11
+ CURRENCY["NGN"] = "NGN";
12
+ })(CURRENCY || (exports.CURRENCY = CURRENCY = {}));
13
+ var TRANSACTION_STATUS;
14
+ (function (TRANSACTION_STATUS) {
15
+ TRANSACTION_STATUS["PENDING"] = "PENDING";
16
+ TRANSACTION_STATUS["SUCCESSFUL"] = "SUCCESSFUL";
17
+ TRANSACTION_STATUS["FAILED"] = "FAILED";
18
+ TRANSACTION_STATUS["REVERSED"] = "REVERSED";
19
+ })(TRANSACTION_STATUS || (exports.TRANSACTION_STATUS = TRANSACTION_STATUS = {}));
20
+ var TRANSACTION_TYPE;
21
+ (function (TRANSACTION_TYPE) {
22
+ TRANSACTION_TYPE["INFLOW"] = "INFLOW";
23
+ TRANSACTION_TYPE["REVERSAL"] = "REVERSAL";
24
+ TRANSACTION_TYPE["OUTFLOW"] = "OUTFLOW";
25
+ })(TRANSACTION_TYPE || (exports.TRANSACTION_TYPE = TRANSACTION_TYPE = {}));
26
+ var TRANSACTION_DIRECTION;
27
+ (function (TRANSACTION_DIRECTION) {
28
+ TRANSACTION_DIRECTION["DEBIT"] = "DEBIT";
29
+ TRANSACTION_DIRECTION["CREDIT"] = "CREDIT";
30
+ })(TRANSACTION_DIRECTION || (exports.TRANSACTION_DIRECTION = TRANSACTION_DIRECTION = {}));
@@ -0,0 +1,27 @@
1
+ import { CURRENCY, TRANSACTION_STATUS } from "./data";
2
+ export declare class TransactionStatusDto {
3
+ imtoPayoutTransactionId?: string;
4
+ imtoWalletTransactionId?: string;
5
+ status: TRANSACTION_STATUS;
6
+ remark?: string;
7
+ }
8
+ export declare class TransactionStatusResponse {
9
+ id: string;
10
+ imtoPayoutTransactionId?: string;
11
+ imtoWalletTransactionId?: string;
12
+ status: TRANSACTION_STATUS;
13
+ remark?: string;
14
+ createdAt: Date;
15
+ updatedAt: Date;
16
+ }
17
+ export declare class CreateIMTOWalletDto {
18
+ userId: string;
19
+ currency: CURRENCY;
20
+ }
21
+ export declare class IMTOWalletResponse {
22
+ id: string;
23
+ userId: string;
24
+ currency: CURRENCY;
25
+ createdAt: Date;
26
+ updatedAt: Date;
27
+ }
@@ -0,0 +1,152 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.IMTOWalletResponse = exports.CreateIMTOWalletDto = exports.TransactionStatusResponse = exports.TransactionStatusDto = void 0;
13
+ const swagger_1 = require("@nestjs/swagger");
14
+ // import { Type } from "class-transformer";
15
+ const data_1 = require("./data"); // Adjust the import path as necessary
16
+ const class_validator_1 = require("class-validator");
17
+ // import { IMTOWalletTransactionDto } from "./imto-wallet-transaction.dto"; // Assuming you have a DTO for IMTOWalletTransaction
18
+ // import { IMTORequestDto } from "./imto-request.dto"; // Assuming you have a DTO for IMTORequest
19
+ class TransactionStatusDto {
20
+ }
21
+ exports.TransactionStatusDto = TransactionStatusDto;
22
+ __decorate([
23
+ (0, swagger_1.ApiProperty)({
24
+ type: String,
25
+ format: "uuid",
26
+ description: "Unique identifier for the IMTO payout transaction",
27
+ required: false,
28
+ }),
29
+ (0, class_validator_1.IsUUID)("4", { message: "imtoPayoutTransactionId must be a valid UUID" }),
30
+ (0, class_validator_1.IsOptional)(),
31
+ (0, class_validator_1.IsNotEmpty)({ message: "imtoPayoutTransactionId should not be empty" }),
32
+ __metadata("design:type", String)
33
+ ], TransactionStatusDto.prototype, "imtoPayoutTransactionId", void 0);
34
+ __decorate([
35
+ (0, swagger_1.ApiProperty)({
36
+ type: String,
37
+ format: "uuid",
38
+ description: "Unique identifier for the IMTO wallet transaction",
39
+ required: false,
40
+ }),
41
+ (0, class_validator_1.IsUUID)("4", { message: "imtoWalletTransactionId must be a valid UUID" }),
42
+ (0, class_validator_1.IsOptional)(),
43
+ (0, class_validator_1.IsNotEmpty)({ message: "imtoWalletTransactionId should not be empty" }),
44
+ __metadata("design:type", String)
45
+ ], TransactionStatusDto.prototype, "imtoWalletTransactionId", void 0);
46
+ __decorate([
47
+ (0, swagger_1.ApiProperty)({ enum: data_1.TRANSACTION_STATUS, description: "Status of the transaction" }),
48
+ (0, class_validator_1.IsEnum)(data_1.TRANSACTION_STATUS, { message: "status must be a valid enum value" }),
49
+ __metadata("design:type", String)
50
+ ], TransactionStatusDto.prototype, "status", void 0);
51
+ __decorate([
52
+ (0, swagger_1.ApiProperty)({ type: String, description: "Remark for the transaction status", required: false }),
53
+ (0, class_validator_1.IsString)({ message: "remark must be a string" }),
54
+ (0, class_validator_1.IsOptional)(),
55
+ (0, class_validator_1.IsNotEmpty)({ message: "remark should not be empty" }),
56
+ __metadata("design:type", String)
57
+ ], TransactionStatusDto.prototype, "remark", void 0);
58
+ class TransactionStatusResponse {
59
+ }
60
+ exports.TransactionStatusResponse = TransactionStatusResponse;
61
+ __decorate([
62
+ (0, swagger_1.ApiProperty)({ type: String, format: "uuid", description: "Unique identifier for the transaction status" }),
63
+ (0, class_validator_1.IsUUID)("4", { message: "id must be a valid UUID" }),
64
+ __metadata("design:type", String)
65
+ ], TransactionStatusResponse.prototype, "id", void 0);
66
+ __decorate([
67
+ (0, swagger_1.ApiProperty)({
68
+ type: String,
69
+ format: "uuid",
70
+ description: "Unique identifier for the IMTO payout transaction",
71
+ required: false,
72
+ }),
73
+ (0, class_validator_1.IsUUID)("4", { message: "imtoPayoutTransactionId must be a valid UUID" }),
74
+ (0, class_validator_1.IsOptional)(),
75
+ (0, class_validator_1.IsNotEmpty)({ message: "imtoPayoutTransactionId should not be empty" }),
76
+ __metadata("design:type", String)
77
+ ], TransactionStatusResponse.prototype, "imtoPayoutTransactionId", void 0);
78
+ __decorate([
79
+ (0, swagger_1.ApiProperty)({
80
+ type: String,
81
+ format: "uuid",
82
+ description: "Unique identifier for the IMTO wallet transaction",
83
+ required: false,
84
+ }),
85
+ (0, class_validator_1.IsUUID)("4", { message: "imtoWalletTransactionId must be a valid UUID" }),
86
+ (0, class_validator_1.IsOptional)(),
87
+ (0, class_validator_1.IsNotEmpty)({ message: "imtoWalletTransactionId should not be empty" }),
88
+ __metadata("design:type", String)
89
+ ], TransactionStatusResponse.prototype, "imtoWalletTransactionId", void 0);
90
+ __decorate([
91
+ (0, swagger_1.ApiProperty)({ enum: data_1.TRANSACTION_STATUS, description: "Status of the transaction" }),
92
+ (0, class_validator_1.IsEnum)(data_1.TRANSACTION_STATUS, { message: "status must be a valid enum value" }),
93
+ __metadata("design:type", String)
94
+ ], TransactionStatusResponse.prototype, "status", void 0);
95
+ __decorate([
96
+ (0, swagger_1.ApiProperty)({ type: String, description: "Remark for the transaction status", required: false }),
97
+ (0, class_validator_1.IsString)({ message: "remark must be a string" }),
98
+ (0, class_validator_1.IsOptional)(),
99
+ (0, class_validator_1.IsNotEmpty)({ message: "remark should not be empty" }),
100
+ __metadata("design:type", String)
101
+ ], TransactionStatusResponse.prototype, "remark", void 0);
102
+ __decorate([
103
+ (0, swagger_1.ApiProperty)({ type: Date, description: "Date when the transaction status was created" }),
104
+ (0, class_validator_1.IsDate)({ message: "createdAt must be a valid date" }),
105
+ __metadata("design:type", Date)
106
+ ], TransactionStatusResponse.prototype, "createdAt", void 0);
107
+ __decorate([
108
+ (0, swagger_1.ApiProperty)({ type: Date, description: "Date when the transaction status was last updated" }),
109
+ (0, class_validator_1.IsDate)({ message: "updatedAt must be a valid date" }),
110
+ __metadata("design:type", Date)
111
+ ], TransactionStatusResponse.prototype, "updatedAt", void 0);
112
+ class CreateIMTOWalletDto {
113
+ }
114
+ exports.CreateIMTOWalletDto = CreateIMTOWalletDto;
115
+ __decorate([
116
+ (0, swagger_1.ApiProperty)({ type: String, format: "uuid", description: "Unique identifier for the user" }),
117
+ (0, class_validator_1.IsUUID)("4", { message: "userId must be a valid UUID" }),
118
+ __metadata("design:type", String)
119
+ ], CreateIMTOWalletDto.prototype, "userId", void 0);
120
+ __decorate([
121
+ (0, swagger_1.ApiProperty)({ enum: data_1.CURRENCY, description: "Currency type for the wallet" }),
122
+ (0, class_validator_1.IsEnum)(data_1.CURRENCY, { message: "currency must be a valid enum value" }),
123
+ __metadata("design:type", String)
124
+ ], CreateIMTOWalletDto.prototype, "currency", void 0);
125
+ class IMTOWalletResponse {
126
+ }
127
+ exports.IMTOWalletResponse = IMTOWalletResponse;
128
+ __decorate([
129
+ (0, swagger_1.ApiProperty)({ type: String, format: "uuid" }),
130
+ (0, class_validator_1.IsUUID)(),
131
+ __metadata("design:type", String)
132
+ ], IMTOWalletResponse.prototype, "id", void 0);
133
+ __decorate([
134
+ (0, swagger_1.ApiProperty)({ type: String, format: "uuid" }),
135
+ (0, class_validator_1.IsUUID)(),
136
+ __metadata("design:type", String)
137
+ ], IMTOWalletResponse.prototype, "userId", void 0);
138
+ __decorate([
139
+ (0, swagger_1.ApiProperty)({ enum: data_1.CURRENCY }),
140
+ (0, class_validator_1.IsEnum)(data_1.CURRENCY),
141
+ __metadata("design:type", String)
142
+ ], IMTOWalletResponse.prototype, "currency", void 0);
143
+ __decorate([
144
+ (0, swagger_1.ApiProperty)({ type: Date }),
145
+ (0, class_validator_1.IsDate)(),
146
+ __metadata("design:type", Date)
147
+ ], IMTOWalletResponse.prototype, "createdAt", void 0);
148
+ __decorate([
149
+ (0, swagger_1.ApiProperty)({ type: Date }),
150
+ (0, class_validator_1.IsDate)(),
151
+ __metadata("design:type", Date)
152
+ ], IMTOWalletResponse.prototype, "updatedAt", void 0);
@@ -0,0 +1,2 @@
1
+ export * from "./imto-account.dto";
2
+ export * from "./data";
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./imto-account.dto"), exports);
18
+ __exportStar(require("./data"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "resurgence-data",
3
- "version": "1.1.57",
3
+ "version": "1.1.58",
4
4
  "description": "DTOs and shareable resources",
5
5
  "module": "dist/index.js",
6
6
  "main": "dist/index.js",
@@ -0,0 +1,26 @@
1
+ export enum CURRENCY {
2
+ USD = "USD",
3
+ CAD = "CAD",
4
+ GBP = "GBP",
5
+ CNY = "CNY",
6
+ EUR = "EUR",
7
+ NGN = "NGN"
8
+ }
9
+
10
+ export enum TRANSACTION_STATUS {
11
+ PENDING = "PENDING",
12
+ SUCCESSFUL = "SUCCESSFUL",
13
+ FAILED = "FAILED",
14
+ REVERSED = "REVERSED"
15
+ }
16
+
17
+ export enum TRANSACTION_TYPE {
18
+ INFLOW = "INFLOW",
19
+ REVERSAL = "REVERSAL",
20
+ OUTFLOW = "OUTFLOW"
21
+ }
22
+
23
+ export enum TRANSACTION_DIRECTION {
24
+ DEBIT = "DEBIT",
25
+ CREDIT = "CREDIT"
26
+ }
@@ -0,0 +1,129 @@
1
+ import { ApiProperty } from "@nestjs/swagger";
2
+ // import { Type } from "class-transformer";
3
+ import { CURRENCY, TRANSACTION_STATUS } from "./data"; // Adjust the import path as necessary
4
+ import { IsUUID, IsEnum, IsDate, ValidateNested, IsOptional, IsNotEmpty, IsString } from "class-validator";
5
+
6
+ // import { IMTOWalletTransactionDto } from "./imto-wallet-transaction.dto"; // Assuming you have a DTO for IMTOWalletTransaction
7
+ // import { IMTORequestDto } from "./imto-request.dto"; // Assuming you have a DTO for IMTORequest
8
+
9
+ export class TransactionStatusDto {
10
+ @ApiProperty({
11
+ type: String,
12
+ format: "uuid",
13
+ description: "Unique identifier for the IMTO payout transaction",
14
+ required: false,
15
+ })
16
+ @IsUUID("4", { message: "imtoPayoutTransactionId must be a valid UUID" })
17
+ @IsOptional()
18
+ @IsNotEmpty({ message: "imtoPayoutTransactionId should not be empty" })
19
+ imtoPayoutTransactionId?: string;
20
+
21
+ @ApiProperty({
22
+ type: String,
23
+ format: "uuid",
24
+ description: "Unique identifier for the IMTO wallet transaction",
25
+ required: false,
26
+ })
27
+ @IsUUID("4", { message: "imtoWalletTransactionId must be a valid UUID" })
28
+ @IsOptional()
29
+ @IsNotEmpty({ message: "imtoWalletTransactionId should not be empty" })
30
+ imtoWalletTransactionId?: string;
31
+
32
+ @ApiProperty({ enum: TRANSACTION_STATUS, description: "Status of the transaction" })
33
+ @IsEnum(TRANSACTION_STATUS, { message: "status must be a valid enum value" })
34
+ status: TRANSACTION_STATUS;
35
+
36
+ @ApiProperty({ type: String, description: "Remark for the transaction status", required: false })
37
+ @IsString({ message: "remark must be a string" })
38
+ @IsOptional()
39
+ @IsNotEmpty({ message: "remark should not be empty" })
40
+ remark?: string;
41
+ }
42
+
43
+ export class TransactionStatusResponse {
44
+ @ApiProperty({ type: String, format: "uuid", description: "Unique identifier for the transaction status" })
45
+ @IsUUID("4", { message: "id must be a valid UUID" })
46
+ id: string;
47
+
48
+ @ApiProperty({
49
+ type: String,
50
+ format: "uuid",
51
+ description: "Unique identifier for the IMTO payout transaction",
52
+ required: false,
53
+ })
54
+ @IsUUID("4", { message: "imtoPayoutTransactionId must be a valid UUID" })
55
+ @IsOptional()
56
+ @IsNotEmpty({ message: "imtoPayoutTransactionId should not be empty" })
57
+ imtoPayoutTransactionId?: string;
58
+
59
+ @ApiProperty({
60
+ type: String,
61
+ format: "uuid",
62
+ description: "Unique identifier for the IMTO wallet transaction",
63
+ required: false,
64
+ })
65
+ @IsUUID("4", { message: "imtoWalletTransactionId must be a valid UUID" })
66
+ @IsOptional()
67
+ @IsNotEmpty({ message: "imtoWalletTransactionId should not be empty" })
68
+ imtoWalletTransactionId?: string;
69
+
70
+ @ApiProperty({ enum: TRANSACTION_STATUS, description: "Status of the transaction" })
71
+ @IsEnum(TRANSACTION_STATUS, { message: "status must be a valid enum value" })
72
+ status: TRANSACTION_STATUS;
73
+
74
+ @ApiProperty({ type: String, description: "Remark for the transaction status", required: false })
75
+ @IsString({ message: "remark must be a string" })
76
+ @IsOptional()
77
+ @IsNotEmpty({ message: "remark should not be empty" })
78
+ remark?: string;
79
+
80
+ @ApiProperty({ type: Date, description: "Date when the transaction status was created" })
81
+ @IsDate({ message: "createdAt must be a valid date" })
82
+ createdAt: Date;
83
+
84
+ @ApiProperty({ type: Date, description: "Date when the transaction status was last updated" })
85
+ @IsDate({ message: "updatedAt must be a valid date" })
86
+ updatedAt: Date;
87
+ }
88
+
89
+ export class CreateIMTOWalletDto {
90
+ @ApiProperty({ type: String, format: "uuid", description: "Unique identifier for the user" })
91
+ @IsUUID("4", { message: "userId must be a valid UUID" })
92
+ userId: string;
93
+
94
+ @ApiProperty({ enum: CURRENCY, description: "Currency type for the wallet" })
95
+ @IsEnum(CURRENCY, { message: "currency must be a valid enum value" })
96
+ currency: CURRENCY;
97
+ }
98
+
99
+ export class IMTOWalletResponse {
100
+ @ApiProperty({ type: String, format: "uuid" })
101
+ @IsUUID()
102
+ id: string;
103
+
104
+ @ApiProperty({ type: String, format: "uuid" })
105
+ @IsUUID()
106
+ userId: string;
107
+
108
+ @ApiProperty({ enum: CURRENCY })
109
+ @IsEnum(CURRENCY)
110
+ currency: CURRENCY;
111
+
112
+ @ApiProperty({ type: Date })
113
+ @IsDate()
114
+ createdAt: Date;
115
+
116
+ @ApiProperty({ type: Date })
117
+ @IsDate()
118
+ updatedAt: Date;
119
+
120
+ // @ApiProperty({ type: [IMTOWalletTransactionDto] })
121
+ // @ValidateNested({ each: true })
122
+ // @Type(() => IMTOWalletTransactionDto)
123
+ // transactions: IMTOWalletTransactionDto[];
124
+
125
+ // @ApiProperty({ type: [IMTORequestDto] })
126
+ // @ValidateNested({ each: true })
127
+ // @Type(() => IMTORequestDto)
128
+ // imtoRequests: IMTORequestDto[];
129
+ }
@@ -0,0 +1,2 @@
1
+ export * from "./imto-account.dto";
2
+ export * from "./data";