@deallony/shared 1.2.29 → 1.2.31

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.
@@ -6,10 +6,7 @@ export declare const createPaymentSchema: z.ZodObject<{
6
6
  }>;
7
7
  payment_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
8
8
  media: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodAny>>>;
9
- description: z.ZodOptional<z.ZodObject<{
10
- en: z.ZodDefault<z.ZodString>;
11
- ar: z.ZodDefault<z.ZodString>;
12
- }, z.core.$strip>>;
9
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
13
10
  }, z.core.$strip>;
14
11
  export declare const rejectPaymentSchema: z.ZodObject<{
15
12
  reason: z.ZodOptional<z.ZodString>;
@@ -11,9 +11,7 @@ exports.createPaymentSchema = zod_1.z
11
11
  payment_gateway: zod_1.z.enum(payments_1.PaymentGatewayValues),
12
12
  payment_id: zod_1.z.string().trim().max(255).nullable().optional(),
13
13
  media: zod_1.z.record(zod_1.z.string(), zod_1.z.any()).nullable().optional(),
14
- description: zod_1.z
15
- .object({ en: zod_1.z.string().default(""), ar: zod_1.z.string().default("") })
16
- .optional(),
14
+ description: zod_1.z.string().trim().max(500).nullable().optional(),
17
15
  })
18
16
  .refine((data) => !(data.payment_id && data.media), "payment_id and media are mutually exclusive");
19
17
  exports.rejectPaymentSchema = zod_1.z.object({
@@ -1,4 +1,4 @@
1
- import { PaymentGateway, PaymentStatus } from '../../constants/payments';
1
+ import { PaymentGateway, PaymentStatus } from "../../constants/payments";
2
2
  export type IPayment = {
3
3
  id: number;
4
4
  user_id: number;
@@ -9,9 +9,16 @@ export type IPayment = {
9
9
  status: PaymentStatus;
10
10
  rejection_reason: string | null;
11
11
  wallet_transaction_id: number | null;
12
- description: {
13
- en: string;
14
- ar: string;
15
- };
12
+ description: string | null;
16
13
  created_at: string | Date;
17
14
  };
15
+ export type CreatePaymentInput = {
16
+ user_id: number;
17
+ amount: string;
18
+ payment_gateway: PaymentGateway;
19
+ payment_id?: string | null;
20
+ media?: Record<string, any> | null;
21
+ description?: string | null;
22
+ status: PaymentStatus;
23
+ };
24
+ export type UpdatePaymentInput = Partial<Pick<IPayment, "status" | "rejection_reason" | "wallet_transaction_id" | "payment_id" | "media">>;
@@ -8,9 +8,7 @@ export const createPaymentSchema = z
8
8
  payment_gateway: z.enum(PaymentGatewayValues),
9
9
  payment_id: z.string().trim().max(255).nullable().optional(),
10
10
  media: z.record(z.string(), z.any()).nullable().optional(),
11
- description: z
12
- .object({ en: z.string().default(""), ar: z.string().default("") })
13
- .optional(),
11
+ description: z.string().trim().max(500).nullable().optional(),
14
12
  })
15
13
  .refine((data) => !(data.payment_id && data.media), "payment_id and media are mutually exclusive");
16
14
  export const rejectPaymentSchema = z.object({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deallony/shared",
3
- "version": "1.2.29",
3
+ "version": "1.2.31",
4
4
  "private": false,
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",