@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.
Files changed (77) hide show
  1. package/dist/address-type.enum.d.ts +10 -0
  2. package/dist/address-type.enum.d.ts.map +1 -0
  3. package/dist/address-type.enum.js +14 -0
  4. package/dist/address-type.enum.js.map +1 -0
  5. package/dist/contact.module.d.ts.map +1 -1
  6. package/dist/contact.module.js +0 -2
  7. package/dist/contact.module.js.map +1 -1
  8. package/dist/contact.service.d.ts +19 -22
  9. package/dist/contact.service.d.ts.map +1 -1
  10. package/dist/contact.service.js +22 -2
  11. package/dist/contact.service.js.map +1 -1
  12. package/dist/index.d.ts +5 -8
  13. package/dist/index.d.ts.map +1 -1
  14. package/dist/index.js +1 -4
  15. package/dist/index.js.map +1 -1
  16. package/dist/person/dto/create.dto.d.ts +14 -0
  17. package/dist/person/dto/create.dto.d.ts.map +1 -1
  18. package/dist/person/dto/create.dto.js +52 -1
  19. package/dist/person/dto/create.dto.js.map +1 -1
  20. package/dist/person/dto/update.dto.d.ts +17 -1
  21. package/dist/person/dto/update.dto.d.ts.map +1 -1
  22. package/dist/person/dto/update.dto.js +79 -3
  23. package/dist/person/dto/update.dto.js.map +1 -1
  24. package/dist/person/person.controller.d.ts +33 -8
  25. package/dist/person/person.controller.d.ts.map +1 -1
  26. package/dist/person/person.controller.js +19 -3
  27. package/dist/person/person.controller.js.map +1 -1
  28. package/dist/person/person.service.d.ts +59 -10
  29. package/dist/person/person.service.d.ts.map +1 -1
  30. package/dist/person/person.service.js +710 -107
  31. package/dist/person/person.service.js.map +1 -1
  32. package/dist/person-relation-type/person-relation-type.controller.d.ts +13 -9
  33. package/dist/person-relation-type/person-relation-type.controller.d.ts.map +1 -1
  34. package/dist/person-relation-type/person-relation-type.service.d.ts +16 -20
  35. package/dist/person-relation-type/person-relation-type.service.d.ts.map +1 -1
  36. package/dist/person-relation-type/person-relation-type.service.js +48 -41
  37. package/dist/person-relation-type/person-relation-type.service.js.map +1 -1
  38. package/hedhog/data/menu.yaml +2 -16
  39. package/hedhog/data/route.yaml +2 -21
  40. package/hedhog/data/setting_group.yaml +21 -0
  41. package/hedhog/frontend/app/person/_components/delete-person-dialog.tsx.ejs +59 -0
  42. package/hedhog/frontend/app/person/_components/person-field-with-create.tsx.ejs +831 -0
  43. package/hedhog/frontend/app/person/_components/person-form-sheet.tsx.ejs +1997 -0
  44. package/hedhog/frontend/app/person/_components/person-types.ts.ejs +115 -0
  45. package/hedhog/frontend/app/person/page.tsx.ejs +1209 -1530
  46. package/hedhog/frontend/messages/en.json +114 -4
  47. package/hedhog/frontend/messages/pt.json +114 -4
  48. package/hedhog/table/person.yaml +7 -0
  49. package/hedhog/table/person_address.yaml +18 -0
  50. package/hedhog/table/person_company.yaml +26 -11
  51. package/hedhog/table/person_individual.yaml +17 -13
  52. package/hedhog/table/person_individual_relation.yaml +39 -0
  53. package/package.json +8 -7
  54. package/src/address-type.enum.ts +9 -0
  55. package/src/contact.module.ts +46 -48
  56. package/src/contact.service.ts +28 -13
  57. package/src/index.ts +6 -13
  58. package/src/language/en.json +13 -6
  59. package/src/language/pt.json +14 -6
  60. package/src/person/dto/create.dto.ts +62 -14
  61. package/src/person/dto/update.dto.ts +147 -75
  62. package/src/person/person.controller.ts +39 -27
  63. package/src/person/person.service.ts +1071 -239
  64. package/src/person-relation-type/person-relation-type.service.ts +84 -76
  65. package/hedhog/data/address_type.yaml +0 -28
  66. package/hedhog/frontend/app/address-type/page.tsx.ejs +0 -480
  67. package/hedhog/query/add-unique-address-type-locale.sql +0 -3
  68. package/hedhog/table/address.yaml +0 -28
  69. package/hedhog/table/address_type.yaml +0 -11
  70. package/hedhog/table/person_relation.yaml +0 -20
  71. package/hedhog/table/person_relation_type.yaml +0 -6
  72. package/src/address-type/address-type.controller.ts +0 -55
  73. package/src/address-type/address-type.enum.ts +0 -9
  74. package/src/address-type/address-type.module.ts +0 -18
  75. package/src/address-type/address-type.service.ts +0 -121
  76. package/src/address-type/dto/create.dto.ts +0 -19
  77. 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
+ };