tychat-contracts 1.0.10 → 1.0.12

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.
@@ -5,5 +5,6 @@ export declare class CreatePatientDto {
5
5
  hasDisability: boolean;
6
6
  disabilityDescription?: string | null;
7
7
  initialObservation?: string | null;
8
+ observation?: string | null;
8
9
  }
9
10
  //# sourceMappingURL=create-patient.dto.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"create-patient.dto.d.ts","sourceRoot":"","sources":["../../src/patients/create-patient.dto.ts"],"names":[],"mappings":"AAWA,qBAAa,gBAAgB;IAS3B,IAAI,EAAE,MAAM,CAAC;IAUb,GAAG,EAAE,MAAM,CAAC;IAOZ,SAAS,EAAE,MAAM,CAAC;IAOlB,aAAa,EAAE,OAAO,CAAC;IAWvB,qBAAqB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAUtC,kBAAkB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACpC"}
1
+ {"version":3,"file":"create-patient.dto.d.ts","sourceRoot":"","sources":["../../src/patients/create-patient.dto.ts"],"names":[],"mappings":"AAYA,qBAAa,gBAAgB;IAS3B,IAAI,EAAE,MAAM,CAAC;IAUb,GAAG,EAAE,MAAM,CAAC;IAOZ,SAAS,EAAE,MAAM,CAAC;IAOlB,aAAa,EAAE,OAAO,CAAC;IAWvB,qBAAqB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAUtC,kBAAkB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAYnC,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B"}
@@ -12,6 +12,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.CreatePatientDto = void 0;
13
13
  const swagger_1 = require("@nestjs/swagger");
14
14
  const class_validator_1 = require("class-validator");
15
+ const class_transformer_1 = require("class-transformer");
15
16
  class CreatePatientDto {
16
17
  name;
17
18
  cpf;
@@ -19,6 +20,7 @@ class CreatePatientDto {
19
20
  hasDisability;
20
21
  disabilityDescription;
21
22
  initialObservation;
23
+ observation;
22
24
  }
23
25
  exports.CreatePatientDto = CreatePatientDto;
24
26
  __decorate([
@@ -81,3 +83,15 @@ __decorate([
81
83
  (0, class_validator_1.MaxLength)(2000),
82
84
  __metadata("design:type", Object)
83
85
  ], CreatePatientDto.prototype, "initialObservation", void 0);
86
+ __decorate([
87
+ (0, swagger_1.ApiPropertyOptional)({
88
+ description: 'Nova observação do paciente (cria uma entrada de histórico de observações)',
89
+ example: 'Paciente tem alergia a penicilina',
90
+ maxLength: 2000,
91
+ }),
92
+ (0, class_validator_1.IsString)(),
93
+ (0, class_validator_1.IsOptional)(),
94
+ (0, class_validator_1.MaxLength)(2000),
95
+ (0, class_transformer_1.Transform)(({ value, obj }) => value ?? obj.notes ?? obj.observation),
96
+ __metadata("design:type", Object)
97
+ ], CreatePatientDto.prototype, "observation", void 0);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tychat-contracts",
3
- "version": "1.0.10",
3
+ "version": "1.0.12",
4
4
  "description": "DTOs compartilhados com class-validator (API e microserviços)",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -10,6 +10,7 @@
10
10
  "prepublishOnly": "npm run build"
11
11
  },
12
12
  "dependencies": {
13
+ "class-transformer": "^0.5.1",
13
14
  "class-validator": "^0.14.1",
14
15
  "reflect-metadata": "*"
15
16
  },
@@ -8,6 +8,7 @@ import {
8
8
  Length,
9
9
  MaxLength,
10
10
  } from 'class-validator';
11
+ import { Transform } from 'class-transformer';
11
12
 
12
13
  export class CreatePatientDto {
13
14
  @ApiProperty({
@@ -64,5 +65,17 @@ export class CreatePatientDto {
64
65
  @IsOptional()
65
66
  @MaxLength(2000)
66
67
  initialObservation?: string | null;
68
+
69
+ @ApiPropertyOptional({
70
+ description:
71
+ 'Nova observação do paciente (cria uma entrada de histórico de observações)',
72
+ example: 'Paciente tem alergia a penicilina',
73
+ maxLength: 2000,
74
+ })
75
+ @IsString()
76
+ @IsOptional()
77
+ @MaxLength(2000)
78
+ @Transform(({ value, obj }) => value ?? obj.notes ?? obj.observation)
79
+ observation?: string | null;
67
80
  }
68
81