-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtype.d.ts
More file actions
50 lines (46 loc) · 1.73 KB
/
type.d.ts
File metadata and controls
50 lines (46 loc) · 1.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import { DivisionRecord } from 'src/common/types/address-ship.type';
import { ProductTranslationType } from './common/models/product-translation.model';
import { VariantsType } from './common/models/product.model';
export interface AddressFieldDescriptor {
key: string; // ví dụ: "houseNumber", "street", "ward", "district", "city", "state", "postcode"
label?: string; // nhãn hiển thị (có thể đa ngôn ngữ)
required?: boolean; // có bắt buộc hay không
order?: number; // thứ tự hiển thị
example?: string;
maxLength?: number;
regex?: string; // optional: dùng để validate (ví dụ zipcode)
}
declare global {
namespace PrismaJson {
type Variants = VariantsType;
type ProductTranslations = Pick<
ProductTranslationType,
'id' | 'name' | 'description' | 'languageId'
>[];
type AttributesType = Record<string, string>;
type Geoinfo = {
region: {
latitude: number;
longitude: number;
};
user_adjusted?: boolean; // user có chỉnh sửa thủ công không
user_verified?: boolean; // user xác thực đúng chưa
auto_fill: boolean;
source?: string; // "google_map" | "openstreet" | ...
timestamp?: string;
[key: string]: JsonValue; // cho phép mở rộng
};
type AddressFormat = {
format: string; // ví dụ: "{{houseNumber}} {{street}}, {{district}}, {{city}}, {{state}}, {{country}}"
postcode?: {
regex?: string; // regex string for validation
example?: string;
} | null;
fields: AddressFieldDescriptor[];
example?: string; // ví dụ format
metadata?: Record<string, any>;
[key: string]: JsonValue;
};
type divisionPath = DivisionRecord;
}
}