@zyacreatives/shared 2.5.28 → 2.5.29

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.
@@ -45,14 +45,12 @@ export declare const BaseTransactionSchema: z.ZodObject<{
45
45
  }, z.core.$strip>;
46
46
  export declare const InitTransactionInputSchema: z.ZodObject<{
47
47
  productId: z.ZodCUID2;
48
- paymentProvider: z.ZodEnum<{
49
- readonly STRIPE: "STRIPE";
50
- readonly PAYSTACK: "PAYSTACK";
51
- readonly NONE: "NONE";
52
- }>;
48
+ firstName: z.ZodOptional<z.ZodString>;
49
+ lastName: z.ZodOptional<z.ZodString>;
50
+ buyerId: z.ZodCUID2;
53
51
  email: z.ZodOptional<z.ZodEmail>;
54
52
  discountCode: z.ZodOptional<z.ZodString>;
55
- amount: z.ZodOptional<z.ZodNumber>;
53
+ amount: z.ZodNumber;
56
54
  }, z.core.$strip>;
57
55
  export declare const CreateTransactionInputSchema: z.ZodObject<{
58
56
  status: z.ZodDefault<z.ZodEnum<{
@@ -150,6 +148,9 @@ export declare const TransactionEntitySchema: z.ZodObject<{
150
148
  sellerName: z.ZodOptional<z.ZodString>;
151
149
  sellerId: z.ZodOptional<z.ZodString>;
152
150
  sellerUsername: z.ZodOptional<z.ZodString>;
151
+ buyerName: z.ZodOptional<z.ZodString>;
152
+ buyerUsername: z.ZodOptional<z.ZodString>;
153
+ buyerEmail: z.ZodEmail;
153
154
  }, z.core.$strip>;
154
155
  export declare const InitTransactionOutputSchema: z.ZodObject<{
155
156
  transaction: z.ZodObject<{
@@ -198,6 +199,9 @@ export declare const InitTransactionOutputSchema: z.ZodObject<{
198
199
  sellerName: z.ZodOptional<z.ZodString>;
199
200
  sellerId: z.ZodOptional<z.ZodString>;
200
201
  sellerUsername: z.ZodOptional<z.ZodString>;
202
+ buyerName: z.ZodOptional<z.ZodString>;
203
+ buyerUsername: z.ZodOptional<z.ZodString>;
204
+ buyerEmail: z.ZodEmail;
201
205
  }, z.core.$strip>;
202
206
  checkoutUrl: z.ZodNullable<z.ZodURL>;
203
207
  }, z.core.$strip>;
@@ -27,7 +27,9 @@ exports.InitTransactionInputSchema = zod_openapi_1.z.object({
27
27
  productId: zod_openapi_1.z
28
28
  .cuid2()
29
29
  .openapi({ description: "ID of the product being purchased" }),
30
- paymentProvider: zod_openapi_1.z.enum(constants_1.PAYMENT_PROVIDERS),
30
+ firstName: zod_openapi_1.z.string().optional(),
31
+ lastName: zod_openapi_1.z.string().optional(),
32
+ buyerId: zod_openapi_1.z.cuid2(),
31
33
  email: zod_openapi_1.z
32
34
  .email()
33
35
  .optional()
@@ -40,10 +42,6 @@ exports.InitTransactionInputSchema = zod_openapi_1.z.object({
40
42
  .number()
41
43
  .int("Amount must be a whole number (cents/kobo)")
42
44
  .min(0)
43
- .optional()
44
- .openapi({
45
- description: "Required for PWYW pricing. The amount the buyer chooses to pay in cents/kobo.",
46
- }),
47
45
  });
48
46
  exports.CreateTransactionInputSchema = exports.BaseTransactionSchema.pick({
49
47
  productId: true,
@@ -71,6 +69,9 @@ exports.TransactionEntitySchema = exports.BaseTransactionSchema.extend({
71
69
  sellerName: zod_openapi_1.z.string().optional(),
72
70
  sellerId: zod_openapi_1.z.string().optional(),
73
71
  sellerUsername: zod_openapi_1.z.string().optional(),
72
+ buyerName: zod_openapi_1.z.string().optional(),
73
+ buyerUsername: zod_openapi_1.z.string().optional(),
74
+ buyerEmail: zod_openapi_1.z.email(),
74
75
  }).openapi({ title: "TransactionEntity" });
75
76
  exports.InitTransactionOutputSchema = zod_openapi_1.z
76
77
  .object({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zyacreatives/shared",
3
- "version": "2.5.28",
3
+ "version": "2.5.29",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -7,8 +7,6 @@ import {
7
7
  } from "../constants";
8
8
  import { ProductDiscountEntitySchema } from "./product";
9
9
 
10
-
11
-
12
10
  export const BaseTransactionSchema = z.object({
13
11
  id: z.cuid2(),
14
12
  productId: z.cuid2(),
@@ -38,7 +36,9 @@ export const InitTransactionInputSchema = z.object({
38
36
  productId: z
39
37
  .cuid2()
40
38
  .openapi({ description: "ID of the product being purchased" }),
41
- paymentProvider: z.enum(PAYMENT_PROVIDERS),
39
+ firstName: z.string().optional(),
40
+ lastName: z.string().optional(),
41
+ buyerId: z.cuid2(),
42
42
  email: z
43
43
  .email()
44
44
  .optional()
@@ -51,11 +51,6 @@ export const InitTransactionInputSchema = z.object({
51
51
  .number()
52
52
  .int("Amount must be a whole number (cents/kobo)")
53
53
  .min(0)
54
- .optional()
55
- .openapi({
56
- description:
57
- "Required for PWYW pricing. The amount the buyer chooses to pay in cents/kobo.",
58
- }),
59
54
  });
60
55
 
61
56
  export const CreateTransactionInputSchema = BaseTransactionSchema.pick({
@@ -87,6 +82,9 @@ export const TransactionEntitySchema = BaseTransactionSchema.extend({
87
82
  sellerName: z.string().optional(),
88
83
  sellerId: z.string().optional(),
89
84
  sellerUsername: z.string().optional(),
85
+ buyerName: z.string().optional(),
86
+ buyerUsername: z.string().optional(),
87
+ buyerEmail: z.email(),
90
88
  }).openapi({ title: "TransactionEntity" });
91
89
 
92
90
  export const InitTransactionOutputSchema = z
@@ -102,7 +100,6 @@ export const InitTransactionOutputSchema = z
102
100
  // TYPES EXPORTS
103
101
  // ==========================================
104
102
 
105
-
106
103
  export type BaseTransactionEntity = z.infer<typeof BaseTransactionSchema>;
107
104
 
108
105
  export type InitTransactionInput = z.infer<typeof InitTransactionInputSchema>;