tychat-contracts 1.0.13 → 1.0.15

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 (37) hide show
  1. package/dist/index.d.ts +1 -0
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.js +1 -0
  4. package/dist/patients/create-patient.dto.d.ts +0 -2
  5. package/dist/patients/create-patient.dto.d.ts.map +1 -1
  6. package/dist/patients/create-patient.dto.js +0 -14
  7. package/dist/patients/index.d.ts +1 -0
  8. package/dist/patients/index.d.ts.map +1 -1
  9. package/dist/patients/index.js +1 -0
  10. package/dist/patients/patient-procedure.dto.d.ts +0 -1
  11. package/dist/patients/patient-procedure.dto.d.ts.map +1 -1
  12. package/dist/patients/patient-procedure.dto.js +0 -9
  13. package/dist/patients/update-patient-procedure.dto.d.ts +6 -0
  14. package/dist/patients/update-patient-procedure.dto.d.ts.map +1 -0
  15. package/dist/patients/update-patient-procedure.dto.js +8 -0
  16. package/dist/procedures/create-procedure.dto.d.ts +7 -0
  17. package/dist/procedures/create-procedure.dto.d.ts.map +1 -0
  18. package/dist/procedures/create-procedure.dto.js +61 -0
  19. package/dist/procedures/index.d.ts +4 -0
  20. package/dist/procedures/index.d.ts.map +1 -0
  21. package/dist/procedures/index.js +19 -0
  22. package/dist/procedures/list-procedures-query.dto.d.ts +5 -0
  23. package/dist/procedures/list-procedures-query.dto.d.ts.map +1 -0
  24. package/dist/procedures/list-procedures-query.dto.js +45 -0
  25. package/dist/procedures/update-procedure.dto.d.ts +6 -0
  26. package/dist/procedures/update-procedure.dto.d.ts.map +1 -0
  27. package/dist/procedures/update-procedure.dto.js +8 -0
  28. package/package.json +1 -1
  29. package/src/index.ts +1 -0
  30. package/src/patients/create-patient.dto.ts +9 -14
  31. package/src/patients/index.ts +1 -0
  32. package/src/patients/patient-procedure.dto.ts +0 -7
  33. package/src/patients/update-patient-procedure.dto.ts +4 -0
  34. package/src/procedures/create-procedure.dto.ts +47 -0
  35. package/src/procedures/index.ts +3 -0
  36. package/src/procedures/list-procedures-query.dto.ts +28 -0
  37. package/src/procedures/update-procedure.dto.ts +4 -0
package/dist/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  export * from './auth';
2
2
  export * from './users';
3
3
  export * from './patients';
4
+ export * from './procedures';
4
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC"}
package/dist/index.js CHANGED
@@ -17,3 +17,4 @@ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./auth"), exports);
18
18
  __exportStar(require("./users"), exports);
19
19
  __exportStar(require("./patients"), exports);
20
+ __exportStar(require("./procedures"), exports);
@@ -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,5 +1,4 @@
1
1
  export declare class PatientProcedureDto {
2
- procedureId: string;
3
2
  name: string;
4
3
  value: number;
5
4
  finished: boolean;
@@ -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;IAUlB,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B"}
@@ -13,21 +13,12 @@ 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;
20
19
  observation;
21
20
  }
22
21
  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
