@jsdev_ninja/core 0.8.55 → 0.9.0

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.
@@ -1 +1 @@
1
- {"version":3,"file":"Address.d.ts","sourceRoot":"","sources":["../../lib/entities/Address.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;EAQxB,CAAC;AAEH,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC"}
1
+ {"version":3,"file":"Address.d.ts","sourceRoot":"","sources":["../../lib/entities/Address.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;EAQxB,CAAC;AAEH,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC"}
@@ -1,10 +1,11 @@
1
1
  import { z } from "zod";
2
+ import { notEmptyTextSchema } from "./Atoms";
2
3
  export const AddressSchema = z.object({
3
- country: z.string(),
4
- city: z.string(),
5
- street: z.string(),
6
- streetNumber: z.string(),
7
- floor: z.string(),
8
- apartmentEnterNumber: z.string(),
9
- apartmentNumber: z.string(),
4
+ country: notEmptyTextSchema,
5
+ city: notEmptyTextSchema,
6
+ street: notEmptyTextSchema,
7
+ streetNumber: notEmptyTextSchema,
8
+ floor: notEmptyTextSchema,
9
+ apartmentEnterNumber: notEmptyTextSchema,
10
+ apartmentNumber: notEmptyTextSchema,
10
11
  });
@@ -1 +1 @@
1
- {"version":3,"file":"Atoms.d.ts","sourceRoot":"","sources":["../../lib/entities/Atoms.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,kBAAkB,aAAoB,CAAC;AACpD,eAAO,MAAM,iBAAiB,aAAwD,CAAC"}
1
+ {"version":3,"file":"Atoms.d.ts","sourceRoot":"","sources":["../../lib/entities/Atoms.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,kBAAkB,aAA6C,CAAC;AAC7E,eAAO,MAAM,iBAAiB,aAAwD,CAAC"}
@@ -1,3 +1,3 @@
1
1
  import { z } from "zod";
2
- export const notEmptyTextSchema = z.string().min(1);
2
+ export const notEmptyTextSchema = z.string().min(1, { message: "שדה חובה" });
3
3
  export const numericTextSchema = z.string().regex(/^\d+$/, "Must be a numeric string");
@@ -1,6 +1,6 @@
1
1
  import { z } from "zod";
2
2
  export const LocaleSchema = z.object({
3
3
  lang: z.enum(["he"]),
4
- value: z.string().min(1),
4
+ value: z.string(),
5
5
  });
6
6
  export const LocaleValueSchema = z.array(LocaleSchema);
@@ -717,6 +717,7 @@ export declare const OrderSchema: z.ZodObject<{
717
717
  actualAmount: z.ZodOptional<z.ZodNumber>;
718
718
  date: z.ZodNumber;
719
719
  deliveryDate: z.ZodOptional<z.ZodNumber>;
720
+ createdAt: z.ZodOptional<z.ZodNumber>;
720
721
  client: z.ZodObject<{
721
722
  type: z.ZodLiteral<"Profile">;
722
723
  id: z.ZodString;
@@ -726,17 +727,8 @@ export declare const OrderSchema: z.ZodObject<{
726
727
  clientType: z.ZodEnum<["user", "company"]>;
727
728
  displayName: z.ZodString;
728
729
  email: z.ZodString;
729
- phoneNumber: z.ZodObject<{
730
- code: z.ZodString;
731
- number: z.ZodString;
732
- }, "strip", z.ZodTypeAny, {
733
- number: string;
734
- code: string;
735
- }, {
736
- number: string;
737
- code: string;
738
- }>;
739
- address: z.ZodObject<{
730
+ phoneNumber: z.ZodOptional<z.ZodString>;
731
+ address: z.ZodOptional<z.ZodObject<{
740
732
  country: z.ZodString;
741
733
  city: z.ZodString;
742
734
  street: z.ZodString;
@@ -760,7 +752,7 @@ export declare const OrderSchema: z.ZodObject<{
760
752
  floor: string;
761
753
  apartmentEnterNumber: string;
762
754
  apartmentNumber: string;
763
- }>;
755
+ }>>;
764
756
  isAnonymous: z.ZodBoolean;
765
757
  createdDate: z.ZodNumber;
766
758
  lastActivityDate: z.ZodNumber;
@@ -773,11 +765,11 @@ export declare const OrderSchema: z.ZodObject<{
773
765
  clientType: "user" | "company";
774
766
  displayName: string;
775
767
  email: string;
776
- phoneNumber: {
777
- number: string;
778
- code: string;
779
- };
780
- address: {
768
+ isAnonymous: boolean;
769
+ createdDate: number;
770
+ lastActivityDate: number;
771
+ phoneNumber?: string | undefined;
772
+ address?: {
781
773
  country: string;
782
774
  city: string;
783
775
  street: string;
@@ -785,10 +777,7 @@ export declare const OrderSchema: z.ZodObject<{
785
777
  floor: string;
786
778
  apartmentEnterNumber: string;
787
779
  apartmentNumber: string;
788
- };
789
- isAnonymous: boolean;
790
- createdDate: number;
791
- lastActivityDate: number;
780
+ } | undefined;
792
781
  }, {
793
782
  type: "Profile";
794
783
  id: string;
@@ -798,11 +787,11 @@ export declare const OrderSchema: z.ZodObject<{
798
787
  clientType: "user" | "company";
799
788
  displayName: string;
800
789
  email: string;
801
- phoneNumber: {
802
- number: string;
803
- code: string;
804
- };
805
- address: {
790
+ isAnonymous: boolean;
791
+ createdDate: number;
792
+ lastActivityDate: number;
793
+ phoneNumber?: string | undefined;
794
+ address?: {
806
795
  country: string;
807
796
  city: string;
808
797
  street: string;
@@ -810,10 +799,7 @@ export declare const OrderSchema: z.ZodObject<{
810
799
  floor: string;
811
800
  apartmentEnterNumber: string;
812
801
  apartmentNumber: string;
813
- };
814
- isAnonymous: boolean;
815
- createdDate: number;
816
- lastActivityDate: number;
802
+ } | undefined;
817
803
  }>;
818
804
  }, "strip", z.ZodTypeAny, {
819
805
  type: "Order";
@@ -927,11 +913,11 @@ export declare const OrderSchema: z.ZodObject<{
927
913
  clientType: "user" | "company";
928
914
  displayName: string;
929
915
  email: string;
930
- phoneNumber: {
931
- number: string;
932
- code: string;
933
- };
934
- address: {
916
+ isAnonymous: boolean;
917
+ createdDate: number;
918
+ lastActivityDate: number;
919
+ phoneNumber?: string | undefined;
920
+ address?: {
935
921
  country: string;
936
922
  city: string;
937
923
  street: string;
@@ -939,14 +925,12 @@ export declare const OrderSchema: z.ZodObject<{
939
925
  floor: string;
940
926
  apartmentEnterNumber: string;
941
927
  apartmentNumber: string;
942
- };
943
- isAnonymous: boolean;
944
- createdDate: number;
945
- lastActivityDate: number;
928
+ } | undefined;
946
929
  };
947
930
  originalAmount?: number | undefined;
948
931
  actualAmount?: number | undefined;
949
932
  deliveryDate?: number | undefined;
933
+ createdAt?: number | undefined;
950
934
  }, {
951
935
  type: "Order";
952
936
  status: "completed" | "pending" | "processing" | "in_delivery" | "delivered" | "canceled" | "refunded";
@@ -1059,11 +1043,11 @@ export declare const OrderSchema: z.ZodObject<{
1059
1043
  clientType: "user" | "company";
1060
1044
  displayName: string;
1061
1045
  email: string;
1062
- phoneNumber: {
1063
- number: string;
1064
- code: string;
1065
- };
1066
- address: {
1046
+ isAnonymous: boolean;
1047
+ createdDate: number;
1048
+ lastActivityDate: number;
1049
+ phoneNumber?: string | undefined;
1050
+ address?: {
1067
1051
  country: string;
1068
1052
  city: string;
1069
1053
  street: string;
@@ -1071,14 +1055,12 @@ export declare const OrderSchema: z.ZodObject<{
1071
1055
  floor: string;
1072
1056
  apartmentEnterNumber: string;
1073
1057
  apartmentNumber: string;
1074
- };
1075
- isAnonymous: boolean;
1076
- createdDate: number;
1077
- lastActivityDate: number;
1058
+ } | undefined;
1078
1059
  };
1079
1060
  originalAmount?: number | undefined;
1080
1061
  actualAmount?: number | undefined;
1081
1062
  deliveryDate?: number | undefined;
1063
+ createdAt?: number | undefined;
1082
1064
  }>;
1083
1065
  export type TOrder = z.infer<typeof OrderSchema>;
1084
1066
  //# sourceMappingURL=Order.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Order.d.ts","sourceRoot":"","sources":["../../l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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6BtB,CAAC;AAEH,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC"}
@@ -1,6 +1,7 @@
1
1
  import { z } from "zod";
2
2
  import { ProfileSchema } from "./Profile";
3
3
  import { ProductSchema } from "./Product";
4
+ import { notEmptyTextSchema } from "./Atoms";
4
5
  // pending - order created / by user
5
6
  // processing order accepted by store by admin
6
7
  // delivered - order delivered by admin
@@ -9,10 +10,10 @@ import { ProductSchema } from "./Product";
9
10
  // type PaymentMethod = "credit_card" | "paypal" | "bank_transfer" | "cash_on_delivery";
10
11
  export const OrderSchema = z.object({
11
12
  type: z.literal("Order"),
12
- id: z.string(),
13
- companyId: z.string(),
14
- storeId: z.string(),
15
- userId: z.string(),
13
+ id: notEmptyTextSchema,
14
+ companyId: notEmptyTextSchema,
15
+ storeId: notEmptyTextSchema,
16
+ userId: notEmptyTextSchema,
16
17
  status: z.enum([
17
18
  "pending",
18
19
  "processing",
@@ -34,5 +35,6 @@ export const OrderSchema = z.object({
34
35
  actualAmount: z.number().positive().optional(), // what store charge
35
36
  date: z.number(),
36
37
  deliveryDate: z.number().optional(),
37
- client: ProfileSchema,
38
+ createdAt: z.number().optional(),
39
+ client: ProfileSchema.required({}),
38
40
  });
@@ -336,324 +336,8 @@ export declare const ProductSchema: z.ZodObject<{
336
336
  purchasePrice?: number | undefined;
337
337
  profitPercentage?: number | undefined;
338
338
  }>;
339
- export declare const NewProductSchema: z.ZodObject<z.objectUtil.extendShape<Omit<{
340
- type: z.ZodLiteral<"Product">;
341
- storeId: z.ZodString;
342
- companyId: z.ZodString;
343
- id: z.ZodString;
344
- objectID: z.ZodString;
345
- sku: z.ZodString;
346
- name: z.ZodArray<z.ZodObject<{
347
- lang: z.ZodEnum<["he"]>;
348
- value: z.ZodString;
349
- }, "strip", z.ZodTypeAny, {
350
- value: string;
351
- lang: "he";
352
- }, {
353
- value: string;
354
- lang: "he";
355
- }>, "many">;
356
- description: z.ZodArray<z.ZodObject<{
357
- lang: z.ZodEnum<["he"]>;
358
- value: z.ZodString;
359
- }, "strip", z.ZodTypeAny, {
360
- value: string;
361
- lang: "he";
362
- }, {
363
- value: string;
364
- lang: "he";
365
- }>, "many">;
366
- isPublished: z.ZodBoolean;
367
- vat: z.ZodBoolean;
368
- priceType: z.ZodObject<{
369
- type: z.ZodEnum<["unit", "kg", "gram", "liter", "ml"]>;
370
- value: z.ZodNumber;
371
- }, "strip", z.ZodTypeAny, {
372
- value: number;
373
- type: "unit" | "kg" | "gram" | "liter" | "ml";
374
- }, {
375
- value: number;
376
- type: "unit" | "kg" | "gram" | "liter" | "ml";
377
- }>;
378
- price: z.ZodNumber;
379
- purchasePrice: z.ZodOptional<z.ZodNumber>;
380
- profitPercentage: z.ZodOptional<z.ZodNumber>;
381
- currency: z.ZodLiteral<"ILS">;
382
- discount: z.ZodObject<{
383
- type: z.ZodEnum<["number", "percent", "none"]>;
384
- value: z.ZodNumber;
385
- }, "strip", z.ZodTypeAny, {
386
- value: number;
387
- type: "number" | "percent" | "none";
388
- }, {
389
- value: number;
390
- type: "number" | "percent" | "none";
391
- }>;
392
- weight: z.ZodObject<{
393
- value: z.ZodNumber;
394
- unit: z.ZodEnum<["kg", "gram", "none"]>;
395
- }, "strip", z.ZodTypeAny, {
396
- value: number;
397
- unit: "kg" | "gram" | "none";
398
- }, {
399
- value: number;
400
- unit: "kg" | "gram" | "none";
401
- }>;
402
- volume: z.ZodObject<{
403
- value: z.ZodNumber;
404
- unit: z.ZodEnum<["liter", "ml", "none"]>;
405
- }, "strip", z.ZodTypeAny, {
406
- value: number;
407
- unit: "liter" | "ml" | "none";
408
- }, {
409
- value: number;
410
- unit: "liter" | "ml" | "none";
411
- }>;
412
- images: z.ZodArray<z.ZodObject<{
413
- url: z.ZodString;
414
- id: z.ZodString;
415
- }, "strip", z.ZodTypeAny, {
416
- id: string;
417
- url: string;
418
- }, {
419
- id: string;
420
- url: string;
421
- }>, "many">;
422
- manufacturer: z.ZodString;
423
- brand: z.ZodString;
424
- importer: z.ZodString;
425
- supplier: z.ZodString;
426
- ingredients: z.ZodArray<z.ZodObject<{
427
- lang: z.ZodEnum<["he"]>;
428
- value: z.ZodString;
429
- }, "strip", z.ZodTypeAny, {
430
- value: string;
431
- lang: "he";
432
- }, {
433
- value: string;
434
- lang: "he";
435
- }>, "many">;
436
- created_at: z.ZodNumber;
437
- updated_at: z.ZodNumber;
438
- categoryList: z.ZodArray<z.ZodType<{
439
- id: string;
440
- companyId: string;
441
- storeId: string;
442
- tag: string;
443
- locales: {
444
- value: string;
445
- lang: "he";
446
- }[];
447
- depth: number;
448
- parentId?: string | null | undefined;
449
- } & {
450
- children: ({
451
- id: string;
452
- companyId: string;
453
- storeId: string;
454
- tag: string;
455
- locales: {
456
- value: string;
457
- lang: "he";
458
- }[];
459
- depth: number;
460
- parentId?: string | null | undefined;
461
- } & /*elided*/ any)[];
462
- }, z.ZodTypeDef, {
463
- id: string;
464
- companyId: string;
465
- storeId: string;
466
- tag: string;
467
- locales: {
468
- value: string;
469
- lang: "he";
470
- }[];
471
- depth: number;
472
- parentId?: string | null | undefined;
473
- } & {
474
- children: ({
475
- id: string;
476
- companyId: string;
477
- storeId: string;
478
- tag: string;
479
- locales: {
480
- value: string;
481
- lang: "he";
482
- }[];
483
- depth: number;
484
- parentId?: string | null | undefined;
485
- } & /*elided*/ any)[];
486
- }>, "many">;
487
- categories: z.ZodObject<{
488
- lvl0: z.ZodArray<z.ZodString, "many">;
489
- lvl1: z.ZodArray<z.ZodString, "many">;
490
- lvl2: z.ZodArray<z.ZodString, "many">;
491
- lvl3: z.ZodArray<z.ZodString, "many">;
492
- lvl4: z.ZodArray<z.ZodString, "many">;
493
- }, "strip", z.ZodTypeAny, {
494
- lvl0: string[];
495
- lvl1: string[];
496
- lvl2: string[];
497
- lvl3: string[];
498
- lvl4: string[];
499
- }, {
500
- lvl0: string[];
501
- lvl1: string[];
502
- lvl2: string[];
503
- lvl3: string[];
504
- lvl4: string[];
505
- }>;
506
- categoryNames: z.ZodArray<z.ZodString, "many">;
507
- }, "id" | "images" | "categories">, {
508
- image: z.ZodOptional<z.ZodType<File, z.ZodTypeDef, File>>;
509
- }>, "strip", z.ZodTypeAny, {
510
- type: "Product";
511
- companyId: string;
512
- storeId: string;
513
- objectID: string;
514
- sku: string;
515
- name: {
516
- value: string;
517
- lang: "he";
518
- }[];
519
- description: {
520
- value: string;
521
- lang: "he";
522
- }[];
523
- isPublished: boolean;
524
- vat: boolean;
525
- priceType: {
526
- value: number;
527
- type: "unit" | "kg" | "gram" | "liter" | "ml";
528
- };
529
- price: number;
530
- currency: "ILS";
531
- discount: {
532
- value: number;
533
- type: "number" | "percent" | "none";
534
- };
535
- weight: {
536
- value: number;
537
- unit: "kg" | "gram" | "none";
538
- };
539
- volume: {
540
- value: number;
541
- unit: "liter" | "ml" | "none";
542
- };
543
- manufacturer: string;
544
- brand: string;
545
- importer: string;
546
- supplier: string;
547
- ingredients: {
548
- value: string;
549
- lang: "he";
550
- }[];
551
- created_at: number;
552
- updated_at: number;
553
- categoryList: ({
554
- id: string;
555
- companyId: string;
556
- storeId: string;
557
- tag: string;
558
- locales: {
559
- value: string;
560
- lang: "he";
561
- }[];
562
- depth: number;
563
- parentId?: string | null | undefined;
564
- } & {
565
- children: ({
566
- id: string;
567
- companyId: string;
568
- storeId: string;
569
- tag: string;
570
- locales: {
571
- value: string;
572
- lang: "he";
573
- }[];
574
- depth: number;
575
- parentId?: string | null | undefined;
576
- } & /*elided*/ any)[];
577
- })[];
578
- categoryNames: string[];
579
- purchasePrice?: number | undefined;
580
- profitPercentage?: number | undefined;
581
- image?: File | undefined;
582
- }, {
583
- type: "Product";
584
- companyId: string;
585
- storeId: string;
586
- objectID: string;
587
- sku: string;
588
- name: {
589
- value: string;
590
- lang: "he";
591
- }[];
592
- description: {
593
- value: string;
594
- lang: "he";
595
- }[];
596
- isPublished: boolean;
597
- vat: boolean;
598
- priceType: {
599
- value: number;
600
- type: "unit" | "kg" | "gram" | "liter" | "ml";
601
- };
602
- price: number;
603
- currency: "ILS";
604
- discount: {
605
- value: number;
606
- type: "number" | "percent" | "none";
607
- };
608
- weight: {
609
- value: number;
610
- unit: "kg" | "gram" | "none";
611
- };
612
- volume: {
613
- value: number;
614
- unit: "liter" | "ml" | "none";
615
- };
616
- manufacturer: string;
617
- brand: string;
618
- importer: string;
619
- supplier: string;
620
- ingredients: {
621
- value: string;
622
- lang: "he";
623
- }[];
624
- created_at: number;
625
- updated_at: number;
626
- categoryList: ({
627
- id: string;
628
- companyId: string;
629
- storeId: string;
630
- tag: string;
631
- locales: {
632
- value: string;
633
- lang: "he";
634
- }[];
635
- depth: number;
636
- parentId?: string | null | undefined;
637
- } & {
638
- children: ({
639
- id: string;
640
- companyId: string;
641
- storeId: string;
642
- tag: string;
643
- locales: {
644
- value: string;
645
- lang: "he";
646
- }[];
647
- depth: number;
648
- parentId?: string | null | undefined;
649
- } & /*elided*/ any)[];
650
- })[];
651
- categoryNames: string[];
652
- purchasePrice?: number | undefined;
653
- profitPercentage?: number | undefined;
654
- image?: File | undefined;
655
- }>;
656
- export declare const EditProductSchema: z.ZodObject<z.objectUtil.extendShape<{
339
+ export type TProduct = z.infer<typeof ProductSchema>;
340
+ export declare const NewProductSchema: z.ZodObject<z.objectUtil.extendShape<{
657
341
  type: z.ZodLiteral<"Product">;
658
342
  storeId: z.ZodString;
659
343
  companyId: z.ZodString;
@@ -995,6 +679,4 @@ export declare const EditProductSchema: z.ZodObject<z.objectUtil.extendShape<{
995
679
  image?: File | undefined;
996
680
  }>;
997
681
  export type TNewProduct = z.infer<typeof NewProductSchema>;
998
- export type TEditProduct = z.infer<typeof EditProductSchema>;
999
- export type TProduct = z.infer<typeof ProductSchema>;
1000
682
  //# sourceMappingURL=Product.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Product.d.ts","sourceRoot":"","sources":["../../lib/entities/Product.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkDxB,CAAC;AAEH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkDxB,CAAC;AACH,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AAErD,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAE3B,CAAC;AAEH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC"}
@@ -1,14 +1,14 @@
1
1
  import { z } from "zod";
2
2
  import { LocaleSchema } from "./Locale";
3
3
  import { CategorySchema } from "./Category";
4
- const text = z.string();
4
+ const text = z.string().min(1);
5
5
  export const ProductSchema = z.object({
6
6
  type: z.literal("Product"),
7
7
  storeId: text,
8
8
  companyId: text,
9
- id: z.string(),
10
- objectID: z.string(),
11
- sku: z.string().min(1),
9
+ id: text,
10
+ objectID: text,
11
+ sku: text,
12
12
  name: z.array(LocaleSchema),
13
13
  description: z.array(LocaleSchema),
14
14
  isPublished: z.boolean(),
@@ -34,7 +34,7 @@ export const ProductSchema = z.object({
34
34
  unit: z.enum(["liter", "ml", "none"]),
35
35
  }),
36
36
  images: z.array(z.object({ url: z.string().url(), id: z.string() })),
37
- manufacturer: text,
37
+ manufacturer: z.string(),
38
38
  brand: z.string(),
39
39
  importer: z.string(),
40
40
  supplier: z.string(),
@@ -52,13 +52,6 @@ export const ProductSchema = z.object({
52
52
  }),
53
53
  categoryNames: z.array(z.string()),
54
54
  });
55
- export const NewProductSchema = ProductSchema.omit({
56
- id: true,
57
- categories: true,
58
- images: true,
59
- }).extend({
60
- image: z.instanceof(File).optional(),
61
- });
62
- export const EditProductSchema = ProductSchema.extend({
55
+ export const NewProductSchema = ProductSchema.extend({
63
56
  image: z.instanceof(File).optional(),
64
57
  });