@deallony/shared 1.1.97 → 1.1.99
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.
- package/dist/cjs/constants/index.d.ts +1 -0
- package/dist/cjs/constants/index.js +2 -1
- package/dist/cjs/constants/routes/app.d.ts +303 -0
- package/dist/cjs/constants/routes/app.js +136 -0
- package/dist/cjs/constants/routes/index.d.ts +1 -0
- package/dist/cjs/constants/routes/index.js +17 -0
- package/dist/cjs/schema/ad/save-ad.schema.d.ts +6 -22
- package/dist/cjs/schema/ad/save-ad.schema.js +18 -13
- package/dist/cjs/schema/ai/ai-fill-ad-form.schema.d.ts +6 -0
- package/dist/cjs/schema/ai/ai-fill-ad-form.schema.js +2 -0
- package/dist/esm/constants/index.js +1 -0
- package/dist/esm/constants/routes/app.js +133 -0
- package/dist/esm/constants/routes/index.js +1 -0
- package/dist/esm/schema/ad/save-ad.schema.js +16 -11
- package/dist/esm/schema/ai/ai-fill-ad-form.schema.js +2 -0
- package/package.json +2 -2
|
@@ -33,12 +33,13 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.USED_PRODUCT = exports.SERVICE = exports.PROPERTY = exports.MOTOR = exports.EVENTS = exports.AD = exports.COMMON = exports.Subject = void 0;
|
|
36
|
+
exports.USED_PRODUCT = exports.SERVICE = exports.ROUTES = exports.PROPERTY = exports.MOTOR = exports.EVENTS = exports.AD = exports.COMMON = exports.Subject = void 0;
|
|
37
37
|
exports.Subject = __importStar(require("./common/Subject"));
|
|
38
38
|
exports.COMMON = __importStar(require("./common"));
|
|
39
39
|
exports.AD = __importStar(require("./ad"));
|
|
40
40
|
exports.EVENTS = __importStar(require("./events"));
|
|
41
41
|
exports.MOTOR = __importStar(require("./motor"));
|
|
42
42
|
exports.PROPERTY = __importStar(require("./property"));
|
|
43
|
+
exports.ROUTES = __importStar(require("./routes"));
|
|
43
44
|
exports.SERVICE = __importStar(require("./service"));
|
|
44
45
|
exports.USED_PRODUCT = __importStar(require("./used-product"));
|
|
@@ -0,0 +1,303 @@
|
|
|
1
|
+
type SubjectTypeValue = string;
|
|
2
|
+
type GenericParams = Record<string, unknown>;
|
|
3
|
+
export declare const APP_ROUTES: {
|
|
4
|
+
readonly main: {
|
|
5
|
+
readonly home: () => {
|
|
6
|
+
pathname: string;
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
readonly categories: {
|
|
10
|
+
readonly all: (params: {
|
|
11
|
+
type: SubjectTypeValue;
|
|
12
|
+
}) => {
|
|
13
|
+
pathname: string;
|
|
14
|
+
params: {
|
|
15
|
+
type: SubjectTypeValue;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
readonly filter_by_id: (params: {
|
|
19
|
+
category_id: string | number;
|
|
20
|
+
type: SubjectTypeValue;
|
|
21
|
+
}) => {
|
|
22
|
+
pathname: string;
|
|
23
|
+
params: {
|
|
24
|
+
id: string | number;
|
|
25
|
+
category_id: string | number;
|
|
26
|
+
type: string;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
readonly ads: {
|
|
31
|
+
readonly new: (props?: {
|
|
32
|
+
categoryId?: unknown;
|
|
33
|
+
subject_type?: SubjectTypeValue;
|
|
34
|
+
}) => {
|
|
35
|
+
pathname: string;
|
|
36
|
+
params: {
|
|
37
|
+
categoryId?: unknown;
|
|
38
|
+
subject_type?: SubjectTypeValue;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
readonly details: (ad_id: number | string, ad?: unknown) => {
|
|
42
|
+
pathname: string;
|
|
43
|
+
params: {
|
|
44
|
+
id: string | number;
|
|
45
|
+
ad: string;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
readonly filter: (props: {
|
|
49
|
+
subject_type: SubjectTypeValue;
|
|
50
|
+
category_id?: number;
|
|
51
|
+
}) => {
|
|
52
|
+
pathname: string;
|
|
53
|
+
params: {
|
|
54
|
+
subject_type: SubjectTypeValue;
|
|
55
|
+
category_id?: number;
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
readonly promote: (params: {
|
|
59
|
+
id: number | string;
|
|
60
|
+
}) => {
|
|
61
|
+
pathname: string;
|
|
62
|
+
params: {
|
|
63
|
+
ad_id: string | number;
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
readonly promotionHistory: (params: {
|
|
67
|
+
id: number | string;
|
|
68
|
+
}) => {
|
|
69
|
+
pathname: string;
|
|
70
|
+
params: {
|
|
71
|
+
ad_id: string | number;
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
readonly list: (params: GenericParams) => {
|
|
75
|
+
pathname: string;
|
|
76
|
+
params: {
|
|
77
|
+
subject_type: {};
|
|
78
|
+
filter: string;
|
|
79
|
+
};
|
|
80
|
+
} | {
|
|
81
|
+
pathname: string;
|
|
82
|
+
params: {
|
|
83
|
+
filter: string;
|
|
84
|
+
subject_type?: undefined;
|
|
85
|
+
};
|
|
86
|
+
};
|
|
87
|
+
};
|
|
88
|
+
readonly properties: {
|
|
89
|
+
readonly add: (props?: {
|
|
90
|
+
categoryId?: number;
|
|
91
|
+
}) => {
|
|
92
|
+
pathname: string;
|
|
93
|
+
params: {
|
|
94
|
+
categoryId?: number;
|
|
95
|
+
};
|
|
96
|
+
};
|
|
97
|
+
readonly edit: (property_id: number | string) => {
|
|
98
|
+
pathname: string;
|
|
99
|
+
params: {
|
|
100
|
+
id: string | number;
|
|
101
|
+
};
|
|
102
|
+
};
|
|
103
|
+
};
|
|
104
|
+
readonly motor: {
|
|
105
|
+
readonly add: (props?: {
|
|
106
|
+
categoryId?: number;
|
|
107
|
+
}) => {
|
|
108
|
+
pathname: string;
|
|
109
|
+
params: {
|
|
110
|
+
categoryId?: number;
|
|
111
|
+
};
|
|
112
|
+
};
|
|
113
|
+
readonly edit: (motor_id: number | string) => {
|
|
114
|
+
pathname: string;
|
|
115
|
+
params: {
|
|
116
|
+
id: string | number;
|
|
117
|
+
};
|
|
118
|
+
};
|
|
119
|
+
};
|
|
120
|
+
readonly services: {
|
|
121
|
+
readonly add: (props?: {
|
|
122
|
+
categoryId?: number;
|
|
123
|
+
}) => {
|
|
124
|
+
pathname: string;
|
|
125
|
+
params: {
|
|
126
|
+
categoryId?: number;
|
|
127
|
+
};
|
|
128
|
+
};
|
|
129
|
+
readonly edit: (service_id: number | string) => {
|
|
130
|
+
pathname: string;
|
|
131
|
+
params: {
|
|
132
|
+
id: string | number;
|
|
133
|
+
};
|
|
134
|
+
};
|
|
135
|
+
readonly myService: () => {
|
|
136
|
+
pathname: string;
|
|
137
|
+
};
|
|
138
|
+
readonly filtered_list: (params: {
|
|
139
|
+
category_id: number;
|
|
140
|
+
price_max: number;
|
|
141
|
+
price_min_fixed: number;
|
|
142
|
+
access_type_id: number;
|
|
143
|
+
text: string;
|
|
144
|
+
city_id: number;
|
|
145
|
+
district_ids: number[];
|
|
146
|
+
getDefault: "1" | "0";
|
|
147
|
+
}) => {
|
|
148
|
+
pathname: string;
|
|
149
|
+
params: {
|
|
150
|
+
getDefault: "0" | "1";
|
|
151
|
+
category_id: number;
|
|
152
|
+
price_max: number;
|
|
153
|
+
price_min_fixed: number;
|
|
154
|
+
access_type_id: number;
|
|
155
|
+
text: string;
|
|
156
|
+
city_id: number;
|
|
157
|
+
district_ids: number[];
|
|
158
|
+
};
|
|
159
|
+
};
|
|
160
|
+
};
|
|
161
|
+
readonly system: {
|
|
162
|
+
readonly privicy: () => {
|
|
163
|
+
pathname: string;
|
|
164
|
+
};
|
|
165
|
+
readonly general_settings: () => {
|
|
166
|
+
pathname: string;
|
|
167
|
+
};
|
|
168
|
+
readonly contact: () => {
|
|
169
|
+
pathname: string;
|
|
170
|
+
};
|
|
171
|
+
readonly download: () => {
|
|
172
|
+
pathname: string;
|
|
173
|
+
};
|
|
174
|
+
readonly needMobileApp: () => {
|
|
175
|
+
pathname: string;
|
|
176
|
+
};
|
|
177
|
+
readonly noInternet: () => {
|
|
178
|
+
pathname: string;
|
|
179
|
+
};
|
|
180
|
+
};
|
|
181
|
+
readonly settings: {
|
|
182
|
+
readonly selectCurrency: () => {
|
|
183
|
+
pathname: string;
|
|
184
|
+
};
|
|
185
|
+
readonly selectCity: () => {
|
|
186
|
+
pathname: string;
|
|
187
|
+
};
|
|
188
|
+
readonly selectBoundary: () => {
|
|
189
|
+
pathname: string;
|
|
190
|
+
};
|
|
191
|
+
readonly general_settings: () => {
|
|
192
|
+
pathname: string;
|
|
193
|
+
};
|
|
194
|
+
};
|
|
195
|
+
readonly auth: {
|
|
196
|
+
readonly login: (props?: {
|
|
197
|
+
categoryId?: unknown;
|
|
198
|
+
subject_type?: SubjectTypeValue;
|
|
199
|
+
}) => {
|
|
200
|
+
pathname: string;
|
|
201
|
+
params: {
|
|
202
|
+
categoryId?: unknown;
|
|
203
|
+
subject_type?: SubjectTypeValue;
|
|
204
|
+
};
|
|
205
|
+
};
|
|
206
|
+
readonly editProfile: () => {
|
|
207
|
+
pathname: string;
|
|
208
|
+
};
|
|
209
|
+
};
|
|
210
|
+
readonly user: {
|
|
211
|
+
readonly myAds: () => {
|
|
212
|
+
pathname: string;
|
|
213
|
+
};
|
|
214
|
+
readonly favorites: () => {
|
|
215
|
+
pathname: string;
|
|
216
|
+
};
|
|
217
|
+
readonly profile: (id: string | number) => {
|
|
218
|
+
pathname: string;
|
|
219
|
+
params: {
|
|
220
|
+
id: string | number;
|
|
221
|
+
};
|
|
222
|
+
};
|
|
223
|
+
readonly referral: () => {
|
|
224
|
+
pathname: string;
|
|
225
|
+
};
|
|
226
|
+
readonly referralCode: (code: string) => {
|
|
227
|
+
pathname: string;
|
|
228
|
+
params: {
|
|
229
|
+
code: string;
|
|
230
|
+
};
|
|
231
|
+
};
|
|
232
|
+
readonly myReferralCode: () => {
|
|
233
|
+
pathname: string;
|
|
234
|
+
};
|
|
235
|
+
readonly myNumbers: () => {
|
|
236
|
+
pathname: string;
|
|
237
|
+
};
|
|
238
|
+
};
|
|
239
|
+
readonly product: {
|
|
240
|
+
readonly save: (props?: {
|
|
241
|
+
product_id?: number | string;
|
|
242
|
+
isFree?: boolean;
|
|
243
|
+
categoryId?: number;
|
|
244
|
+
}) => {
|
|
245
|
+
pathname: string;
|
|
246
|
+
params: {
|
|
247
|
+
id: string | number | undefined;
|
|
248
|
+
isFree: boolean | undefined;
|
|
249
|
+
categoryId: number | undefined;
|
|
250
|
+
};
|
|
251
|
+
};
|
|
252
|
+
};
|
|
253
|
+
readonly chat: {
|
|
254
|
+
readonly chatlist: () => {
|
|
255
|
+
pathname: string;
|
|
256
|
+
};
|
|
257
|
+
readonly messages: (params: {
|
|
258
|
+
provider_id: string | number;
|
|
259
|
+
chat_room_id: string | number;
|
|
260
|
+
ad_id: string | number;
|
|
261
|
+
requester_id: string | number;
|
|
262
|
+
}) => {
|
|
263
|
+
pathname: string;
|
|
264
|
+
params: {
|
|
265
|
+
provider_id: string | number;
|
|
266
|
+
chat_room_id: string | number;
|
|
267
|
+
ad_id: string | number;
|
|
268
|
+
requester_id: string | number;
|
|
269
|
+
};
|
|
270
|
+
};
|
|
271
|
+
readonly offerPrice: (props: {
|
|
272
|
+
provider_id: string | number;
|
|
273
|
+
ad_price: number;
|
|
274
|
+
currency_id: number;
|
|
275
|
+
ad_id?: string | number;
|
|
276
|
+
chat_room_id?: string | number;
|
|
277
|
+
by_call: string;
|
|
278
|
+
by_message: string;
|
|
279
|
+
by_whatsapp: string;
|
|
280
|
+
phone: string;
|
|
281
|
+
}) => {
|
|
282
|
+
pathname: string;
|
|
283
|
+
params: {
|
|
284
|
+
provider_id: string | number;
|
|
285
|
+
currency_id: number;
|
|
286
|
+
ad_id: string | number | undefined;
|
|
287
|
+
chat_room_id: string | number | undefined;
|
|
288
|
+
by_call: string;
|
|
289
|
+
by_message: string;
|
|
290
|
+
by_whatsapp: string;
|
|
291
|
+
phone: string;
|
|
292
|
+
ad_price: number;
|
|
293
|
+
};
|
|
294
|
+
};
|
|
295
|
+
};
|
|
296
|
+
readonly wallet: {
|
|
297
|
+
readonly details: () => {
|
|
298
|
+
pathname: string;
|
|
299
|
+
};
|
|
300
|
+
};
|
|
301
|
+
};
|
|
302
|
+
export type SharedAppRoutes = typeof APP_ROUTES;
|
|
303
|
+
export {};
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.APP_ROUTES = void 0;
|
|
4
|
+
exports.APP_ROUTES = {
|
|
5
|
+
main: {
|
|
6
|
+
home: () => ({ pathname: "/(tabs)" }),
|
|
7
|
+
},
|
|
8
|
+
categories: {
|
|
9
|
+
all: (params) => ({
|
|
10
|
+
pathname: "/category/all-category",
|
|
11
|
+
params,
|
|
12
|
+
}),
|
|
13
|
+
filter_by_id: (params) => ({
|
|
14
|
+
pathname: "/category/[id]",
|
|
15
|
+
params: { id: params.category_id, category_id: params.category_id, type: params.type },
|
|
16
|
+
}),
|
|
17
|
+
},
|
|
18
|
+
ads: {
|
|
19
|
+
new: (props) => ({
|
|
20
|
+
pathname: "/ad/new",
|
|
21
|
+
params: { ...props },
|
|
22
|
+
}),
|
|
23
|
+
details: (ad_id, ad) => {
|
|
24
|
+
const data = JSON.stringify(ad);
|
|
25
|
+
return { pathname: "/ad/details/[id]", params: { id: ad_id, ad: data } };
|
|
26
|
+
},
|
|
27
|
+
filter: (props) => ({
|
|
28
|
+
pathname: "/ad/filter",
|
|
29
|
+
params: { ...props },
|
|
30
|
+
}),
|
|
31
|
+
promote: (params) => ({
|
|
32
|
+
pathname: "/ad/promotions/new/[ad_id]",
|
|
33
|
+
params: { ad_id: params.id },
|
|
34
|
+
}),
|
|
35
|
+
promotionHistory: (params) => ({
|
|
36
|
+
pathname: "/ad/promotions/history/[ad_id]",
|
|
37
|
+
params: { ad_id: params.id },
|
|
38
|
+
}),
|
|
39
|
+
list: (params) => {
|
|
40
|
+
const filter = JSON.stringify(params);
|
|
41
|
+
if (params === null || params === void 0 ? void 0 : params.subject_type) {
|
|
42
|
+
return {
|
|
43
|
+
pathname: "/ad/[subject_type]",
|
|
44
|
+
params: {
|
|
45
|
+
subject_type: params.subject_type,
|
|
46
|
+
filter,
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
return {
|
|
51
|
+
pathname: "/ad/list",
|
|
52
|
+
params: { filter },
|
|
53
|
+
};
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
properties: {
|
|
57
|
+
add: (props) => ({ pathname: "/properties/save", params: { ...props } }),
|
|
58
|
+
edit: (property_id) => ({ pathname: "/properties/save", params: { id: property_id } }),
|
|
59
|
+
},
|
|
60
|
+
motor: {
|
|
61
|
+
add: (props) => ({ pathname: "/motor/save", params: { ...props } }),
|
|
62
|
+
edit: (motor_id) => ({ pathname: "/motor/save", params: { id: motor_id } }),
|
|
63
|
+
},
|
|
64
|
+
services: {
|
|
65
|
+
add: (props) => ({ pathname: "/screens/AddServiceScreen", params: { ...props } }),
|
|
66
|
+
edit: (service_id) => ({ pathname: "/screens/AddServiceScreen", params: { id: service_id } }),
|
|
67
|
+
myService: () => ({ pathname: "/(tabs)/my-service" }),
|
|
68
|
+
filtered_list: (params) => ({
|
|
69
|
+
pathname: "/services/list/filtred",
|
|
70
|
+
params: {
|
|
71
|
+
...params,
|
|
72
|
+
getDefault: params.getDefault || "1",
|
|
73
|
+
},
|
|
74
|
+
}),
|
|
75
|
+
},
|
|
76
|
+
system: {
|
|
77
|
+
privicy: () => ({ pathname: "/privacy-policy" }),
|
|
78
|
+
general_settings: () => ({ pathname: "/system/general-settings" }),
|
|
79
|
+
contact: () => ({ pathname: "/system/contact-us" }),
|
|
80
|
+
download: () => ({ pathname: "/system/download-app" }),
|
|
81
|
+
needMobileApp: () => ({ pathname: "/system/need-mobile-app" }),
|
|
82
|
+
noInternet: () => ({ pathname: "/system/no-internet" }),
|
|
83
|
+
},
|
|
84
|
+
settings: {
|
|
85
|
+
selectCurrency: () => ({ pathname: "/settings/select-currency" }),
|
|
86
|
+
selectCity: () => ({ pathname: "/settings/select-city" }),
|
|
87
|
+
selectBoundary: () => ({ pathname: "/settings/select-boundary" }),
|
|
88
|
+
general_settings: () => ({ pathname: "/system/general-settings" }),
|
|
89
|
+
},
|
|
90
|
+
auth: {
|
|
91
|
+
login: (props) => ({
|
|
92
|
+
pathname: "/auth/login",
|
|
93
|
+
params: { ...props },
|
|
94
|
+
}),
|
|
95
|
+
editProfile: () => ({ pathname: "/auth/edit-profile" }),
|
|
96
|
+
},
|
|
97
|
+
user: {
|
|
98
|
+
myAds: () => ({ pathname: "/(tabs)/my-service" }),
|
|
99
|
+
favorites: () => ({ pathname: "/(tabs)/favorite" }),
|
|
100
|
+
profile: (id) => ({ pathname: "/user/profile/[id]", params: { id } }),
|
|
101
|
+
referral: () => ({ pathname: "/user/referral" }),
|
|
102
|
+
referralCode: (code) => ({ pathname: "/user/referral/[code]", params: { code } }),
|
|
103
|
+
myReferralCode: () => ({ pathname: "/user/referral/my-code" }),
|
|
104
|
+
myNumbers: () => ({ pathname: "/user/my-numbers" }),
|
|
105
|
+
},
|
|
106
|
+
product: {
|
|
107
|
+
save: (props) => ({
|
|
108
|
+
pathname: "/products/save",
|
|
109
|
+
params: { id: props === null || props === void 0 ? void 0 : props.product_id, isFree: props === null || props === void 0 ? void 0 : props.isFree, categoryId: props === null || props === void 0 ? void 0 : props.categoryId },
|
|
110
|
+
}),
|
|
111
|
+
},
|
|
112
|
+
chat: {
|
|
113
|
+
chatlist: () => ({ pathname: "/(tabs)/chat" }),
|
|
114
|
+
messages: (params) => ({
|
|
115
|
+
pathname: "/chat/[provider_id]",
|
|
116
|
+
params,
|
|
117
|
+
}),
|
|
118
|
+
offerPrice: (props) => ({
|
|
119
|
+
pathname: "/chat/offer-price",
|
|
120
|
+
params: {
|
|
121
|
+
provider_id: props.provider_id,
|
|
122
|
+
currency_id: props.currency_id,
|
|
123
|
+
ad_id: props.ad_id,
|
|
124
|
+
chat_room_id: props.chat_room_id,
|
|
125
|
+
by_call: props.by_call,
|
|
126
|
+
by_message: props.by_message,
|
|
127
|
+
by_whatsapp: props.by_whatsapp,
|
|
128
|
+
phone: props.phone,
|
|
129
|
+
ad_price: props.ad_price,
|
|
130
|
+
},
|
|
131
|
+
}),
|
|
132
|
+
},
|
|
133
|
+
wallet: {
|
|
134
|
+
details: () => ({ pathname: "/wallet" }),
|
|
135
|
+
},
|
|
136
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./app";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./app"), exports);
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
export declare const subjectTypeSchema: z.ZodEnum<{
|
|
3
|
+
properties: "properties";
|
|
4
|
+
services: "services";
|
|
5
|
+
motors: "motors";
|
|
6
|
+
used_products: "used_products";
|
|
7
|
+
}>;
|
|
2
8
|
export declare const createAdSchema: z.ZodObject<{
|
|
3
9
|
motor: z.ZodNullable<z.ZodOptional<z.ZodObject<{
|
|
4
10
|
ad_id: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
@@ -42,10 +48,6 @@ export declare const createAdSchema: z.ZodObject<{
|
|
|
42
48
|
facility_id: z.ZodCoercedNumber<unknown>;
|
|
43
49
|
distance_in_meters: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
44
50
|
}, z.core.$strip>>>;
|
|
45
|
-
condition_id: z.ZodPipe<z.ZodOptional<z.ZodCoercedNumber<unknown>>, z.ZodTransform<number | null | undefined, number | undefined>>;
|
|
46
|
-
age_id: z.ZodPipe<z.ZodOptional<z.ZodCoercedNumber<unknown>>, z.ZodTransform<number | null | undefined, number | undefined>>;
|
|
47
|
-
property_status_id: z.ZodPipe<z.ZodOptional<z.ZodCoercedNumber<unknown>>, z.ZodTransform<number | null | undefined, number | undefined>>;
|
|
48
|
-
license_type_id: z.ZodPipe<z.ZodOptional<z.ZodCoercedNumber<unknown>>, z.ZodTransform<number | null | undefined, number | undefined>>;
|
|
49
51
|
}, z.core.$strip>>>;
|
|
50
52
|
product: z.ZodNullable<z.ZodOptional<z.ZodObject<{
|
|
51
53
|
ad_id: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
@@ -77,7 +79,6 @@ export declare const createAdSchema: z.ZodObject<{
|
|
|
77
79
|
city_id: z.ZodNullable<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
78
80
|
latitude: z.ZodNullable<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
79
81
|
longitude: z.ZodNullable<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
80
|
-
baseAdminBoundaryId: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodNullable<z.ZodOptional<z.ZodCoercedNumber<unknown>>>>;
|
|
81
82
|
media: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodAny>>>;
|
|
82
83
|
subject_type: z.ZodOptional<z.ZodEnum<{
|
|
83
84
|
properties: "properties";
|
|
@@ -144,10 +145,6 @@ export declare const updateAdSchema: z.ZodObject<{
|
|
|
144
145
|
facility_id: z.ZodCoercedNumber<unknown>;
|
|
145
146
|
distance_in_meters: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
146
147
|
}, z.core.$strip>>>;
|
|
147
|
-
condition_id: z.ZodPipe<z.ZodOptional<z.ZodCoercedNumber<unknown>>, z.ZodTransform<number | null | undefined, number | undefined>>;
|
|
148
|
-
age_id: z.ZodPipe<z.ZodOptional<z.ZodCoercedNumber<unknown>>, z.ZodTransform<number | null | undefined, number | undefined>>;
|
|
149
|
-
property_status_id: z.ZodPipe<z.ZodOptional<z.ZodCoercedNumber<unknown>>, z.ZodTransform<number | null | undefined, number | undefined>>;
|
|
150
|
-
license_type_id: z.ZodPipe<z.ZodOptional<z.ZodCoercedNumber<unknown>>, z.ZodTransform<number | null | undefined, number | undefined>>;
|
|
151
148
|
id: z.ZodCoercedNumber<unknown>;
|
|
152
149
|
}, z.core.$strip>>>;
|
|
153
150
|
product: z.ZodNullable<z.ZodOptional<z.ZodObject<{
|
|
@@ -166,7 +163,6 @@ export declare const updateAdSchema: z.ZodObject<{
|
|
|
166
163
|
unit_id: z.ZodNullable<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
167
164
|
locations: z.ZodArray<z.ZodObject<{
|
|
168
165
|
city_id: z.ZodNumber;
|
|
169
|
-
district_id: z.ZodPipe<z.ZodTransform<{} | undefined, unknown>, z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
170
166
|
}, z.core.$strip>>;
|
|
171
167
|
}, z.core.$strip>>>;
|
|
172
168
|
title: z.ZodOptional<z.ZodString>;
|
|
@@ -179,7 +175,6 @@ export declare const updateAdSchema: z.ZodObject<{
|
|
|
179
175
|
city_id: z.ZodNullable<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
180
176
|
latitude: z.ZodNullable<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
181
177
|
longitude: z.ZodNullable<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
182
|
-
baseAdminBoundaryId: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodNullable<z.ZodOptional<z.ZodCoercedNumber<unknown>>>>;
|
|
183
178
|
media: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodAny>>>;
|
|
184
179
|
subject_type: z.ZodOptional<z.ZodEnum<{
|
|
185
180
|
properties: "properties";
|
|
@@ -243,10 +238,6 @@ export declare const saveAdSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
243
238
|
facility_id: z.ZodCoercedNumber<unknown>;
|
|
244
239
|
distance_in_meters: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
245
240
|
}, z.core.$strip>>>;
|
|
246
|
-
condition_id: z.ZodPipe<z.ZodOptional<z.ZodCoercedNumber<unknown>>, z.ZodTransform<number | null | undefined, number | undefined>>;
|
|
247
|
-
age_id: z.ZodPipe<z.ZodOptional<z.ZodCoercedNumber<unknown>>, z.ZodTransform<number | null | undefined, number | undefined>>;
|
|
248
|
-
property_status_id: z.ZodPipe<z.ZodOptional<z.ZodCoercedNumber<unknown>>, z.ZodTransform<number | null | undefined, number | undefined>>;
|
|
249
|
-
license_type_id: z.ZodPipe<z.ZodOptional<z.ZodCoercedNumber<unknown>>, z.ZodTransform<number | null | undefined, number | undefined>>;
|
|
250
241
|
}, z.core.$strip>>>;
|
|
251
242
|
product: z.ZodNullable<z.ZodOptional<z.ZodObject<{
|
|
252
243
|
ad_id: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
@@ -278,7 +269,6 @@ export declare const saveAdSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
278
269
|
city_id: z.ZodNullable<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
279
270
|
latitude: z.ZodNullable<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
280
271
|
longitude: z.ZodNullable<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
281
|
-
baseAdminBoundaryId: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodNullable<z.ZodOptional<z.ZodCoercedNumber<unknown>>>>;
|
|
282
272
|
media: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodAny>>>;
|
|
283
273
|
subject_type: z.ZodOptional<z.ZodEnum<{
|
|
284
274
|
properties: "properties";
|
|
@@ -344,10 +334,6 @@ export declare const saveAdSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
344
334
|
facility_id: z.ZodCoercedNumber<unknown>;
|
|
345
335
|
distance_in_meters: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
346
336
|
}, z.core.$strip>>>;
|
|
347
|
-
condition_id: z.ZodPipe<z.ZodOptional<z.ZodCoercedNumber<unknown>>, z.ZodTransform<number | null | undefined, number | undefined>>;
|
|
348
|
-
age_id: z.ZodPipe<z.ZodOptional<z.ZodCoercedNumber<unknown>>, z.ZodTransform<number | null | undefined, number | undefined>>;
|
|
349
|
-
property_status_id: z.ZodPipe<z.ZodOptional<z.ZodCoercedNumber<unknown>>, z.ZodTransform<number | null | undefined, number | undefined>>;
|
|
350
|
-
license_type_id: z.ZodPipe<z.ZodOptional<z.ZodCoercedNumber<unknown>>, z.ZodTransform<number | null | undefined, number | undefined>>;
|
|
351
337
|
id: z.ZodCoercedNumber<unknown>;
|
|
352
338
|
}, z.core.$strip>>>;
|
|
353
339
|
product: z.ZodNullable<z.ZodOptional<z.ZodObject<{
|
|
@@ -366,7 +352,6 @@ export declare const saveAdSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
366
352
|
unit_id: z.ZodNullable<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
367
353
|
locations: z.ZodArray<z.ZodObject<{
|
|
368
354
|
city_id: z.ZodNumber;
|
|
369
|
-
district_id: z.ZodPipe<z.ZodTransform<{} | undefined, unknown>, z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
370
355
|
}, z.core.$strip>>;
|
|
371
356
|
}, z.core.$strip>>>;
|
|
372
357
|
title: z.ZodOptional<z.ZodString>;
|
|
@@ -379,7 +364,6 @@ export declare const saveAdSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
379
364
|
city_id: z.ZodNullable<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
380
365
|
latitude: z.ZodNullable<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
381
366
|
longitude: z.ZodNullable<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
382
|
-
baseAdminBoundaryId: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodNullable<z.ZodOptional<z.ZodCoercedNumber<unknown>>>>;
|
|
383
367
|
media: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodAny>>>;
|
|
384
368
|
subject_type: z.ZodOptional<z.ZodEnum<{
|
|
385
369
|
properties: "properties";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.saveAdSchema = exports.updateAdSchema = exports.createAdSchema = void 0;
|
|
3
|
+
exports.saveAdSchema = exports.updateAdSchema = exports.createAdSchema = exports.subjectTypeSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
-
|
|
5
|
+
exports.subjectTypeSchema = zod_1.z.enum(['properties', 'services', 'motors', 'used_products']);
|
|
6
6
|
const adLocationSchema = zod_1.z.object({
|
|
7
7
|
ad_id: zod_1.z.coerce.number().int().positive().optional(),
|
|
8
8
|
admin_boundary_id: zod_1.z.coerce.number().int().positive(),
|
|
@@ -53,10 +53,10 @@ const createPropertySchema = zod_1.z.object({
|
|
|
53
53
|
feature_ids: zod_1.z.array(zod_1.z.coerce.number().int().positive()).optional(),
|
|
54
54
|
facility_ids: zod_1.z.array(zod_1.z.coerce.number().int().positive()).optional(),
|
|
55
55
|
property_facilities: zod_1.z.array(propertyFacilityRelationSchema).optional(),
|
|
56
|
-
condition_id:
|
|
57
|
-
age_id:
|
|
58
|
-
property_status_id:
|
|
59
|
-
license_type_id:
|
|
56
|
+
// condition_id: z.coerce.number().int().min(0).optional().transform((val) => (val === 0 ? null : val)),
|
|
57
|
+
// age_id: z.coerce.number().int().min(0).optional().transform((val) => (val === 0 ? null : val)),
|
|
58
|
+
// property_status_id: z.coerce.number().int().min(0).optional().transform((val) => (val === 0 ? null : val)),
|
|
59
|
+
// license_type_id: z.coerce.number().int().min(0).optional().transform((val) => (val === 0 ? null : val)),
|
|
60
60
|
});
|
|
61
61
|
const updatePropertySchema = createPropertySchema.extend({
|
|
62
62
|
id: zod_1.z.coerce.number().int().positive(),
|
|
@@ -85,7 +85,10 @@ const createServiceLocationSchema = zod_1.z.object({
|
|
|
85
85
|
});
|
|
86
86
|
const updateServiceLocationSchema = zod_1.z.object({
|
|
87
87
|
city_id: zod_1.z.number(),
|
|
88
|
-
district_id:
|
|
88
|
+
// district_id: z.preprocess(
|
|
89
|
+
// (v) => (v === null || v === '' ? undefined : v),
|
|
90
|
+
// z.coerce.number().int().optional(),
|
|
91
|
+
// ),
|
|
89
92
|
});
|
|
90
93
|
const createServiceSchema = zod_1.z.object({
|
|
91
94
|
ad_id: zod_1.z.coerce.number().int().positive().optional(),
|
|
@@ -113,13 +116,15 @@ const baseAdCommon = zod_1.z.object({
|
|
|
113
116
|
city_id: zod_1.z.coerce.number().int().positive().optional().nullable(),
|
|
114
117
|
latitude: zod_1.z.coerce.number().optional().nullable(),
|
|
115
118
|
longitude: zod_1.z.coerce.number().optional().nullable(),
|
|
116
|
-
baseAdminBoundaryId:
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
},
|
|
119
|
+
// baseAdminBoundaryId: z.preprocess(
|
|
120
|
+
// (value) => {
|
|
121
|
+
// if (value === 0 || value === '0') return undefined;
|
|
122
|
+
// return value;
|
|
123
|
+
// },
|
|
124
|
+
// z.coerce.number().optional().nullable(),
|
|
125
|
+
// ),
|
|
121
126
|
media: zod_1.z.array(zod_1.z.any()).optional().nullable(),
|
|
122
|
-
subject_type: subjectTypeSchema.optional(),
|
|
127
|
+
subject_type: exports.subjectTypeSchema.optional(),
|
|
123
128
|
base_price: zod_1.z.coerce.number().optional().nullable(),
|
|
124
129
|
contact_methods: zod_1.z
|
|
125
130
|
.object({
|
|
@@ -11,4 +11,10 @@ export declare const aiFillAdFormSchema: z.ZodObject<{
|
|
|
11
11
|
mimeType: z.ZodString;
|
|
12
12
|
name: z.ZodString;
|
|
13
13
|
}, z.core.$strip>>>;
|
|
14
|
+
subject_type: z.ZodEnum<{
|
|
15
|
+
properties: "properties";
|
|
16
|
+
services: "services";
|
|
17
|
+
motors: "motors";
|
|
18
|
+
used_products: "used_products";
|
|
19
|
+
}>;
|
|
14
20
|
}, z.core.$strip>;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.aiFillAdFormSchema = exports.aiAdFillFormFileSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
+
const ad_1 = require("../ad");
|
|
5
6
|
exports.aiAdFillFormFileSchema = zod_1.z.object({
|
|
6
7
|
URL: zod_1.z.string().trim().min(1),
|
|
7
8
|
mimeType: zod_1.z.string().trim().min(1),
|
|
@@ -10,4 +11,5 @@ exports.aiAdFillFormFileSchema = zod_1.z.object({
|
|
|
10
11
|
exports.aiFillAdFormSchema = zod_1.z.object({
|
|
11
12
|
text: zod_1.z.string().trim(),
|
|
12
13
|
files: zod_1.z.array(exports.aiAdFillFormFileSchema).optional(),
|
|
14
|
+
subject_type: ad_1.subjectTypeSchema
|
|
13
15
|
});
|
|
@@ -4,5 +4,6 @@ export * as AD from "./ad/index.js";
|
|
|
4
4
|
export * as EVENTS from "./events/index.js";
|
|
5
5
|
export * as MOTOR from "./motor/index.js";
|
|
6
6
|
export * as PROPERTY from "./property/index.js";
|
|
7
|
+
export * as ROUTES from "./routes/index.js";
|
|
7
8
|
export * as SERVICE from "./service/index.js";
|
|
8
9
|
export * as USED_PRODUCT from "./used-product/index.js";
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
export const APP_ROUTES = {
|
|
2
|
+
main: {
|
|
3
|
+
home: () => ({ pathname: "/(tabs)" }),
|
|
4
|
+
},
|
|
5
|
+
categories: {
|
|
6
|
+
all: (params) => ({
|
|
7
|
+
pathname: "/category/all-category",
|
|
8
|
+
params,
|
|
9
|
+
}),
|
|
10
|
+
filter_by_id: (params) => ({
|
|
11
|
+
pathname: "/category/[id]",
|
|
12
|
+
params: { id: params.category_id, category_id: params.category_id, type: params.type },
|
|
13
|
+
}),
|
|
14
|
+
},
|
|
15
|
+
ads: {
|
|
16
|
+
new: (props) => ({
|
|
17
|
+
pathname: "/ad/new",
|
|
18
|
+
params: { ...props },
|
|
19
|
+
}),
|
|
20
|
+
details: (ad_id, ad) => {
|
|
21
|
+
const data = JSON.stringify(ad);
|
|
22
|
+
return { pathname: "/ad/details/[id]", params: { id: ad_id, ad: data } };
|
|
23
|
+
},
|
|
24
|
+
filter: (props) => ({
|
|
25
|
+
pathname: "/ad/filter",
|
|
26
|
+
params: { ...props },
|
|
27
|
+
}),
|
|
28
|
+
promote: (params) => ({
|
|
29
|
+
pathname: "/ad/promotions/new/[ad_id]",
|
|
30
|
+
params: { ad_id: params.id },
|
|
31
|
+
}),
|
|
32
|
+
promotionHistory: (params) => ({
|
|
33
|
+
pathname: "/ad/promotions/history/[ad_id]",
|
|
34
|
+
params: { ad_id: params.id },
|
|
35
|
+
}),
|
|
36
|
+
list: (params) => {
|
|
37
|
+
const filter = JSON.stringify(params);
|
|
38
|
+
if (params === null || params === void 0 ? void 0 : params.subject_type) {
|
|
39
|
+
return {
|
|
40
|
+
pathname: "/ad/[subject_type]",
|
|
41
|
+
params: {
|
|
42
|
+
subject_type: params.subject_type,
|
|
43
|
+
filter,
|
|
44
|
+
},
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
return {
|
|
48
|
+
pathname: "/ad/list",
|
|
49
|
+
params: { filter },
|
|
50
|
+
};
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
properties: {
|
|
54
|
+
add: (props) => ({ pathname: "/properties/save", params: { ...props } }),
|
|
55
|
+
edit: (property_id) => ({ pathname: "/properties/save", params: { id: property_id } }),
|
|
56
|
+
},
|
|
57
|
+
motor: {
|
|
58
|
+
add: (props) => ({ pathname: "/motor/save", params: { ...props } }),
|
|
59
|
+
edit: (motor_id) => ({ pathname: "/motor/save", params: { id: motor_id } }),
|
|
60
|
+
},
|
|
61
|
+
services: {
|
|
62
|
+
add: (props) => ({ pathname: "/screens/AddServiceScreen", params: { ...props } }),
|
|
63
|
+
edit: (service_id) => ({ pathname: "/screens/AddServiceScreen", params: { id: service_id } }),
|
|
64
|
+
myService: () => ({ pathname: "/(tabs)/my-service" }),
|
|
65
|
+
filtered_list: (params) => ({
|
|
66
|
+
pathname: "/services/list/filtred",
|
|
67
|
+
params: {
|
|
68
|
+
...params,
|
|
69
|
+
getDefault: params.getDefault || "1",
|
|
70
|
+
},
|
|
71
|
+
}),
|
|
72
|
+
},
|
|
73
|
+
system: {
|
|
74
|
+
privicy: () => ({ pathname: "/privacy-policy" }),
|
|
75
|
+
general_settings: () => ({ pathname: "/system/general-settings" }),
|
|
76
|
+
contact: () => ({ pathname: "/system/contact-us" }),
|
|
77
|
+
download: () => ({ pathname: "/system/download-app" }),
|
|
78
|
+
needMobileApp: () => ({ pathname: "/system/need-mobile-app" }),
|
|
79
|
+
noInternet: () => ({ pathname: "/system/no-internet" }),
|
|
80
|
+
},
|
|
81
|
+
settings: {
|
|
82
|
+
selectCurrency: () => ({ pathname: "/settings/select-currency" }),
|
|
83
|
+
selectCity: () => ({ pathname: "/settings/select-city" }),
|
|
84
|
+
selectBoundary: () => ({ pathname: "/settings/select-boundary" }),
|
|
85
|
+
general_settings: () => ({ pathname: "/system/general-settings" }),
|
|
86
|
+
},
|
|
87
|
+
auth: {
|
|
88
|
+
login: (props) => ({
|
|
89
|
+
pathname: "/auth/login",
|
|
90
|
+
params: { ...props },
|
|
91
|
+
}),
|
|
92
|
+
editProfile: () => ({ pathname: "/auth/edit-profile" }),
|
|
93
|
+
},
|
|
94
|
+
user: {
|
|
95
|
+
myAds: () => ({ pathname: "/(tabs)/my-service" }),
|
|
96
|
+
favorites: () => ({ pathname: "/(tabs)/favorite" }),
|
|
97
|
+
profile: (id) => ({ pathname: "/user/profile/[id]", params: { id } }),
|
|
98
|
+
referral: () => ({ pathname: "/user/referral" }),
|
|
99
|
+
referralCode: (code) => ({ pathname: "/user/referral/[code]", params: { code } }),
|
|
100
|
+
myReferralCode: () => ({ pathname: "/user/referral/my-code" }),
|
|
101
|
+
myNumbers: () => ({ pathname: "/user/my-numbers" }),
|
|
102
|
+
},
|
|
103
|
+
product: {
|
|
104
|
+
save: (props) => ({
|
|
105
|
+
pathname: "/products/save",
|
|
106
|
+
params: { id: props === null || props === void 0 ? void 0 : props.product_id, isFree: props === null || props === void 0 ? void 0 : props.isFree, categoryId: props === null || props === void 0 ? void 0 : props.categoryId },
|
|
107
|
+
}),
|
|
108
|
+
},
|
|
109
|
+
chat: {
|
|
110
|
+
chatlist: () => ({ pathname: "/(tabs)/chat" }),
|
|
111
|
+
messages: (params) => ({
|
|
112
|
+
pathname: "/chat/[provider_id]",
|
|
113
|
+
params,
|
|
114
|
+
}),
|
|
115
|
+
offerPrice: (props) => ({
|
|
116
|
+
pathname: "/chat/offer-price",
|
|
117
|
+
params: {
|
|
118
|
+
provider_id: props.provider_id,
|
|
119
|
+
currency_id: props.currency_id,
|
|
120
|
+
ad_id: props.ad_id,
|
|
121
|
+
chat_room_id: props.chat_room_id,
|
|
122
|
+
by_call: props.by_call,
|
|
123
|
+
by_message: props.by_message,
|
|
124
|
+
by_whatsapp: props.by_whatsapp,
|
|
125
|
+
phone: props.phone,
|
|
126
|
+
ad_price: props.ad_price,
|
|
127
|
+
},
|
|
128
|
+
}),
|
|
129
|
+
},
|
|
130
|
+
wallet: {
|
|
131
|
+
details: () => ({ pathname: "/wallet" }),
|
|
132
|
+
},
|
|
133
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./app.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
const subjectTypeSchema = z.enum(['properties', 'services', 'motors', 'used_products']);
|
|
2
|
+
export const subjectTypeSchema = z.enum(['properties', 'services', 'motors', 'used_products']);
|
|
3
3
|
const adLocationSchema = z.object({
|
|
4
4
|
ad_id: z.coerce.number().int().positive().optional(),
|
|
5
5
|
admin_boundary_id: z.coerce.number().int().positive(),
|
|
@@ -50,10 +50,10 @@ const createPropertySchema = z.object({
|
|
|
50
50
|
feature_ids: z.array(z.coerce.number().int().positive()).optional(),
|
|
51
51
|
facility_ids: z.array(z.coerce.number().int().positive()).optional(),
|
|
52
52
|
property_facilities: z.array(propertyFacilityRelationSchema).optional(),
|
|
53
|
-
condition_id: z.coerce.number().int().min(0).optional().transform((val) => (val === 0 ? null : val)),
|
|
54
|
-
age_id: z.coerce.number().int().min(0).optional().transform((val) => (val === 0 ? null : val)),
|
|
55
|
-
property_status_id: z.coerce.number().int().min(0).optional().transform((val) => (val === 0 ? null : val)),
|
|
56
|
-
license_type_id: z.coerce.number().int().min(0).optional().transform((val) => (val === 0 ? null : val)),
|
|
53
|
+
// condition_id: z.coerce.number().int().min(0).optional().transform((val) => (val === 0 ? null : val)),
|
|
54
|
+
// age_id: z.coerce.number().int().min(0).optional().transform((val) => (val === 0 ? null : val)),
|
|
55
|
+
// property_status_id: z.coerce.number().int().min(0).optional().transform((val) => (val === 0 ? null : val)),
|
|
56
|
+
// license_type_id: z.coerce.number().int().min(0).optional().transform((val) => (val === 0 ? null : val)),
|
|
57
57
|
});
|
|
58
58
|
const updatePropertySchema = createPropertySchema.extend({
|
|
59
59
|
id: z.coerce.number().int().positive(),
|
|
@@ -82,7 +82,10 @@ const createServiceLocationSchema = z.object({
|
|
|
82
82
|
});
|
|
83
83
|
const updateServiceLocationSchema = z.object({
|
|
84
84
|
city_id: z.number(),
|
|
85
|
-
district_id: z.preprocess(
|
|
85
|
+
// district_id: z.preprocess(
|
|
86
|
+
// (v) => (v === null || v === '' ? undefined : v),
|
|
87
|
+
// z.coerce.number().int().optional(),
|
|
88
|
+
// ),
|
|
86
89
|
});
|
|
87
90
|
const createServiceSchema = z.object({
|
|
88
91
|
ad_id: z.coerce.number().int().positive().optional(),
|
|
@@ -110,11 +113,13 @@ const baseAdCommon = z.object({
|
|
|
110
113
|
city_id: z.coerce.number().int().positive().optional().nullable(),
|
|
111
114
|
latitude: z.coerce.number().optional().nullable(),
|
|
112
115
|
longitude: z.coerce.number().optional().nullable(),
|
|
113
|
-
baseAdminBoundaryId: z.preprocess(
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
},
|
|
116
|
+
// baseAdminBoundaryId: z.preprocess(
|
|
117
|
+
// (value) => {
|
|
118
|
+
// if (value === 0 || value === '0') return undefined;
|
|
119
|
+
// return value;
|
|
120
|
+
// },
|
|
121
|
+
// z.coerce.number().optional().nullable(),
|
|
122
|
+
// ),
|
|
118
123
|
media: z.array(z.any()).optional().nullable(),
|
|
119
124
|
subject_type: subjectTypeSchema.optional(),
|
|
120
125
|
base_price: z.coerce.number().optional().nullable(),
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { subjectTypeSchema } from '../ad/index.js';
|
|
2
3
|
export const aiAdFillFormFileSchema = z.object({
|
|
3
4
|
URL: z.string().trim().min(1),
|
|
4
5
|
mimeType: z.string().trim().min(1),
|
|
@@ -7,4 +8,5 @@ export const aiAdFillFormFileSchema = z.object({
|
|
|
7
8
|
export const aiFillAdFormSchema = z.object({
|
|
8
9
|
text: z.string().trim(),
|
|
9
10
|
files: z.array(aiAdFillFormFileSchema).optional(),
|
|
11
|
+
subject_type: subjectTypeSchema
|
|
10
12
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deallony/shared",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.99",
|
|
4
4
|
"private": false,
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"dashboard:update": "cd ../frontend-react-aloo && node ./scripts/upgrade-dellony.js",
|
|
28
28
|
"current": "npm view @deallony/shared version",
|
|
29
29
|
"============================= Links with project =============================": "",
|
|
30
|
-
"link:backend": "cd ../backend-service-marketplace && pnpm add @deallony/shared@file:../shared-deallony",
|
|
30
|
+
"link:backend": "cd ../backend-service-marketplace && pnpm uninstall @deallony/shared && pnpm add @deallony/shared@file:../shared-deallony",
|
|
31
31
|
"========": "============ DEFAULT ============",
|
|
32
32
|
"build": "tsc -p tsconfig.cjs.json && tsc -p tsconfig.esm.json && node ./scripts/fix-esm-imports.mjs",
|
|
33
33
|
"watch": "tsc -p tsconfig.cjs.json --watch",
|