@hed-hog/contact 0.0.266 → 0.0.274
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/README.md +470 -0
- 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/interaction-create.dto.d.ts +16 -0
- package/dist/person/dto/interaction-create.dto.d.ts.map +1 -0
- package/dist/person/dto/interaction-create.dto.js +57 -0
- package/dist/person/dto/interaction-create.dto.js.map +1 -0
- 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 +37 -8
- package/dist/person/person.controller.d.ts.map +1 -1
- package/dist/person/person.controller.js +29 -3
- package/dist/person/person.controller.js.map +1 -1
- package/dist/person/person.service.d.ts +71 -13
- package/dist/person/person.service.d.ts.map +1 -1
- package/dist/person/person.service.js +762 -108
- 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/role.yaml +9 -1
- package/hedhog/data/route.yaml +10 -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 +2277 -0
- package/hedhog/frontend/app/person/_components/person-types.ts.ejs +157 -0
- package/hedhog/frontend/app/person/page.tsx.ejs +1158 -1335
- package/hedhog/frontend/messages/en.json +114 -4
- package/hedhog/frontend/messages/pt.json +155 -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 +4 -0
- package/hedhog/table/person_individual_relation.yaml +39 -0
- package/package.json +6 -5
- 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 +8 -1
- package/src/language/pt.json +9 -1
- package/src/person/dto/create.dto.ts +49 -1
- package/src/person/dto/update.dto.ts +75 -3
- package/src/person/person.controller.ts +31 -14
- package/src/person/person.service.ts +1019 -121
- 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
package/src/contact.service.ts
CHANGED
|
@@ -16,19 +16,34 @@ export class ContactService {
|
|
|
16
16
|
private readonly jwtService: JwtService,
|
|
17
17
|
) {}
|
|
18
18
|
|
|
19
|
-
async getPerson(personId: number) {
|
|
20
|
-
|
|
21
|
-
where: {
|
|
22
|
-
id: personId,
|
|
23
|
-
},
|
|
24
|
-
include: {
|
|
25
|
-
contact: true,
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
19
|
+
async getPerson(personId: number) {
|
|
20
|
+
const person = await this.prismaService.person.findUnique({
|
|
21
|
+
where: {
|
|
22
|
+
id: personId,
|
|
23
|
+
},
|
|
24
|
+
include: {
|
|
25
|
+
contact: true,
|
|
26
|
+
person_address: {
|
|
27
|
+
include: {
|
|
28
|
+
address: true,
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
document: true,
|
|
32
|
+
person_metadata: true,
|
|
33
|
+
},
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
if (!person) {
|
|
37
|
+
return null;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const { person_address, ...data } = person;
|
|
41
|
+
|
|
42
|
+
return {
|
|
43
|
+
...data,
|
|
44
|
+
address: person_address.map((item) => item.address),
|
|
45
|
+
};
|
|
46
|
+
}
|
|
32
47
|
|
|
33
48
|
async getPersonOrCreateIfNotExists(
|
|
34
49
|
type_id: number,
|
package/src/index.ts
CHANGED
|
@@ -1,14 +1,7 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
1
|
+
export * from './contact.module';
|
|
2
|
+
export * from './contact.service';
|
|
3
|
+
|
|
4
|
+
export * from './address-type.enum';
|
|
5
|
+
export * from './contact-type/contact-type.enum';
|
|
6
|
+
export * from './document-type/document-type.enum';
|
|
3
7
|
|
|
4
|
-
export * from "./address-type/address-type.enum";
|
|
5
|
-
|
|
6
|
-
export * from "./contact-type/contact-type.enum";
|
|
7
|
-
|
|
8
|
-
export * from "./document-type/document-type.enum";
|
|
9
|
-
|
|
10
|
-
export * from "./address-type/address-type.enum";
|
|
11
|
-
|
|
12
|
-
export * from "./contact-type/contact-type.enum";
|
|
13
|
-
|
|
14
|
-
export * from "./document-type/document-type.enum";
|
package/src/language/en.json
CHANGED
|
@@ -11,6 +11,10 @@
|
|
|
11
11
|
"moreThanOnePrimaryContact": "More than one contact of the same type cannot be marked as primary.",
|
|
12
12
|
"moreThanOnePrimaryAddress": "More than one address of the same type cannot be marked as primary.",
|
|
13
13
|
"moreThanOnePrimaryDocument": "More than one document of the same type cannot be marked as primary.",
|
|
14
|
+
"companyRegistrationDisabled": "Company registration is disabled. Only individual records can be created.",
|
|
15
|
+
"employeeRelationTypeMissing": "Configure the employee relationship type before linking an individual to a company.",
|
|
16
|
+
"employeeRelationSelfReference": "A person cannot be linked as an employee of the same record.",
|
|
17
|
+
"employeeCompanyInvalidTarget": "Only company records can be selected as employer.",
|
|
14
18
|
"validation": {
|
|
15
19
|
"codeMustBeString": "Code must be a string",
|
|
16
20
|
"countryCodeMustBeString": "Country code must be a string",
|
|
@@ -24,10 +28,13 @@
|
|
|
24
28
|
"line1MustBeString": "line1 must be a string",
|
|
25
29
|
"cityMustBeString": "City must be a string",
|
|
26
30
|
"stateMustBeString": "State must be a string",
|
|
27
|
-
"
|
|
31
|
+
"addressTypeMustBeEnum": "address_type must be a valid enum value",
|
|
32
|
+
"line2MustBeString": "line2 must be a string",
|
|
33
|
+
"postalCodeMustBeString": "postal_code must be a string",
|
|
28
34
|
"documentTypeIdMustBeInteger": "document_type_id must be an integer",
|
|
29
35
|
"contactsMustBeArray": "Contacts must be an array",
|
|
30
36
|
"addressesMustBeArray": "Addresses must be an array",
|
|
31
37
|
"documentsMustBeArray": "Documents must be an array"
|
|
32
38
|
}
|
|
33
39
|
}
|
|
40
|
+
|
package/src/language/pt.json
CHANGED
|
@@ -11,6 +11,10 @@
|
|
|
11
11
|
"moreThanOnePrimaryContact": "Não é permitido mais de um contato do mesmo tipo marcado como principal.",
|
|
12
12
|
"moreThanOnePrimaryAddress": "Não é permitido mais de um endereço do mesmo tipo marcado como principal.",
|
|
13
13
|
"moreThanOnePrimaryDocument": "Não é permitido mais de um documento do mesmo tipo marcado como principal.",
|
|
14
|
+
"companyRegistrationDisabled": "O cadastro de empresas esta desabilitado. Apenas pessoas fisicas podem ser cadastradas.",
|
|
15
|
+
"employeeRelationTypeMissing": "Configure o tipo de relacionamento empregado antes de vincular uma pessoa física a uma empresa.",
|
|
16
|
+
"employeeRelationSelfReference": "Uma pessoa não pode ser vinculada como empregada do mesmo cadastro.",
|
|
17
|
+
"employeeCompanyInvalidTarget": "Apenas cadastros do tipo empresa podem ser selecionados como empregador.",
|
|
14
18
|
"validation": {
|
|
15
19
|
"codeMustBeString": "Código deve ser uma string",
|
|
16
20
|
"countryCodeMustBeString": "Código do país deve ser uma string",
|
|
@@ -24,10 +28,14 @@
|
|
|
24
28
|
"line1MustBeString": "line1 deve ser uma string",
|
|
25
29
|
"cityMustBeString": "Cidade deve ser uma string",
|
|
26
30
|
"stateMustBeString": "Estado deve ser uma string",
|
|
27
|
-
"
|
|
31
|
+
"addressTypeMustBeEnum": "address_type deve ser um valor de enum valido",
|
|
32
|
+
"line2MustBeString": "line2 deve ser uma string",
|
|
33
|
+
"postalCodeMustBeString": "postal_code deve ser uma string",
|
|
28
34
|
"documentTypeIdMustBeInteger": "document_type_id deve ser um inteiro",
|
|
29
35
|
"contactsMustBeArray": "Contatos devem ser um array",
|
|
30
36
|
"addressesMustBeArray": "Endereços devem ser um array",
|
|
31
37
|
"documentsMustBeArray": "Documentos devem ser um array"
|
|
32
38
|
}
|
|
33
39
|
}
|
|
40
|
+
|
|
41
|
+
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import { getLocaleText } from '@hed-hog/api-locale';
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
IsDateString,
|
|
4
|
+
IsEnum,
|
|
5
|
+
IsInt,
|
|
6
|
+
IsOptional,
|
|
7
|
+
IsString,
|
|
8
|
+
} from 'class-validator';
|
|
3
9
|
|
|
4
10
|
export enum PersonType {
|
|
5
11
|
INDIVIDUAL = 'individual',
|
|
@@ -11,6 +17,12 @@ export enum PersonStatus {
|
|
|
11
17
|
INACTIVE = 'inactive'
|
|
12
18
|
}
|
|
13
19
|
|
|
20
|
+
export enum PersonGender {
|
|
21
|
+
MALE = 'male',
|
|
22
|
+
FEMALE = 'female',
|
|
23
|
+
OTHER = 'other'
|
|
24
|
+
}
|
|
25
|
+
|
|
14
26
|
export class CreateDTO {
|
|
15
27
|
@IsString({ message: (args) => getLocaleText('validation.nameMustBeString', args.value) })
|
|
16
28
|
name: string;
|
|
@@ -20,4 +32,40 @@ export class CreateDTO {
|
|
|
20
32
|
|
|
21
33
|
@IsEnum(PersonStatus, { message: (args) => getLocaleText('validation.statusMustBeEnum', args.value) })
|
|
22
34
|
status: PersonStatus = PersonStatus.ACTIVE;
|
|
35
|
+
|
|
36
|
+
@IsOptional()
|
|
37
|
+
@IsInt({ message: (args) => getLocaleText('validation.idMustBeInteger', args.value) })
|
|
38
|
+
avatar_id?: number | null;
|
|
39
|
+
|
|
40
|
+
@IsOptional()
|
|
41
|
+
@IsDateString({}, { message: (args) => getLocaleText('validation.dateMustBeString', args.value) })
|
|
42
|
+
birth_date?: string | null;
|
|
43
|
+
|
|
44
|
+
@IsOptional()
|
|
45
|
+
@IsEnum(PersonGender, { message: (args) => getLocaleText('validation.typeMustBeEnum', args.value) })
|
|
46
|
+
gender?: PersonGender | null;
|
|
47
|
+
|
|
48
|
+
@IsOptional()
|
|
49
|
+
@IsString({ message: (args) => getLocaleText('validation.stringRequired', args.value) })
|
|
50
|
+
job_title?: string | null;
|
|
51
|
+
|
|
52
|
+
@IsOptional()
|
|
53
|
+
@IsString({ message: (args) => getLocaleText('validation.stringRequired', args.value) })
|
|
54
|
+
trade_name?: string | null;
|
|
55
|
+
|
|
56
|
+
@IsOptional()
|
|
57
|
+
@IsDateString({}, { message: (args) => getLocaleText('validation.dateMustBeString', args.value) })
|
|
58
|
+
foundation_date?: string | null;
|
|
59
|
+
|
|
60
|
+
@IsOptional()
|
|
61
|
+
@IsString({ message: (args) => getLocaleText('validation.stringRequired', args.value) })
|
|
62
|
+
legal_nature?: string | null;
|
|
63
|
+
|
|
64
|
+
@IsOptional()
|
|
65
|
+
@IsString({ message: (args) => getLocaleText('validation.notesMustBeString', args.value) })
|
|
66
|
+
notes?: string | null;
|
|
67
|
+
|
|
68
|
+
@IsOptional()
|
|
69
|
+
@IsInt({ message: (args) => getLocaleText('validation.idMustBeInteger', args.value) })
|
|
70
|
+
employer_company_id?: number | null;
|
|
23
71
|
}
|
|
@@ -1,6 +1,17 @@
|
|
|
1
|
+
import { AddressTypeEnum } from '../../address-type.enum';
|
|
2
|
+
import { PersonGender } from './create.dto';
|
|
1
3
|
import { getLocaleText } from '@hed-hog/api-locale';
|
|
2
4
|
import { Type } from 'class-transformer';
|
|
3
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
IsArray,
|
|
7
|
+
IsBoolean,
|
|
8
|
+
IsDateString,
|
|
9
|
+
IsEnum,
|
|
10
|
+
IsInt,
|
|
11
|
+
IsOptional,
|
|
12
|
+
IsString,
|
|
13
|
+
ValidateNested,
|
|
14
|
+
} from 'class-validator';
|
|
4
15
|
|
|
5
16
|
export class UpdateAllContactDTO {
|
|
6
17
|
@IsOptional()
|
|
@@ -25,17 +36,31 @@ export class UpdateAllAddressDTO {
|
|
|
25
36
|
@IsString({ message: (args) => getLocaleText('validation.line1MustBeString', args.value) })
|
|
26
37
|
line1: string;
|
|
27
38
|
|
|
39
|
+
@IsOptional()
|
|
40
|
+
@IsString({ message: (args) => getLocaleText('validation.line2MustBeString', args.value) })
|
|
41
|
+
line2?: string;
|
|
42
|
+
|
|
28
43
|
@IsString({ message: (args) => getLocaleText('validation.cityMustBeString', args.value) })
|
|
29
44
|
city: string;
|
|
30
45
|
|
|
31
46
|
@IsString({ message: (args) => getLocaleText('validation.stateMustBeString', args.value) })
|
|
32
47
|
state: string;
|
|
33
48
|
|
|
49
|
+
@IsOptional()
|
|
50
|
+
@IsString({ message: (args) => getLocaleText('validation.countryCodeMustBeString', args.value) })
|
|
51
|
+
country_code?: string;
|
|
52
|
+
|
|
53
|
+
@IsOptional()
|
|
54
|
+
@IsString({ message: (args) => getLocaleText('validation.postalCodeMustBeString', args.value) })
|
|
55
|
+
postal_code?: string;
|
|
56
|
+
|
|
34
57
|
@IsBoolean({ message: (args) => getLocaleText('validation.isPrimaryMustBeBoolean', args.value) })
|
|
35
58
|
is_primary: boolean;
|
|
36
59
|
|
|
37
|
-
@
|
|
38
|
-
|
|
60
|
+
@IsEnum(AddressTypeEnum, {
|
|
61
|
+
message: (args) => getLocaleText('validation.addressTypeMustBeEnum', args.value),
|
|
62
|
+
})
|
|
63
|
+
address_type: AddressTypeEnum;
|
|
39
64
|
}
|
|
40
65
|
|
|
41
66
|
export class UpdateAllDocumentDTO {
|
|
@@ -60,6 +85,52 @@ export class UpdateAllPersonDTO {
|
|
|
60
85
|
@IsString({ message: (args) => getLocaleText('validation.statusMustBeEnum', args.value) })
|
|
61
86
|
status: string;
|
|
62
87
|
|
|
88
|
+
@IsOptional()
|
|
89
|
+
@IsInt({ message: (args) => getLocaleText('validation.idMustBeInteger', args.value) })
|
|
90
|
+
avatar_id?: number | null;
|
|
91
|
+
|
|
92
|
+
@IsOptional()
|
|
93
|
+
@IsDateString({}, { message: (args) => getLocaleText('validation.dateMustBeString', args.value) })
|
|
94
|
+
birth_date?: string | null;
|
|
95
|
+
|
|
96
|
+
@IsOptional()
|
|
97
|
+
@IsEnum(PersonGender, { message: (args) => getLocaleText('validation.typeMustBeEnum', args.value) })
|
|
98
|
+
gender?: PersonGender | null;
|
|
99
|
+
|
|
100
|
+
@IsOptional()
|
|
101
|
+
@IsString({ message: (args) => getLocaleText('validation.stringRequired', args.value) })
|
|
102
|
+
job_title?: string | null;
|
|
103
|
+
|
|
104
|
+
@IsOptional()
|
|
105
|
+
@IsString({ message: (args) => getLocaleText('validation.stringRequired', args.value) })
|
|
106
|
+
trade_name?: string | null;
|
|
107
|
+
|
|
108
|
+
@IsOptional()
|
|
109
|
+
@IsDateString({}, { message: (args) => getLocaleText('validation.dateMustBeString', args.value) })
|
|
110
|
+
foundation_date?: string | null;
|
|
111
|
+
|
|
112
|
+
@IsOptional()
|
|
113
|
+
@IsString({ message: (args) => getLocaleText('validation.stringRequired', args.value) })
|
|
114
|
+
legal_nature?: string | null;
|
|
115
|
+
|
|
116
|
+
@IsOptional()
|
|
117
|
+
@IsString({ message: (args) => getLocaleText('validation.notesMustBeString', args.value) })
|
|
118
|
+
notes?: string | null;
|
|
119
|
+
|
|
120
|
+
@IsOptional()
|
|
121
|
+
@IsInt({ message: (args) => getLocaleText('validation.idMustBeInteger', args.value) })
|
|
122
|
+
employer_company_id?: number | null;
|
|
123
|
+
|
|
124
|
+
@IsOptional()
|
|
125
|
+
@IsInt({ message: (args) => getLocaleText('validation.idMustBeInteger', args.value) })
|
|
126
|
+
headquarter_id?: number | null;
|
|
127
|
+
|
|
128
|
+
@IsOptional()
|
|
129
|
+
@IsArray({ message: (args) => getLocaleText('validation.contactsMustBeArray', args.value) })
|
|
130
|
+
@Type(() => Number)
|
|
131
|
+
@IsInt({ each: true, message: (args) => getLocaleText('validation.idMustBeInteger', args.value) })
|
|
132
|
+
branch_ids?: number[];
|
|
133
|
+
|
|
63
134
|
@IsArray({ message: (args) => getLocaleText('validation.contactsMustBeArray', args.value) })
|
|
64
135
|
@ValidateNested({ each: true })
|
|
65
136
|
@Type(() => UpdateAllContactDTO)
|
|
@@ -75,3 +146,4 @@ export class UpdateAllPersonDTO {
|
|
|
75
146
|
@Type(() => UpdateAllDocumentDTO)
|
|
76
147
|
documents: UpdateAllDocumentDTO[];
|
|
77
148
|
}
|
|
149
|
+
|
|
@@ -1,19 +1,21 @@
|
|
|
1
|
-
import { DeleteDTO, Role } from '@hed-hog/api';
|
|
1
|
+
import { DeleteDTO, Public, Role, User } from '@hed-hog/api';
|
|
2
2
|
import { Locale } from '@hed-hog/api-locale';
|
|
3
3
|
import { Pagination } from '@hed-hog/api-pagination';
|
|
4
4
|
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
5
|
+
Body,
|
|
6
|
+
Controller,
|
|
7
|
+
Delete,
|
|
8
|
+
Get,
|
|
9
|
+
Inject,
|
|
10
|
+
Param,
|
|
11
|
+
ParseIntPipe,
|
|
12
|
+
Patch,
|
|
13
|
+
Post,
|
|
14
|
+
Query,
|
|
15
|
+
Res,
|
|
16
|
+
forwardRef
|
|
16
17
|
} from '@nestjs/common';
|
|
18
|
+
import { Response } from 'express';
|
|
17
19
|
import { CreateDTO } from './dto/create.dto';
|
|
18
20
|
import { UpdateAllPersonDTO } from './dto/update.dto';
|
|
19
21
|
import { PersonService } from './person.service';
|
|
@@ -31,19 +33,34 @@ export class PersonController {
|
|
|
31
33
|
return this.personService.getStats();
|
|
32
34
|
}
|
|
33
35
|
|
|
36
|
+
@Get('owner-options')
|
|
37
|
+
async getOwnerOptions(@User() user) {
|
|
38
|
+
return this.personService.getOwnerOptions(Number(user?.id || 0));
|
|
39
|
+
}
|
|
40
|
+
|
|
34
41
|
@Get()
|
|
35
42
|
async list(@Pagination() paginationParams, @Query() filters) {
|
|
36
43
|
return this.personService.list({ ...paginationParams, ...filters });
|
|
37
44
|
}
|
|
38
45
|
|
|
46
|
+
@Public()
|
|
47
|
+
@Get('avatar/:id')
|
|
48
|
+
async openAvatar(
|
|
49
|
+
@Param('id', ParseIntPipe) id: number,
|
|
50
|
+
@Res() res: Response,
|
|
51
|
+
@Locale() locale: string,
|
|
52
|
+
) {
|
|
53
|
+
return this.personService.openPublicAvatar(locale, id, res);
|
|
54
|
+
}
|
|
55
|
+
|
|
39
56
|
@Get(':id')
|
|
40
57
|
async get(@Param('id', ParseIntPipe) id: number, @Locale() locale: string) {
|
|
41
58
|
return this.personService.get(locale, id);
|
|
42
59
|
}
|
|
43
60
|
|
|
44
61
|
@Post()
|
|
45
|
-
async create(@Body() data: CreateDTO) {
|
|
46
|
-
return this.personService.create(data);
|
|
62
|
+
async create(@Body() data: CreateDTO, @Locale() locale: string) {
|
|
63
|
+
return this.personService.create(data, locale);
|
|
47
64
|
}
|
|
48
65
|
|
|
49
66
|
@Patch(':id')
|