@zyacreatives/shared 2.5.8 → 2.5.9
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/schemas/seller.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import z from "zod";
|
|
1
|
+
import { z } from "@hono/zod-openapi";
|
|
2
2
|
export declare const SellerEntitySchema: z.ZodObject<{
|
|
3
3
|
id: z.ZodCUID2;
|
|
4
4
|
businessName: z.ZodString;
|
|
@@ -81,3 +81,10 @@ export declare const SellerProfileSchema: z.ZodObject<{
|
|
|
81
81
|
}, z.core.$strip>>;
|
|
82
82
|
}, z.core.$strip>;
|
|
83
83
|
export type SellerProfile = z.infer<typeof SellerProfileSchema>;
|
|
84
|
+
export declare const GetStripeOnboardingUrlInputSchema: z.ZodObject<{
|
|
85
|
+
refreshUrl: z.ZodString;
|
|
86
|
+
returnUrl: z.ZodString;
|
|
87
|
+
}, z.core.$strip>;
|
|
88
|
+
export declare const GetStripeOnboardingUrlOutputSchema: z.ZodObject<{
|
|
89
|
+
url: z.ZodString;
|
|
90
|
+
}, z.core.$strip>;
|
package/dist/schemas/seller.js
CHANGED
|
@@ -1,37 +1,40 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.SellerProfileSchema = exports.UpdateSellerEntitySchema = exports.CreateSellerEntityInputSchema = exports.SellerEntitySchema = void 0;
|
|
7
|
-
const
|
|
3
|
+
exports.GetStripeOnboardingUrlOutputSchema = exports.GetStripeOnboardingUrlInputSchema = exports.SellerProfileSchema = exports.UpdateSellerEntitySchema = exports.CreateSellerEntityInputSchema = exports.SellerEntitySchema = void 0;
|
|
4
|
+
const zod_openapi_1 = require("@hono/zod-openapi");
|
|
8
5
|
const constants_1 = require("../constants");
|
|
9
6
|
const payout_method_1 = require("./payout-method");
|
|
10
|
-
exports.SellerEntitySchema =
|
|
11
|
-
id:
|
|
12
|
-
businessName:
|
|
13
|
-
countryOfOperation:
|
|
14
|
-
stripeConnectId:
|
|
15
|
-
paystackSubaccountCode:
|
|
16
|
-
status:
|
|
17
|
-
createdAt:
|
|
18
|
-
updatedAt:
|
|
7
|
+
exports.SellerEntitySchema = zod_openapi_1.z.object({
|
|
8
|
+
id: zod_openapi_1.z.cuid2(),
|
|
9
|
+
businessName: zod_openapi_1.z.string(),
|
|
10
|
+
countryOfOperation: zod_openapi_1.z.enum(constants_1.COUNTRY_OF_OPERATION),
|
|
11
|
+
stripeConnectId: zod_openapi_1.z.string().nullable(),
|
|
12
|
+
paystackSubaccountCode: zod_openapi_1.z.string().nullable(),
|
|
13
|
+
status: zod_openapi_1.z.enum(constants_1.SELLER_STATUS).default(constants_1.SELLER_STATUS.PENDING),
|
|
14
|
+
createdAt: zod_openapi_1.z.coerce.date(),
|
|
15
|
+
updatedAt: zod_openapi_1.z.coerce.date(),
|
|
19
16
|
});
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
accountName: zod_1.default.string(),
|
|
17
|
+
exports.CreateSellerEntityInputSchema = zod_openapi_1.z.object({
|
|
18
|
+
countryOfOperation: zod_openapi_1.z.enum(constants_1.COUNTRY_OF_OPERATION),
|
|
19
|
+
bankCode: zod_openapi_1.z.string().nullable(),
|
|
20
|
+
accountNumber: zod_openapi_1.z.string(),
|
|
21
|
+
accountName: zod_openapi_1.z.string(),
|
|
26
22
|
});
|
|
27
|
-
exports.UpdateSellerEntitySchema =
|
|
23
|
+
exports.UpdateSellerEntitySchema = zod_openapi_1.z
|
|
28
24
|
.object({
|
|
29
|
-
countryOfOperation:
|
|
30
|
-
stripeConnectId:
|
|
31
|
-
paystackSubaccountCode:
|
|
32
|
-
status:
|
|
25
|
+
countryOfOperation: zod_openapi_1.z.enum(constants_1.COUNTRY_OF_OPERATION),
|
|
26
|
+
stripeConnectId: zod_openapi_1.z.string().nullable(),
|
|
27
|
+
paystackSubaccountCode: zod_openapi_1.z.string().nullable(),
|
|
28
|
+
status: zod_openapi_1.z.enum(constants_1.SELLER_STATUS),
|
|
33
29
|
})
|
|
34
30
|
.partial();
|
|
35
31
|
exports.SellerProfileSchema = exports.SellerEntitySchema.extend({
|
|
36
|
-
payoutMethods:
|
|
32
|
+
payoutMethods: zod_openapi_1.z.array(payout_method_1.PayoutMethodEntitySchema),
|
|
33
|
+
});
|
|
34
|
+
exports.GetStripeOnboardingUrlInputSchema = zod_openapi_1.z.object({
|
|
35
|
+
refreshUrl: zod_openapi_1.z.string().url(),
|
|
36
|
+
returnUrl: zod_openapi_1.z.string().url(),
|
|
37
|
+
});
|
|
38
|
+
exports.GetStripeOnboardingUrlOutputSchema = zod_openapi_1.z.object({
|
|
39
|
+
url: zod_openapi_1.z.string().url(),
|
|
37
40
|
});
|
|
@@ -54,7 +54,7 @@ exports.CreateTransactionInputSchema = exports.BaseTransactionSchema.pick({
|
|
|
54
54
|
status: true,
|
|
55
55
|
}).extend({
|
|
56
56
|
discountApplied: exports.TransactionDiscountSnapshotSchema.optional(),
|
|
57
|
-
providerTransactionId: zod_openapi_1.z.string().optional(),
|
|
57
|
+
providerTransactionId: zod_openapi_1.z.string().optional(),
|
|
58
58
|
});
|
|
59
59
|
exports.UpdateTransactionWebhookInputSchema = zod_openapi_1.z.object({
|
|
60
60
|
status: zod_openapi_1.z.enum(constants_1.TRANSACTION_STATUSES),
|
package/package.json
CHANGED
package/src/schemas/seller.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import z from "zod";
|
|
1
|
+
import { z } from "@hono/zod-openapi";
|
|
2
2
|
import { COUNTRY_OF_OPERATION, SELLER_STATUS } from "../constants";
|
|
3
3
|
import { PayoutMethodEntitySchema } from "./payout-method";
|
|
4
4
|
|
|
5
5
|
export const SellerEntitySchema = z.object({
|
|
6
6
|
id: z.cuid2(),
|
|
7
|
-
businessName: z.string(),
|
|
7
|
+
businessName: z.string(),
|
|
8
8
|
countryOfOperation: z.enum(COUNTRY_OF_OPERATION),
|
|
9
9
|
stripeConnectId: z.string().nullable(),
|
|
10
10
|
paystackSubaccountCode: z.string().nullable(),
|
|
@@ -12,15 +12,16 @@ export const SellerEntitySchema = z.object({
|
|
|
12
12
|
createdAt: z.coerce.date(),
|
|
13
13
|
updatedAt: z.coerce.date(),
|
|
14
14
|
});
|
|
15
|
+
|
|
15
16
|
export type SellerEntity = z.infer<typeof SellerEntitySchema>;
|
|
16
17
|
|
|
17
|
-
// No businessName here, because the API doesn't accept it (it relies on the User table)
|
|
18
18
|
export const CreateSellerEntityInputSchema = z.object({
|
|
19
19
|
countryOfOperation: z.enum(COUNTRY_OF_OPERATION),
|
|
20
20
|
bankCode: z.string().nullable(),
|
|
21
21
|
accountNumber: z.string(),
|
|
22
22
|
accountName: z.string(),
|
|
23
23
|
});
|
|
24
|
+
|
|
24
25
|
export type CreateSellerInput = z.infer<typeof CreateSellerEntityInputSchema>;
|
|
25
26
|
|
|
26
27
|
export const UpdateSellerEntitySchema = z
|
|
@@ -31,6 +32,7 @@ export const UpdateSellerEntitySchema = z
|
|
|
31
32
|
status: z.enum(SELLER_STATUS),
|
|
32
33
|
})
|
|
33
34
|
.partial();
|
|
35
|
+
|
|
34
36
|
export type UpdateSellerInput = z.infer<typeof UpdateSellerEntitySchema>;
|
|
35
37
|
|
|
36
38
|
export const SellerProfileSchema = SellerEntitySchema.extend({
|
|
@@ -38,3 +40,12 @@ export const SellerProfileSchema = SellerEntitySchema.extend({
|
|
|
38
40
|
});
|
|
39
41
|
|
|
40
42
|
export type SellerProfile = z.infer<typeof SellerProfileSchema>;
|
|
43
|
+
|
|
44
|
+
export const GetStripeOnboardingUrlInputSchema = z.object({
|
|
45
|
+
refreshUrl: z.string().url(),
|
|
46
|
+
returnUrl: z.string().url(),
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
export const GetStripeOnboardingUrlOutputSchema = z.object({
|
|
50
|
+
url: z.string().url(),
|
|
51
|
+
});
|
|
@@ -65,7 +65,7 @@ export const CreateTransactionInputSchema = BaseTransactionSchema.pick({
|
|
|
65
65
|
status: true,
|
|
66
66
|
}).extend({
|
|
67
67
|
discountApplied: TransactionDiscountSnapshotSchema.optional(),
|
|
68
|
-
providerTransactionId: z.string().optional(),
|
|
68
|
+
providerTransactionId: z.string().optional(),
|
|
69
69
|
});
|
|
70
70
|
|
|
71
71
|
export const UpdateTransactionWebhookInputSchema = z.object({
|
|
@@ -83,6 +83,7 @@ export const TransactionEntitySchema = BaseTransactionSchema.extend({
|
|
|
83
83
|
export type TransactionDiscountSnapshot = z.infer<
|
|
84
84
|
typeof TransactionDiscountSnapshotSchema
|
|
85
85
|
>;
|
|
86
|
+
|
|
86
87
|
export type BaseTransactionEntity = z.infer<typeof BaseTransactionSchema>;
|
|
87
88
|
|
|
88
89
|
export type InitTransactionInput = z.infer<typeof InitTransactionInputSchema>;
|