@zyacreatives/shared 2.2.86 → 2.2.88
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/constants.d.ts +4 -0
- package/dist/schemas/payout-method.d.ts +18 -0
- package/dist/schemas/payout-method.js +27 -1
- package/dist/schemas/seller.d.ts +39 -0
- package/dist/schemas/seller.js +5 -1
- package/package.json +1 -1
- package/src/constants.ts +5 -0
- package/src/schemas/payout-method.ts +41 -0
- package/src/schemas/seller.ts +7 -0
package/dist/constants.d.ts
CHANGED
|
@@ -4,6 +4,10 @@ export declare const ROLES: {
|
|
|
4
4
|
readonly INVESTOR: "INVESTOR";
|
|
5
5
|
readonly ADMIN: "ADMIN";
|
|
6
6
|
};
|
|
7
|
+
export type PaystackBank = {
|
|
8
|
+
name: string;
|
|
9
|
+
code: string;
|
|
10
|
+
};
|
|
7
11
|
export declare const USER_STATUSES: {
|
|
8
12
|
readonly ACTIVE: "ACTIVE";
|
|
9
13
|
readonly SUSPENDED: "SUSPENDED";
|
|
@@ -45,3 +45,21 @@ export declare const UpdatePayoutMethodEntitySchema: z.ZodObject<{
|
|
|
45
45
|
externalBankId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
46
46
|
}, z.core.$strip>;
|
|
47
47
|
export type UpdatePayoutMethodInput = z.infer<typeof UpdatePayoutMethodEntitySchema>;
|
|
48
|
+
export declare const GetBanksInputSchema: z.ZodObject<{
|
|
49
|
+
country: z.ZodDefault<z.ZodString>;
|
|
50
|
+
}, z.core.$strip>;
|
|
51
|
+
export type GetBanksInput = z.infer<typeof GetBanksInputSchema>;
|
|
52
|
+
export declare const VerifyAccountInputSchema: z.ZodObject<{
|
|
53
|
+
accountNumber: z.ZodString;
|
|
54
|
+
bankCode: z.ZodString;
|
|
55
|
+
}, z.core.$strip>;
|
|
56
|
+
export type VerifyAccountInput = z.infer<typeof VerifyAccountInputSchema>;
|
|
57
|
+
export declare const VerifyAccountOutputSchema: z.ZodObject<{
|
|
58
|
+
accountName: z.ZodString;
|
|
59
|
+
}, z.core.$strip>;
|
|
60
|
+
export type VerifyAccountOutput = z.infer<typeof VerifyAccountOutputSchema>;
|
|
61
|
+
export declare const BankListOutputSchema: z.ZodArray<z.ZodObject<{
|
|
62
|
+
name: z.ZodString;
|
|
63
|
+
code: z.ZodString;
|
|
64
|
+
}, z.core.$strip>>;
|
|
65
|
+
export type BankListOutput = z.infer<typeof BankListOutputSchema>;
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.UpdatePayoutMethodEntitySchema = exports.CreatePayoutMethodEntitySchema = exports.PayoutMethodEntitySchema = void 0;
|
|
6
|
+
exports.BankListOutputSchema = exports.VerifyAccountOutputSchema = exports.VerifyAccountInputSchema = exports.GetBanksInputSchema = exports.UpdatePayoutMethodEntitySchema = exports.CreatePayoutMethodEntitySchema = exports.PayoutMethodEntitySchema = void 0;
|
|
7
7
|
const zod_1 = __importDefault(require("zod"));
|
|
8
8
|
const constants_1 = require("../constants");
|
|
9
9
|
exports.PayoutMethodEntitySchema = zod_1.default.object({
|
|
@@ -37,3 +37,29 @@ exports.UpdatePayoutMethodEntitySchema = zod_1.default
|
|
|
37
37
|
externalBankId: zod_1.default.string().nullable(),
|
|
38
38
|
})
|
|
39
39
|
.partial();
|
|
40
|
+
exports.GetBanksInputSchema = zod_1.default.object({
|
|
41
|
+
country: zod_1.default
|
|
42
|
+
.string()
|
|
43
|
+
.default("nigeria")
|
|
44
|
+
.openapi({
|
|
45
|
+
param: { in: "query", name: "country" },
|
|
46
|
+
example: "nigeria",
|
|
47
|
+
}),
|
|
48
|
+
});
|
|
49
|
+
exports.VerifyAccountInputSchema = zod_1.default
|
|
50
|
+
.object({
|
|
51
|
+
accountNumber: zod_1.default.string().length(10, "Account number must be 10 digits"),
|
|
52
|
+
bankCode: zod_1.default.string().min(1, "Bank code is required"),
|
|
53
|
+
})
|
|
54
|
+
.openapi("VerifyAccountInput");
|
|
55
|
+
exports.VerifyAccountOutputSchema = zod_1.default
|
|
56
|
+
.object({
|
|
57
|
+
accountName: zod_1.default.string(),
|
|
58
|
+
})
|
|
59
|
+
.openapi("VerifyAccountOutput");
|
|
60
|
+
exports.BankListOutputSchema = zod_1.default
|
|
61
|
+
.array(zod_1.default.object({
|
|
62
|
+
name: zod_1.default.string(),
|
|
63
|
+
code: zod_1.default.string(),
|
|
64
|
+
}))
|
|
65
|
+
.openapi("BankListOutput");
|
package/dist/schemas/seller.d.ts
CHANGED
|
@@ -41,3 +41,42 @@ export declare const UpdateSellerEntitySchema: z.ZodObject<{
|
|
|
41
41
|
}>>;
|
|
42
42
|
}, z.core.$strip>;
|
|
43
43
|
export type UpdateSellerInput = z.infer<typeof UpdateSellerEntitySchema>;
|
|
44
|
+
export declare const SellerProfileSchema: z.ZodObject<{
|
|
45
|
+
id: z.ZodCUID2;
|
|
46
|
+
businessName: z.ZodString;
|
|
47
|
+
countryOfOperation: z.ZodEnum<{
|
|
48
|
+
readonly NG: "NG";
|
|
49
|
+
readonly GB: "GB";
|
|
50
|
+
}>;
|
|
51
|
+
stripeConnectId: z.ZodNullable<z.ZodString>;
|
|
52
|
+
paystackSubaccountCode: z.ZodNullable<z.ZodString>;
|
|
53
|
+
status: z.ZodDefault<z.ZodEnum<{
|
|
54
|
+
readonly ACTIVE: "ACTIVE";
|
|
55
|
+
readonly PENDING: "PENDING";
|
|
56
|
+
readonly SUSPENDED: "SUSPENDED";
|
|
57
|
+
}>>;
|
|
58
|
+
createdAt: z.ZodCoercedDate<unknown>;
|
|
59
|
+
updatedAt: z.ZodCoercedDate<unknown>;
|
|
60
|
+
payoutMethods: z.ZodArray<z.ZodObject<{
|
|
61
|
+
id: z.ZodCUID2;
|
|
62
|
+
sellerId: z.ZodCUID2;
|
|
63
|
+
provider: z.ZodEnum<{
|
|
64
|
+
readonly PAYSTACK: "PAYSTACK";
|
|
65
|
+
readonly STRIPE: "STRIPE";
|
|
66
|
+
}>;
|
|
67
|
+
currency: z.ZodString;
|
|
68
|
+
bankName: z.ZodString;
|
|
69
|
+
accountLast4: z.ZodString;
|
|
70
|
+
accountName: z.ZodString;
|
|
71
|
+
externalBankId: z.ZodNullable<z.ZodString>;
|
|
72
|
+
isDefault: z.ZodBoolean;
|
|
73
|
+
status: z.ZodDefault<z.ZodEnum<{
|
|
74
|
+
readonly VERIFIED: "VERIFIED";
|
|
75
|
+
readonly PENDING: "PENDING";
|
|
76
|
+
readonly REJECTED: "REJECTED";
|
|
77
|
+
}>>;
|
|
78
|
+
createdAt: z.ZodCoercedDate<unknown>;
|
|
79
|
+
updatedAt: z.ZodCoercedDate<unknown>;
|
|
80
|
+
}, z.core.$strip>>;
|
|
81
|
+
}, z.core.$strip>;
|
|
82
|
+
export type SellerProfile = z.infer<typeof SellerProfileSchema>;
|
package/dist/schemas/seller.js
CHANGED
|
@@ -3,9 +3,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.UpdateSellerEntitySchema = exports.CreateSellerEntityInputSchema = exports.SellerEntitySchema = void 0;
|
|
6
|
+
exports.SellerProfileSchema = exports.UpdateSellerEntitySchema = exports.CreateSellerEntityInputSchema = exports.SellerEntitySchema = void 0;
|
|
7
7
|
const zod_1 = __importDefault(require("zod"));
|
|
8
8
|
const constants_1 = require("../constants");
|
|
9
|
+
const payout_method_1 = require("./payout-method");
|
|
9
10
|
exports.SellerEntitySchema = zod_1.default.object({
|
|
10
11
|
id: zod_1.default.cuid2(),
|
|
11
12
|
businessName: zod_1.default.string(), // Kept here for the app to consume!
|
|
@@ -31,3 +32,6 @@ exports.UpdateSellerEntitySchema = zod_1.default
|
|
|
31
32
|
status: zod_1.default.enum(constants_1.SELLER_STATUS),
|
|
32
33
|
})
|
|
33
34
|
.partial();
|
|
35
|
+
exports.SellerProfileSchema = exports.SellerEntitySchema.extend({
|
|
36
|
+
payoutMethods: zod_1.default.array(payout_method_1.PayoutMethodEntitySchema),
|
|
37
|
+
});
|
package/package.json
CHANGED
package/src/constants.ts
CHANGED
|
@@ -37,6 +37,47 @@ export const UpdatePayoutMethodEntitySchema = z
|
|
|
37
37
|
externalBankId: z.string().nullable(),
|
|
38
38
|
})
|
|
39
39
|
.partial();
|
|
40
|
+
|
|
40
41
|
export type UpdatePayoutMethodInput = z.infer<
|
|
41
42
|
typeof UpdatePayoutMethodEntitySchema
|
|
42
43
|
>;
|
|
44
|
+
|
|
45
|
+
export const GetBanksInputSchema = z.object({
|
|
46
|
+
country: z
|
|
47
|
+
.string()
|
|
48
|
+
.default("nigeria")
|
|
49
|
+
.openapi({
|
|
50
|
+
param: { in: "query", name: "country" },
|
|
51
|
+
example: "nigeria",
|
|
52
|
+
}),
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
export type GetBanksInput = z.infer<typeof GetBanksInputSchema>;
|
|
56
|
+
|
|
57
|
+
export const VerifyAccountInputSchema = z
|
|
58
|
+
.object({
|
|
59
|
+
accountNumber: z.string().length(10, "Account number must be 10 digits"),
|
|
60
|
+
bankCode: z.string().min(1, "Bank code is required"),
|
|
61
|
+
})
|
|
62
|
+
.openapi("VerifyAccountInput");
|
|
63
|
+
|
|
64
|
+
export type VerifyAccountInput = z.infer<typeof VerifyAccountInputSchema>;
|
|
65
|
+
|
|
66
|
+
export const VerifyAccountOutputSchema = z
|
|
67
|
+
.object({
|
|
68
|
+
accountName: z.string(),
|
|
69
|
+
})
|
|
70
|
+
.openapi("VerifyAccountOutput");
|
|
71
|
+
|
|
72
|
+
export type VerifyAccountOutput = z.infer<typeof VerifyAccountOutputSchema>;
|
|
73
|
+
|
|
74
|
+
export const BankListOutputSchema = z
|
|
75
|
+
.array(
|
|
76
|
+
z.object({
|
|
77
|
+
name: z.string(),
|
|
78
|
+
code: z.string(),
|
|
79
|
+
}),
|
|
80
|
+
)
|
|
81
|
+
.openapi("BankListOutput");
|
|
82
|
+
|
|
83
|
+
export type BankListOutput = z.infer<typeof BankListOutputSchema>;
|
package/src/schemas/seller.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import z from "zod";
|
|
2
2
|
import { COUNTRY_OF_OPERATION, SELLER_STATUS } from "../constants";
|
|
3
|
+
import { PayoutMethodEntitySchema } from "./payout-method";
|
|
3
4
|
|
|
4
5
|
export const SellerEntitySchema = z.object({
|
|
5
6
|
id: z.cuid2(),
|
|
@@ -31,3 +32,9 @@ export const UpdateSellerEntitySchema = z
|
|
|
31
32
|
})
|
|
32
33
|
.partial();
|
|
33
34
|
export type UpdateSellerInput = z.infer<typeof UpdateSellerEntitySchema>;
|
|
35
|
+
|
|
36
|
+
export const SellerProfileSchema = SellerEntitySchema.extend({
|
|
37
|
+
payoutMethods: z.array(PayoutMethodEntitySchema),
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
export type SellerProfile = z.infer<typeof SellerProfileSchema>;
|