@budgetbuddyde/api 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +366 -0
- package/lib/api.d.ts +17 -0
- package/lib/api.js +22 -0
- package/lib/budget.d.ts +3 -0
- package/lib/budget.js +19 -0
- package/lib/category.d.ts +3 -0
- package/lib/category.js +19 -0
- package/lib/error.d.ts +33 -0
- package/lib/error.js +55 -0
- package/lib/index.d.ts +6 -0
- package/lib/index.js +22 -0
- package/lib/paymentMethod.d.ts +3 -0
- package/lib/paymentMethod.js +19 -0
- package/lib/recurringPayment.d.ts +4 -0
- package/lib/recurringPayment.js +20 -0
- package/lib/services/budget.service.d.ts +8 -0
- package/lib/services/budget.service.js +43 -0
- package/lib/services/category.service.d.ts +24 -0
- package/lib/services/category.service.js +98 -0
- package/lib/services/entity.service.d.ts +31 -0
- package/lib/services/entity.service.js +185 -0
- package/lib/services/paymentMethod.service.d.ts +15 -0
- package/lib/services/paymentMethod.service.js +64 -0
- package/lib/services/recurringPayment.service.d.ts +43 -0
- package/lib/services/recurringPayment.service.js +26 -0
- package/lib/services/transaction.service.d.ts +43 -0
- package/lib/services/transaction.service.js +46 -0
- package/lib/transaction.d.ts +4 -0
- package/lib/transaction.js +20 -0
- package/lib/types/budget.type.d.ts +5 -0
- package/lib/types/budget.type.js +2 -0
- package/lib/types/category.type.d.ts +6 -0
- package/lib/types/category.type.js +2 -0
- package/lib/types/common.d.ts +15 -0
- package/lib/types/common.js +2 -0
- package/lib/types/index.d.ts +6 -0
- package/lib/types/index.js +22 -0
- package/lib/types/interfaces/index.d.ts +3 -0
- package/lib/types/interfaces/index.js +19 -0
- package/lib/types/interfaces/query.interface.d.ts +14 -0
- package/lib/types/interfaces/query.interface.js +2 -0
- package/lib/types/interfaces/recurringPayment.interface.d.ts +5 -0
- package/lib/types/interfaces/recurringPayment.interface.js +2 -0
- package/lib/types/interfaces/transaction.interface.d.ts +5 -0
- package/lib/types/interfaces/transaction.interface.js +2 -0
- package/lib/types/paymentMethod.type.d.ts +5 -0
- package/lib/types/paymentMethod.type.js +2 -0
- package/lib/types/recurringPayment.type.d.ts +5 -0
- package/lib/types/recurringPayment.type.js +2 -0
- package/lib/types/schemas/budget.schema.d.ts +228 -0
- package/lib/types/schemas/budget.schema.js +77 -0
- package/lib/types/schemas/category.schema.d.ts +160 -0
- package/lib/types/schemas/category.schema.js +69 -0
- package/lib/types/schemas/common.schema.d.ts +25 -0
- package/lib/types/schemas/common.schema.js +27 -0
- package/lib/types/schemas/index.d.ts +6 -0
- package/lib/types/schemas/index.js +22 -0
- package/lib/types/schemas/paymentMethod.schema.d.ts +138 -0
- package/lib/types/schemas/paymentMethod.schema.js +59 -0
- package/lib/types/schemas/recurringPayment.schema.d.ts +199 -0
- package/lib/types/schemas/recurringPayment.schema.js +62 -0
- package/lib/types/schemas/transaction.schema.d.ts +207 -0
- package/lib/types/schemas/transaction.schema.js +76 -0
- package/lib/types/transaction.type.d.ts +6 -0
- package/lib/types/transaction.type.js +2 -0
- package/package.json +144 -0
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.MergeCategoriesResponse = exports.CategoryStatsResponse = exports.DeleteCategoryResponse = exports.UpdateCategoryResponse = exports.CreateCategoryResponse = exports.GetCategoryResponse = exports.GetAllCategoriesResponse = exports.CategoryStats = exports.CategoryVH = exports.CreateOrUpdateCategoryPayload = exports.Category = void 0;
|
|
7
|
+
const zod_1 = __importDefault(require("zod"));
|
|
8
|
+
const common_schema_1 = require("./common.schema");
|
|
9
|
+
exports.Category = zod_1.default.object({
|
|
10
|
+
id: zod_1.default.uuid().brand("CategoryID"),
|
|
11
|
+
ownerId: common_schema_1.UserID,
|
|
12
|
+
name: zod_1.default.string(),
|
|
13
|
+
description: zod_1.default.string().nullable(),
|
|
14
|
+
createdAt: zod_1.default.iso.datetime(),
|
|
15
|
+
updatedAt: zod_1.default.iso.datetime(),
|
|
16
|
+
});
|
|
17
|
+
// export const CreateCategoryPayload = Category.pick({
|
|
18
|
+
// name: true,
|
|
19
|
+
// description: true,
|
|
20
|
+
// });
|
|
21
|
+
// export const UpdateCategoryPayload = z.object({
|
|
22
|
+
// name: Category.shape.name.optional(),
|
|
23
|
+
// description: Category.shape.description.optional(),
|
|
24
|
+
// });
|
|
25
|
+
exports.CreateOrUpdateCategoryPayload = exports.Category.pick({
|
|
26
|
+
name: true,
|
|
27
|
+
description: true,
|
|
28
|
+
}).extend({
|
|
29
|
+
description: exports.Category.shape.description.optional(),
|
|
30
|
+
});
|
|
31
|
+
exports.CategoryVH = exports.Category.pick({
|
|
32
|
+
id: true,
|
|
33
|
+
name: true,
|
|
34
|
+
description: true,
|
|
35
|
+
});
|
|
36
|
+
exports.CategoryStats = zod_1.default.object({
|
|
37
|
+
from: zod_1.default.coerce.date(),
|
|
38
|
+
to: zod_1.default.coerce.date(),
|
|
39
|
+
stats: zod_1.default.array(zod_1.default.object({
|
|
40
|
+
balance: zod_1.default.number(),
|
|
41
|
+
income: zod_1.default.number(),
|
|
42
|
+
expenses: zod_1.default.number(),
|
|
43
|
+
category: exports.Category.pick({
|
|
44
|
+
id: true,
|
|
45
|
+
name: true,
|
|
46
|
+
description: true,
|
|
47
|
+
}),
|
|
48
|
+
})),
|
|
49
|
+
});
|
|
50
|
+
exports.GetAllCategoriesResponse = common_schema_1.ApiResponse.extend({
|
|
51
|
+
data: zod_1.default.array(exports.Category).nullable(),
|
|
52
|
+
});
|
|
53
|
+
exports.GetCategoryResponse = common_schema_1.ApiResponse.extend({
|
|
54
|
+
data: exports.Category.nullable(),
|
|
55
|
+
});
|
|
56
|
+
exports.CreateCategoryResponse = common_schema_1.ApiResponse.extend({
|
|
57
|
+
data: zod_1.default.array(exports.Category).nullable(),
|
|
58
|
+
});
|
|
59
|
+
exports.UpdateCategoryResponse = exports.CreateCategoryResponse;
|
|
60
|
+
exports.DeleteCategoryResponse = exports.CreateCategoryResponse;
|
|
61
|
+
exports.CategoryStatsResponse = common_schema_1.ApiResponse.extend({
|
|
62
|
+
data: exports.CategoryStats,
|
|
63
|
+
});
|
|
64
|
+
exports.MergeCategoriesResponse = common_schema_1.ApiResponse.extend({
|
|
65
|
+
data: zod_1.default.object({
|
|
66
|
+
source: zod_1.default.array(exports.Category.shape.id).transform((ids) => new Set(ids)),
|
|
67
|
+
target: exports.Category.shape.id,
|
|
68
|
+
}),
|
|
69
|
+
});
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import z from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* Type helper to create branded UserID strings.
|
|
4
|
+
*/
|
|
5
|
+
export declare const UserID: z.core.$ZodBranded<z.ZodString, "UserID">;
|
|
6
|
+
/**
|
|
7
|
+
* In order to use this schema, extend it and add the `data` field with the appropriate type.
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* const GetUserResponse = ApiResponse.extend({
|
|
11
|
+
* data: z.string(),
|
|
12
|
+
* });
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
export declare const ApiResponse: z.ZodObject<{
|
|
16
|
+
status: z.ZodNumber;
|
|
17
|
+
message: z.ZodOptional<z.ZodString>;
|
|
18
|
+
data: z.ZodOptional<z.ZodAny>;
|
|
19
|
+
totalCount: z.ZodOptional<z.ZodNumber>;
|
|
20
|
+
from: z.ZodOptional<z.ZodEnum<{
|
|
21
|
+
db: "db";
|
|
22
|
+
cache: "cache";
|
|
23
|
+
external: "external";
|
|
24
|
+
}>>;
|
|
25
|
+
}, z.core.$strip>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ApiResponse = exports.UserID = void 0;
|
|
7
|
+
const zod_1 = __importDefault(require("zod"));
|
|
8
|
+
/**
|
|
9
|
+
* Type helper to create branded UserID strings.
|
|
10
|
+
*/
|
|
11
|
+
exports.UserID = zod_1.default.string().brand("UserID");
|
|
12
|
+
/**
|
|
13
|
+
* In order to use this schema, extend it and add the `data` field with the appropriate type.
|
|
14
|
+
* @example
|
|
15
|
+
* ```ts
|
|
16
|
+
* const GetUserResponse = ApiResponse.extend({
|
|
17
|
+
* data: z.string(),
|
|
18
|
+
* });
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
exports.ApiResponse = zod_1.default.object({
|
|
22
|
+
status: zod_1.default.number(),
|
|
23
|
+
message: zod_1.default.string().optional(),
|
|
24
|
+
data: zod_1.default.any().optional(),
|
|
25
|
+
totalCount: zod_1.default.number().optional(),
|
|
26
|
+
from: zod_1.default.enum(["db", "cache", "external"]).optional(),
|
|
27
|
+
});
|
|
@@ -0,0 +1,22 @@
|
|
|
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("./budget.schema"), exports);
|
|
18
|
+
__exportStar(require("./category.schema"), exports);
|
|
19
|
+
__exportStar(require("./common.schema"), exports);
|
|
20
|
+
__exportStar(require("./paymentMethod.schema"), exports);
|
|
21
|
+
__exportStar(require("./recurringPayment.schema"), exports);
|
|
22
|
+
__exportStar(require("./transaction.schema"), exports);
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const PaymentMethod: z.ZodObject<{
|
|
3
|
+
id: z.core.$ZodBranded<z.ZodUUID, "PaymentMethodID">;
|
|
4
|
+
ownerId: z.core.$ZodBranded<z.ZodString, "UserID">;
|
|
5
|
+
name: z.ZodString;
|
|
6
|
+
provider: z.ZodString;
|
|
7
|
+
address: z.ZodString;
|
|
8
|
+
description: z.ZodNullable<z.ZodString>;
|
|
9
|
+
createdAt: z.ZodISODateTime;
|
|
10
|
+
updatedAt: z.ZodISODateTime;
|
|
11
|
+
}, z.core.$strip>;
|
|
12
|
+
export declare const CreateOrUpdatePaymentMethodPayload: z.ZodObject<{
|
|
13
|
+
name: z.ZodString;
|
|
14
|
+
provider: z.ZodString;
|
|
15
|
+
address: z.ZodString;
|
|
16
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
17
|
+
}, z.core.$strip>;
|
|
18
|
+
export declare const PaymentMethodVH: z.ZodObject<{
|
|
19
|
+
id: z.core.$ZodBranded<z.ZodUUID, "PaymentMethodID">;
|
|
20
|
+
description: z.ZodNullable<z.ZodString>;
|
|
21
|
+
name: z.ZodString;
|
|
22
|
+
provider: z.ZodString;
|
|
23
|
+
address: z.ZodString;
|
|
24
|
+
}, z.core.$strip>;
|
|
25
|
+
export declare const GetAllPaymentMethodsResponse: z.ZodObject<{
|
|
26
|
+
status: z.ZodNumber;
|
|
27
|
+
message: z.ZodOptional<z.ZodString>;
|
|
28
|
+
totalCount: z.ZodOptional<z.ZodNumber>;
|
|
29
|
+
from: z.ZodOptional<z.ZodEnum<{
|
|
30
|
+
db: "db";
|
|
31
|
+
cache: "cache";
|
|
32
|
+
external: "external";
|
|
33
|
+
}>>;
|
|
34
|
+
data: z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
35
|
+
id: z.core.$ZodBranded<z.ZodUUID, "PaymentMethodID">;
|
|
36
|
+
ownerId: z.core.$ZodBranded<z.ZodString, "UserID">;
|
|
37
|
+
name: z.ZodString;
|
|
38
|
+
provider: z.ZodString;
|
|
39
|
+
address: z.ZodString;
|
|
40
|
+
description: z.ZodNullable<z.ZodString>;
|
|
41
|
+
createdAt: z.ZodISODateTime;
|
|
42
|
+
updatedAt: z.ZodISODateTime;
|
|
43
|
+
}, z.core.$strip>>>;
|
|
44
|
+
}, z.core.$strip>;
|
|
45
|
+
export declare const GetPaymentMethodResponse: z.ZodObject<{
|
|
46
|
+
status: z.ZodNumber;
|
|
47
|
+
message: z.ZodOptional<z.ZodString>;
|
|
48
|
+
totalCount: z.ZodOptional<z.ZodNumber>;
|
|
49
|
+
from: z.ZodOptional<z.ZodEnum<{
|
|
50
|
+
db: "db";
|
|
51
|
+
cache: "cache";
|
|
52
|
+
external: "external";
|
|
53
|
+
}>>;
|
|
54
|
+
data: z.ZodNullable<z.ZodObject<{
|
|
55
|
+
id: z.core.$ZodBranded<z.ZodUUID, "PaymentMethodID">;
|
|
56
|
+
ownerId: z.core.$ZodBranded<z.ZodString, "UserID">;
|
|
57
|
+
name: z.ZodString;
|
|
58
|
+
provider: z.ZodString;
|
|
59
|
+
address: z.ZodString;
|
|
60
|
+
description: z.ZodNullable<z.ZodString>;
|
|
61
|
+
createdAt: z.ZodISODateTime;
|
|
62
|
+
updatedAt: z.ZodISODateTime;
|
|
63
|
+
}, z.core.$strip>>;
|
|
64
|
+
}, z.core.$strip>;
|
|
65
|
+
export declare const CreatePaymentMethodResponse: z.ZodObject<{
|
|
66
|
+
status: z.ZodNumber;
|
|
67
|
+
message: z.ZodOptional<z.ZodString>;
|
|
68
|
+
totalCount: z.ZodOptional<z.ZodNumber>;
|
|
69
|
+
from: z.ZodOptional<z.ZodEnum<{
|
|
70
|
+
db: "db";
|
|
71
|
+
cache: "cache";
|
|
72
|
+
external: "external";
|
|
73
|
+
}>>;
|
|
74
|
+
data: z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
75
|
+
id: z.core.$ZodBranded<z.ZodUUID, "PaymentMethodID">;
|
|
76
|
+
ownerId: z.core.$ZodBranded<z.ZodString, "UserID">;
|
|
77
|
+
name: z.ZodString;
|
|
78
|
+
provider: z.ZodString;
|
|
79
|
+
address: z.ZodString;
|
|
80
|
+
description: z.ZodNullable<z.ZodString>;
|
|
81
|
+
createdAt: z.ZodISODateTime;
|
|
82
|
+
updatedAt: z.ZodISODateTime;
|
|
83
|
+
}, z.core.$strip>>>;
|
|
84
|
+
}, z.core.$strip>;
|
|
85
|
+
export declare const UpdatePaymentMethodResponse: z.ZodObject<{
|
|
86
|
+
status: z.ZodNumber;
|
|
87
|
+
message: z.ZodOptional<z.ZodString>;
|
|
88
|
+
totalCount: z.ZodOptional<z.ZodNumber>;
|
|
89
|
+
from: z.ZodOptional<z.ZodEnum<{
|
|
90
|
+
db: "db";
|
|
91
|
+
cache: "cache";
|
|
92
|
+
external: "external";
|
|
93
|
+
}>>;
|
|
94
|
+
data: z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
95
|
+
id: z.core.$ZodBranded<z.ZodUUID, "PaymentMethodID">;
|
|
96
|
+
ownerId: z.core.$ZodBranded<z.ZodString, "UserID">;
|
|
97
|
+
name: z.ZodString;
|
|
98
|
+
provider: z.ZodString;
|
|
99
|
+
address: z.ZodString;
|
|
100
|
+
description: z.ZodNullable<z.ZodString>;
|
|
101
|
+
createdAt: z.ZodISODateTime;
|
|
102
|
+
updatedAt: z.ZodISODateTime;
|
|
103
|
+
}, z.core.$strip>>>;
|
|
104
|
+
}, z.core.$strip>;
|
|
105
|
+
export declare const DeletePaymentMethodResponse: z.ZodObject<{
|
|
106
|
+
status: z.ZodNumber;
|
|
107
|
+
message: z.ZodOptional<z.ZodString>;
|
|
108
|
+
totalCount: z.ZodOptional<z.ZodNumber>;
|
|
109
|
+
from: z.ZodOptional<z.ZodEnum<{
|
|
110
|
+
db: "db";
|
|
111
|
+
cache: "cache";
|
|
112
|
+
external: "external";
|
|
113
|
+
}>>;
|
|
114
|
+
data: z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
115
|
+
id: z.core.$ZodBranded<z.ZodUUID, "PaymentMethodID">;
|
|
116
|
+
ownerId: z.core.$ZodBranded<z.ZodString, "UserID">;
|
|
117
|
+
name: z.ZodString;
|
|
118
|
+
provider: z.ZodString;
|
|
119
|
+
address: z.ZodString;
|
|
120
|
+
description: z.ZodNullable<z.ZodString>;
|
|
121
|
+
createdAt: z.ZodISODateTime;
|
|
122
|
+
updatedAt: z.ZodISODateTime;
|
|
123
|
+
}, z.core.$strip>>>;
|
|
124
|
+
}, z.core.$strip>;
|
|
125
|
+
export declare const MergePaymentMethodsResponse: z.ZodObject<{
|
|
126
|
+
status: z.ZodNumber;
|
|
127
|
+
message: z.ZodOptional<z.ZodString>;
|
|
128
|
+
totalCount: z.ZodOptional<z.ZodNumber>;
|
|
129
|
+
from: z.ZodOptional<z.ZodEnum<{
|
|
130
|
+
db: "db";
|
|
131
|
+
cache: "cache";
|
|
132
|
+
external: "external";
|
|
133
|
+
}>>;
|
|
134
|
+
data: z.ZodObject<{
|
|
135
|
+
source: z.ZodPipe<z.ZodArray<z.core.$ZodBranded<z.ZodUUID, "PaymentMethodID">>, z.ZodTransform<Set<string & z.core.$brand<"PaymentMethodID">>, (string & z.core.$brand<"PaymentMethodID">)[]>>;
|
|
136
|
+
target: z.core.$ZodBranded<z.ZodUUID, "PaymentMethodID">;
|
|
137
|
+
}, z.core.$strip>;
|
|
138
|
+
}, z.core.$strip>;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MergePaymentMethodsResponse = exports.DeletePaymentMethodResponse = exports.UpdatePaymentMethodResponse = exports.CreatePaymentMethodResponse = exports.GetPaymentMethodResponse = exports.GetAllPaymentMethodsResponse = exports.PaymentMethodVH = exports.CreateOrUpdatePaymentMethodPayload = exports.PaymentMethod = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const common_schema_1 = require("./common.schema");
|
|
6
|
+
exports.PaymentMethod = zod_1.z.object({
|
|
7
|
+
id: zod_1.z.uuid().brand("PaymentMethodID"),
|
|
8
|
+
ownerId: common_schema_1.UserID,
|
|
9
|
+
name: zod_1.z.string(),
|
|
10
|
+
provider: zod_1.z.string().nonempty().min(1).max(100),
|
|
11
|
+
address: zod_1.z.string().nonempty().min(1).max(100),
|
|
12
|
+
description: zod_1.z.string().nullable(),
|
|
13
|
+
createdAt: zod_1.z.iso.datetime(),
|
|
14
|
+
updatedAt: zod_1.z.iso.datetime(),
|
|
15
|
+
});
|
|
16
|
+
// export const CreatePaymentMethodPayload = PaymentMethod.pick({
|
|
17
|
+
// name: true,
|
|
18
|
+
// provider: true,
|
|
19
|
+
// address: true,
|
|
20
|
+
// description: true,
|
|
21
|
+
// });
|
|
22
|
+
// export const UpdatePaymentMethodPayload = z.object({
|
|
23
|
+
// name: PaymentMethod.shape.name.optional(),
|
|
24
|
+
// provider: PaymentMethod.shape.provider.optional(),
|
|
25
|
+
// address: PaymentMethod.shape.address.optional(),
|
|
26
|
+
// description: PaymentMethod.shape.description.optional(),
|
|
27
|
+
// });
|
|
28
|
+
exports.CreateOrUpdatePaymentMethodPayload = exports.PaymentMethod.pick({
|
|
29
|
+
name: true,
|
|
30
|
+
provider: true,
|
|
31
|
+
address: true,
|
|
32
|
+
description: true,
|
|
33
|
+
}).extend({
|
|
34
|
+
description: exports.PaymentMethod.shape.description.optional(),
|
|
35
|
+
});
|
|
36
|
+
exports.PaymentMethodVH = exports.PaymentMethod.pick({
|
|
37
|
+
id: true,
|
|
38
|
+
name: true,
|
|
39
|
+
address: true,
|
|
40
|
+
provider: true,
|
|
41
|
+
description: true,
|
|
42
|
+
});
|
|
43
|
+
exports.GetAllPaymentMethodsResponse = common_schema_1.ApiResponse.extend({
|
|
44
|
+
data: zod_1.z.array(exports.PaymentMethod).nullable(),
|
|
45
|
+
});
|
|
46
|
+
exports.GetPaymentMethodResponse = common_schema_1.ApiResponse.extend({
|
|
47
|
+
data: exports.PaymentMethod.nullable(),
|
|
48
|
+
});
|
|
49
|
+
exports.CreatePaymentMethodResponse = common_schema_1.ApiResponse.extend({
|
|
50
|
+
data: zod_1.z.array(exports.PaymentMethod).nullable(),
|
|
51
|
+
});
|
|
52
|
+
exports.UpdatePaymentMethodResponse = exports.CreatePaymentMethodResponse;
|
|
53
|
+
exports.DeletePaymentMethodResponse = exports.CreatePaymentMethodResponse;
|
|
54
|
+
exports.MergePaymentMethodsResponse = common_schema_1.ApiResponse.extend({
|
|
55
|
+
data: zod_1.z.object({
|
|
56
|
+
source: zod_1.z.array(exports.PaymentMethod.shape.id).transform((ids) => new Set(ids)),
|
|
57
|
+
target: exports.PaymentMethod.shape.id,
|
|
58
|
+
}),
|
|
59
|
+
});
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const RecurringPayment: z.ZodObject<{
|
|
3
|
+
id: z.core.$ZodBranded<z.ZodUUID, "TransactionID">;
|
|
4
|
+
ownerId: z.core.$ZodBranded<z.ZodString, "UserID">;
|
|
5
|
+
createdAt: z.ZodISODateTime;
|
|
6
|
+
updatedAt: z.ZodISODateTime;
|
|
7
|
+
categoryId: z.core.$ZodBranded<z.ZodUUID, "CategoryID">;
|
|
8
|
+
paymentMethodId: z.core.$ZodBranded<z.ZodUUID, "PaymentMethodID">;
|
|
9
|
+
receiver: z.ZodString;
|
|
10
|
+
transferAmount: z.ZodNumber;
|
|
11
|
+
information: z.ZodNullable<z.ZodString>;
|
|
12
|
+
paused: z.ZodDefault<z.ZodBoolean>;
|
|
13
|
+
executeAt: z.ZodNumber;
|
|
14
|
+
}, z.core.$strip>;
|
|
15
|
+
export declare const ExpandedRecurringPayment: z.ZodObject<{
|
|
16
|
+
id: z.core.$ZodBranded<z.ZodUUID, "TransactionID">;
|
|
17
|
+
ownerId: z.core.$ZodBranded<z.ZodString, "UserID">;
|
|
18
|
+
createdAt: z.ZodISODateTime;
|
|
19
|
+
updatedAt: z.ZodISODateTime;
|
|
20
|
+
category: z.ZodObject<{
|
|
21
|
+
id: z.core.$ZodBranded<z.ZodUUID, "CategoryID">;
|
|
22
|
+
ownerId: z.core.$ZodBranded<z.ZodString, "UserID">;
|
|
23
|
+
name: z.ZodString;
|
|
24
|
+
description: z.ZodNullable<z.ZodString>;
|
|
25
|
+
createdAt: z.ZodISODateTime;
|
|
26
|
+
updatedAt: z.ZodISODateTime;
|
|
27
|
+
}, z.core.$strip>;
|
|
28
|
+
receiver: z.ZodString;
|
|
29
|
+
transferAmount: z.ZodNumber;
|
|
30
|
+
information: z.ZodNullable<z.ZodString>;
|
|
31
|
+
paymentMethod: z.ZodObject<{
|
|
32
|
+
id: z.core.$ZodBranded<z.ZodUUID, "PaymentMethodID">;
|
|
33
|
+
ownerId: z.core.$ZodBranded<z.ZodString, "UserID">;
|
|
34
|
+
name: z.ZodString;
|
|
35
|
+
provider: z.ZodString;
|
|
36
|
+
address: z.ZodString;
|
|
37
|
+
description: z.ZodNullable<z.ZodString>;
|
|
38
|
+
createdAt: z.ZodISODateTime;
|
|
39
|
+
updatedAt: z.ZodISODateTime;
|
|
40
|
+
}, z.core.$strip>;
|
|
41
|
+
paused: z.ZodDefault<z.ZodBoolean>;
|
|
42
|
+
executeAt: z.ZodNumber;
|
|
43
|
+
}, z.core.$strip>;
|
|
44
|
+
export declare const CreateOrUpdateRecurringPaymentPayload: z.ZodObject<{
|
|
45
|
+
categoryId: z.core.$ZodBranded<z.ZodUUID, "CategoryID">;
|
|
46
|
+
paymentMethodId: z.core.$ZodBranded<z.ZodUUID, "PaymentMethodID">;
|
|
47
|
+
receiver: z.ZodString;
|
|
48
|
+
transferAmount: z.ZodNumber;
|
|
49
|
+
paused: z.ZodDefault<z.ZodBoolean>;
|
|
50
|
+
executeAt: z.ZodNumber;
|
|
51
|
+
information: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
52
|
+
}, z.core.$strip>;
|
|
53
|
+
export declare const GetAllRecurringPaymentsResponse: z.ZodObject<{
|
|
54
|
+
status: z.ZodNumber;
|
|
55
|
+
message: z.ZodOptional<z.ZodString>;
|
|
56
|
+
totalCount: z.ZodOptional<z.ZodNumber>;
|
|
57
|
+
from: z.ZodOptional<z.ZodEnum<{
|
|
58
|
+
db: "db";
|
|
59
|
+
cache: "cache";
|
|
60
|
+
external: "external";
|
|
61
|
+
}>>;
|
|
62
|
+
data: z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
63
|
+
id: z.core.$ZodBranded<z.ZodUUID, "TransactionID">;
|
|
64
|
+
ownerId: z.core.$ZodBranded<z.ZodString, "UserID">;
|
|
65
|
+
createdAt: z.ZodISODateTime;
|
|
66
|
+
updatedAt: z.ZodISODateTime;
|
|
67
|
+
category: z.ZodObject<{
|
|
68
|
+
id: z.core.$ZodBranded<z.ZodUUID, "CategoryID">;
|
|
69
|
+
ownerId: z.core.$ZodBranded<z.ZodString, "UserID">;
|
|
70
|
+
name: z.ZodString;
|
|
71
|
+
description: z.ZodNullable<z.ZodString>;
|
|
72
|
+
createdAt: z.ZodISODateTime;
|
|
73
|
+
updatedAt: z.ZodISODateTime;
|
|
74
|
+
}, z.core.$strip>;
|
|
75
|
+
receiver: z.ZodString;
|
|
76
|
+
transferAmount: z.ZodNumber;
|
|
77
|
+
information: z.ZodNullable<z.ZodString>;
|
|
78
|
+
paymentMethod: z.ZodObject<{
|
|
79
|
+
id: z.core.$ZodBranded<z.ZodUUID, "PaymentMethodID">;
|
|
80
|
+
ownerId: z.core.$ZodBranded<z.ZodString, "UserID">;
|
|
81
|
+
name: z.ZodString;
|
|
82
|
+
provider: z.ZodString;
|
|
83
|
+
address: z.ZodString;
|
|
84
|
+
description: z.ZodNullable<z.ZodString>;
|
|
85
|
+
createdAt: z.ZodISODateTime;
|
|
86
|
+
updatedAt: z.ZodISODateTime;
|
|
87
|
+
}, z.core.$strip>;
|
|
88
|
+
paused: z.ZodDefault<z.ZodBoolean>;
|
|
89
|
+
executeAt: z.ZodNumber;
|
|
90
|
+
}, z.core.$strip>>>;
|
|
91
|
+
}, z.core.$strip>;
|
|
92
|
+
export declare const GetRecurringPaymentResponse: z.ZodObject<{
|
|
93
|
+
status: z.ZodNumber;
|
|
94
|
+
message: z.ZodOptional<z.ZodString>;
|
|
95
|
+
totalCount: z.ZodOptional<z.ZodNumber>;
|
|
96
|
+
from: z.ZodOptional<z.ZodEnum<{
|
|
97
|
+
db: "db";
|
|
98
|
+
cache: "cache";
|
|
99
|
+
external: "external";
|
|
100
|
+
}>>;
|
|
101
|
+
data: z.ZodNullable<z.ZodObject<{
|
|
102
|
+
id: z.core.$ZodBranded<z.ZodUUID, "TransactionID">;
|
|
103
|
+
ownerId: z.core.$ZodBranded<z.ZodString, "UserID">;
|
|
104
|
+
createdAt: z.ZodISODateTime;
|
|
105
|
+
updatedAt: z.ZodISODateTime;
|
|
106
|
+
category: z.ZodObject<{
|
|
107
|
+
id: z.core.$ZodBranded<z.ZodUUID, "CategoryID">;
|
|
108
|
+
ownerId: z.core.$ZodBranded<z.ZodString, "UserID">;
|
|
109
|
+
name: z.ZodString;
|
|
110
|
+
description: z.ZodNullable<z.ZodString>;
|
|
111
|
+
createdAt: z.ZodISODateTime;
|
|
112
|
+
updatedAt: z.ZodISODateTime;
|
|
113
|
+
}, z.core.$strip>;
|
|
114
|
+
receiver: z.ZodString;
|
|
115
|
+
transferAmount: z.ZodNumber;
|
|
116
|
+
information: z.ZodNullable<z.ZodString>;
|
|
117
|
+
paymentMethod: z.ZodObject<{
|
|
118
|
+
id: z.core.$ZodBranded<z.ZodUUID, "PaymentMethodID">;
|
|
119
|
+
ownerId: z.core.$ZodBranded<z.ZodString, "UserID">;
|
|
120
|
+
name: z.ZodString;
|
|
121
|
+
provider: z.ZodString;
|
|
122
|
+
address: z.ZodString;
|
|
123
|
+
description: z.ZodNullable<z.ZodString>;
|
|
124
|
+
createdAt: z.ZodISODateTime;
|
|
125
|
+
updatedAt: z.ZodISODateTime;
|
|
126
|
+
}, z.core.$strip>;
|
|
127
|
+
paused: z.ZodDefault<z.ZodBoolean>;
|
|
128
|
+
executeAt: z.ZodNumber;
|
|
129
|
+
}, z.core.$strip>>;
|
|
130
|
+
}, z.core.$strip>;
|
|
131
|
+
export declare const CreateRecurringPaymentResponse: z.ZodObject<{
|
|
132
|
+
status: z.ZodNumber;
|
|
133
|
+
message: z.ZodOptional<z.ZodString>;
|
|
134
|
+
totalCount: z.ZodOptional<z.ZodNumber>;
|
|
135
|
+
from: z.ZodOptional<z.ZodEnum<{
|
|
136
|
+
db: "db";
|
|
137
|
+
cache: "cache";
|
|
138
|
+
external: "external";
|
|
139
|
+
}>>;
|
|
140
|
+
data: z.ZodObject<{
|
|
141
|
+
id: z.core.$ZodBranded<z.ZodUUID, "TransactionID">;
|
|
142
|
+
ownerId: z.core.$ZodBranded<z.ZodString, "UserID">;
|
|
143
|
+
createdAt: z.ZodISODateTime;
|
|
144
|
+
updatedAt: z.ZodISODateTime;
|
|
145
|
+
categoryId: z.core.$ZodBranded<z.ZodUUID, "CategoryID">;
|
|
146
|
+
paymentMethodId: z.core.$ZodBranded<z.ZodUUID, "PaymentMethodID">;
|
|
147
|
+
receiver: z.ZodString;
|
|
148
|
+
transferAmount: z.ZodNumber;
|
|
149
|
+
information: z.ZodNullable<z.ZodString>;
|
|
150
|
+
paused: z.ZodDefault<z.ZodBoolean>;
|
|
151
|
+
executeAt: z.ZodNumber;
|
|
152
|
+
}, z.core.$strip>;
|
|
153
|
+
}, z.core.$strip>;
|
|
154
|
+
export declare const UpdateRecurringPaymentResponse: z.ZodObject<{
|
|
155
|
+
status: z.ZodNumber;
|
|
156
|
+
message: z.ZodOptional<z.ZodString>;
|
|
157
|
+
totalCount: z.ZodOptional<z.ZodNumber>;
|
|
158
|
+
from: z.ZodOptional<z.ZodEnum<{
|
|
159
|
+
db: "db";
|
|
160
|
+
cache: "cache";
|
|
161
|
+
external: "external";
|
|
162
|
+
}>>;
|
|
163
|
+
data: z.ZodObject<{
|
|
164
|
+
id: z.core.$ZodBranded<z.ZodUUID, "TransactionID">;
|
|
165
|
+
ownerId: z.core.$ZodBranded<z.ZodString, "UserID">;
|
|
166
|
+
createdAt: z.ZodISODateTime;
|
|
167
|
+
updatedAt: z.ZodISODateTime;
|
|
168
|
+
categoryId: z.core.$ZodBranded<z.ZodUUID, "CategoryID">;
|
|
169
|
+
paymentMethodId: z.core.$ZodBranded<z.ZodUUID, "PaymentMethodID">;
|
|
170
|
+
receiver: z.ZodString;
|
|
171
|
+
transferAmount: z.ZodNumber;
|
|
172
|
+
information: z.ZodNullable<z.ZodString>;
|
|
173
|
+
paused: z.ZodDefault<z.ZodBoolean>;
|
|
174
|
+
executeAt: z.ZodNumber;
|
|
175
|
+
}, z.core.$strip>;
|
|
176
|
+
}, z.core.$strip>;
|
|
177
|
+
export declare const DeleteRecurringPaymentResponse: z.ZodObject<{
|
|
178
|
+
status: z.ZodNumber;
|
|
179
|
+
message: z.ZodOptional<z.ZodString>;
|
|
180
|
+
totalCount: z.ZodOptional<z.ZodNumber>;
|
|
181
|
+
from: z.ZodOptional<z.ZodEnum<{
|
|
182
|
+
db: "db";
|
|
183
|
+
cache: "cache";
|
|
184
|
+
external: "external";
|
|
185
|
+
}>>;
|
|
186
|
+
data: z.ZodObject<{
|
|
187
|
+
id: z.core.$ZodBranded<z.ZodUUID, "TransactionID">;
|
|
188
|
+
ownerId: z.core.$ZodBranded<z.ZodString, "UserID">;
|
|
189
|
+
createdAt: z.ZodISODateTime;
|
|
190
|
+
updatedAt: z.ZodISODateTime;
|
|
191
|
+
categoryId: z.core.$ZodBranded<z.ZodUUID, "CategoryID">;
|
|
192
|
+
paymentMethodId: z.core.$ZodBranded<z.ZodUUID, "PaymentMethodID">;
|
|
193
|
+
receiver: z.ZodString;
|
|
194
|
+
transferAmount: z.ZodNumber;
|
|
195
|
+
information: z.ZodNullable<z.ZodString>;
|
|
196
|
+
paused: z.ZodDefault<z.ZodBoolean>;
|
|
197
|
+
executeAt: z.ZodNumber;
|
|
198
|
+
}, z.core.$strip>;
|
|
199
|
+
}, z.core.$strip>;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DeleteRecurringPaymentResponse = exports.UpdateRecurringPaymentResponse = exports.CreateRecurringPaymentResponse = exports.GetRecurringPaymentResponse = exports.GetAllRecurringPaymentsResponse = exports.CreateOrUpdateRecurringPaymentPayload = exports.ExpandedRecurringPayment = exports.RecurringPayment = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const common_schema_1 = require("./common.schema");
|
|
6
|
+
const transaction_schema_1 = require("./transaction.schema");
|
|
7
|
+
exports.RecurringPayment = transaction_schema_1.Transaction.omit({
|
|
8
|
+
processedAt: true,
|
|
9
|
+
}).extend({
|
|
10
|
+
paused: zod_1.z.boolean().default(false),
|
|
11
|
+
executeAt: zod_1.z.number().min(1).max(31),
|
|
12
|
+
});
|
|
13
|
+
exports.ExpandedRecurringPayment = transaction_schema_1.ExpandedTransaction.omit({
|
|
14
|
+
processedAt: true,
|
|
15
|
+
}).extend({
|
|
16
|
+
paused: zod_1.z.boolean().default(false),
|
|
17
|
+
executeAt: zod_1.z.number().min(1).max(31),
|
|
18
|
+
});
|
|
19
|
+
// export const CreateRecurringPaymentPayload = RecurringPayment.pick({
|
|
20
|
+
// executeAt: true,
|
|
21
|
+
// paused: true,
|
|
22
|
+
// categoryId: true,
|
|
23
|
+
// paymentMethodId: true,
|
|
24
|
+
// receiver: true,
|
|
25
|
+
// transferAmount: true,
|
|
26
|
+
// information: true,
|
|
27
|
+
// }).extend({
|
|
28
|
+
// information: RecurringPayment.shape.information.optional(),
|
|
29
|
+
// });
|
|
30
|
+
// export const UpdateRecurringPaymentPayload = RecurringPayment.pick({
|
|
31
|
+
// executeAt: true,
|
|
32
|
+
// paused: true,
|
|
33
|
+
// categoryId: true,
|
|
34
|
+
// paymentMethodId: true,
|
|
35
|
+
// receiver: true,
|
|
36
|
+
// transferAmount: true,
|
|
37
|
+
// information: true,
|
|
38
|
+
// }).extend({
|
|
39
|
+
// information: RecurringPayment.shape.information.optional(),
|
|
40
|
+
// });
|
|
41
|
+
exports.CreateOrUpdateRecurringPaymentPayload = exports.RecurringPayment.pick({
|
|
42
|
+
executeAt: true,
|
|
43
|
+
paused: true,
|
|
44
|
+
categoryId: true,
|
|
45
|
+
paymentMethodId: true,
|
|
46
|
+
receiver: true,
|
|
47
|
+
transferAmount: true,
|
|
48
|
+
information: true,
|
|
49
|
+
}).extend({
|
|
50
|
+
information: exports.RecurringPayment.shape.information.optional(),
|
|
51
|
+
});
|
|
52
|
+
exports.GetAllRecurringPaymentsResponse = common_schema_1.ApiResponse.extend({
|
|
53
|
+
data: zod_1.z.array(exports.ExpandedRecurringPayment).nullable(),
|
|
54
|
+
});
|
|
55
|
+
exports.GetRecurringPaymentResponse = common_schema_1.ApiResponse.extend({
|
|
56
|
+
data: exports.ExpandedRecurringPayment.nullable(),
|
|
57
|
+
});
|
|
58
|
+
exports.CreateRecurringPaymentResponse = common_schema_1.ApiResponse.extend({
|
|
59
|
+
data: exports.RecurringPayment,
|
|
60
|
+
});
|
|
61
|
+
exports.UpdateRecurringPaymentResponse = exports.CreateRecurringPaymentResponse;
|
|
62
|
+
exports.DeleteRecurringPaymentResponse = exports.CreateRecurringPaymentResponse;
|