22
  __decorate([
32
23
  (0, swagger_1.ApiProperty)({
33
24
  description: 'Nome do procedimento que o paciente irá realizar ou realizou',
@@ -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;
@@ -0,0 +1,7 @@
1
+ export declare class CreateProcedureDto {
2
+ name: string;
3
+ value: number;
4
+ duration: number;
5
+ side_effects?: string | null;
6
+ }
7
+ //# sourceMappingURL=create-procedure.dto.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-procedure.dto.d.ts","sourceRoot":"","sources":["../../src/procedures/create-procedure.dto.ts"],"names":[],"mappings":"AAUA,qBAAa,kBAAkB;IAS7B,IAAI,EAAE,MAAM,CAAC;IAQb,KAAK,EAAE,MAAM,CAAC;IAQd,QAAQ,EAAE,MAAM,CAAC;IAUjB,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B"}
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.CreateProcedureDto = void 0;
13
+ const swagger_1 = require("@nestjs/swagger");
14
+ const class_validator_1 = require("class-validator");
15
+ class CreateProcedureDto {
16
+ name;
17
+ value;
18
+ duration;
19
+ side_effects;
20
+ }
21
+ exports.CreateProcedureDto = CreateProcedureDto;
22
+ __decorate([
23
+ (0, swagger_1.ApiProperty)({
24
+ description: 'Nome do procedimento',
25
+ example: 'Consulta clínica',
26
+ maxLength: 255,
27
+ }),
28
+ (0, class_validator_1.IsString)(),
29
+ (0, class_validator_1.IsNotEmpty)(),
30
+ (0, class_validator_1.MaxLength)(255),
31
+ __metadata("design:type", String)
32
+ ], CreateProcedureDto.prototype, "name", void 0);
33
+ __decorate([
34
+ (0, swagger_1.ApiProperty)({
35
+ description: 'Valor monetário do procedimento',
36
+ example: 150.5,
37
+ }),
38
+ (0, class_validator_1.IsNumber)({ maxDecimalPlaces: 2 }),
39
+ (0, class_validator_1.Min)(0),
40
+ __metadata("design:type", Number)
41
+ ], CreateProcedureDto.prototype, "value", void 0);
42
+ __decorate([
43
+ (0, swagger_1.ApiProperty)({
44
+ description: 'Duração do procedimento em minutos',
45
+ example: 30,
46
+ }),
47
+ (0, class_validator_1.IsNumber)(),
48
+ (0, class_validator_1.Min)(1),
49
+ __metadata("design:type", Number)
50
+ ], CreateProcedureDto.prototype, "duration", void 0);
51
+ __decorate([
52
+ (0, swagger_1.ApiPropertyOptional)({
53
+ description: 'Efeitos colaterais ou observações sobre o procedimento',
54
+ example: 'Pode causar sonolência leve',
55
+ maxLength: 5000,
56
+ }),
57
+ (0, class_validator_1.IsString)(),
58
+ (0, class_validator_1.IsOptional)(),
59
+ (0, class_validator_1.MaxLength)(5000),
60
+ __metadata("design:type", Object)
61
+ ], CreateProcedureDto.prototype, "side_effects", void 0);
@@ -0,0 +1,4 @@
1
+ export * from './create-procedure.dto';
2
+ export * from './update-procedure.dto';
3
+ export * from './list-procedures-query.dto';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/procedures/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,6BAA6B,CAAC"}
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./create-procedure.dto"), exports);
18
+ __exportStar(require("./update-procedure.dto"), exports);
19
+ __exportStar(require("./list-procedures-query.dto"), exports);
@@ -0,0 +1,5 @@
1
+ export declare class ListProceduresQueryDto {
2
+ page?: number;
3
+ limit?: number;
4
+ }
5
+ //# sourceMappingURL=list-procedures-query.dto.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list-procedures-query.dto.d.ts","sourceRoot":"","sources":["../../src/procedures/list-procedures-query.dto.ts"],"names":[],"mappings":"AAGA,qBAAa,sBAAsB;IAUjC,IAAI,CAAC,EAAE,MAAM,CAAC;IAad,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB"}
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.ListProceduresQueryDto = void 0;
13
+ const swagger_1 = require("@nestjs/swagger");
14
+ const class_validator_1 = require("class-validator");
15
+ class ListProceduresQueryDto {
16
+ page;
17
+ limit;
18
+ }
19
+ exports.ListProceduresQueryDto = ListProceduresQueryDto;
20
+ __decorate([
21
+ (0, swagger_1.ApiPropertyOptional)({
22
+ description: 'Número da página (iniciando em 1)',
23
+ example: 1,
24
+ minimum: 1,
25
+ default: 1,
26
+ }),
27
+ (0, class_validator_1.IsOptional)(),
28
+ (0, class_validator_1.IsInt)(),
29
+ (0, class_validator_1.Min)(1),
30
+ __metadata("design:type", Number)
31
+ ], ListProceduresQueryDto.prototype, "page", void 0);
32
+ __decorate([
33
+ (0, swagger_1.ApiPropertyOptional)({
34
+ description: 'Quantidade de registros por página',
35
+ example: 20,
36
+ minimum: 1,
37
+ maximum: 100,
38
+ default: 20,
39
+ }),
40
+ (0, class_validator_1.IsOptional)(),
41
+ (0, class_validator_1.IsInt)(),
42
+ (0, class_validator_1.Min)(1),
43
+ (0, class_validator_1.Max)(100),
44
+ __metadata("design:type", Number)
45
+ ], ListProceduresQueryDto.prototype, "limit", void 0);
@@ -0,0 +1,6 @@
1
+ import { CreateProcedureDto } from './create-procedure.dto';
2
+ declare const UpdateProcedureDto_base: import("@nestjs/common").Type<Partial<CreateProcedureDto>>;
3
+ export declare class UpdateProcedureDto extends UpdateProcedureDto_base {
4
+ }
5
+ export {};
6
+ //# sourceMappingURL=update-procedure.dto.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update-procedure.dto.d.ts","sourceRoot":"","sources":["../../src/procedures/update-procedure.dto.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;;AAE5D,qBAAa,kBAAmB,SAAQ,uBAA+B;CAAG"}
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UpdateProcedureDto = void 0;
4
+ const swagger_1 = require("@nestjs/swagger");
5
+ const create_procedure_dto_1 = require("./create-procedure.dto");
6
+ class UpdateProcedureDto extends (0, swagger_1.PartialType)(create_procedure_dto_1.CreateProcedureDto) {
7
+ }
8
+ exports.UpdateProcedureDto = UpdateProcedureDto;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tychat-contracts",
3
- "version": "1.0.13",
3
+ "version": "1.0.15",
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",
package/src/index.ts CHANGED
@@ -1,3 +1,4 @@
1
1
  export * from './auth';
2
2
  export * from './users';
3
3
  export * from './patients';
4
+ export * from './procedures';
@@ -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
 
@@ -10,13 +10,6 @@ import {
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',
@@ -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) {}
@@ -0,0 +1,47 @@
1
+ import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
2
+ import {
3
+ IsNotEmpty,
4
+ IsNumber,
5
+ IsOptional,
6
+ IsString,
7
+ MaxLength,
8
+ Min,
9
+ } from 'class-validator';
10
+
11
+ export class CreateProcedureDto {
12
+ @ApiProperty({
13
+ description: 'Nome do procedimento',
14
+ example: 'Consulta clínica',
15
+ maxLength: 255,
16
+ })
17
+ @IsString()
18
+ @IsNotEmpty()
19
+ @MaxLength(255)
20
+ name: string;
21
+
22
+ @ApiProperty({
23
+ description: 'Valor monetário do procedimento',
24
+ example: 150.5,
25
+ })
26
+ @IsNumber({ maxDecimalPlaces: 2 })
27
+ @Min(0)
28
+ value: number;
29
+
30
+ @ApiProperty({
31
+ description: 'Duração do procedimento em minutos',
32
+ example: 30,
33
+ })
34
+ @IsNumber()
35
+ @Min(1)
36
+ duration: number;
37
+
38
+ @ApiPropertyOptional({
39
+ description: 'Efeitos colaterais ou observações sobre o procedimento',
40
+ example: 'Pode causar sonolência leve',
41
+ maxLength: 5000,
42
+ })
43
+ @IsString()
44
+ @IsOptional()
45
+ @MaxLength(5000)
46
+ side_effects?: string | null;
47
+ }
@@ -0,0 +1,3 @@
1
+ export * from './create-procedure.dto';
2
+ export * from './update-procedure.dto';
3
+ export * from './list-procedures-query.dto';
@@ -0,0 +1,28 @@
1
+ import { ApiPropertyOptional } from '@nestjs/swagger';
2
+ import { IsInt, IsOptional, Max, Min } from 'class-validator';
3
+
4
+ export class ListProceduresQueryDto {
5
+ @ApiPropertyOptional({
6
+ description: 'Número da página (iniciando em 1)',
7
+ example: 1,
8
+ minimum: 1,
9
+ default: 1,
10
+ })
11
+ @IsOptional()
12
+ @IsInt()
13
+ @Min(1)
14
+ page?: number;
15
+
16
+ @ApiPropertyOptional({
17
+ description: 'Quantidade de registros por página',
18
+ example: 20,
19
+ minimum: 1,
20
+ maximum: 100,
21
+ default: 20,
22
+ })
23
+ @IsOptional()
24
+ @IsInt()
25
+ @Min(1)
26
+ @Max(100)
27
+ limit?: number;
28
+ }
@@ -0,0 +1,4 @@
1
+ import { PartialType } from '@nestjs/swagger';
2
+ import { CreateProcedureDto } from './create-procedure.dto';
3
+
4
+ export class UpdateProcedureDto extends PartialType(CreateProcedureDto) {}