@zyacreatives/shared 2.5.32 → 2.5.34

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.
@@ -492,7 +492,7 @@ export declare const ProductDiscountCheckInputSchema: z.ZodObject<{
492
492
  }, z.core.$strip>;
493
493
  export declare const ProductDiscountCheckOutputSchema: z.ZodObject<{
494
494
  exists: z.ZodBoolean;
495
- discount: z.ZodObject<{
495
+ discount: z.ZodNullable<z.ZodObject<{
496
496
  discountType: z.ZodEnum<{
497
497
  readonly FIXED_AMOUNT: "Fixed Amount";
498
498
  readonly PERCENTAGE: "Percentage";
@@ -500,7 +500,44 @@ export declare const ProductDiscountCheckOutputSchema: z.ZodObject<{
500
500
  amount: z.ZodNumber;
501
501
  discountCode: z.ZodOptional<z.ZodString>;
502
502
  active: z.ZodDefault<z.ZodBoolean>;
503
- }, z.core.$strip>;
503
+ }, z.core.$strip>>;
504
+ }, z.core.$strip>;
505
+ export declare const ProductStatsOutputSchema: z.ZodObject<{
506
+ salesToday: z.ZodNumber;
507
+ revenueToday: z.ZodNumber;
508
+ totalProductRevenue: z.ZodNumber;
509
+ }, z.core.$strip>;
510
+ export declare const ProductTransactionItemSchema: z.ZodObject<{
511
+ id: z.ZodString;
512
+ customerEmail: z.ZodNullable<z.ZodString>;
513
+ orderId: z.ZodNullable<z.ZodString>;
514
+ price: z.ZodNumber;
515
+ status: z.ZodString;
516
+ date: z.ZodCoercedDate<unknown>;
517
+ }, z.core.$strip>;
518
+ export declare const ProductTransactionsOutputSchema: z.ZodObject<{
519
+ transactions: z.ZodArray<z.ZodObject<{
520
+ id: z.ZodString;
521
+ customerEmail: z.ZodNullable<z.ZodString>;
522
+ orderId: z.ZodNullable<z.ZodString>;
523
+ price: z.ZodNumber;
524
+ status: z.ZodString;
525
+ date: z.ZodCoercedDate<unknown>;
526
+ }, z.core.$strip>>;
527
+ }, z.core.$strip>;
528
+ export declare const RevenueChartPointSchema: z.ZodObject<{
529
+ date: z.ZodString;
530
+ revenue: z.ZodNumber;
531
+ }, z.core.$strip>;
532
+ export declare const ProductRevenueChartOutputSchema: z.ZodObject<{
533
+ chartData: z.ZodArray<z.ZodObject<{
534
+ date: z.ZodString;
535
+ revenue: z.ZodNumber;
536
+ }, z.core.$strip>>;
537
+ }, z.core.$strip>;
538
+ export declare const RevenueChartInputSchema: z.ZodObject<{
539
+ startDate: z.ZodOptional<z.ZodString>;
540
+ endDate: z.ZodOptional<z.ZodString>;
504
541
  }, z.core.$strip>;
505
542
  export type ProductLink = z.infer<typeof ProductLinkSchema>;
506
543
  export type SearchProductInput = z.infer<typeof SearchProductInputSchema>;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ProductDiscountCheckOutputSchema = exports.ProductDiscountCheckInputSchema = exports.MarketplaceProductEntitySchema = exports.GetMarketplaceInfoOutputSchema = exports.MarketplaceCategorySchema = exports.SearchProductOutputSchema = exports.SearchProductInputSchema = exports.ProductSearchDocumentSchema = exports.ProductEntitySchema = exports.UpdateProductInputSchema = exports.ProductServiceAndComplianceInputSchema = exports.CreateProductInputSchema = exports.ProductLinkSchema = exports.ProductDiscountEntitySchema = void 0;
3
+ exports.RevenueChartInputSchema = exports.ProductRevenueChartOutputSchema = exports.RevenueChartPointSchema = exports.ProductTransactionsOutputSchema = exports.ProductTransactionItemSchema = exports.ProductStatsOutputSchema = exports.ProductDiscountCheckOutputSchema = exports.ProductDiscountCheckInputSchema = exports.MarketplaceProductEntitySchema = exports.GetMarketplaceInfoOutputSchema = exports.MarketplaceCategorySchema = exports.SearchProductOutputSchema = exports.SearchProductInputSchema = exports.ProductSearchDocumentSchema = exports.ProductEntitySchema = exports.UpdateProductInputSchema = exports.ProductServiceAndComplianceInputSchema = exports.CreateProductInputSchema = 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");
@@ -210,5 +210,32 @@ exports.ProductDiscountCheckInputSchema = zod_openapi_1.z.object({
210
210
  });
211
211
  exports.ProductDiscountCheckOutputSchema = zod_openapi_1.z.object({
212
212
  exists: zod_openapi_1.z.boolean(),
213
- discount: exports.ProductDiscountEntitySchema,
213
+ discount: exports.ProductDiscountEntitySchema.nullable(),
214
+ });
215
+ exports.ProductStatsOutputSchema = zod_openapi_1.z.object({
216
+ salesToday: zod_openapi_1.z.number().int(),
217
+ revenueToday: zod_openapi_1.z.number().int(),
218
+ totalProductRevenue: zod_openapi_1.z.number().int(),
219
+ });
220
+ exports.ProductTransactionItemSchema = zod_openapi_1.z.object({
221
+ id: zod_openapi_1.z.string(),
222
+ customerEmail: zod_openapi_1.z.string().nullable(),
223
+ orderId: zod_openapi_1.z.string().nullable(),
224
+ price: zod_openapi_1.z.number().int(),
225
+ status: zod_openapi_1.z.string(),
226
+ date: zod_openapi_1.z.coerce.date(),
227
+ });
228
+ exports.ProductTransactionsOutputSchema = zod_openapi_1.z.object({
229
+ transactions: zod_openapi_1.z.array(exports.ProductTransactionItemSchema),
230
+ });
231
+ exports.RevenueChartPointSchema = zod_openapi_1.z.object({
232
+ date: zod_openapi_1.z.string().openapi({ example: "2023-11-25" }),
233
+ revenue: zod_openapi_1.z.number().int(),
234
+ });
235
+ exports.ProductRevenueChartOutputSchema = zod_openapi_1.z.object({
236
+ chartData: zod_openapi_1.z.array(exports.RevenueChartPointSchema),
237
+ });
238
+ exports.RevenueChartInputSchema = zod_openapi_1.z.object({
239
+ startDate: zod_openapi_1.z.string().optional().openapi({ description: "YYYY-MM-DD" }),
240
+ endDate: zod_openapi_1.z.string().optional().openapi({ description: "YYYY-MM-DD" }),
214
241
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zyacreatives/shared",
3
- "version": "2.5.32",
3
+ "version": "2.5.34",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -263,7 +263,40 @@ export const ProductDiscountCheckInputSchema = z.object({
263
263
 
264
264
  export const ProductDiscountCheckOutputSchema = z.object({
265
265
  exists: z.boolean(),
266
- discount: ProductDiscountEntitySchema,
266
+ discount: ProductDiscountEntitySchema.nullable(),
267
+ });
268
+
269
+ export const ProductStatsOutputSchema = z.object({
270
+ salesToday: z.number().int(),
271
+ revenueToday: z.number().int(),
272
+ totalProductRevenue: z.number().int(),
273
+ });
274
+
275
+ export const ProductTransactionItemSchema = z.object({
276
+ id: z.string(),
277
+ customerEmail: z.string().nullable(),
278
+ orderId: z.string().nullable(),
279
+ price: z.number().int(),
280
+ status: z.string(),
281
+ date: z.coerce.date(),
282
+ });
283
+
284
+ export const ProductTransactionsOutputSchema = z.object({
285
+ transactions: z.array(ProductTransactionItemSchema),
286
+ });
287
+
288
+ export const RevenueChartPointSchema = z.object({
289
+ date: z.string().openapi({ example: "2023-11-25" }),
290
+ revenue: z.number().int(),
291
+ });
292
+
293
+ export const ProductRevenueChartOutputSchema = z.object({
294
+ chartData: z.array(RevenueChartPointSchema),
295
+ });
296
+
297
+ export const RevenueChartInputSchema = z.object({
298
+ startDate: z.string().optional().openapi({ description: "YYYY-MM-DD" }),
299
+ endDate: z.string().optional().openapi({ description: "YYYY-MM-DD" }),
267
300
  });
268
301
 
269
302
  export type ProductLink = z.infer<typeof ProductLinkSchema>;
@@ -288,5 +321,9 @@ export type MarketplaceProductEntity = z.infer<
288
321
  typeof MarketplaceProductEntitySchema
289
322
  >;
290
323
 
291
- export type ProductDiscountCheckInput = z.infer<typeof ProductDiscountCheckInputSchema>;
292
- export type ProductDiscountCheckOutput = z.infer<typeof ProductDiscountCheckOutputSchema>;
324
+ export type ProductDiscountCheckInput = z.infer<
325
+ typeof ProductDiscountCheckInputSchema
326
+ >;
327
+ export type ProductDiscountCheckOutput = z.infer<
328
+ typeof ProductDiscountCheckOutputSchema
329
+ >;