@deallony/shared 1.1.64 → 1.1.65

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,77 +1,18 @@
1
- import { z } from 'zod';
2
- import { type LocalizedName } from '../../types/common/LocalizedName';
3
- import type { IEventType } from './EventType.dto';
4
- import type { IEventWedding } from './EventWedding.dto';
5
- export declare const eventTemplateBaseSchema: z.ZodObject<{
6
- code: z.ZodString;
7
- name: z.ZodObject<{
8
- en: z.ZodString;
9
- ar: z.ZodString;
10
- }, z.core.$strip>;
11
- active: z.ZodOptional<z.ZodBoolean>;
12
- religion: z.ZodOptional<z.ZodNullable<z.ZodString>>;
13
- event_type_id: z.ZodCoercedNumber<unknown>;
14
- }, z.core.$strip>;
15
- export declare const createEventTemplateSchema: z.ZodObject<{
16
- code: z.ZodString;
17
- name: z.ZodObject<{
18
- en: z.ZodString;
19
- ar: z.ZodString;
20
- }, z.core.$strip>;
21
- active: z.ZodOptional<z.ZodBoolean>;
22
- religion: z.ZodOptional<z.ZodNullable<z.ZodString>>;
23
- event_type_id: z.ZodCoercedNumber<unknown>;
24
- }, z.core.$strip>;
25
- export declare const updateEventTemplateSchema: z.ZodObject<{
26
- code: z.ZodString;
27
- name: z.ZodObject<{
28
- en: z.ZodString;
29
- ar: z.ZodString;
30
- }, z.core.$strip>;
31
- active: z.ZodOptional<z.ZodBoolean>;
32
- religion: z.ZodOptional<z.ZodNullable<z.ZodString>>;
33
- event_type_id: z.ZodCoercedNumber<unknown>;
34
- id: z.ZodCoercedNumber<unknown>;
35
- }, z.core.$strip>;
36
- export declare const saveEventTemplateSchema: z.ZodUnion<readonly [z.ZodObject<{
37
- code: z.ZodString;
38
- name: z.ZodObject<{
39
- en: z.ZodString;
40
- ar: z.ZodString;
41
- }, z.core.$strip>;
42
- active: z.ZodOptional<z.ZodBoolean>;
43
- religion: z.ZodOptional<z.ZodNullable<z.ZodString>>;
44
- event_type_id: z.ZodCoercedNumber<unknown>;
45
- }, z.core.$strip>, z.ZodObject<{
46
- code: z.ZodString;
47
- name: z.ZodObject<{
48
- en: z.ZodString;
49
- ar: z.ZodString;
50
- }, z.core.$strip>;
51
- active: z.ZodOptional<z.ZodBoolean>;
52
- religion: z.ZodOptional<z.ZodNullable<z.ZodString>>;
53
- event_type_id: z.ZodCoercedNumber<unknown>;
54
- id: z.ZodCoercedNumber<unknown>;
55
- }, z.core.$strip>]>;
56
- export declare const getEventTemplatesFilterSchema: z.ZodObject<{
57
- search: z.ZodOptional<z.ZodString>;
58
- active: z.ZodOptional<z.ZodBoolean>;
59
- event_type_id: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
60
- page: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
61
- limit: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
62
- }, z.core.$strip>;
63
- export type CreateEventTemplateDto = z.infer<typeof createEventTemplateSchema>;
64
- export type UpdateEventTemplateDto = z.infer<typeof updateEventTemplateSchema>;
65
- export type SaveEventTemplateDto = z.infer<typeof saveEventTemplateSchema>;
66
- export type GetEventTemplatesFilterDto = z.infer<typeof getEventTemplatesFilterSchema>;
67
- export type IEventTemplate = {
68
- id?: number;
69
- code: string;
70
- name: LocalizedName;
71
- active: boolean;
72
- religion: string | null;
73
- event_type_id: number;
74
- eventType?: IEventType;
75
- weddings?: IEventWedding[];
1
+ export declare const EventTemplate: {
2
+ WEDDING: {
3
+ value: string;
4
+ name: {
5
+ en: string;
6
+ ar: string;
7
+ };
8
+ event_types: string[];
9
+ };
76
10
  };
77
- export declare const emptyEventTemplate: IEventTemplate;
11
+ export declare const EventTemplateOptions: {
12
+ value: string;
13
+ name: {
14
+ en: string;
15
+ ar: string;
16
+ };
17
+ event_types: string[];
18
+ }[];
@@ -1,38 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.emptyEventTemplate = exports.getEventTemplatesFilterSchema = exports.saveEventTemplateSchema = exports.updateEventTemplateSchema = exports.createEventTemplateSchema = exports.eventTemplateBaseSchema = void 0;
4
- const zod_1 = require("zod");
5
- const LocalizedName_1 = require("../../types/common/LocalizedName");
6
- const localizedName_dto_1 = require("../common/localizedName.dto");
7
- exports.eventTemplateBaseSchema = zod_1.z.object({
8
- code: zod_1.z.string().trim().min(1).max(100),
9
- name: localizedName_dto_1.localizedNameSchema,
10
- active: zod_1.z.boolean().optional(),
11
- religion: zod_1.z.string().trim().max(100).nullable().optional(),
12
- event_type_id: zod_1.z.coerce.number().int().positive(),
13
- });
14
- exports.createEventTemplateSchema = exports.eventTemplateBaseSchema;
15
- exports.updateEventTemplateSchema = exports.eventTemplateBaseSchema.extend({
16
- id: zod_1.z.coerce.number().int().positive(),
17
- });
18
- exports.saveEventTemplateSchema = zod_1.z.union([
19
- exports.createEventTemplateSchema,
20
- exports.updateEventTemplateSchema,
21
- ]);
22
- exports.getEventTemplatesFilterSchema = zod_1.z.object({
23
- search: zod_1.z.string().trim().optional(),
24
- active: zod_1.z.boolean().optional(),
25
- event_type_id: zod_1.z.coerce.number().int().positive().optional(),
26
- page: zod_1.z.coerce.number().int().positive().optional(),
27
- limit: zod_1.z.coerce.number().int().positive().max(100).optional(),
28
- });
29
- exports.emptyEventTemplate = {
30
- id: 0,
31
- code: '',
32
- name: (0, LocalizedName_1.createEmptyLocalizedName)(),
33
- active: true,
34
- religion: null,
35
- event_type_id: 0,
36
- eventType: undefined,
37
- weddings: [],
3
+ exports.EventTemplateOptions = exports.EventTemplate = void 0;
4
+ exports.EventTemplate = {
5
+ WEDDING: { value: 'wedding-1', name: { en: 'Wedding', ar: 'زفاف' }, event_types: ['wedding'] },
38
6
  };
7
+ exports.EventTemplateOptions = Object.values(exports.EventTemplate).map((type) => ({
8
+ value: type.value,
9
+ name: type.name,
10
+ event_types: type.event_types,
11
+ }));
@@ -1,35 +1,8 @@
1
- import { z } from 'zod';
2
- import { createEmptyLocalizedName } from '../../types/common/LocalizedName.js';
3
- import { localizedNameSchema } from '../common/localizedName.dto.js';
4
- export const eventTemplateBaseSchema = z.object({
5
- code: z.string().trim().min(1).max(100),
6
- name: localizedNameSchema,
7
- active: z.boolean().optional(),
8
- religion: z.string().trim().max(100).nullable().optional(),
9
- event_type_id: z.coerce.number().int().positive(),
10
- });
11
- export const createEventTemplateSchema = eventTemplateBaseSchema;
12
- export const updateEventTemplateSchema = eventTemplateBaseSchema.extend({
13
- id: z.coerce.number().int().positive(),
14
- });
15
- export const saveEventTemplateSchema = z.union([
16
- createEventTemplateSchema,
17
- updateEventTemplateSchema,
18
- ]);
19
- export const getEventTemplatesFilterSchema = z.object({
20
- search: z.string().trim().optional(),
21
- active: z.boolean().optional(),
22
- event_type_id: z.coerce.number().int().positive().optional(),
23
- page: z.coerce.number().int().positive().optional(),
24
- limit: z.coerce.number().int().positive().max(100).optional(),
25
- });
26
- export const emptyEventTemplate = {
27
- id: 0,
28
- code: '',
29
- name: createEmptyLocalizedName(),
30
- active: true,
31
- religion: null,
32
- event_type_id: 0,
33
- eventType: undefined,
34
- weddings: [],
1
+ export const EventTemplate = {
2
+ WEDDING: { value: 'wedding-1', name: { en: 'Wedding', ar: 'زفاف' }, event_types: ['wedding'] },
35
3
  };
4
+ export const EventTemplateOptions = Object.values(EventTemplate).map((type) => ({
5
+ value: type.value,
6
+ name: type.name,
7
+ event_types: type.event_types,
8
+ }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deallony/shared",
3
- "version": "1.1.64",
3
+ "version": "1.1.65",
4
4
  "private": false,
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",