@zyacreatives/shared 2.5.28 → 2.5.30

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,11 @@ 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>;
53
50
  email: z.ZodOptional<z.ZodEmail>;
54
51
  discountCode: z.ZodOptional<z.ZodString>;
55
- amount: z.ZodOptional<z.ZodNumber>;
52
+ amount: z.ZodNumber;
56
53
  }, z.core.$strip>;
57
54
  export declare const CreateTransactionInputSchema: z.ZodObject<{
58
55
  status: z.ZodDefault<z.ZodEnum<{
@@ -150,6 +147,9 @@ export declare const TransactionEntitySchema: z.ZodObject<{
150
147
  sellerName: z.ZodOptional<z.ZodString>;
151
148
  sellerId: z.ZodOptional<z.ZodString>;
152
149
  sellerUsername: z.ZodOptional<z.ZodString>;
150
+ buyerName: z.ZodOptional<z.ZodString>;
151
+ buyerUsername: z.ZodOptional<z.ZodString>;
152
+ buyerEmail: z.ZodEmail;
153
153
  }, z.core.$strip>;
154
154
  export declare const InitTransactionOutputSchema: z.ZodObject<{
155
155
  transaction: z.ZodObject<{
@@ -198,6 +198,9 @@ export declare const InitTransactionOutputSchema: z.ZodObject<{
198
198
  sellerName: z.ZodOptional<z.ZodString>;
199
199
  sellerId: z.ZodOptional<z.ZodString>;
200
200
  sellerUsername: z.ZodOptional<z.ZodString>;
201
+ buyerName: z.ZodOptional<z.ZodString>;
202
+ buyerUsername: z.ZodOptional<z.ZodString>;
203
+ buyerEmail: z.ZodEmail;
201
204
  }, z.core.$strip>;
202
205
  checkoutUrl: z.ZodNullable<z.ZodURL>;
203
206
  }, z.core.$strip>;
@@ -27,7 +27,8 @@ 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(),
31
32
  email: zod_openapi_1.z
32
33
  .email()
33
34
  .optional()
@@ -40,10 +41,6 @@ exports.InitTransactionInputSchema = zod_openapi_1.z.object({
40
41
  .number()
41
42
  .int("Amount must be a whole number (cents/kobo)")
42
43
  .min(0)
43
- .optional()
44
- .openapi({
45
- description: "Required for PWYW pricing. The amount the buyer chooses to pay in cents/kobo.",
46
- }),
47
44
  });
48
45
  exports.CreateTransactionInputSchema = exports.BaseTransactionSchema.pick({
49
46
  productId: true,
@@ -71,6 +68,9 @@ exports.TransactionEntitySchema = exports.BaseTransactionSchema.extend({
71
68
  sellerName: zod_openapi_1.z.string().optional(),
72
69
  sellerId: zod_openapi_1.z.string().optional(),
73
70
  sellerUsername: zod_openapi_1.z.string().optional(),
71
+ buyerName: zod_openapi_1.z.string().optional(),
72
+ buyerUsername: zod_openapi_1.z.string().optional(),
73
+ buyerEmail: zod_openapi_1.z.email(),
74
74
  }).openapi({ title: "TransactionEntity" });
75
75
  exports.InitTransactionOutputSchema = zod_openapi_1.z
76
76
  .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.30",
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,8 @@ 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(),
42
41
  email: z
43
42
  .email()
44
43
  .optional()
@@ -51,11 +50,6 @@ export const InitTransactionInputSchema = z.object({
51
50
  .number()
52
51
  .int("Amount must be a whole number (cents/kobo)")
53
52
  .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
53
  });
60
54
 
61
55
  export const CreateTransactionInputSchema = BaseTransactionSchema.pick({
@@ -87,6 +81,9 @@ export const TransactionEntitySchema = BaseTransactionSchema.extend({
87
81
  sellerName: z.string().optional(),
88
82
  sellerId: z.string().optional(),
89
83
  sellerUsername: z.string().optional(),
84
+ buyerName: z.string().optional(),
85
+ buyerUsername: z.string().optional(),
86
+ buyerEmail: z.email(),
90
87
  }).openapi({ title: "TransactionEntity" });
91
88
 
92
89
  export const InitTransactionOutputSchema = z
@@ -102,7 +99,6 @@ export const InitTransactionOutputSchema = z
102
99
  // TYPES EXPORTS
103
100
  // ==========================================
104
101
 
105
-
106
102
  export type BaseTransactionEntity = z.infer<typeof BaseTransactionSchema>;
107
103
 
108
104
  export type InitTransactionInput = z.infer<typeof InitTransactionInputSchema>;