tychat-contracts 1.0.14 → 1.0.16

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.
@@ -1,4 +1,3 @@
1
- import { PatientProcedureDto } from './patient-procedure.dto';
2
1
  export declare class CreatePatientDto {
3
2
  name: string;
4
3
  cpf: string;
@@ -7,6 +6,5 @@ export declare class CreatePatientDto {
7
6
  disabilityDescription?: string | null;
8
7
  initialObservation?: string | null;
9
8
  observation?: string | null;
10
- procedures?: PatientProcedureDto[];
11
9
  }
12
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":"AAIA,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAE9D,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;IAW5B,UAAU,CAAC,EAAE,mBAAmB,EAAE,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"}
@@ -13,8 +13,6 @@ exports.CreatePatientDto = void 0;
13
13
  const swagger_1 = require("@nestjs/swagger");
14
14
  const class_validator_1 = require("class-validator");
15
15
  const class_transformer_1 = require("class-transformer");
16
- const class_transformer_2 = require("class-transformer");
17
- const patient_procedure_dto_1 = require("./patient-procedure.dto");
18
16
  class CreatePatientDto {
19
17
  name;
20
18
  cpf;
@@ -23,7 +21,6 @@ class CreatePatientDto {
23
21
  disabilityDescription;
24
22
  initialObservation;
25
23
  observation;
26
- procedures;
27
24
  }
28
25
  exports.CreatePatientDto = CreatePatientDto;
29
26
  __decorate([
@@ -98,14 +95,3 @@ __decorate([
98
95
  (0, class_transformer_1.Transform)(({ value, obj }) => value ?? obj.notes ?? obj.observation),
99
96
  __metadata("design:type", Object)
100
97
  ], CreatePatientDto.prototype, "observation", void 0);
101
- __decorate([
102
- (0, swagger_1.ApiPropertyOptional)({
103
- description: 'Lista de procedimentos que o paciente irá realizar ou realizou',
104
- type: () => [patient_procedure_dto_1.PatientProcedureDto],
105
- }),
106
- (0, class_validator_1.IsArray)(),
107
- (0, class_validator_1.ValidateNested)({ each: true }),
108
- (0, class_transformer_2.Type)(() => patient_procedure_dto_1.PatientProcedureDto),
109
- (0, class_validator_1.IsOptional)(),
110
- __metadata("design:type", Array)
111
- ], CreatePatientDto.prototype, "procedures", void 0);
@@ -3,4 +3,5 @@ export * from './update-patient.dto';
3
3
  export * from './patient-history-entry.dto';
4
4
  export * from './list-patients-query.dto';
5
5
  export * from './patient-procedure.dto';
6
+ export * from './update-patient-procedure.dto';
6
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/patients/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yBAAyB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/patients/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yBAAyB,CAAC;AACxC,cAAc,gCAAgC,CAAC"}
@@ -19,3 +19,4 @@ __exportStar(require("./update-patient.dto"), exports);
19
19
  __exportStar(require("./patient-history-entry.dto"), exports);
20
20
  __exportStar(require("./list-patients-query.dto"), exports);
21
21
  __exportStar(require("./patient-procedure.dto"), exports);
22
+ __exportStar(require("./update-patient-procedure.dto"), exports);
@@ -1,8 +1,8 @@
1
1
  export declare class PatientProcedureDto {
2
- procedureId: string;
3
2
  name: string;
4
3
  value: number;
5
4
  finished: boolean;
5
+ finished_at?: string | null;
6
6
  observation?: string | null;
7
7
  }
8
8
  //# sourceMappingURL=patient-procedure.dto.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"patient-procedure.dto.d.ts","sourceRoot":"","sources":["../../src/patients/patient-procedure.dto.ts"],"names":[],"mappings":"AAWA,qBAAa,mBAAmB;IAM9B,WAAW,EAAE,MAAM,CAAC;IAUpB,IAAI,EAAE,MAAM,CAAC;IAOb,KAAK,EAAE,MAAM,CAAC;IAOd,QAAQ,EAAE,OAAO,CAAC;IAUlB,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B"}
1
+ {"version":3,"file":"patient-procedure.dto.d.ts","sourceRoot":"","sources":["../../src/patients/patient-procedure.dto.ts"],"names":[],"mappings":"AAWA,qBAAa,mBAAmB;IAS9B,IAAI,EAAE,MAAM,CAAC;IAOb,KAAK,EAAE,MAAM,CAAC;IAOd,QAAQ,EAAE,OAAO,CAAC;IAQlB,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAU5B,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B"}
@@ -13,21 +13,13 @@ exports.PatientProcedureDto = void 0;
13
13
  const swagger_1 = require("@nestjs/swagger");
14
14
  const class_validator_1 = require("class-validator");
15
15
  class PatientProcedureDto {
16
- procedureId;
17
16
  name;
18
17
  value;
19
18
  finished;
19
+ finished_at;
20
20
  observation;
21
21
  }
22
22
  exports.PatientProcedureDto = PatientProcedureDto;
23
- __decorate([
24
- (0, swagger_1.ApiProperty)({
25
- description: 'ID do procedimento base (UUID)',
26
- example: '5e8f9e3b-3b9a-4d9a-9f4b-2a1c1b9e9f1a',
27
- }),
28
- (0, class_validator_1.IsUUID)('4'),
29
- __metadata("design:type", String)
30
- ], PatientProcedureDto.prototype, "procedureId", void 0);
31
23
  __decorate([
32
24
  (0, swagger_1.ApiProperty)({
33
25
  description: 'Nome do procedimento que o paciente irá realizar ou realizou',
@@ -55,6 +47,15 @@ __decorate([
55
47
  (0, class_validator_1.IsBoolean)(),
56
48
  __metadata("design:type", Boolean)
57
49
  ], PatientProcedureDto.prototype, "finished", void 0);
50
+ __decorate([
51
+ (0, swagger_1.ApiPropertyOptional)({
52
+ description: 'Data e hora em que o procedimento foi finalizado (ISO 8601)',
53
+ example: '2026-03-10T14:30:00.000Z',
54
+ }),
55
+ (0, class_validator_1.IsOptional)(),
56
+ (0, class_validator_1.IsDateString)(),
57
+ __metadata("design:type", Object)
58
+ ], PatientProcedureDto.prototype, "finished_at", void 0);
58
59
  __decorate([
59
60
  (0, swagger_1.ApiPropertyOptional)({
60
61
  description: 'Observação adicional sobre o procedimento',
@@ -0,0 +1,6 @@
1
+ import { PatientProcedureDto } from './patient-procedure.dto';
2
+ declare const UpdatePatientProcedureDto_base: import("@nestjs/common").Type<Partial<PatientProcedureDto>>;
3
+ export declare class UpdatePatientProcedureDto extends UpdatePatientProcedureDto_base {
4
+ }
5
+ export {};
6
+ //# sourceMappingURL=update-patient-procedure.dto.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update-patient-procedure.dto.d.ts","sourceRoot":"","sources":["../../src/patients/update-patient-procedure.dto.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;;AAE9D,qBAAa,yBAA0B,SAAQ,8BAAgC;CAAG"}
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UpdatePatientProcedureDto = void 0;
4
+ const swagger_1 = require("@nestjs/swagger");
5
+ const patient_procedure_dto_1 = require("./patient-procedure.dto");
6
+ class UpdatePatientProcedureDto extends (0, swagger_1.PartialType)(patient_procedure_dto_1.PatientProcedureDto) {
7
+ }
8
+ exports.UpdatePatientProcedureDto = UpdatePatientProcedureDto;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tychat-contracts",
3
- "version": "1.0.14",
3
+ "version": "1.0.16",
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",
@@ -1,8 +1,14 @@
1
1
  import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
2
- import { IsBoolean, IsDateString, IsNotEmpty, IsOptional, IsString, Length, MaxLength, ValidateNested, IsArray } from 'class-validator';
2
+ import {
3
+ IsBoolean,
4
+ IsDateString,
5
+ IsNotEmpty,
6
+ IsOptional,
7
+ IsString,
8
+ Length,
9
+ MaxLength,
10
+ } from 'class-validator';
3
11
  import { Transform } from 'class-transformer';
4
- import { Type } from 'class-transformer';
5
- import { PatientProcedureDto } from './patient-procedure.dto';
6
12
 
7
13
  export class CreatePatientDto {
8
14
  @ApiProperty({
@@ -71,16 +77,5 @@ export class CreatePatientDto {
71
77
  @MaxLength(2000)
72
78
  @Transform(({ value, obj }) => value ?? obj.notes ?? obj.observation)
73
79
  observation?: string | null;
74
-
75
- @ApiPropertyOptional({
76
- description:
77
- 'Lista de procedimentos que o paciente irá realizar ou realizou',
78
- type: () => [PatientProcedureDto],
79
- })
80
- @IsArray()
81
- @ValidateNested({ each: true })
82
- @Type(() => PatientProcedureDto)
83
- @IsOptional()
84
- procedures?: PatientProcedureDto[];
85
80
  }
86
81
 
@@ -3,4 +3,5 @@ export * from './update-patient.dto';
3
3
  export * from './patient-history-entry.dto';
4
4
  export * from './list-patients-query.dto';
5
5
  export * from './patient-procedure.dto';
6
+ export * from './update-patient-procedure.dto';
6
7
 
@@ -1,22 +1,15 @@
1
1
  import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
2
2
  import {
3
3
  IsBoolean,
4
+ IsDateString,
4
5
  IsNotEmpty,
5
6
  IsNumber,
6
7
  IsOptional,
7
8
  IsString,
8
- IsUUID,
9
9
  MaxLength,
10
10
  } from 'class-validator';
11
11
 
12
12
  export class PatientProcedureDto {
13
- @ApiProperty({
14
- description: 'ID do procedimento base (UUID)',
15
- example: '5e8f9e3b-3b9a-4d9a-9f4b-2a1c1b9e9f1a',
16
- })
17
- @IsUUID('4')
18
- procedureId: string;
19
-
20
13
  @ApiProperty({
21
14
  description: 'Nome do procedimento que o paciente irá realizar ou realizou',
22
15
  example: 'Consulta clínica',
@@ -41,6 +34,14 @@ export class PatientProcedureDto {
41
34
  @IsBoolean()
42
35
  finished: boolean;
43
36
 
37
+ @ApiPropertyOptional({
38
+ description: 'Data e hora em que o procedimento foi finalizado (ISO 8601)',
39
+ example: '2026-03-10T14:30:00.000Z',
40
+ })
41
+ @IsOptional()
42
+ @IsDateString()
43
+ finished_at?: string | null;
44
+
44
45
  @ApiPropertyOptional({
45
46
  description: 'Observação adicional sobre o procedimento',
46
47
  example: 'Paciente chegou em jejum',
@@ -0,0 +1,4 @@
1
+ import { PartialType } from '@nestjs/swagger';
2
+ import { PatientProcedureDto } from './patient-procedure.dto';
3
+
4
+ export class UpdatePatientProcedureDto extends PartialType(PatientProcedureDto) {}