@zyacreatives/shared 2.5.72 → 2.5.73
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.
|
@@ -594,4 +594,63 @@ export declare const SellerDashboardStatsOutputSchema: z.ZodObject<{
|
|
|
594
594
|
totalDrafts: z.ZodNumber;
|
|
595
595
|
}, z.core.$strip>;
|
|
596
596
|
export type SellerDashboardStatsOutput = z.infer<typeof SellerDashboardStatsOutputSchema>;
|
|
597
|
+
export declare const ProductPurchaseSnapshotSchema: z.ZodObject<{
|
|
598
|
+
productId: z.ZodCUID2;
|
|
599
|
+
title: z.ZodString;
|
|
600
|
+
description: z.ZodOptional<z.ZodString>;
|
|
601
|
+
keyFeatures: z.ZodOptional<z.ZodString>;
|
|
602
|
+
sellerId: z.ZodCUID2;
|
|
603
|
+
sellerName: z.ZodString;
|
|
604
|
+
sellerUsername: z.ZodString;
|
|
605
|
+
sellerImageUrl: z.ZodOptional<z.ZodNullable<z.ZodURL>>;
|
|
606
|
+
category: z.ZodString;
|
|
607
|
+
subcategory: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
608
|
+
tags: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
609
|
+
pricingModel: z.ZodEnum<{
|
|
610
|
+
readonly FREE: "Free";
|
|
611
|
+
readonly FIXED: "Fixed";
|
|
612
|
+
readonly PWYW: "Pay What You Want";
|
|
613
|
+
}>;
|
|
614
|
+
price: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
615
|
+
suggestedPrice: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
616
|
+
currency: z.ZodEnum<{
|
|
617
|
+
readonly USD: "USD (United States Dollar)";
|
|
618
|
+
readonly EUR: "EUR (Euro)";
|
|
619
|
+
readonly GBP: "GBP (British Pound Sterling)";
|
|
620
|
+
readonly NGN: "NGN (Nigerian Naira)";
|
|
621
|
+
}>;
|
|
622
|
+
thumbnailImgUrl: z.ZodOptional<z.ZodNullable<z.ZodURL>>;
|
|
623
|
+
deliveryFiles: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
624
|
+
createdAt: z.ZodISODateTime;
|
|
625
|
+
updatedAt: z.ZodISODateTime;
|
|
626
|
+
deletedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
627
|
+
key: z.ZodString;
|
|
628
|
+
mimeType: z.ZodString;
|
|
629
|
+
parentId: z.ZodNullable<z.ZodCUID2>;
|
|
630
|
+
parentType: z.ZodNullable<z.ZodEnum<{
|
|
631
|
+
readonly PROJECT: "PROJECT";
|
|
632
|
+
readonly USER: "USER";
|
|
633
|
+
readonly JOB: "JOB";
|
|
634
|
+
readonly POST: "POST";
|
|
635
|
+
readonly PRODUCT: "PRODUCT";
|
|
636
|
+
readonly SIGNAL: "SIGNAL";
|
|
637
|
+
readonly PRODUCT_COVER: "PRODUCT_COVER";
|
|
638
|
+
readonly PRODUCT_DELIVERY: "PRODUCT_DELIVERY";
|
|
639
|
+
readonly COMMENT: "COMMENT";
|
|
640
|
+
readonly JOB_APPLICATION: "JOB_APPLICATION";
|
|
641
|
+
}>>;
|
|
642
|
+
isThumbnail: z.ZodNullable<z.ZodBoolean>;
|
|
643
|
+
order: z.ZodNumber;
|
|
644
|
+
id: z.ZodCUID2;
|
|
645
|
+
url: z.ZodURL;
|
|
646
|
+
}, z.core.$strip>>>;
|
|
647
|
+
productLinks: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
648
|
+
title: z.ZodNullable<z.ZodString>;
|
|
649
|
+
url: z.ZodString;
|
|
650
|
+
}, z.core.$strip>>>;
|
|
651
|
+
supportEmail: z.ZodOptional<z.ZodNullable<z.ZodEmail>>;
|
|
652
|
+
supportPhone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
653
|
+
purchasedAt: z.ZodISODateTime;
|
|
654
|
+
}, z.core.$strip>;
|
|
655
|
+
export type ProductPurchaseSnapshot = z.infer<typeof ProductPurchaseSnapshotSchema>;
|
|
597
656
|
export {};
|
package/dist/schemas/product.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SellerDashboardStatsOutputSchema = exports.ProductRevenueChartOutputSchema = exports.RevenueChartPointSchema = exports.ProductTransactionsOutputSchema = exports.ProductTransactionItemSchema = exports.ProductStatsOutputSchema = exports.ProductDiscountCheckOutputSchema = exports.GetMarketplaceInfoOutputSchema = exports.SearchProductOutputSchema = exports.MarketplaceCategorySchema = exports.MarketplaceProductEntitySchema = exports.ProductSearchDocumentSchema = exports.RevenueChartInputSchema = exports.ProductDiscountCheckInputSchema = exports.SearchProductInputSchema = exports.UpdateProductInputSchema = exports.ProductServiceAndComplianceInputSchema = exports.CreateProductInputSchema = exports.ProductEntitySchema = exports.ProductLinkSchema = exports.ProductDiscountEntitySchema = void 0;
|
|
3
|
+
exports.ProductPurchaseSnapshotSchema = exports.SellerDashboardStatsOutputSchema = exports.ProductRevenueChartOutputSchema = exports.RevenueChartPointSchema = exports.ProductTransactionsOutputSchema = exports.ProductTransactionItemSchema = exports.ProductStatsOutputSchema = exports.ProductDiscountCheckOutputSchema = exports.GetMarketplaceInfoOutputSchema = exports.SearchProductOutputSchema = exports.MarketplaceCategorySchema = exports.MarketplaceProductEntitySchema = exports.ProductSearchDocumentSchema = exports.RevenueChartInputSchema = exports.ProductDiscountCheckInputSchema = exports.SearchProductInputSchema = exports.UpdateProductInputSchema = exports.ProductServiceAndComplianceInputSchema = exports.CreateProductInputSchema = exports.ProductEntitySchema = exports.ProductLinkSchema = exports.ProductDiscountEntitySchema = void 0;
|
|
4
4
|
const zod_openapi_1 = require("@hono/zod-openapi");
|
|
5
5
|
const constants_1 = require("../constants");
|
|
6
6
|
const file_1 = require("./file");
|
|
@@ -262,3 +262,26 @@ exports.SellerDashboardStatsOutputSchema = zod_openapi_1.z.object({
|
|
|
262
262
|
totalProducts: zod_openapi_1.z.number().int(),
|
|
263
263
|
totalDrafts: zod_openapi_1.z.number().int(),
|
|
264
264
|
});
|
|
265
|
+
exports.ProductPurchaseSnapshotSchema = zod_openapi_1.z.object({
|
|
266
|
+
productId: zod_openapi_1.z.cuid2(),
|
|
267
|
+
title: zod_openapi_1.z.string(),
|
|
268
|
+
description: zod_openapi_1.z.string().optional(),
|
|
269
|
+
keyFeatures: zod_openapi_1.z.string().optional(),
|
|
270
|
+
sellerId: zod_openapi_1.z.cuid2(),
|
|
271
|
+
sellerName: zod_openapi_1.z.string(),
|
|
272
|
+
sellerUsername: zod_openapi_1.z.string(),
|
|
273
|
+
sellerImageUrl: zod_openapi_1.z.url().nullable().optional(),
|
|
274
|
+
category: zod_openapi_1.z.string(),
|
|
275
|
+
subcategory: zod_openapi_1.z.string().nullable().optional(),
|
|
276
|
+
tags: zod_openapi_1.z.array(zod_openapi_1.z.string()).default([]),
|
|
277
|
+
pricingModel: zod_openapi_1.z.enum(constants_1.PRICING_MODELS),
|
|
278
|
+
price: zod_openapi_1.z.number().int().nullable().optional(),
|
|
279
|
+
suggestedPrice: zod_openapi_1.z.number().int().nullable().optional(),
|
|
280
|
+
currency: zod_openapi_1.z.enum(constants_1.WAGES_CURRENCY),
|
|
281
|
+
thumbnailImgUrl: zod_openapi_1.z.url().nullable().optional(),
|
|
282
|
+
deliveryFiles: zod_openapi_1.z.array(file_1.FileEntitySchema).default([]),
|
|
283
|
+
productLinks: zod_openapi_1.z.array(exports.ProductLinkSchema).default([]),
|
|
284
|
+
supportEmail: zod_openapi_1.z.email().nullable().optional(),
|
|
285
|
+
supportPhone: zod_openapi_1.z.string().nullable().optional(),
|
|
286
|
+
purchasedAt: zod_openapi_1.z.iso.datetime(),
|
|
287
|
+
});
|
|
@@ -39,7 +39,64 @@ export declare const BaseTransactionSchema: z.ZodObject<{
|
|
|
39
39
|
discountCode: z.ZodOptional<z.ZodString>;
|
|
40
40
|
active: z.ZodDefault<z.ZodBoolean>;
|
|
41
41
|
}, z.core.$strip>>>;
|
|
42
|
-
|
|
42
|
+
productSnapshot: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
43
|
+
productId: z.ZodCUID2;
|
|
44
|
+
title: z.ZodString;
|
|
45
|
+
description: z.ZodOptional<z.ZodString>;
|
|
46
|
+
keyFeatures: z.ZodOptional<z.ZodString>;
|
|
47
|
+
sellerId: z.ZodCUID2;
|
|
48
|
+
sellerName: z.ZodString;
|
|
49
|
+
sellerUsername: z.ZodString;
|
|
50
|
+
sellerImageUrl: z.ZodOptional<z.ZodNullable<z.ZodURL>>;
|
|
51
|
+
category: z.ZodString;
|
|
52
|
+
subcategory: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
53
|
+
tags: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
54
|
+
pricingModel: z.ZodEnum<{
|
|
55
|
+
readonly FREE: "Free";
|
|
56
|
+
readonly FIXED: "Fixed";
|
|
57
|
+
readonly PWYW: "Pay What You Want";
|
|
58
|
+
}>;
|
|
59
|
+
price: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
60
|
+
suggestedPrice: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
61
|
+
currency: z.ZodEnum<{
|
|
62
|
+
readonly USD: "USD (United States Dollar)";
|
|
63
|
+
readonly EUR: "EUR (Euro)";
|
|
64
|
+
readonly GBP: "GBP (British Pound Sterling)";
|
|
65
|
+
readonly NGN: "NGN (Nigerian Naira)";
|
|
66
|
+
}>;
|
|
67
|
+
thumbnailImgUrl: z.ZodOptional<z.ZodNullable<z.ZodURL>>;
|
|
68
|
+
deliveryFiles: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
69
|
+
createdAt: z.ZodISODateTime;
|
|
70
|
+
updatedAt: z.ZodISODateTime;
|
|
71
|
+
deletedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
72
|
+
key: z.ZodString;
|
|
73
|
+
mimeType: z.ZodString;
|
|
74
|
+
parentId: z.ZodNullable<z.ZodCUID2>;
|
|
75
|
+
parentType: z.ZodNullable<z.ZodEnum<{
|
|
76
|
+
readonly PROJECT: "PROJECT";
|
|
77
|
+
readonly USER: "USER";
|
|
78
|
+
readonly JOB: "JOB";
|
|
79
|
+
readonly POST: "POST";
|
|
80
|
+
readonly PRODUCT: "PRODUCT";
|
|
81
|
+
readonly SIGNAL: "SIGNAL";
|
|
82
|
+
readonly PRODUCT_COVER: "PRODUCT_COVER";
|
|
83
|
+
readonly PRODUCT_DELIVERY: "PRODUCT_DELIVERY";
|
|
84
|
+
readonly COMMENT: "COMMENT";
|
|
85
|
+
readonly JOB_APPLICATION: "JOB_APPLICATION";
|
|
86
|
+
}>>;
|
|
87
|
+
isThumbnail: z.ZodNullable<z.ZodBoolean>;
|
|
88
|
+
order: z.ZodNumber;
|
|
89
|
+
id: z.ZodCUID2;
|
|
90
|
+
url: z.ZodURL;
|
|
91
|
+
}, z.core.$strip>>>;
|
|
92
|
+
productLinks: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
93
|
+
title: z.ZodNullable<z.ZodString>;
|
|
94
|
+
url: z.ZodString;
|
|
95
|
+
}, z.core.$strip>>>;
|
|
96
|
+
supportEmail: z.ZodOptional<z.ZodNullable<z.ZodEmail>>;
|
|
97
|
+
supportPhone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
98
|
+
purchasedAt: z.ZodISODateTime;
|
|
99
|
+
}, z.core.$strip>>>;
|
|
43
100
|
createdAt: z.ZodISODateTime;
|
|
44
101
|
updatedAt: z.ZodISODateTime;
|
|
45
102
|
}, z.core.$strip>;
|
|
@@ -82,7 +139,7 @@ export declare const CreateTransactionInputSchema: z.ZodObject<{
|
|
|
82
139
|
readonly PAYSTACK: "PAYSTACK";
|
|
83
140
|
readonly NONE: "NONE";
|
|
84
141
|
}>;
|
|
85
|
-
discountApplied: z.ZodOptional<z.ZodObject<{
|
|
142
|
+
discountApplied: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
86
143
|
discountType: z.ZodEnum<{
|
|
87
144
|
readonly FIXED_AMOUNT: "Fixed Amount";
|
|
88
145
|
readonly PERCENTAGE: "Percentage";
|
|
@@ -90,8 +147,66 @@ export declare const CreateTransactionInputSchema: z.ZodObject<{
|
|
|
90
147
|
amount: z.ZodNumber;
|
|
91
148
|
discountCode: z.ZodOptional<z.ZodString>;
|
|
92
149
|
active: z.ZodDefault<z.ZodBoolean>;
|
|
93
|
-
}, z.core.$strip
|
|
150
|
+
}, z.core.$strip>>>;
|
|
94
151
|
providerTransactionId: z.ZodOptional<z.ZodString>;
|
|
152
|
+
productSnapshot: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
153
|
+
productId: z.ZodCUID2;
|
|
154
|
+
title: z.ZodString;
|
|
155
|
+
description: z.ZodOptional<z.ZodString>;
|
|
156
|
+
keyFeatures: z.ZodOptional<z.ZodString>;
|
|
157
|
+
sellerId: z.ZodCUID2;
|
|
158
|
+
sellerName: z.ZodString;
|
|
159
|
+
sellerUsername: z.ZodString;
|
|
160
|
+
sellerImageUrl: z.ZodOptional<z.ZodNullable<z.ZodURL>>;
|
|
161
|
+
category: z.ZodString;
|
|
162
|
+
subcategory: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
163
|
+
tags: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
164
|
+
pricingModel: z.ZodEnum<{
|
|
165
|
+
readonly FREE: "Free";
|
|
166
|
+
readonly FIXED: "Fixed";
|
|
167
|
+
readonly PWYW: "Pay What You Want";
|
|
168
|
+
}>;
|
|
169
|
+
price: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
170
|
+
suggestedPrice: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
171
|
+
currency: z.ZodEnum<{
|
|
172
|
+
readonly USD: "USD (United States Dollar)";
|
|
173
|
+
readonly EUR: "EUR (Euro)";
|
|
174
|
+
readonly GBP: "GBP (British Pound Sterling)";
|
|
175
|
+
readonly NGN: "NGN (Nigerian Naira)";
|
|
176
|
+
}>;
|
|
177
|
+
thumbnailImgUrl: z.ZodOptional<z.ZodNullable<z.ZodURL>>;
|
|
178
|
+
deliveryFiles: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
179
|
+
createdAt: z.ZodISODateTime;
|
|
180
|
+
updatedAt: z.ZodISODateTime;
|
|
181
|
+
deletedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
182
|
+
key: z.ZodString;
|
|
183
|
+
mimeType: z.ZodString;
|
|
184
|
+
parentId: z.ZodNullable<z.ZodCUID2>;
|
|
185
|
+
parentType: z.ZodNullable<z.ZodEnum<{
|
|
186
|
+
readonly PROJECT: "PROJECT";
|
|
187
|
+
readonly USER: "USER";
|
|
188
|
+
readonly JOB: "JOB";
|
|
189
|
+
readonly POST: "POST";
|
|
190
|
+
readonly PRODUCT: "PRODUCT";
|
|
191
|
+
readonly SIGNAL: "SIGNAL";
|
|
192
|
+
readonly PRODUCT_COVER: "PRODUCT_COVER";
|
|
193
|
+
readonly PRODUCT_DELIVERY: "PRODUCT_DELIVERY";
|
|
194
|
+
readonly COMMENT: "COMMENT";
|
|
195
|
+
readonly JOB_APPLICATION: "JOB_APPLICATION";
|
|
196
|
+
}>>;
|
|
197
|
+
isThumbnail: z.ZodNullable<z.ZodBoolean>;
|
|
198
|
+
order: z.ZodNumber;
|
|
199
|
+
id: z.ZodCUID2;
|
|
200
|
+
url: z.ZodURL;
|
|
201
|
+
}, z.core.$strip>>>;
|
|
202
|
+
productLinks: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
203
|
+
title: z.ZodNullable<z.ZodString>;
|
|
204
|
+
url: z.ZodString;
|
|
205
|
+
}, z.core.$strip>>>;
|
|
206
|
+
supportEmail: z.ZodOptional<z.ZodNullable<z.ZodEmail>>;
|
|
207
|
+
supportPhone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
208
|
+
purchasedAt: z.ZodISODateTime;
|
|
209
|
+
}, z.core.$strip>>>;
|
|
95
210
|
}, z.core.$strip>;
|
|
96
211
|
export type CreateTransactionInput = z.infer<typeof CreateTransactionInputSchema>;
|
|
97
212
|
export declare const UpdateTransactionWebhookInputSchema: z.ZodObject<{
|
|
@@ -144,7 +259,64 @@ export declare const TransactionEntitySchema: z.ZodObject<{
|
|
|
144
259
|
discountCode: z.ZodOptional<z.ZodString>;
|
|
145
260
|
active: z.ZodDefault<z.ZodBoolean>;
|
|
146
261
|
}, z.core.$strip>>>;
|
|
147
|
-
|
|
262
|
+
productSnapshot: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
263
|
+
productId: z.ZodCUID2;
|
|
264
|
+
title: z.ZodString;
|
|
265
|
+
description: z.ZodOptional<z.ZodString>;
|
|
266
|
+
keyFeatures: z.ZodOptional<z.ZodString>;
|
|
267
|
+
sellerId: z.ZodCUID2;
|
|
268
|
+
sellerName: z.ZodString;
|
|
269
|
+
sellerUsername: z.ZodString;
|
|
270
|
+
sellerImageUrl: z.ZodOptional<z.ZodNullable<z.ZodURL>>;
|
|
271
|
+
category: z.ZodString;
|
|
272
|
+
subcategory: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
273
|
+
tags: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
274
|
+
pricingModel: z.ZodEnum<{
|
|
275
|
+
readonly FREE: "Free";
|
|
276
|
+
readonly FIXED: "Fixed";
|
|
277
|
+
readonly PWYW: "Pay What You Want";
|
|
278
|
+
}>;
|
|
279
|
+
price: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
280
|
+
suggestedPrice: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
281
|
+
currency: z.ZodEnum<{
|
|
282
|
+
readonly USD: "USD (United States Dollar)";
|
|
283
|
+
readonly EUR: "EUR (Euro)";
|
|
284
|
+
readonly GBP: "GBP (British Pound Sterling)";
|
|
285
|
+
readonly NGN: "NGN (Nigerian Naira)";
|
|
286
|
+
}>;
|
|
287
|
+
thumbnailImgUrl: z.ZodOptional<z.ZodNullable<z.ZodURL>>;
|
|
288
|
+
deliveryFiles: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
289
|
+
createdAt: z.ZodISODateTime;
|
|
290
|
+
updatedAt: z.ZodISODateTime;
|
|
291
|
+
deletedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
292
|
+
key: z.ZodString;
|
|
293
|
+
mimeType: z.ZodString;
|
|
294
|
+
parentId: z.ZodNullable<z.ZodCUID2>;
|
|
295
|
+
parentType: z.ZodNullable<z.ZodEnum<{
|
|
296
|
+
readonly PROJECT: "PROJECT";
|
|
297
|
+
readonly USER: "USER";
|
|
298
|
+
readonly JOB: "JOB";
|
|
299
|
+
readonly POST: "POST";
|
|
300
|
+
readonly PRODUCT: "PRODUCT";
|
|
301
|
+
readonly SIGNAL: "SIGNAL";
|
|
302
|
+
readonly PRODUCT_COVER: "PRODUCT_COVER";
|
|
303
|
+
readonly PRODUCT_DELIVERY: "PRODUCT_DELIVERY";
|
|
304
|
+
readonly COMMENT: "COMMENT";
|
|
305
|
+
readonly JOB_APPLICATION: "JOB_APPLICATION";
|
|
306
|
+
}>>;
|
|
307
|
+
isThumbnail: z.ZodNullable<z.ZodBoolean>;
|
|
308
|
+
order: z.ZodNumber;
|
|
309
|
+
id: z.ZodCUID2;
|
|
310
|
+
url: z.ZodURL;
|
|
311
|
+
}, z.core.$strip>>>;
|
|
312
|
+
productLinks: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
313
|
+
title: z.ZodNullable<z.ZodString>;
|
|
314
|
+
url: z.ZodString;
|
|
315
|
+
}, z.core.$strip>>>;
|
|
316
|
+
supportEmail: z.ZodOptional<z.ZodNullable<z.ZodEmail>>;
|
|
317
|
+
supportPhone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
318
|
+
purchasedAt: z.ZodISODateTime;
|
|
319
|
+
}, z.core.$strip>>>;
|
|
148
320
|
createdAt: z.ZodISODateTime;
|
|
149
321
|
updatedAt: z.ZodISODateTime;
|
|
150
322
|
productTitle: z.ZodOptional<z.ZodString>;
|
|
@@ -196,7 +368,64 @@ export declare const InitTransactionOutputSchema: z.ZodObject<{
|
|
|
196
368
|
discountCode: z.ZodOptional<z.ZodString>;
|
|
197
369
|
active: z.ZodDefault<z.ZodBoolean>;
|
|
198
370
|
}, z.core.$strip>>>;
|
|
199
|
-
|
|
371
|
+
productSnapshot: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
372
|
+
productId: z.ZodCUID2;
|
|
373
|
+
title: z.ZodString;
|
|
374
|
+
description: z.ZodOptional<z.ZodString>;
|
|
375
|
+
keyFeatures: z.ZodOptional<z.ZodString>;
|
|
376
|
+
sellerId: z.ZodCUID2;
|
|
377
|
+
sellerName: z.ZodString;
|
|
378
|
+
sellerUsername: z.ZodString;
|
|
379
|
+
sellerImageUrl: z.ZodOptional<z.ZodNullable<z.ZodURL>>;
|
|
380
|
+
category: z.ZodString;
|
|
381
|
+
subcategory: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
382
|
+
tags: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
383
|
+
pricingModel: z.ZodEnum<{
|
|
384
|
+
readonly FREE: "Free";
|
|
385
|
+
readonly FIXED: "Fixed";
|
|
386
|
+
readonly PWYW: "Pay What You Want";
|
|
387
|
+
}>;
|
|
388
|
+
price: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
389
|
+
suggestedPrice: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
390
|
+
currency: z.ZodEnum<{
|
|
391
|
+
readonly USD: "USD (United States Dollar)";
|
|
392
|
+
readonly EUR: "EUR (Euro)";
|
|
393
|
+
readonly GBP: "GBP (British Pound Sterling)";
|
|
394
|
+
readonly NGN: "NGN (Nigerian Naira)";
|
|
395
|
+
}>;
|
|
396
|
+
thumbnailImgUrl: z.ZodOptional<z.ZodNullable<z.ZodURL>>;
|
|
397
|
+
deliveryFiles: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
398
|
+
createdAt: z.ZodISODateTime;
|
|
399
|
+
updatedAt: z.ZodISODateTime;
|
|
400
|
+
deletedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
401
|
+
key: z.ZodString;
|
|
402
|
+
mimeType: z.ZodString;
|
|
403
|
+
parentId: z.ZodNullable<z.ZodCUID2>;
|
|
404
|
+
parentType: z.ZodNullable<z.ZodEnum<{
|
|
405
|
+
readonly PROJECT: "PROJECT";
|
|
406
|
+
readonly USER: "USER";
|
|
407
|
+
readonly JOB: "JOB";
|
|
408
|
+
readonly POST: "POST";
|
|
409
|
+
readonly PRODUCT: "PRODUCT";
|
|
410
|
+
readonly SIGNAL: "SIGNAL";
|
|
411
|
+
readonly PRODUCT_COVER: "PRODUCT_COVER";
|
|
412
|
+
readonly PRODUCT_DELIVERY: "PRODUCT_DELIVERY";
|
|
413
|
+
readonly COMMENT: "COMMENT";
|
|
414
|
+
readonly JOB_APPLICATION: "JOB_APPLICATION";
|
|
415
|
+
}>>;
|
|
416
|
+
isThumbnail: z.ZodNullable<z.ZodBoolean>;
|
|
417
|
+
order: z.ZodNumber;
|
|
418
|
+
id: z.ZodCUID2;
|
|
419
|
+
url: z.ZodURL;
|
|
420
|
+
}, z.core.$strip>>>;
|
|
421
|
+
productLinks: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
422
|
+
title: z.ZodNullable<z.ZodString>;
|
|
423
|
+
url: z.ZodString;
|
|
424
|
+
}, z.core.$strip>>>;
|
|
425
|
+
supportEmail: z.ZodOptional<z.ZodNullable<z.ZodEmail>>;
|
|
426
|
+
supportPhone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
427
|
+
purchasedAt: z.ZodISODateTime;
|
|
428
|
+
}, z.core.$strip>>>;
|
|
200
429
|
createdAt: z.ZodISODateTime;
|
|
201
430
|
updatedAt: z.ZodISODateTime;
|
|
202
431
|
productTitle: z.ZodOptional<z.ZodString>;
|
|
@@ -22,7 +22,7 @@ exports.BaseTransactionSchema = zod_openapi_1.z.object({
|
|
|
22
22
|
paymentProvider: zod_openapi_1.z.enum(constants_1.PAYMENT_PROVIDERS),
|
|
23
23
|
providerTransactionId: zod_openapi_1.z.string().nullable().optional(),
|
|
24
24
|
discountApplied: product_1.ProductDiscountEntitySchema.nullable().optional(),
|
|
25
|
-
|
|
25
|
+
productSnapshot: product_1.ProductPurchaseSnapshotSchema.nullable().optional(),
|
|
26
26
|
createdAt: zod_openapi_1.z.iso.datetime(),
|
|
27
27
|
updatedAt: zod_openapi_1.z.iso.datetime(),
|
|
28
28
|
});
|
|
@@ -39,7 +39,10 @@ exports.InitTransactionInputSchema = zod_openapi_1.z.object({
|
|
|
39
39
|
lastName: zod_openapi_1.z.string().optional(),
|
|
40
40
|
email: zod_openapi_1.z.email(),
|
|
41
41
|
discountCode: zod_openapi_1.z.string().optional(),
|
|
42
|
-
amount: zod_openapi_1.z
|
|
42
|
+
amount: zod_openapi_1.z
|
|
43
|
+
.number()
|
|
44
|
+
.int("Amount must be a whole number in the smallest currency unit")
|
|
45
|
+
.min(0),
|
|
43
46
|
});
|
|
44
47
|
exports.CreateTransactionInputSchema = exports.BaseTransactionSchema.pick({
|
|
45
48
|
productId: true,
|
|
@@ -52,8 +55,9 @@ exports.CreateTransactionInputSchema = exports.BaseTransactionSchema.pick({
|
|
|
52
55
|
paymentProvider: true,
|
|
53
56
|
status: true,
|
|
54
57
|
}).extend({
|
|
55
|
-
discountApplied: product_1.ProductDiscountEntitySchema.optional(),
|
|
58
|
+
discountApplied: product_1.ProductDiscountEntitySchema.nullable().optional(),
|
|
56
59
|
providerTransactionId: zod_openapi_1.z.string().optional(),
|
|
60
|
+
productSnapshot: product_1.ProductPurchaseSnapshotSchema.nullable().optional(),
|
|
57
61
|
});
|
|
58
62
|
exports.UpdateTransactionWebhookInputSchema = zod_openapi_1.z.object({
|
|
59
63
|
status: zod_openapi_1.z.enum(constants_1.TRANSACTION_STATUSES),
|
package/package.json
CHANGED
package/src/schemas/product.ts
CHANGED
|
@@ -117,7 +117,6 @@ export type ProductEntity = z.infer<typeof ProductEntitySchema>;
|
|
|
117
117
|
|
|
118
118
|
const ProductCoreInputSchema = ProductShape.extend({
|
|
119
119
|
id: z.cuid2(),
|
|
120
|
-
|
|
121
120
|
files: z.array(CreateFileInputSchema).default([]),
|
|
122
121
|
productLinks: z.array(ProductLinkSchema).default([]),
|
|
123
122
|
});
|
|
@@ -411,3 +410,39 @@ export const SellerDashboardStatsOutputSchema = z.object({
|
|
|
411
410
|
export type SellerDashboardStatsOutput = z.infer<
|
|
412
411
|
typeof SellerDashboardStatsOutputSchema
|
|
413
412
|
>;
|
|
413
|
+
|
|
414
|
+
export const ProductPurchaseSnapshotSchema = z.object({
|
|
415
|
+
productId: z.cuid2(),
|
|
416
|
+
|
|
417
|
+
title: z.string(),
|
|
418
|
+
description: z.string().optional(),
|
|
419
|
+
keyFeatures: z.string().optional(),
|
|
420
|
+
|
|
421
|
+
sellerId: z.cuid2(),
|
|
422
|
+
sellerName: z.string(),
|
|
423
|
+
sellerUsername: z.string(),
|
|
424
|
+
sellerImageUrl: z.url().nullable().optional(),
|
|
425
|
+
|
|
426
|
+
category: z.string(),
|
|
427
|
+
subcategory: z.string().nullable().optional(),
|
|
428
|
+
tags: z.array(z.string()).default([]),
|
|
429
|
+
|
|
430
|
+
pricingModel: z.enum(PRICING_MODELS),
|
|
431
|
+
price: z.number().int().nullable().optional(),
|
|
432
|
+
suggestedPrice: z.number().int().nullable().optional(),
|
|
433
|
+
currency: z.enum(WAGES_CURRENCY),
|
|
434
|
+
|
|
435
|
+
thumbnailImgUrl: z.url().nullable().optional(),
|
|
436
|
+
|
|
437
|
+
deliveryFiles: z.array(FileEntitySchema).default([]),
|
|
438
|
+
productLinks: z.array(ProductLinkSchema).default([]),
|
|
439
|
+
|
|
440
|
+
supportEmail: z.email().nullable().optional(),
|
|
441
|
+
supportPhone: z.string().nullable().optional(),
|
|
442
|
+
|
|
443
|
+
purchasedAt: z.iso.datetime(),
|
|
444
|
+
});
|
|
445
|
+
|
|
446
|
+
export type ProductPurchaseSnapshot = z.infer<
|
|
447
|
+
typeof ProductPurchaseSnapshotSchema
|
|
448
|
+
>;
|
|
@@ -4,7 +4,10 @@ import {
|
|
|
4
4
|
TRANSACTION_STATUSES,
|
|
5
5
|
PAYMENT_PROVIDERS,
|
|
6
6
|
} from "../constants";
|
|
7
|
-
import {
|
|
7
|
+
import {
|
|
8
|
+
ProductDiscountEntitySchema,
|
|
9
|
+
ProductPurchaseSnapshotSchema,
|
|
10
|
+
} from "./product";
|
|
8
11
|
|
|
9
12
|
/**
|
|
10
13
|
* --------------------------------
|
|
@@ -14,6 +17,7 @@ import { ProductDiscountEntitySchema } from "./product";
|
|
|
14
17
|
|
|
15
18
|
export const BaseTransactionSchema = z.object({
|
|
16
19
|
id: z.cuid2(),
|
|
20
|
+
|
|
17
21
|
productId: z.cuid2(),
|
|
18
22
|
buyerId: z.cuid2(),
|
|
19
23
|
sellerId: z.cuid2(),
|
|
@@ -28,7 +32,8 @@ export const BaseTransactionSchema = z.object({
|
|
|
28
32
|
providerTransactionId: z.string().nullable().optional(),
|
|
29
33
|
|
|
30
34
|
discountApplied: ProductDiscountEntitySchema.nullable().optional(),
|
|
31
|
-
|
|
35
|
+
|
|
36
|
+
productSnapshot: ProductPurchaseSnapshotSchema.nullable().optional(),
|
|
32
37
|
|
|
33
38
|
createdAt: z.iso.datetime(),
|
|
34
39
|
updatedAt: z.iso.datetime(),
|
|
@@ -46,11 +51,17 @@ export const InitTransactionInputSchema = z.object({
|
|
|
46
51
|
productId: z
|
|
47
52
|
.cuid2()
|
|
48
53
|
.openapi({ description: "ID of the product being purchased" }),
|
|
54
|
+
|
|
49
55
|
firstName: z.string().optional(),
|
|
50
56
|
lastName: z.string().optional(),
|
|
51
57
|
email: z.email(),
|
|
58
|
+
|
|
52
59
|
discountCode: z.string().optional(),
|
|
53
|
-
|
|
60
|
+
|
|
61
|
+
amount: z
|
|
62
|
+
.number()
|
|
63
|
+
.int("Amount must be a whole number in the smallest currency unit")
|
|
64
|
+
.min(0),
|
|
54
65
|
});
|
|
55
66
|
|
|
56
67
|
export type InitTransactionInput = z.infer<typeof InitTransactionInputSchema>;
|
|
@@ -66,8 +77,9 @@ export const CreateTransactionInputSchema = BaseTransactionSchema.pick({
|
|
|
66
77
|
paymentProvider: true,
|
|
67
78
|
status: true,
|
|
68
79
|
}).extend({
|
|
69
|
-
discountApplied: ProductDiscountEntitySchema.optional(),
|
|
80
|
+
discountApplied: ProductDiscountEntitySchema.nullable().optional(),
|
|
70
81
|
providerTransactionId: z.string().optional(),
|
|
82
|
+
productSnapshot: ProductPurchaseSnapshotSchema.nullable().optional(),
|
|
71
83
|
});
|
|
72
84
|
|
|
73
85
|
export type CreateTransactionInput = z.infer<
|
|
@@ -117,4 +129,6 @@ export const InitTransactionOutputSchema = z
|
|
|
117
129
|
})
|
|
118
130
|
.openapi({ title: "InitTransactionResult" });
|
|
119
131
|
|
|
120
|
-
export type InitTransactionResult = z.infer<
|
|
132
|
+
export type InitTransactionResult = z.infer<
|
|
133
|
+
typeof InitTransactionOutputSchema
|
|
134
|
+
>;
|