@deallony/shared 1.0.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.
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/types/AccessTypeType.d.ts +5 -0
- package/dist/types/AccessTypeType.js +1 -0
- package/dist/types/AdType.d.ts +33 -0
- package/dist/types/AdType.js +1 -0
- package/dist/types/AppStartScreenType.d.ts +9 -0
- package/dist/types/AppStartScreenType.js +1 -0
- package/dist/types/CarBodyType.d.ts +5 -0
- package/dist/types/CarBodyType.js +1 -0
- package/dist/types/CategoryType.d.ts +17 -0
- package/dist/types/CategoryType.js +2 -0
- package/dist/types/CategoryWorkTypeType.d.ts +10 -0
- package/dist/types/CategoryWorkTypeType.js +1 -0
- package/dist/types/ChatType.d.ts +54 -0
- package/dist/types/ChatType.js +5 -0
- package/dist/types/CityType.d.ts +10 -0
- package/dist/types/CityType.js +1 -0
- package/dist/types/ColorType.d.ts +5 -0
- package/dist/types/ColorType.js +1 -0
- package/dist/types/CurrencyType.d.ts +12 -0
- package/dist/types/CurrencyType.js +1 -0
- package/dist/types/DeviceType.d.ts +32 -0
- package/dist/types/DeviceType.js +1 -0
- package/dist/types/DistrictType.d.ts +12 -0
- package/dist/types/DistrictType.js +1 -0
- package/dist/types/FacilityType.d.ts +6 -0
- package/dist/types/FacilityType.js +1 -0
- package/dist/types/FeatureType.d.ts +7 -0
- package/dist/types/FeatureType.js +1 -0
- package/dist/types/FuelTypeType.d.ts +5 -0
- package/dist/types/FuelTypeType.js +1 -0
- package/dist/types/ImageType.d.ts +5 -0
- package/dist/types/ImageType.js +1 -0
- package/dist/types/LicenseTypeType.d.ts +5 -0
- package/dist/types/LicenseTypeType.js +1 -0
- package/dist/types/LocalizedNameType.d.ts +5 -0
- package/dist/types/LocalizedNameType.js +2 -0
- package/dist/types/MediaType.d.ts +9 -0
- package/dist/types/MediaType.js +1 -0
- package/dist/types/MessageTemplateType.d.ts +8 -0
- package/dist/types/MessageTemplateType.js +1 -0
- package/dist/types/MotorTrimType.d.ts +6 -0
- package/dist/types/MotorTrimType.js +1 -0
- package/dist/types/MotorType.d.ts +25 -0
- package/dist/types/MotorType.js +1 -0
- package/dist/types/NotificationTokenType.d.ts +7 -0
- package/dist/types/NotificationTokenType.js +1 -0
- package/dist/types/OfferTypeType.d.ts +5 -0
- package/dist/types/OfferTypeType.js +1 -0
- package/dist/types/PermissionType.d.ts +6 -0
- package/dist/types/PermissionType.js +3 -0
- package/dist/types/PotentialUserType.d.ts +38 -0
- package/dist/types/PotentialUserType.js +1 -0
- package/dist/types/PriceTypeType.d.ts +7 -0
- package/dist/types/PriceTypeType.js +1 -0
- package/dist/types/PropertyStatusType.d.ts +5 -0
- package/dist/types/PropertyStatusType.js +1 -0
- package/dist/types/PropertyType.d.ts +25 -0
- package/dist/types/PropertyType.js +1 -0
- package/dist/types/PropertyTypeType.d.ts +6 -0
- package/dist/types/PropertyTypeType.js +1 -0
- package/dist/types/PublisherTypeType.d.ts +5 -0
- package/dist/types/PublisherTypeType.js +1 -0
- package/dist/types/RegionalSpecType.d.ts +5 -0
- package/dist/types/RegionalSpecType.js +1 -0
- package/dist/types/ResponseType.d.ts +6 -0
- package/dist/types/ResponseType.js +2 -0
- package/dist/types/RoleType.d.ts +9 -0
- package/dist/types/RoleType.js +1 -0
- package/dist/types/ServiceType.d.ts +12 -0
- package/dist/types/ServiceType.js +1 -0
- package/dist/types/ServicesLocationsType.d.ts +6 -0
- package/dist/types/ServicesLocationsType.js +1 -0
- package/dist/types/SocialMediaPlatformType.d.ts +7 -0
- package/dist/types/SocialMediaPlatformType.js +1 -0
- package/dist/types/SocialMediaProfileType.d.ts +6 -0
- package/dist/types/SocialMediaProfileType.js +1 -0
- package/dist/types/StatusType.d.ts +9 -0
- package/dist/types/StatusType.js +1 -0
- package/dist/types/SubjectType.d.ts +17 -0
- package/dist/types/SubjectType.js +13 -0
- package/dist/types/TransmissionType.d.ts +5 -0
- package/dist/types/TransmissionType.js +1 -0
- package/dist/types/UnitType.d.ts +5 -0
- package/dist/types/UnitType.js +1 -0
- package/dist/types/UserType.d.ts +33 -0
- package/dist/types/UserType.js +1 -0
- package/dist/types/WalletType.d.ts +7 -0
- package/dist/types/WalletType.js +1 -0
- package/dist/types/WorkTypeType.d.ts +6 -0
- package/dist/types/WorkTypeType.js +1 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.js +2 -0
- package/dist/types/product/ProductCategoryType.d.ts +15 -0
- package/dist/types/product/ProductCategoryType.js +1 -0
- package/dist/types/product/UsedProductAge.d.ts +7 -0
- package/dist/types/product/UsedProductAge.js +1 -0
- package/dist/types/product/UsedProductCondation.d.ts +7 -0
- package/dist/types/product/UsedProductCondation.js +1 -0
- package/dist/types/product/UsedProductType.d.ts +6 -0
- package/dist/types/product/UsedProductType.js +1 -0
- package/dist/validation/ad/save-ad.d.ts +45 -0
- package/dist/validation/ad/save-ad.js +52 -0
- package/package.json +22 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * as TYPES from './types';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * as TYPES from './types';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { MotorType } from "./MotorType";
|
|
2
|
+
import { UsedProductType } from "./product/UsedProductType";
|
|
3
|
+
import { PropertyType } from "./PropertyType";
|
|
4
|
+
import { ServiceType } from "./ServiceType";
|
|
5
|
+
import { SubjectTableType } from "./SubjectType";
|
|
6
|
+
import { UserType } from "./UserType";
|
|
7
|
+
export type AdType = {
|
|
8
|
+
id?: number;
|
|
9
|
+
user_id?: number;
|
|
10
|
+
status_id?: number;
|
|
11
|
+
title: string;
|
|
12
|
+
description?: string;
|
|
13
|
+
category_id?: number;
|
|
14
|
+
price?: number;
|
|
15
|
+
base_price?: number;
|
|
16
|
+
currency_id?: number;
|
|
17
|
+
negotiable?: boolean;
|
|
18
|
+
views?: number;
|
|
19
|
+
city_id?: number;
|
|
20
|
+
latitude?: number;
|
|
21
|
+
longitude?: number;
|
|
22
|
+
media?: any;
|
|
23
|
+
subject_id?: number;
|
|
24
|
+
subject_type?: SubjectTableType;
|
|
25
|
+
motor?: MotorType;
|
|
26
|
+
property?: PropertyType;
|
|
27
|
+
product?: UsedProductType;
|
|
28
|
+
service?: ServiceType;
|
|
29
|
+
selected_phone?: string;
|
|
30
|
+
user: UserType;
|
|
31
|
+
created_at?: string;
|
|
32
|
+
updated_at?: string;
|
|
33
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { CategoryWorkTypeType } from "./CategoryWorkTypeType";
|
|
2
|
+
import { MediaType } from "./MediaType";
|
|
3
|
+
import { SubjectTableType } from "./SubjectType";
|
|
4
|
+
export type CategoryType = {
|
|
5
|
+
id?: number;
|
|
6
|
+
parent_id?: number | null;
|
|
7
|
+
name: string;
|
|
8
|
+
description?: string;
|
|
9
|
+
display_order?: number;
|
|
10
|
+
children?: CategoryType[];
|
|
11
|
+
category_work_types?: Array<CategoryWorkTypeType>;
|
|
12
|
+
isBranch: boolean;
|
|
13
|
+
should_validate?: boolean;
|
|
14
|
+
type?: SubjectTableType;
|
|
15
|
+
props?: Record<string, any>;
|
|
16
|
+
media: MediaType;
|
|
17
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { CategoryType } from "./CategoryType";
|
|
2
|
+
import { WorkTypeType } from "./WorkTypeType";
|
|
3
|
+
export type CategoryWorkTypeType = {
|
|
4
|
+
id?: number;
|
|
5
|
+
category_id: number;
|
|
6
|
+
work_type_id: number;
|
|
7
|
+
is_price_require: boolean;
|
|
8
|
+
workType?: WorkTypeType;
|
|
9
|
+
category?: CategoryType;
|
|
10
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
export type ChatRoomType = {
|
|
2
|
+
id: number;
|
|
3
|
+
requester_id: number;
|
|
4
|
+
provider_id: number;
|
|
5
|
+
ad_id?: number | null;
|
|
6
|
+
created_at: Date;
|
|
7
|
+
requester: {
|
|
8
|
+
id: number;
|
|
9
|
+
name: string;
|
|
10
|
+
phone: string;
|
|
11
|
+
email?: string;
|
|
12
|
+
};
|
|
13
|
+
provider: {
|
|
14
|
+
id: number;
|
|
15
|
+
name: string;
|
|
16
|
+
phone: string;
|
|
17
|
+
email?: string;
|
|
18
|
+
};
|
|
19
|
+
ad?: {
|
|
20
|
+
id: number;
|
|
21
|
+
title: string;
|
|
22
|
+
} | null;
|
|
23
|
+
chats?: ChatMessageType[];
|
|
24
|
+
lastMessage?: string;
|
|
25
|
+
lastMessageAt?: Date;
|
|
26
|
+
};
|
|
27
|
+
export type ChatMessageType = {
|
|
28
|
+
id: number;
|
|
29
|
+
message: string;
|
|
30
|
+
message_type: MessageType;
|
|
31
|
+
payload?: Record<string, any> | null;
|
|
32
|
+
created_at: Date;
|
|
33
|
+
chat_room_id: number;
|
|
34
|
+
sender_id: number;
|
|
35
|
+
sender: {
|
|
36
|
+
id: number;
|
|
37
|
+
name: string;
|
|
38
|
+
phone: string;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
export declare enum MessageType {
|
|
42
|
+
TEXT = 1,
|
|
43
|
+
PRICE_OFFER = 2
|
|
44
|
+
}
|
|
45
|
+
export type SendMessagePayload = {
|
|
46
|
+
chat_room_id: number;
|
|
47
|
+
requester_id: number;
|
|
48
|
+
provider_id: number;
|
|
49
|
+
sender_id: number;
|
|
50
|
+
message: string;
|
|
51
|
+
message_type?: MessageType;
|
|
52
|
+
payload?: Record<string, any> | null;
|
|
53
|
+
ad_id?: number | null;
|
|
54
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export type DeviceType = {
|
|
2
|
+
id?: number;
|
|
3
|
+
user_id?: number | null;
|
|
4
|
+
is_logout?: boolean;
|
|
5
|
+
device_id: string;
|
|
6
|
+
device_name?: string | null;
|
|
7
|
+
device_brand?: string | null;
|
|
8
|
+
os?: string | null;
|
|
9
|
+
os_version?: string | null;
|
|
10
|
+
is_tablet?: boolean;
|
|
11
|
+
version_app?: string | null;
|
|
12
|
+
first_install_date?: Date | null;
|
|
13
|
+
open_count?: number;
|
|
14
|
+
last_open_date?: Date | null;
|
|
15
|
+
network_type?: string | null;
|
|
16
|
+
language?: string | null;
|
|
17
|
+
country?: string | null;
|
|
18
|
+
notification_token?: string | null;
|
|
19
|
+
last_notification_sent?: Date | null;
|
|
20
|
+
last_notification_clicked?: Date | null;
|
|
21
|
+
notification_enabled?: boolean;
|
|
22
|
+
screen_resolution?: string | null;
|
|
23
|
+
build_type?: string | null;
|
|
24
|
+
heartbeat?: Date | null;
|
|
25
|
+
created_at?: Date;
|
|
26
|
+
updated_at?: Date;
|
|
27
|
+
user?: {
|
|
28
|
+
id: number;
|
|
29
|
+
name: string;
|
|
30
|
+
phone: string;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { SubjectTableEnum } from "./SubjectType";
|
|
2
|
+
export type MotorOfferType = 'sale' | 'for_rent';
|
|
3
|
+
export type MotorDoors = number | null;
|
|
4
|
+
export type MotorType = {
|
|
5
|
+
id: number;
|
|
6
|
+
componentType?: SubjectTableEnum.MOTORS;
|
|
7
|
+
trim_id?: number | null;
|
|
8
|
+
body_type_id: number;
|
|
9
|
+
regional_spec_id: number;
|
|
10
|
+
transmission_id: number;
|
|
11
|
+
fuel_type_id: number;
|
|
12
|
+
age_id: number;
|
|
13
|
+
condition_id: number;
|
|
14
|
+
interior_color_id: number;
|
|
15
|
+
exterior_color_id?: number | null;
|
|
16
|
+
mileage: number;
|
|
17
|
+
offer_type_id: MotorOfferType;
|
|
18
|
+
year: number;
|
|
19
|
+
doors?: MotorDoors;
|
|
20
|
+
horsepower?: number | null;
|
|
21
|
+
created_at: string;
|
|
22
|
+
updated_at: string;
|
|
23
|
+
publisher_type_id?: number;
|
|
24
|
+
price_type_id?: number;
|
|
25
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export type PotentialUserType = {
|
|
2
|
+
id: number;
|
|
3
|
+
name?: string;
|
|
4
|
+
phone_number: string;
|
|
5
|
+
note?: string;
|
|
6
|
+
user_id?: number | null;
|
|
7
|
+
saved_by?: number;
|
|
8
|
+
user?: {
|
|
9
|
+
id: number;
|
|
10
|
+
name: string;
|
|
11
|
+
phone?: string;
|
|
12
|
+
[k: string]: any;
|
|
13
|
+
} | null;
|
|
14
|
+
savedBy?: {
|
|
15
|
+
id: number;
|
|
16
|
+
name: string;
|
|
17
|
+
phone?: string;
|
|
18
|
+
[k: string]: any;
|
|
19
|
+
} | null;
|
|
20
|
+
last_message_at?: string | null;
|
|
21
|
+
created_at?: string;
|
|
22
|
+
subject_type?: string;
|
|
23
|
+
};
|
|
24
|
+
export type CreatePotentialUserPayload = {
|
|
25
|
+
name?: string;
|
|
26
|
+
phone_number: string;
|
|
27
|
+
note?: string;
|
|
28
|
+
user_id?: string;
|
|
29
|
+
last_message_at?: Date | string;
|
|
30
|
+
};
|
|
31
|
+
export type UpdatePotentialUserPayload = {
|
|
32
|
+
id: number;
|
|
33
|
+
name?: string;
|
|
34
|
+
phone_number?: string;
|
|
35
|
+
note?: string;
|
|
36
|
+
user_id?: string | null;
|
|
37
|
+
last_message_at?: Date | string | null;
|
|
38
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { SubjectTableEnum } from "./SubjectType";
|
|
2
|
+
export type PropertyBathroomsEnum = '0' | '1' | '2' | '3' | '4' | '5' | '6';
|
|
3
|
+
export type PropertyFurnishedEnum = '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | '+10';
|
|
4
|
+
export type PropertyType = {
|
|
5
|
+
id: number;
|
|
6
|
+
componentType?: SubjectTableEnum.PROPERTIES;
|
|
7
|
+
property_type_id: number;
|
|
8
|
+
property_status_id: number;
|
|
9
|
+
license_type_id: number;
|
|
10
|
+
offer_type_id: number;
|
|
11
|
+
price_type_id: number;
|
|
12
|
+
publisher_type_id: number;
|
|
13
|
+
size_m2: number;
|
|
14
|
+
bedrooms?: number;
|
|
15
|
+
bathrooms: PropertyBathroomsEnum;
|
|
16
|
+
furnished: PropertyFurnishedEnum;
|
|
17
|
+
parking: boolean;
|
|
18
|
+
floor?: number;
|
|
19
|
+
total_floors?: number;
|
|
20
|
+
age_id: number;
|
|
21
|
+
condition_id: number;
|
|
22
|
+
district_id: number;
|
|
23
|
+
created_at: string;
|
|
24
|
+
updated_at: string;
|
|
25
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { MediaType } from "./MediaType";
|
|
2
|
+
import { ServiceLocationType } from "./ServicesLocationsType";
|
|
3
|
+
export type ServiceType = {
|
|
4
|
+
id?: number;
|
|
5
|
+
user_id: number;
|
|
6
|
+
title: string;
|
|
7
|
+
unit_id: number | null;
|
|
8
|
+
access_type_id: number | null;
|
|
9
|
+
work_type_id: number | null;
|
|
10
|
+
locations: ServiceLocationType[];
|
|
11
|
+
media: MediaType[];
|
|
12
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export type SubjectTableType = "properties" | "services" | 'motors' | 'used_products';
|
|
2
|
+
export declare enum SubjectTableEnum {
|
|
3
|
+
PROPERTIES = "properties",
|
|
4
|
+
SERVICES = "services",
|
|
5
|
+
MOTORS = "motors",
|
|
6
|
+
USED_PRODUCTS = "used_products"
|
|
7
|
+
}
|
|
8
|
+
export type SubjectTypeOption = {
|
|
9
|
+
value: SubjectTableType;
|
|
10
|
+
label: string;
|
|
11
|
+
isCategory?: boolean;
|
|
12
|
+
isAge?: boolean;
|
|
13
|
+
isCondition?: boolean;
|
|
14
|
+
color?: string;
|
|
15
|
+
[key: string]: any;
|
|
16
|
+
};
|
|
17
|
+
export declare const SubjectTypeOptions: SubjectTypeOption[];
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export var SubjectTableEnum;
|
|
2
|
+
(function (SubjectTableEnum) {
|
|
3
|
+
SubjectTableEnum["PROPERTIES"] = "properties";
|
|
4
|
+
SubjectTableEnum["SERVICES"] = "services";
|
|
5
|
+
SubjectTableEnum["MOTORS"] = "motors";
|
|
6
|
+
SubjectTableEnum["USED_PRODUCTS"] = "used_products";
|
|
7
|
+
})(SubjectTableEnum || (SubjectTableEnum = {}));
|
|
8
|
+
export const SubjectTypeOptions = [
|
|
9
|
+
{ value: SubjectTableEnum.SERVICES, label: "Services", isCategory: true, color: '#3B82F6', isAge: false, isCondition: false, isFeature: false },
|
|
10
|
+
{ value: SubjectTableEnum.MOTORS, label: "Motors", isCategory: true, color: '#125b40ff', isAge: false, isCondition: false, isFeature: true },
|
|
11
|
+
{ value: SubjectTableEnum.USED_PRODUCTS, label: "Used Products", isCategory: true, color: '#6b5212ff', isAge: true, isCondition: true, isFeature: false },
|
|
12
|
+
{ value: SubjectTableEnum.PROPERTIES, label: "properties", isCategory: false, color: '#6c4fc3ff', isAge: true, isCondition: true, isFeature: true },
|
|
13
|
+
];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { AdType } from "./AdType";
|
|
2
|
+
import { NotificationTokenType } from "./NotificationTokenType";
|
|
3
|
+
import { SocialMediaProfileType } from "./SocialMediaProfileType";
|
|
4
|
+
import { WalletType } from "./WalletType";
|
|
5
|
+
import { RoleType } from "./RoleType";
|
|
6
|
+
export type UserType = {
|
|
7
|
+
id?: number;
|
|
8
|
+
name: string;
|
|
9
|
+
token: string;
|
|
10
|
+
phone: string;
|
|
11
|
+
referral_id?: number | null;
|
|
12
|
+
referral_code?: string | null;
|
|
13
|
+
role_id: number;
|
|
14
|
+
role: RoleType;
|
|
15
|
+
phone_numbers?: Array<{
|
|
16
|
+
number: string;
|
|
17
|
+
name: string;
|
|
18
|
+
is_primary: boolean;
|
|
19
|
+
}>;
|
|
20
|
+
ads?: AdType[];
|
|
21
|
+
notificationTokens?: NotificationTokenType[];
|
|
22
|
+
socialMediaProfiles?: SocialMediaProfileType[];
|
|
23
|
+
referredUsers?: Array<{
|
|
24
|
+
id: number;
|
|
25
|
+
name: string;
|
|
26
|
+
phone: string;
|
|
27
|
+
}>;
|
|
28
|
+
wallet?: WalletType;
|
|
29
|
+
created_at?: string;
|
|
30
|
+
updated_at?: string;
|
|
31
|
+
blocked_at?: string | null;
|
|
32
|
+
};
|
|
33
|
+
export type UserTypeOrNull = UserType | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { MediaType } from "../MediaType";
|
|
2
|
+
export type ProductCategoryType = {
|
|
3
|
+
id?: number;
|
|
4
|
+
parent_id: number | null;
|
|
5
|
+
name: string;
|
|
6
|
+
media?: MediaType;
|
|
7
|
+
created_at: string;
|
|
8
|
+
updated_at: string;
|
|
9
|
+
parent?: ProductCategoryType;
|
|
10
|
+
isBranch?: boolean;
|
|
11
|
+
children?: ProductCategoryType[];
|
|
12
|
+
savedBy?: {
|
|
13
|
+
id: number;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const createAdSchema: z.ZodObject<{
|
|
3
|
+
title: z.ZodOptional<z.ZodString>;
|
|
4
|
+
status_id: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
5
|
+
description: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
6
|
+
category_id: z.ZodNullable<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
7
|
+
price: z.ZodNullable<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
8
|
+
currency_id: z.ZodNullable<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
9
|
+
negotiable: z.ZodNullable<z.ZodOptional<z.ZodCoercedBoolean<unknown>>>;
|
|
10
|
+
city_id: z.ZodNullable<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
11
|
+
latitude: z.ZodNullable<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
12
|
+
longitude: z.ZodNullable<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
13
|
+
media: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodAny>>>;
|
|
14
|
+
base_price: z.ZodNullable<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
15
|
+
contact_methods: z.ZodNullable<z.ZodOptional<z.ZodObject<{
|
|
16
|
+
by_message: z.ZodOptional<z.ZodBoolean>;
|
|
17
|
+
by_whatsapp: z.ZodOptional<z.ZodBoolean>;
|
|
18
|
+
by_call: z.ZodOptional<z.ZodBoolean>;
|
|
19
|
+
}, z.core.$strip>>>;
|
|
20
|
+
selected_phone: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
21
|
+
user_id: z.ZodCoercedNumber<unknown>;
|
|
22
|
+
id: z.ZodOptional<z.ZodNever>;
|
|
23
|
+
}, z.core.$strip>;
|
|
24
|
+
export declare const updateAdSchema: z.ZodObject<{
|
|
25
|
+
id: z.ZodCoercedNumber<unknown>;
|
|
26
|
+
title: z.ZodOptional<z.ZodString>;
|
|
27
|
+
status_id: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
28
|
+
description: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
29
|
+
category_id: z.ZodNullable<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
30
|
+
price: z.ZodNullable<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
31
|
+
currency_id: z.ZodNullable<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
32
|
+
negotiable: z.ZodNullable<z.ZodOptional<z.ZodCoercedBoolean<unknown>>>;
|
|
33
|
+
city_id: z.ZodNullable<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
34
|
+
latitude: z.ZodNullable<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
35
|
+
longitude: z.ZodNullable<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
36
|
+
media: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodAny>>>;
|
|
37
|
+
base_price: z.ZodNullable<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
38
|
+
contact_methods: z.ZodNullable<z.ZodOptional<z.ZodObject<{
|
|
39
|
+
by_message: z.ZodOptional<z.ZodBoolean>;
|
|
40
|
+
by_whatsapp: z.ZodOptional<z.ZodBoolean>;
|
|
41
|
+
by_call: z.ZodOptional<z.ZodBoolean>;
|
|
42
|
+
}, z.core.$strip>>>;
|
|
43
|
+
selected_phone: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
44
|
+
user_id: z.ZodCoercedNumber<unknown>;
|
|
45
|
+
}, z.core.$strip>;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
const baseAdCommon = z.object({
|
|
3
|
+
title: z.string().trim().optional(),
|
|
4
|
+
status_id: z.coerce.number().int().positive().optional(),
|
|
5
|
+
description: z.string().trim().optional().nullable(),
|
|
6
|
+
category_id: z.coerce.number().int().positive().optional().nullable(),
|
|
7
|
+
price: z.coerce.number().min(0).optional().nullable(),
|
|
8
|
+
currency_id: z.coerce.number().int().positive().optional().nullable(),
|
|
9
|
+
negotiable: z.coerce.boolean().optional().nullable(),
|
|
10
|
+
city_id: z.coerce.number().int().positive().optional().nullable(),
|
|
11
|
+
latitude: z.coerce.number().optional().nullable(),
|
|
12
|
+
longitude: z.coerce.number().optional().nullable(),
|
|
13
|
+
media: z.array(z.any()).optional().nullable(),
|
|
14
|
+
// subject_type: SubjectTypeSchema.optional(),
|
|
15
|
+
base_price: z.coerce.number().optional().nullable(),
|
|
16
|
+
contact_methods: z.object({
|
|
17
|
+
by_message: z.boolean().optional(),
|
|
18
|
+
by_whatsapp: z.boolean().optional(),
|
|
19
|
+
by_call: z.boolean().optional(),
|
|
20
|
+
}).optional().nullable(),
|
|
21
|
+
selected_phone: z.string().trim().optional().nullable(),
|
|
22
|
+
});
|
|
23
|
+
export const createAdSchema = z.object({
|
|
24
|
+
user_id: z.coerce.number().int().positive(),
|
|
25
|
+
id: z.never().optional(), // disallow id on create
|
|
26
|
+
...baseAdCommon.shape,
|
|
27
|
+
// motor: createMotorSchema
|
|
28
|
+
// .extend({ ad_id: z.coerce.number().optional() })
|
|
29
|
+
// .optional()
|
|
30
|
+
// .nullable(),
|
|
31
|
+
// // Make nested ad_id optional/nullable without changing original schemas
|
|
32
|
+
// property: createPropertySchema
|
|
33
|
+
// .extend({ ad_id: z.coerce.number().optional() })
|
|
34
|
+
// .optional()
|
|
35
|
+
// .nullable(),
|
|
36
|
+
// product: createUsedProductSchema
|
|
37
|
+
// .extend({ ad_id: z.coerce.number().optional() })
|
|
38
|
+
// .optional()
|
|
39
|
+
// .nullable(),
|
|
40
|
+
// service: createServiceSchema
|
|
41
|
+
// .extend({ ad_id: z.coerce.number().optional() })
|
|
42
|
+
// .optional()
|
|
43
|
+
// .nullable(),
|
|
44
|
+
});
|
|
45
|
+
export const updateAdSchema = z.object({
|
|
46
|
+
...createAdSchema.shape,
|
|
47
|
+
id: z.coerce.number().int().positive(),
|
|
48
|
+
// motor: updateMotorSchema.optional().nullable(),
|
|
49
|
+
// property: updatePropertySchema.optional().nullable(),
|
|
50
|
+
// product: updateUsedProductSchema.optional().nullable(),
|
|
51
|
+
// service: updateServiceSchema.optional().nullable(),
|
|
52
|
+
});
|
package/package.json
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@deallony/shared",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"private": false,
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"files": [
|
|
8
|
+
"dist"
|
|
9
|
+
],
|
|
10
|
+
"scripts": {
|
|
11
|
+
"build": "tsc",
|
|
12
|
+
"watch": "tsc --watch",
|
|
13
|
+
"prepublishOnly": "npm run build"
|
|
14
|
+
},
|
|
15
|
+
"dependencies": {
|
|
16
|
+
"zod": "^4.2.1"
|
|
17
|
+
},
|
|
18
|
+
"devDependencies": {
|
|
19
|
+
"@types/node": "^25.0.3",
|
|
20
|
+
"typescript": "^5.9.3"
|
|
21
|
+
}
|
|
22
|
+
}
|