@serene-dev/la-nest-library 0.0.122 → 0.0.124
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/libs/la-library/src/dtos/search.dto.d.ts +2 -2
- package/dist/libs/la-library/src/dtos/search.dto.js +1 -1
- package/dist/libs/la-library/src/dtos/search.dto.js.map +1 -1
- package/dist/libs/la-library/src/entities/base.entity.d.ts +3 -1
- package/dist/libs/la-library/src/entities/base.entity.js +8 -0
- package/dist/libs/la-library/src/entities/base.entity.js.map +1 -1
- package/dist/libs/la-library/src/entities/likes.entity.d.ts +0 -1
- package/dist/libs/la-library/src/enums/base.enum.d.ts +3 -0
- package/dist/libs/la-library/src/enums/base.enum.js +3 -0
- package/dist/libs/la-library/src/enums/base.enum.js.map +1 -1
- package/dist/libs/la-library/src/index.d.ts +7 -1
- package/dist/libs/la-library/src/index.js +24 -2
- package/dist/libs/la-library/src/index.js.map +1 -1
- package/dist/libs/la-library/src/modules/logs/logs.module.js.map +1 -1
- package/dist/libs/la-library/src/modules/messages/messages.module.js.map +1 -1
- package/dist/libs/la-library/src/modules/wallet/wallet-transaction.controller.d.ts +10 -0
- package/dist/libs/la-library/src/modules/wallet/wallet-transaction.controller.js +88 -0
- package/dist/libs/la-library/src/modules/wallet/wallet-transaction.controller.js.map +1 -0
- package/dist/libs/la-library/src/modules/wallet/wallet-transaction.service.d.ts +11 -0
- package/dist/libs/la-library/src/modules/wallet/wallet-transaction.service.js +70 -0
- package/dist/libs/la-library/src/modules/wallet/wallet-transaction.service.js.map +1 -0
- package/dist/libs/la-library/src/modules/wallet/wallet.controller.d.ts +10 -0
- package/dist/libs/la-library/src/modules/wallet/wallet.controller.js +85 -0
- package/dist/libs/la-library/src/modules/wallet/wallet.controller.js.map +1 -0
- package/dist/libs/la-library/src/modules/wallet/wallet.dto.d.ts +67 -0
- package/dist/libs/la-library/src/modules/wallet/wallet.dto.js +348 -0
- package/dist/libs/la-library/src/modules/wallet/wallet.dto.js.map +1 -0
- package/dist/libs/la-library/src/modules/wallet/wallet.entity.d.ts +41 -0
- package/dist/libs/la-library/src/modules/wallet/wallet.entity.js +204 -0
- package/dist/libs/la-library/src/modules/wallet/wallet.entity.js.map +1 -0
- package/dist/libs/la-library/src/modules/wallet/wallet.enum.d.ts +13 -0
- package/dist/libs/la-library/src/modules/wallet/wallet.enum.js +20 -0
- package/dist/libs/la-library/src/modules/wallet/wallet.enum.js.map +1 -0
- package/dist/libs/la-library/src/modules/wallet/wallet.module.d.ts +10 -0
- package/dist/libs/la-library/src/modules/wallet/wallet.module.js +32 -0
- package/dist/libs/la-library/src/modules/wallet/wallet.module.js.map +1 -0
- package/dist/libs/la-library/src/modules/wallet/wallet.service.d.ts +10 -0
- package/dist/libs/la-library/src/modules/wallet/wallet.service.js +52 -0
- package/dist/libs/la-library/src/modules/wallet/wallet.service.js.map +1 -0
- package/dist/libs/la-library/src/services/base.service.d.ts +1 -1
- package/dist/libs/la-library/src/services/environment.service.d.ts +1 -0
- package/dist/libs/la-library/src/services/environment.service.js +3 -0
- package/dist/libs/la-library/src/services/environment.service.js.map +1 -1
- package/dist/libs/la-library/src/services/utility.service.d.ts +26 -9
- package/dist/libs/la-library/src/services/utility.service.js +70 -2
- package/dist/libs/la-library/src/services/utility.service.js.map +1 -1
- package/package.json +3 -2
|
@@ -0,0 +1,348 @@
|
|
|
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.WalletTransactionSearchDTO = exports.CreateWalletTransactionDTO = exports.UpdateWalletTransactionDTO = exports.WalletSearchDTO = exports.SaveWalletDTO = void 0;
|
|
13
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
const search_dto_1 = require("../../dtos/search.dto");
|
|
16
|
+
const wallet_enum_1 = require("./wallet.enum");
|
|
17
|
+
class SaveWalletDTO {
|
|
18
|
+
}
|
|
19
|
+
exports.SaveWalletDTO = SaveWalletDTO;
|
|
20
|
+
__decorate([
|
|
21
|
+
(0, swagger_1.ApiPropertyOptional)(),
|
|
22
|
+
(0, class_validator_1.IsString)(),
|
|
23
|
+
(0, class_validator_1.IsOptional)(),
|
|
24
|
+
__metadata("design:type", String)
|
|
25
|
+
], SaveWalletDTO.prototype, "name", void 0);
|
|
26
|
+
__decorate([
|
|
27
|
+
(0, swagger_1.ApiPropertyOptional)(),
|
|
28
|
+
(0, class_validator_1.IsString)(),
|
|
29
|
+
(0, class_validator_1.IsOptional)(),
|
|
30
|
+
__metadata("design:type", String)
|
|
31
|
+
], SaveWalletDTO.prototype, "userID", void 0);
|
|
32
|
+
__decorate([
|
|
33
|
+
(0, swagger_1.ApiPropertyOptional)({ type: 'string' }),
|
|
34
|
+
(0, class_validator_1.IsString)(),
|
|
35
|
+
(0, class_validator_1.IsOptional)(),
|
|
36
|
+
__metadata("design:type", Object)
|
|
37
|
+
], SaveWalletDTO.prototype, "type", void 0);
|
|
38
|
+
__decorate([
|
|
39
|
+
(0, swagger_1.ApiPropertyOptional)(),
|
|
40
|
+
(0, class_validator_1.IsBoolean)(),
|
|
41
|
+
(0, class_validator_1.IsOptional)(),
|
|
42
|
+
__metadata("design:type", Boolean)
|
|
43
|
+
], SaveWalletDTO.prototype, "allowOverdraft", void 0);
|
|
44
|
+
__decorate([
|
|
45
|
+
(0, swagger_1.ApiPropertyOptional)(),
|
|
46
|
+
(0, class_validator_1.IsNumber)(),
|
|
47
|
+
(0, class_validator_1.IsOptional)(),
|
|
48
|
+
__metadata("design:type", Number)
|
|
49
|
+
], SaveWalletDTO.prototype, "overdraftLimit", void 0);
|
|
50
|
+
class WalletSearchDTO extends search_dto_1.SearchQueryDto {
|
|
51
|
+
}
|
|
52
|
+
exports.WalletSearchDTO = WalletSearchDTO;
|
|
53
|
+
__decorate([
|
|
54
|
+
(0, swagger_1.ApiPropertyOptional)(),
|
|
55
|
+
(0, class_validator_1.IsOptional)(),
|
|
56
|
+
(0, class_validator_1.IsNumberString)(),
|
|
57
|
+
__metadata("design:type", Number)
|
|
58
|
+
], WalletSearchDTO.prototype, "grossBalance", void 0);
|
|
59
|
+
__decorate([
|
|
60
|
+
(0, swagger_1.ApiPropertyOptional)(),
|
|
61
|
+
(0, class_validator_1.IsOptional)(),
|
|
62
|
+
(0, class_validator_1.IsNumberString)(),
|
|
63
|
+
__metadata("design:type", Number)
|
|
64
|
+
], WalletSearchDTO.prototype, "grossBalanceFrom", void 0);
|
|
65
|
+
__decorate([
|
|
66
|
+
(0, swagger_1.ApiPropertyOptional)(),
|
|
67
|
+
(0, class_validator_1.IsOptional)(),
|
|
68
|
+
(0, class_validator_1.IsNumberString)(),
|
|
69
|
+
__metadata("design:type", Number)
|
|
70
|
+
], WalletSearchDTO.prototype, "grossBalanceTo", void 0);
|
|
71
|
+
__decorate([
|
|
72
|
+
(0, swagger_1.ApiPropertyOptional)(),
|
|
73
|
+
(0, class_validator_1.IsOptional)(),
|
|
74
|
+
(0, class_validator_1.IsNumberString)(),
|
|
75
|
+
__metadata("design:type", Number)
|
|
76
|
+
], WalletSearchDTO.prototype, "netBalance", void 0);
|
|
77
|
+
__decorate([
|
|
78
|
+
(0, swagger_1.ApiPropertyOptional)(),
|
|
79
|
+
(0, class_validator_1.IsOptional)(),
|
|
80
|
+
(0, class_validator_1.IsNumberString)(),
|
|
81
|
+
__metadata("design:type", Number)
|
|
82
|
+
], WalletSearchDTO.prototype, "netBalanceFrom", void 0);
|
|
83
|
+
__decorate([
|
|
84
|
+
(0, swagger_1.ApiPropertyOptional)(),
|
|
85
|
+
(0, class_validator_1.IsOptional)(),
|
|
86
|
+
(0, class_validator_1.IsNumberString)(),
|
|
87
|
+
__metadata("design:type", Number)
|
|
88
|
+
], WalletSearchDTO.prototype, "netBalanceTo", void 0);
|
|
89
|
+
__decorate([
|
|
90
|
+
(0, swagger_1.ApiPropertyOptional)(),
|
|
91
|
+
(0, class_validator_1.IsOptional)(),
|
|
92
|
+
(0, class_validator_1.IsNumberString)(),
|
|
93
|
+
__metadata("design:type", Number)
|
|
94
|
+
], WalletSearchDTO.prototype, "grossTotalCredit", void 0);
|
|
95
|
+
__decorate([
|
|
96
|
+
(0, swagger_1.ApiPropertyOptional)(),
|
|
97
|
+
(0, class_validator_1.IsOptional)(),
|
|
98
|
+
(0, class_validator_1.IsNumberString)(),
|
|
99
|
+
__metadata("design:type", Number)
|
|
100
|
+
], WalletSearchDTO.prototype, "grossTotalCreditFrom", void 0);
|
|
101
|
+
__decorate([
|
|
102
|
+
(0, swagger_1.ApiPropertyOptional)(),
|
|
103
|
+
(0, class_validator_1.IsOptional)(),
|
|
104
|
+
(0, class_validator_1.IsNumberString)(),
|
|
105
|
+
__metadata("design:type", Number)
|
|
106
|
+
], WalletSearchDTO.prototype, "grossTotalCreditTo", void 0);
|
|
107
|
+
__decorate([
|
|
108
|
+
(0, swagger_1.ApiPropertyOptional)(),
|
|
109
|
+
(0, class_validator_1.IsOptional)(),
|
|
110
|
+
(0, class_validator_1.IsNumberString)(),
|
|
111
|
+
__metadata("design:type", Number)
|
|
112
|
+
], WalletSearchDTO.prototype, "grossTotalDebit", void 0);
|
|
113
|
+
__decorate([
|
|
114
|
+
(0, swagger_1.ApiPropertyOptional)(),
|
|
115
|
+
(0, class_validator_1.IsOptional)(),
|
|
116
|
+
(0, class_validator_1.IsNumberString)(),
|
|
117
|
+
__metadata("design:type", Number)
|
|
118
|
+
], WalletSearchDTO.prototype, "grossTotalDebitFrom", void 0);
|
|
119
|
+
__decorate([
|
|
120
|
+
(0, swagger_1.ApiPropertyOptional)(),
|
|
121
|
+
(0, class_validator_1.IsOptional)(),
|
|
122
|
+
(0, class_validator_1.IsNumberString)(),
|
|
123
|
+
__metadata("design:type", Number)
|
|
124
|
+
], WalletSearchDTO.prototype, "grossTotalDebitTo", void 0);
|
|
125
|
+
__decorate([
|
|
126
|
+
(0, swagger_1.ApiPropertyOptional)(),
|
|
127
|
+
(0, class_validator_1.IsOptional)(),
|
|
128
|
+
(0, class_validator_1.IsNumberString)(),
|
|
129
|
+
__metadata("design:type", Number)
|
|
130
|
+
], WalletSearchDTO.prototype, "netTotalCredit", void 0);
|
|
131
|
+
__decorate([
|
|
132
|
+
(0, swagger_1.ApiPropertyOptional)(),
|
|
133
|
+
(0, class_validator_1.IsOptional)(),
|
|
134
|
+
(0, class_validator_1.IsNumberString)(),
|
|
135
|
+
__metadata("design:type", Number)
|
|
136
|
+
], WalletSearchDTO.prototype, "netTotalCreditFrom", void 0);
|
|
137
|
+
__decorate([
|
|
138
|
+
(0, swagger_1.ApiPropertyOptional)(),
|
|
139
|
+
(0, class_validator_1.IsOptional)(),
|
|
140
|
+
(0, class_validator_1.IsNumberString)(),
|
|
141
|
+
__metadata("design:type", Number)
|
|
142
|
+
], WalletSearchDTO.prototype, "netTotalCreditTo", void 0);
|
|
143
|
+
__decorate([
|
|
144
|
+
(0, swagger_1.ApiPropertyOptional)(),
|
|
145
|
+
(0, class_validator_1.IsOptional)(),
|
|
146
|
+
(0, class_validator_1.IsNumberString)(),
|
|
147
|
+
__metadata("design:type", Number)
|
|
148
|
+
], WalletSearchDTO.prototype, "netTotalDebit", void 0);
|
|
149
|
+
__decorate([
|
|
150
|
+
(0, swagger_1.ApiPropertyOptional)(),
|
|
151
|
+
(0, class_validator_1.IsOptional)(),
|
|
152
|
+
(0, class_validator_1.IsNumberString)(),
|
|
153
|
+
__metadata("design:type", Number)
|
|
154
|
+
], WalletSearchDTO.prototype, "netTotalDebitFrom", void 0);
|
|
155
|
+
__decorate([
|
|
156
|
+
(0, swagger_1.ApiPropertyOptional)(),
|
|
157
|
+
(0, class_validator_1.IsOptional)(),
|
|
158
|
+
(0, class_validator_1.IsNumberString)(),
|
|
159
|
+
__metadata("design:type", Number)
|
|
160
|
+
], WalletSearchDTO.prototype, "netTotalDebitTo", void 0);
|
|
161
|
+
__decorate([
|
|
162
|
+
(0, swagger_1.ApiPropertyOptional)({ type: 'boolean' }),
|
|
163
|
+
(0, class_validator_1.IsBooleanString)(),
|
|
164
|
+
(0, class_validator_1.IsOptional)(),
|
|
165
|
+
__metadata("design:type", Boolean)
|
|
166
|
+
], WalletSearchDTO.prototype, "allowOverdraft", void 0);
|
|
167
|
+
__decorate([
|
|
168
|
+
(0, swagger_1.ApiPropertyOptional)(),
|
|
169
|
+
(0, class_validator_1.IsOptional)(),
|
|
170
|
+
(0, class_validator_1.IsNumberString)(),
|
|
171
|
+
__metadata("design:type", Number)
|
|
172
|
+
], WalletSearchDTO.prototype, "overdraftLimit", void 0);
|
|
173
|
+
__decorate([
|
|
174
|
+
(0, swagger_1.ApiPropertyOptional)(),
|
|
175
|
+
(0, class_validator_1.IsOptional)(),
|
|
176
|
+
(0, class_validator_1.IsNumberString)(),
|
|
177
|
+
__metadata("design:type", Number)
|
|
178
|
+
], WalletSearchDTO.prototype, "overdraftLimitFrom", void 0);
|
|
179
|
+
__decorate([
|
|
180
|
+
(0, swagger_1.ApiPropertyOptional)(),
|
|
181
|
+
(0, class_validator_1.IsOptional)(),
|
|
182
|
+
(0, class_validator_1.IsNumberString)(),
|
|
183
|
+
__metadata("design:type", Number)
|
|
184
|
+
], WalletSearchDTO.prototype, "overdraftLimitTo", void 0);
|
|
185
|
+
__decorate([
|
|
186
|
+
(0, swagger_1.ApiPropertyOptional)(),
|
|
187
|
+
(0, class_validator_1.IsString)(),
|
|
188
|
+
(0, class_validator_1.IsOptional)(),
|
|
189
|
+
__metadata("design:type", String)
|
|
190
|
+
], WalletSearchDTO.prototype, "name", void 0);
|
|
191
|
+
__decorate([
|
|
192
|
+
(0, swagger_1.ApiPropertyOptional)(),
|
|
193
|
+
(0, class_validator_1.IsString)(),
|
|
194
|
+
(0, class_validator_1.IsOptional)(),
|
|
195
|
+
__metadata("design:type", String)
|
|
196
|
+
], WalletSearchDTO.prototype, "userID", void 0);
|
|
197
|
+
__decorate([
|
|
198
|
+
(0, swagger_1.ApiPropertyOptional)({ type: 'string' }),
|
|
199
|
+
(0, class_validator_1.IsString)(),
|
|
200
|
+
(0, class_validator_1.IsOptional)(),
|
|
201
|
+
__metadata("design:type", Object)
|
|
202
|
+
], WalletSearchDTO.prototype, "type", void 0);
|
|
203
|
+
class UpdateWalletTransactionDTO {
|
|
204
|
+
}
|
|
205
|
+
exports.UpdateWalletTransactionDTO = UpdateWalletTransactionDTO;
|
|
206
|
+
__decorate([
|
|
207
|
+
(0, swagger_1.ApiPropertyOptional)({ type: 'boolean' }),
|
|
208
|
+
(0, class_validator_1.IsBoolean)(),
|
|
209
|
+
(0, class_validator_1.IsOptional)(),
|
|
210
|
+
__metadata("design:type", Boolean)
|
|
211
|
+
], UpdateWalletTransactionDTO.prototype, "isVerified", void 0);
|
|
212
|
+
__decorate([
|
|
213
|
+
(0, swagger_1.ApiPropertyOptional)({ type: 'boolean' }),
|
|
214
|
+
(0, class_validator_1.IsBoolean)(),
|
|
215
|
+
(0, class_validator_1.IsOptional)(),
|
|
216
|
+
__metadata("design:type", Boolean)
|
|
217
|
+
], UpdateWalletTransactionDTO.prototype, "isFailed", void 0);
|
|
218
|
+
class CreateWalletTransactionDTO {
|
|
219
|
+
}
|
|
220
|
+
exports.CreateWalletTransactionDTO = CreateWalletTransactionDTO;
|
|
221
|
+
__decorate([
|
|
222
|
+
(0, swagger_1.ApiProperty)(),
|
|
223
|
+
(0, class_validator_1.IsNumber)(),
|
|
224
|
+
__metadata("design:type", Number)
|
|
225
|
+
], CreateWalletTransactionDTO.prototype, "amount", void 0);
|
|
226
|
+
__decorate([
|
|
227
|
+
(0, swagger_1.ApiProperty)({ type: 'enum', enum: wallet_enum_1.ETransactionType }),
|
|
228
|
+
(0, class_validator_1.IsEnum)(wallet_enum_1.ETransactionType),
|
|
229
|
+
__metadata("design:type", String)
|
|
230
|
+
], CreateWalletTransactionDTO.prototype, "type", void 0);
|
|
231
|
+
__decorate([
|
|
232
|
+
(0, swagger_1.ApiProperty)({ type: 'enum', enum: wallet_enum_1.ECurrency }),
|
|
233
|
+
(0, class_validator_1.IsEnum)(wallet_enum_1.ECurrency),
|
|
234
|
+
__metadata("design:type", String)
|
|
235
|
+
], CreateWalletTransactionDTO.prototype, "currency", void 0);
|
|
236
|
+
__decorate([
|
|
237
|
+
(0, swagger_1.ApiProperty)(),
|
|
238
|
+
(0, class_validator_1.IsString)(),
|
|
239
|
+
__metadata("design:type", String)
|
|
240
|
+
], CreateWalletTransactionDTO.prototype, "reason", void 0);
|
|
241
|
+
__decorate([
|
|
242
|
+
(0, swagger_1.ApiProperty)({ type: 'enum', enum: wallet_enum_1.ETransMethod }),
|
|
243
|
+
(0, class_validator_1.IsEnum)(wallet_enum_1.ETransMethod),
|
|
244
|
+
__metadata("design:type", String)
|
|
245
|
+
], CreateWalletTransactionDTO.prototype, "transMethod", void 0);
|
|
246
|
+
__decorate([
|
|
247
|
+
(0, swagger_1.ApiProperty)(),
|
|
248
|
+
(0, class_validator_1.IsString)(),
|
|
249
|
+
__metadata("design:type", String)
|
|
250
|
+
], CreateWalletTransactionDTO.prototype, "transactionReference", void 0);
|
|
251
|
+
__decorate([
|
|
252
|
+
(0, swagger_1.ApiProperty)({ type: 'boolean' }),
|
|
253
|
+
(0, class_validator_1.IsBoolean)(),
|
|
254
|
+
__metadata("design:type", Boolean)
|
|
255
|
+
], CreateWalletTransactionDTO.prototype, "isVerified", void 0);
|
|
256
|
+
__decorate([
|
|
257
|
+
(0, swagger_1.ApiProperty)({ type: 'boolean' }),
|
|
258
|
+
(0, class_validator_1.IsBoolean)(),
|
|
259
|
+
__metadata("design:type", Boolean)
|
|
260
|
+
], CreateWalletTransactionDTO.prototype, "isFailed", void 0);
|
|
261
|
+
class WalletTransactionSearchDTO extends search_dto_1.SearchQueryDto {
|
|
262
|
+
}
|
|
263
|
+
exports.WalletTransactionSearchDTO = WalletTransactionSearchDTO;
|
|
264
|
+
__decorate([
|
|
265
|
+
(0, swagger_1.ApiPropertyOptional)(),
|
|
266
|
+
(0, class_validator_1.IsNumberString)(),
|
|
267
|
+
(0, class_validator_1.IsOptional)(),
|
|
268
|
+
__metadata("design:type", Number)
|
|
269
|
+
], WalletTransactionSearchDTO.prototype, "amount", void 0);
|
|
270
|
+
__decorate([
|
|
271
|
+
(0, swagger_1.ApiPropertyOptional)(),
|
|
272
|
+
(0, class_validator_1.IsNumberString)(),
|
|
273
|
+
(0, class_validator_1.IsOptional)(),
|
|
274
|
+
__metadata("design:type", Number)
|
|
275
|
+
], WalletTransactionSearchDTO.prototype, "amountFrom", void 0);
|
|
276
|
+
__decorate([
|
|
277
|
+
(0, swagger_1.ApiPropertyOptional)(),
|
|
278
|
+
(0, class_validator_1.IsNumberString)(),
|
|
279
|
+
(0, class_validator_1.IsOptional)(),
|
|
280
|
+
__metadata("design:type", Number)
|
|
281
|
+
], WalletTransactionSearchDTO.prototype, "amountTo", void 0);
|
|
282
|
+
__decorate([
|
|
283
|
+
(0, swagger_1.ApiPropertyOptional)({}),
|
|
284
|
+
(0, class_validator_1.IsNumberString)(),
|
|
285
|
+
(0, class_validator_1.IsOptional)(),
|
|
286
|
+
__metadata("design:type", Number)
|
|
287
|
+
], WalletTransactionSearchDTO.prototype, "netBalanceBefore", void 0);
|
|
288
|
+
__decorate([
|
|
289
|
+
(0, swagger_1.ApiPropertyOptional)({}),
|
|
290
|
+
(0, class_validator_1.IsNumberString)(),
|
|
291
|
+
(0, class_validator_1.IsOptional)(),
|
|
292
|
+
__metadata("design:type", Number)
|
|
293
|
+
], WalletTransactionSearchDTO.prototype, "grossBalanceBefore", void 0);
|
|
294
|
+
__decorate([
|
|
295
|
+
(0, swagger_1.ApiPropertyOptional)({ type: 'enum', enum: wallet_enum_1.ETransactionType }),
|
|
296
|
+
(0, class_validator_1.IsEnum)(wallet_enum_1.ETransactionType),
|
|
297
|
+
(0, class_validator_1.IsOptional)(),
|
|
298
|
+
__metadata("design:type", String)
|
|
299
|
+
], WalletTransactionSearchDTO.prototype, "type", void 0);
|
|
300
|
+
__decorate([
|
|
301
|
+
(0, swagger_1.ApiPropertyOptional)({ type: 'enum', enum: wallet_enum_1.ECurrency }),
|
|
302
|
+
(0, class_validator_1.IsEnum)(wallet_enum_1.ECurrency),
|
|
303
|
+
(0, class_validator_1.IsOptional)(),
|
|
304
|
+
__metadata("design:type", String)
|
|
305
|
+
], WalletTransactionSearchDTO.prototype, "currency", void 0);
|
|
306
|
+
__decorate([
|
|
307
|
+
(0, swagger_1.ApiPropertyOptional)({ type: 'string' }),
|
|
308
|
+
(0, class_validator_1.IsString)(),
|
|
309
|
+
(0, class_validator_1.IsOptional)(),
|
|
310
|
+
__metadata("design:type", String)
|
|
311
|
+
], WalletTransactionSearchDTO.prototype, "reason", void 0);
|
|
312
|
+
__decorate([
|
|
313
|
+
(0, swagger_1.ApiPropertyOptional)({ type: 'string' }),
|
|
314
|
+
(0, class_validator_1.IsString)(),
|
|
315
|
+
(0, class_validator_1.IsOptional)(),
|
|
316
|
+
__metadata("design:type", String)
|
|
317
|
+
], WalletTransactionSearchDTO.prototype, "userID", void 0);
|
|
318
|
+
__decorate([
|
|
319
|
+
(0, swagger_1.ApiPropertyOptional)({ type: 'enum', enum: wallet_enum_1.ETransMethod }),
|
|
320
|
+
(0, class_validator_1.IsEnum)(wallet_enum_1.ETransMethod),
|
|
321
|
+
(0, class_validator_1.IsOptional)(),
|
|
322
|
+
__metadata("design:type", String)
|
|
323
|
+
], WalletTransactionSearchDTO.prototype, "transMethod", void 0);
|
|
324
|
+
__decorate([
|
|
325
|
+
(0, swagger_1.ApiPropertyOptional)({ type: 'boolean' }),
|
|
326
|
+
(0, class_validator_1.IsBooleanString)(),
|
|
327
|
+
(0, class_validator_1.IsOptional)(),
|
|
328
|
+
__metadata("design:type", Boolean)
|
|
329
|
+
], WalletTransactionSearchDTO.prototype, "isVerified", void 0);
|
|
330
|
+
__decorate([
|
|
331
|
+
(0, swagger_1.ApiPropertyOptional)({ type: 'boolean' }),
|
|
332
|
+
(0, class_validator_1.IsBooleanString)(),
|
|
333
|
+
(0, class_validator_1.IsOptional)(),
|
|
334
|
+
__metadata("design:type", Boolean)
|
|
335
|
+
], WalletTransactionSearchDTO.prototype, "isFailed", void 0);
|
|
336
|
+
__decorate([
|
|
337
|
+
(0, swagger_1.ApiPropertyOptional)({ type: 'string' }),
|
|
338
|
+
(0, class_validator_1.IsString)(),
|
|
339
|
+
(0, class_validator_1.IsOptional)(),
|
|
340
|
+
__metadata("design:type", String)
|
|
341
|
+
], WalletTransactionSearchDTO.prototype, "transactionReference", void 0);
|
|
342
|
+
__decorate([
|
|
343
|
+
(0, swagger_1.ApiPropertyOptional)(),
|
|
344
|
+
(0, class_validator_1.IsString)(),
|
|
345
|
+
(0, class_validator_1.IsOptional)(),
|
|
346
|
+
__metadata("design:type", String)
|
|
347
|
+
], WalletTransactionSearchDTO.prototype, "walletId", void 0);
|
|
348
|
+
//# sourceMappingURL=wallet.dto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wallet.dto.js","sourceRoot":"","sources":["../../../../../../libs/la-library/src/modules/wallet/wallet.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAAmE;AAMnE,qDAQyB;AACzB,sDAAuD;AACvD,+CAA0E;AAE1E,MAAa,aAAa;CAyBzB;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,IAAA,4BAAU,GAAE;;4DACQ;AAKrB;IAHC,IAAA,6BAAmB,EAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;IACvC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;0DACG;AAKhB;IAHC,IAAA,6BAAmB,EAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;IACvC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;0DACG;AAKhB;IAHC,IAAA,6BAAmB,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,0BAAY,EAAE,CAAC;IACzD,IAAA,wBAAM,EAAC,0BAAY,CAAC;IACpB,IAAA,4BAAU,GAAE;;+DACc;AAK3B;IAHC,IAAA,6BAAmB,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;IACxC,IAAA,iCAAe,GAAE;IACjB,IAAA,4BAAU,GAAE;;8DACQ;AAKrB;IAHC,IAAA,6BAAmB,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;IACxC,IAAA,iCAAe,GAAE;IACjB,IAAA,4BAAU,GAAE;;4DACM;AAKnB;IAHC,IAAA,6BAAmB,EAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;IACvC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;wEACiB;AAK9B;IAHC,IAAA,6BAAmB,GAAE;IACrB,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;4DACK"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { BaseEntity } from '../../entities/base.entity';
|
|
2
|
+
import { ECurrency, ETransMethod, ETransactionType } from './wallet.enum';
|
|
3
|
+
export declare class WalletEntity extends BaseEntity<WalletEntity> {
|
|
4
|
+
name?: string;
|
|
5
|
+
userID: string;
|
|
6
|
+
type?: any;
|
|
7
|
+
allowOverdraft: boolean;
|
|
8
|
+
overdraftLimit: number;
|
|
9
|
+
transactions: WalletTransactionEntity[];
|
|
10
|
+
walletExternalBanks: WalletExternalBank[];
|
|
11
|
+
}
|
|
12
|
+
export declare class WalletExternalBank extends BaseEntity<WalletExternalBank> {
|
|
13
|
+
code?: string;
|
|
14
|
+
accountNumber?: string;
|
|
15
|
+
sortCode?: string;
|
|
16
|
+
wallet: WalletEntity;
|
|
17
|
+
}
|
|
18
|
+
export declare class WalletTransactionEntity extends BaseEntity<WalletTransactionEntity> {
|
|
19
|
+
amount: number;
|
|
20
|
+
netBalanceBefore: number;
|
|
21
|
+
grossBalanceBefore: number;
|
|
22
|
+
type: ETransactionType;
|
|
23
|
+
currency: ECurrency;
|
|
24
|
+
reason?: string;
|
|
25
|
+
transMethod: ETransMethod;
|
|
26
|
+
isVerified: boolean;
|
|
27
|
+
isFailed: boolean;
|
|
28
|
+
isOverdraft?: boolean;
|
|
29
|
+
transactionReference: string;
|
|
30
|
+
userID: string;
|
|
31
|
+
wallet: WalletEntity;
|
|
32
|
+
}
|
|
33
|
+
export declare class WalletBalanceView extends WalletEntity {
|
|
34
|
+
grossBalance: number;
|
|
35
|
+
netBalance: number;
|
|
36
|
+
grossTotalCredit: number;
|
|
37
|
+
grossTotalDebit: number;
|
|
38
|
+
netTotalCredit: number;
|
|
39
|
+
netTotalDebit: number;
|
|
40
|
+
}
|
|
41
|
+
export declare const WalletEntities: (typeof WalletEntity | typeof WalletTransactionEntity | typeof WalletExternalBank)[];
|
|
@@ -0,0 +1,204 @@
|
|
|
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.WalletEntities = exports.WalletBalanceView = exports.WalletTransactionEntity = exports.WalletExternalBank = exports.WalletEntity = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const base_enum_1 = require("../../enums/base.enum");
|
|
15
|
+
const base_entity_1 = require("../../entities/base.entity");
|
|
16
|
+
const wallet_enum_1 = require("./wallet.enum");
|
|
17
|
+
let WalletEntity = class WalletEntity extends base_entity_1.BaseEntity {
|
|
18
|
+
};
|
|
19
|
+
exports.WalletEntity = WalletEntity;
|
|
20
|
+
__decorate([
|
|
21
|
+
(0, typeorm_1.Column)(),
|
|
22
|
+
__metadata("design:type", String)
|
|
23
|
+
], WalletEntity.prototype, "name", void 0);
|
|
24
|
+
__decorate([
|
|
25
|
+
(0, typeorm_1.Column)(),
|
|
26
|
+
__metadata("design:type", String)
|
|
27
|
+
], WalletEntity.prototype, "userID", void 0);
|
|
28
|
+
__decorate([
|
|
29
|
+
(0, typeorm_1.Column)({ type: 'nvarchar', length: 150 }),
|
|
30
|
+
__metadata("design:type", Object)
|
|
31
|
+
], WalletEntity.prototype, "type", void 0);
|
|
32
|
+
__decorate([
|
|
33
|
+
(0, typeorm_1.Column)({ type: 'boolean', default: false }),
|
|
34
|
+
__metadata("design:type", Boolean)
|
|
35
|
+
], WalletEntity.prototype, "allowOverdraft", void 0);
|
|
36
|
+
__decorate([
|
|
37
|
+
(0, typeorm_1.Column)({ type: 'double', default: 0 }),
|
|
38
|
+
__metadata("design:type", Number)
|
|
39
|
+
], WalletEntity.prototype, "overdraftLimit", void 0);
|
|
40
|
+
__decorate([
|
|
41
|
+
(0, typeorm_1.OneToMany)(() => WalletTransactionEntity, (item) => item.wallet),
|
|
42
|
+
__metadata("design:type", Array)
|
|
43
|
+
], WalletEntity.prototype, "transactions", void 0);
|
|
44
|
+
__decorate([
|
|
45
|
+
(0, typeorm_1.OneToMany)(() => WalletExternalBank, (item) => item.wallet),
|
|
46
|
+
__metadata("design:type", Array)
|
|
47
|
+
], WalletEntity.prototype, "walletExternalBanks", void 0);
|
|
48
|
+
exports.WalletEntity = WalletEntity = __decorate([
|
|
49
|
+
(0, typeorm_1.Entity)(base_enum_1.ETableName.wallet)
|
|
50
|
+
], WalletEntity);
|
|
51
|
+
let WalletExternalBank = class WalletExternalBank extends base_entity_1.BaseEntity {
|
|
52
|
+
};
|
|
53
|
+
exports.WalletExternalBank = WalletExternalBank;
|
|
54
|
+
__decorate([
|
|
55
|
+
(0, typeorm_1.Column)({ type: 'nvarchar', length: 20, nullable: true }),
|
|
56
|
+
__metadata("design:type", String)
|
|
57
|
+
], WalletExternalBank.prototype, "code", void 0);
|
|
58
|
+
__decorate([
|
|
59
|
+
(0, typeorm_1.Column)({ type: 'nvarchar', length: 20, nullable: true }),
|
|
60
|
+
__metadata("design:type", String)
|
|
61
|
+
], WalletExternalBank.prototype, "accountNumber", void 0);
|
|
62
|
+
__decorate([
|
|
63
|
+
(0, typeorm_1.Column)({ type: 'nvarchar', length: 20, nullable: true }),
|
|
64
|
+
__metadata("design:type", String)
|
|
65
|
+
], WalletExternalBank.prototype, "sortCode", void 0);
|
|
66
|
+
__decorate([
|
|
67
|
+
(0, typeorm_1.ManyToOne)(() => WalletEntity, (item) => item.walletExternalBanks),
|
|
68
|
+
__metadata("design:type", WalletEntity)
|
|
69
|
+
], WalletExternalBank.prototype, "wallet", void 0);
|
|
70
|
+
exports.WalletExternalBank = WalletExternalBank = __decorate([
|
|
71
|
+
(0, typeorm_1.Entity)(base_enum_1.ETableName.walletExternalBank)
|
|
72
|
+
], WalletExternalBank);
|
|
73
|
+
let WalletTransactionEntity = class WalletTransactionEntity extends base_entity_1.BaseEntity {
|
|
74
|
+
};
|
|
75
|
+
exports.WalletTransactionEntity = WalletTransactionEntity;
|
|
76
|
+
__decorate([
|
|
77
|
+
(0, typeorm_1.Column)({ type: 'double' }),
|
|
78
|
+
__metadata("design:type", Number)
|
|
79
|
+
], WalletTransactionEntity.prototype, "amount", void 0);
|
|
80
|
+
__decorate([
|
|
81
|
+
(0, typeorm_1.Column)({ type: 'double' }),
|
|
82
|
+
__metadata("design:type", Number)
|
|
83
|
+
], WalletTransactionEntity.prototype, "netBalanceBefore", void 0);
|
|
84
|
+
__decorate([
|
|
85
|
+
(0, typeorm_1.Column)({ type: 'double' }),
|
|
86
|
+
__metadata("design:type", Number)
|
|
87
|
+
], WalletTransactionEntity.prototype, "grossBalanceBefore", void 0);
|
|
88
|
+
__decorate([
|
|
89
|
+
(0, typeorm_1.Column)({ type: 'enum', enum: wallet_enum_1.ETransactionType }),
|
|
90
|
+
__metadata("design:type", String)
|
|
91
|
+
], WalletTransactionEntity.prototype, "type", void 0);
|
|
92
|
+
__decorate([
|
|
93
|
+
(0, typeorm_1.Column)({ type: 'enum', enum: wallet_enum_1.ECurrency, default: wallet_enum_1.ECurrency.naira }),
|
|
94
|
+
__metadata("design:type", String)
|
|
95
|
+
], WalletTransactionEntity.prototype, "currency", void 0);
|
|
96
|
+
__decorate([
|
|
97
|
+
(0, typeorm_1.Column)({ type: 'text', nullable: true }),
|
|
98
|
+
__metadata("design:type", String)
|
|
99
|
+
], WalletTransactionEntity.prototype, "reason", void 0);
|
|
100
|
+
__decorate([
|
|
101
|
+
(0, typeorm_1.Column)({ type: 'enum', nullable: false, enum: wallet_enum_1.ETransMethod }),
|
|
102
|
+
__metadata("design:type", String)
|
|
103
|
+
], WalletTransactionEntity.prototype, "transMethod", void 0);
|
|
104
|
+
__decorate([
|
|
105
|
+
(0, typeorm_1.Column)({ type: 'boolean', default: true }),
|
|
106
|
+
__metadata("design:type", Boolean)
|
|
107
|
+
], WalletTransactionEntity.prototype, "isVerified", void 0);
|
|
108
|
+
__decorate([
|
|
109
|
+
(0, typeorm_1.Column)({ type: 'boolean', default: false, nullable: false }),
|
|
110
|
+
__metadata("design:type", Boolean)
|
|
111
|
+
], WalletTransactionEntity.prototype, "isFailed", void 0);
|
|
112
|
+
__decorate([
|
|
113
|
+
(0, typeorm_1.Column)({ type: 'boolean', default: false, nullable: true }),
|
|
114
|
+
__metadata("design:type", Boolean)
|
|
115
|
+
], WalletTransactionEntity.prototype, "isOverdraft", void 0);
|
|
116
|
+
__decorate([
|
|
117
|
+
(0, typeorm_1.Column)({ type: 'text', unique: false }),
|
|
118
|
+
__metadata("design:type", String)
|
|
119
|
+
], WalletTransactionEntity.prototype, "transactionReference", void 0);
|
|
120
|
+
__decorate([
|
|
121
|
+
(0, typeorm_1.Column)({ type: 'text' }),
|
|
122
|
+
__metadata("design:type", String)
|
|
123
|
+
], WalletTransactionEntity.prototype, "userID", void 0);
|
|
124
|
+
__decorate([
|
|
125
|
+
(0, typeorm_1.ManyToOne)(() => WalletEntity, (item) => item.transactions),
|
|
126
|
+
__metadata("design:type", WalletEntity)
|
|
127
|
+
], WalletTransactionEntity.prototype, "wallet", void 0);
|
|
128
|
+
exports.WalletTransactionEntity = WalletTransactionEntity = __decorate([
|
|
129
|
+
(0, typeorm_1.Entity)(base_enum_1.ETableName.walletTransaction)
|
|
130
|
+
], WalletTransactionEntity);
|
|
131
|
+
let WalletBalanceView = class WalletBalanceView extends WalletEntity {
|
|
132
|
+
};
|
|
133
|
+
exports.WalletBalanceView = WalletBalanceView;
|
|
134
|
+
__decorate([
|
|
135
|
+
(0, typeorm_1.ViewColumn)(),
|
|
136
|
+
__metadata("design:type", Number)
|
|
137
|
+
], WalletBalanceView.prototype, "grossBalance", void 0);
|
|
138
|
+
__decorate([
|
|
139
|
+
(0, typeorm_1.ViewColumn)(),
|
|
140
|
+
__metadata("design:type", Number)
|
|
141
|
+
], WalletBalanceView.prototype, "netBalance", void 0);
|
|
142
|
+
__decorate([
|
|
143
|
+
(0, typeorm_1.ViewColumn)(),
|
|
144
|
+
__metadata("design:type", Number)
|
|
145
|
+
], WalletBalanceView.prototype, "grossTotalCredit", void 0);
|
|
146
|
+
__decorate([
|
|
147
|
+
(0, typeorm_1.ViewColumn)(),
|
|
148
|
+
__metadata("design:type", Number)
|
|
149
|
+
], WalletBalanceView.prototype, "grossTotalDebit", void 0);
|
|
150
|
+
__decorate([
|
|
151
|
+
(0, typeorm_1.ViewColumn)(),
|
|
152
|
+
__metadata("design:type", Number)
|
|
153
|
+
], WalletBalanceView.prototype, "netTotalCredit", void 0);
|
|
154
|
+
__decorate([
|
|
155
|
+
(0, typeorm_1.ViewColumn)(),
|
|
156
|
+
__metadata("design:type", Number)
|
|
157
|
+
], WalletBalanceView.prototype, "netTotalDebit", void 0);
|
|
158
|
+
exports.WalletBalanceView = WalletBalanceView = __decorate([
|
|
159
|
+
(0, typeorm_1.ViewEntity)({
|
|
160
|
+
expression: `
|
|
161
|
+
SELECT temp.*,
|
|
162
|
+
temp.grossTotalCredit - temp.grossTotalDebit AS grossBalance,
|
|
163
|
+
temp.netTotalCredit - temp.netTotalDebit AS netBalance
|
|
164
|
+
FROM (SELECT wallet.*,
|
|
165
|
+
Sum(CASE
|
|
166
|
+
WHEN wallet_transaction.type = 'CREDIT'
|
|
167
|
+
AND wallet_transaction.isFailed = 0 THEN
|
|
168
|
+
wallet_transaction.amount
|
|
169
|
+
ELSE 0
|
|
170
|
+
end) AS grossTotalCredit,
|
|
171
|
+
Sum(CASE
|
|
172
|
+
WHEN wallet_transaction.type = 'DEBIT'
|
|
173
|
+
AND wallet_transaction.isFailed = 0 THEN
|
|
174
|
+
wallet_transaction.amount
|
|
175
|
+
ELSE 0
|
|
176
|
+
end) AS grossTotalDebit,
|
|
177
|
+
Sum(CASE
|
|
178
|
+
WHEN wallet_transaction.type = 'CREDIT'
|
|
179
|
+
AND wallet_transaction.isFailed = 0
|
|
180
|
+
AND wallet_transaction.isVerified = 1 THEN
|
|
181
|
+
wallet_transaction.amount
|
|
182
|
+
ELSE 0
|
|
183
|
+
end) AS netTotalCredit,
|
|
184
|
+
Sum(CASE
|
|
185
|
+
WHEN wallet_transaction.type = 'DEBIT'
|
|
186
|
+
AND wallet_transaction.isFailed = 0
|
|
187
|
+
AND wallet_transaction.isVerified = 1 THEN
|
|
188
|
+
wallet_transaction.amount
|
|
189
|
+
ELSE 0
|
|
190
|
+
end) AS netTotalDebit
|
|
191
|
+
FROM wallet
|
|
192
|
+
LEFT JOIN wallet_transaction
|
|
193
|
+
ON wallet.id = wallet_transaction.walletId
|
|
194
|
+
GROUP BY wallet.id) AS temp;
|
|
195
|
+
`,
|
|
196
|
+
})
|
|
197
|
+
], WalletBalanceView);
|
|
198
|
+
exports.WalletEntities = [
|
|
199
|
+
WalletEntity,
|
|
200
|
+
WalletTransactionEntity,
|
|
201
|
+
WalletBalanceView,
|
|
202
|
+
WalletExternalBank,
|
|
203
|
+
];
|
|
204
|
+
//# sourceMappingURL=wallet.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wallet.entity.js","sourceRoot":"","sources":["../../../../../../libs/la-library/src/modules/wallet/wallet.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAOiB;AACjB,qDAAmD;AACnD,4DAAwD;AACxD,+CAA0E;AAGnE,IAAM,YAAY,GAAlB,MAAM,YAAa,SAAQ,wBAAwB;CAqBzD,CAAA;AArBY,oCAAY;AAEvB;IADC,IAAA,gBAAM,GAAE;;0CACK;AAGd;IADC,IAAA,gBAAM,GAAE;;4CACM;AAGf;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC;;0CAC/B;AAGX;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;;oDACpB;AAGxB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,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E,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC;8BACnD,YAAY;uDAAC;kCAtCV,uBAAuB;IADnC,IAAA,gBAAM,EAAC,sBAAU,CAAC,iBAAiB,CAAC;GACxB,uBAAuB,CAuCnC;AAwCM,IAAM,iBAAiB,GAAvB,MAAM,iBAAkB,SAAQ,YAAY;CAkBlD,CAAA;AAlBY,8CAAiB;AAE5B;IADC,IAAA,oBAAU,GAAE;;uDACQ;AAGrB;IADC,IAAA,oBAAU,GAAE;;qDACM;AAGnB;IADC,IAAA,oBAAU,GAAE;;2DACY;AAGzB;IADC,IAAA,oBAAU,GAAE;;0DACW;AAGxB;IADC,IAAA,oBAAU,GAAE;;yDACU;AAGvB;IADC,IAAA,oBAAU,GAAE;;wDACS;4BAjBX,iBAAiB;IAtC7B,IAAA,oBAAU,EAAC;QACV,UAAU,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCX;KACF,CAAC;GACW,iBAAiB,CAkB7B;AAEY,QAAA,cAAc,GAAG;IAC5B,YAAY;IACZ,uBAAuB;IACvB,iBAAiB;IAEjB,kBAAkB;CACnB,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare enum ETransactionType {
|
|
2
|
+
debit = "DEBIT",
|
|
3
|
+
credit = "CREDIT"
|
|
4
|
+
}
|
|
5
|
+
export declare enum ECurrency {
|
|
6
|
+
naira = "NGN"
|
|
7
|
+
}
|
|
8
|
+
export declare enum ETransMethod {
|
|
9
|
+
test = "Test",
|
|
10
|
+
manual = "Manual",
|
|
11
|
+
fincra = "Fincra",
|
|
12
|
+
paystack = "Paystack"
|
|
13
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ETransMethod = exports.ECurrency = exports.ETransactionType = void 0;
|
|
4
|
+
var ETransactionType;
|
|
5
|
+
(function (ETransactionType) {
|
|
6
|
+
ETransactionType["debit"] = "DEBIT";
|
|
7
|
+
ETransactionType["credit"] = "CREDIT";
|
|
8
|
+
})(ETransactionType || (exports.ETransactionType = ETransactionType = {}));
|
|
9
|
+
var ECurrency;
|
|
10
|
+
(function (ECurrency) {
|
|
11
|
+
ECurrency["naira"] = "NGN";
|
|
12
|
+
})(ECurrency || (exports.ECurrency = ECurrency = {}));
|
|
13
|
+
var ETransMethod;
|
|
14
|
+
(function (ETransMethod) {
|
|
15
|
+
ETransMethod["test"] = "Test";
|
|
16
|
+
ETransMethod["manual"] = "Manual";
|
|
17
|
+
ETransMethod["fincra"] = "Fincra";
|
|
18
|
+
ETransMethod["paystack"] = "Paystack";
|
|
19
|
+
})(ETransMethod || (exports.ETransMethod = ETransMethod = {}));
|
|
20
|
+
//# sourceMappingURL=wallet.enum.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wallet.enum.js","sourceRoot":"","sources":["../../../../../../libs/la-library/src/modules/wallet/wallet.enum.ts"],"names":[],"mappings":";;;AAAA,IAAY,gBAGX;AAHD,WAAY,gBAAgB;IAC1B,mCAAe,CAAA;IACf,qCAAiB,CAAA;AACnB,CAAC,EAHW,gBAAgB,gCAAhB,gBAAgB,QAG3B;AAED,IAAY,SAEX;AAFD,WAAY,SAAS;IACnB,0BAAa,CAAA;AACf,CAAC,EAFW,SAAS,yBAAT,SAAS,QAEpB;AAED,IAAY,YAKX;AALD,WAAY,YAAY;IACtB,6BAAa,CAAA;IACb,iCAAiB,CAAA;IACjB,iCAAiB,CAAA;IACjB,qCAAqB,CAAA;AACvB,CAAC,EALW,YAAY,4BAAZ,YAAY,QAKvB"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { WalletController } from './wallet.controller';
|
|
2
|
+
import { WalletService } from './wallet.service';
|
|
3
|
+
import { BaseModule } from '../base.module';
|
|
4
|
+
import { WalletTransactionService } from './wallet-transaction.service';
|
|
5
|
+
import { WalletTransactionController } from './wallet-transaction.controller';
|
|
6
|
+
export declare class WalletModule extends BaseModule {
|
|
7
|
+
static entities: (typeof import("./wallet.entity").WalletEntity | typeof import("./wallet.entity").WalletTransactionEntity | typeof import("./wallet.entity").WalletExternalBank)[];
|
|
8
|
+
static services: (typeof WalletService | typeof WalletTransactionService)[];
|
|
9
|
+
static controllers: (typeof WalletController | typeof WalletTransactionController)[];
|
|
10
|
+
}
|