@hed-hog/contact 0.0.261 → 0.0.270
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/address-type.enum.d.ts +10 -0
- package/dist/address-type.enum.d.ts.map +1 -0
- package/dist/address-type.enum.js +14 -0
- package/dist/address-type.enum.js.map +1 -0
- package/dist/contact.module.d.ts.map +1 -1
- package/dist/contact.module.js +0 -2
- package/dist/contact.module.js.map +1 -1
- package/dist/contact.service.d.ts +19 -22
- package/dist/contact.service.d.ts.map +1 -1
- package/dist/contact.service.js +22 -2
- package/dist/contact.service.js.map +1 -1
- package/dist/index.d.ts +5 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -4
- package/dist/index.js.map +1 -1
- package/dist/person/dto/create.dto.d.ts +14 -0
- package/dist/person/dto/create.dto.d.ts.map +1 -1
- package/dist/person/dto/create.dto.js +52 -1
- package/dist/person/dto/create.dto.js.map +1 -1
- package/dist/person/dto/update.dto.d.ts +17 -1
- package/dist/person/dto/update.dto.d.ts.map +1 -1
- package/dist/person/dto/update.dto.js +79 -3
- package/dist/person/dto/update.dto.js.map +1 -1
- package/dist/person/person.controller.d.ts +33 -8
- package/dist/person/person.controller.d.ts.map +1 -1
- package/dist/person/person.controller.js +19 -3
- package/dist/person/person.controller.js.map +1 -1
- package/dist/person/person.service.d.ts +59 -10
- package/dist/person/person.service.d.ts.map +1 -1
- package/dist/person/person.service.js +710 -107
- package/dist/person/person.service.js.map +1 -1
- package/dist/person-relation-type/person-relation-type.controller.d.ts +13 -9
- package/dist/person-relation-type/person-relation-type.controller.d.ts.map +1 -1
- package/dist/person-relation-type/person-relation-type.service.d.ts +16 -20
- package/dist/person-relation-type/person-relation-type.service.d.ts.map +1 -1
- package/dist/person-relation-type/person-relation-type.service.js +48 -41
- package/dist/person-relation-type/person-relation-type.service.js.map +1 -1
- package/hedhog/data/menu.yaml +2 -16
- package/hedhog/data/route.yaml +2 -21
- package/hedhog/data/setting_group.yaml +21 -0
- package/hedhog/frontend/app/person/_components/delete-person-dialog.tsx.ejs +59 -0
- package/hedhog/frontend/app/person/_components/person-field-with-create.tsx.ejs +831 -0
- package/hedhog/frontend/app/person/_components/person-form-sheet.tsx.ejs +1997 -0
- package/hedhog/frontend/app/person/_components/person-types.ts.ejs +115 -0
- package/hedhog/frontend/app/person/page.tsx.ejs +1209 -1530
- package/hedhog/frontend/messages/en.json +114 -4
- package/hedhog/frontend/messages/pt.json +114 -4
- package/hedhog/table/person.yaml +7 -0
- package/hedhog/table/person_address.yaml +18 -0
- package/hedhog/table/person_company.yaml +26 -11
- package/hedhog/table/person_individual.yaml +17 -13
- package/hedhog/table/person_individual_relation.yaml +39 -0
- package/package.json +8 -7
- package/src/address-type.enum.ts +9 -0
- package/src/contact.module.ts +46 -48
- package/src/contact.service.ts +28 -13
- package/src/index.ts +6 -13
- package/src/language/en.json +13 -6
- package/src/language/pt.json +14 -6
- package/src/person/dto/create.dto.ts +62 -14
- package/src/person/dto/update.dto.ts +147 -75
- package/src/person/person.controller.ts +39 -27
- package/src/person/person.service.ts +1071 -239
- package/src/person-relation-type/person-relation-type.service.ts +84 -76
- package/hedhog/data/address_type.yaml +0 -28
- package/hedhog/frontend/app/address-type/page.tsx.ejs +0 -480
- package/hedhog/query/add-unique-address-type-locale.sql +0 -3
- package/hedhog/table/address.yaml +0 -28
- package/hedhog/table/address_type.yaml +0 -11
- package/hedhog/table/person_relation.yaml +0 -20
- package/hedhog/table/person_relation_type.yaml +0 -6
- package/src/address-type/address-type.controller.ts +0 -55
- package/src/address-type/address-type.enum.ts +0 -9
- package/src/address-type/address-type.module.ts +0 -18
- package/src/address-type/address-type.service.ts +0 -121
- package/src/address-type/dto/create.dto.ts +0 -19
- package/src/address-type/dto/update.dto.ts +0 -9
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
export type PaginatedResult<T> = {
|
|
4
|
+
data: T[];
|
|
5
|
+
total: number;
|
|
6
|
+
page: number;
|
|
7
|
+
pageSize: number;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export type AddressTypeValue =
|
|
11
|
+
| 'residential'
|
|
12
|
+
| 'commercial'
|
|
13
|
+
| 'correspondence'
|
|
14
|
+
| 'alternative'
|
|
15
|
+
| 'work'
|
|
16
|
+
| 'billing'
|
|
17
|
+
| 'shipping';
|
|
18
|
+
|
|
19
|
+
export const ADDRESS_TYPE_OPTIONS: Array<{
|
|
20
|
+
value: AddressTypeValue;
|
|
21
|
+
labelKey: string;
|
|
22
|
+
}> = [
|
|
23
|
+
{ value: 'residential', labelKey: 'addressTypeResidential' },
|
|
24
|
+
{ value: 'commercial', labelKey: 'addressTypeCommercial' },
|
|
25
|
+
{ value: 'correspondence', labelKey: 'addressTypeCorrespondence' },
|
|
26
|
+
{ value: 'alternative', labelKey: 'addressTypeAlternative' },
|
|
27
|
+
{ value: 'work', labelKey: 'addressTypeWork' },
|
|
28
|
+
{ value: 'billing', labelKey: 'addressTypeBilling' },
|
|
29
|
+
{ value: 'shipping', labelKey: 'addressTypeShipping' },
|
|
30
|
+
];
|
|
31
|
+
|
|
32
|
+
export type PersonContact = {
|
|
33
|
+
id?: number;
|
|
34
|
+
value: string;
|
|
35
|
+
is_primary: boolean;
|
|
36
|
+
contact_type_id: number;
|
|
37
|
+
contact_type?: {
|
|
38
|
+
id: number;
|
|
39
|
+
code: string;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export type PersonAddress = {
|
|
44
|
+
id?: number;
|
|
45
|
+
line1: string;
|
|
46
|
+
line2?: string;
|
|
47
|
+
city: string;
|
|
48
|
+
state: string;
|
|
49
|
+
is_primary: boolean;
|
|
50
|
+
address_type: AddressTypeValue;
|
|
51
|
+
postal_code?: string;
|
|
52
|
+
country_code?: string;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
export type PersonDocument = {
|
|
56
|
+
id?: number;
|
|
57
|
+
value: string;
|
|
58
|
+
document_type_id: number;
|
|
59
|
+
document_type?: {
|
|
60
|
+
id: number;
|
|
61
|
+
code: string;
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
export type PersonGender = 'male' | 'female' | 'other';
|
|
66
|
+
|
|
67
|
+
export type PersonRelationSummary = {
|
|
68
|
+
id: number;
|
|
69
|
+
name: string;
|
|
70
|
+
type?: 'individual' | 'company';
|
|
71
|
+
status: 'active' | 'inactive';
|
|
72
|
+
avatar_id?: number | null;
|
|
73
|
+
trade_name?: string | null;
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
export type Person = {
|
|
77
|
+
id: number;
|
|
78
|
+
name: string;
|
|
79
|
+
type: 'individual' | 'company';
|
|
80
|
+
status: 'active' | 'inactive';
|
|
81
|
+
avatar_id?: number | null;
|
|
82
|
+
birth_date?: string | null;
|
|
83
|
+
gender?: PersonGender | null;
|
|
84
|
+
job_title?: string | null;
|
|
85
|
+
trade_name?: string | null;
|
|
86
|
+
foundation_date?: string | null;
|
|
87
|
+
legal_nature?: string | null;
|
|
88
|
+
notes?: string | null;
|
|
89
|
+
employer_company_id?: number | null;
|
|
90
|
+
employer_company?: PersonRelationSummary | null;
|
|
91
|
+
created_at: string;
|
|
92
|
+
contact?: PersonContact[];
|
|
93
|
+
address?: PersonAddress[];
|
|
94
|
+
document?: PersonDocument[];
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
export type ContactTypeOption = {
|
|
98
|
+
id: number;
|
|
99
|
+
code: string;
|
|
100
|
+
contact_type_id: number;
|
|
101
|
+
name: string;
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
export type DocumentTypeOption = {
|
|
105
|
+
id: number;
|
|
106
|
+
document_type_id: number;
|
|
107
|
+
code: string;
|
|
108
|
+
name: string;
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
export type CompanyOption = {
|
|
112
|
+
id: number;
|
|
113
|
+
name: string;
|
|
114
|
+
trade_name?: string | null;
|
|
115
|
+
};
|