tychat-contracts 1.0.65 → 1.0.67

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.
@@ -0,0 +1,12 @@
1
+ /**
2
+ * DTO for creating a procedure linked to an appointment.
3
+ * Procedures belong to appointments (not directly to patients).
4
+ */
5
+ export declare class AppointmentProcedureDto {
6
+ name: string;
7
+ value: number;
8
+ finished: boolean;
9
+ finished_at?: string | null;
10
+ observation?: string | null;
11
+ }
12
+ //# sourceMappingURL=appointment-procedure.dto.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"appointment-procedure.dto.d.ts","sourceRoot":"","sources":["../../src/appointments/appointment-procedure.dto.ts"],"names":[],"mappings":"AAWA;;;GAGG;AACH,qBAAa,uBAAuB;IASlC,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"}
@@ -0,0 +1,73 @@
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.AppointmentProcedureDto = void 0;
13
+ const swagger_1 = require("@nestjs/swagger");
14
+ const class_validator_1 = require("class-validator");
15
+ /**
16
+ * DTO for creating a procedure linked to an appointment.
17
+ * Procedures belong to appointments (not directly to patients).
18
+ */
19
+ class AppointmentProcedureDto {
20
+ name;
21
+ value;
22
+ finished;
23
+ finished_at;
24
+ observation;
25
+ }
26
+ exports.AppointmentProcedureDto = AppointmentProcedureDto;
27
+ __decorate([
28
+ (0, swagger_1.ApiProperty)({
29
+ description: 'Name of the procedure to be performed or already performed',
30
+ example: 'Consulta clínica',
31
+ maxLength: 255,
32
+ }),
33
+ (0, class_validator_1.IsString)(),
34
+ (0, class_validator_1.IsNotEmpty)(),
35
+ (0, class_validator_1.MaxLength)(255),
36
+ __metadata("design:type", String)
37
+ ], AppointmentProcedureDto.prototype, "name", void 0);
38
+ __decorate([
39
+ (0, swagger_1.ApiProperty)({
40
+ description: 'Monetary value of the procedure',
41
+ example: 150.5,
42
+ }),
43
+ (0, class_validator_1.IsNumber)({ maxDecimalPlaces: 2 }),
44
+ __metadata("design:type", Number)
45
+ ], AppointmentProcedureDto.prototype, "value", void 0);
46
+ __decorate([
47
+ (0, swagger_1.ApiProperty)({
48
+ description: 'Indicates whether the procedure has been completed',
49
+ example: false,
50
+ }),
51
+ (0, class_validator_1.IsBoolean)(),
52
+ __metadata("design:type", Boolean)
53
+ ], AppointmentProcedureDto.prototype, "finished", void 0);
54
+ __decorate([
55
+ (0, swagger_1.ApiPropertyOptional)({
56
+ description: 'Date and time when the procedure was completed (ISO 8601)',
57
+ example: '2026-03-10T14:30:00.000Z',
58
+ }),
59
+ (0, class_validator_1.IsOptional)(),
60
+ (0, class_validator_1.IsDateString)(),
61
+ __metadata("design:type", Object)
62
+ ], AppointmentProcedureDto.prototype, "finished_at", void 0);
63
+ __decorate([
64
+ (0, swagger_1.ApiPropertyOptional)({
65
+ description: 'Additional observation about the procedure',
66
+ example: 'Paciente chegou em jejum',
67
+ maxLength: 2000,
68
+ }),
69
+ (0, class_validator_1.IsString)(),
70
+ (0, class_validator_1.IsOptional)(),
71
+ (0, class_validator_1.MaxLength)(2000),
72
+ __metadata("design:type", Object)
73
+ ], AppointmentProcedureDto.prototype, "observation", void 0);
@@ -1,4 +1,16 @@
1
1
  import { AppointmentStatusDto } from "./appointment-status.dto";
2
+ /** Procedure as returned nested inside an appointment response. */
3
+ export interface AppointmentProcedureResponseDto {
4
+ id: string;
5
+ appointmentId: string;
6
+ name: string;
7
+ value: number;
8
+ finished: boolean;
9
+ finishedAt: string | null;
10
+ observation: string | null;
11
+ createdAt?: string;
12
+ updatedAt?: string;
13
+ }
2
14
  export interface AppointmentDto {
3
15
  id: string;
4
16
  patientId: string;
@@ -10,5 +22,6 @@ export interface AppointmentDto {
10
22
  observation?: string;
11
23
  cancellationReason?: string;
12
24
  status: AppointmentStatusDto;
25
+ procedures?: AppointmentProcedureResponseDto[];
13
26
  }
14
27
  //# sourceMappingURL=appointment.dto.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"appointment.dto.d.ts","sourceRoot":"","sources":["../../src/appointments/appointment.dto.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAEhE,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IAMX,SAAS,EAAE,MAAM,CAAC;IAKlB,MAAM,EAAE,MAAM,CAAC;IAKf,IAAI,EAAE,MAAM,CAAC;IAKb,gBAAgB,EAAE,OAAO,CAAC;IAK1B,iBAAiB,EAAE,OAAO,CAAC;IAK3B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAKlB,WAAW,CAAC,EAAE,MAAM,CAAC;IAKrB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAK5B,MAAM,EAAE,oBAAoB,CAAC;CAC9B"}
1
+ {"version":3,"file":"appointment.dto.d.ts","sourceRoot":"","sources":["../../src/appointments/appointment.dto.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAEhE,mEAAmE;AACnE,MAAM,WAAW,+BAA+B;IAC9C,EAAE,EAAE,MAAM,CAAC;IACX,aAAa,EAAE,MAAM,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,OAAO,CAAC;IAClB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IAMX,SAAS,EAAE,MAAM,CAAC;IAKlB,MAAM,EAAE,MAAM,CAAC;IAKf,IAAI,EAAE,MAAM,CAAC;IAKb,gBAAgB,EAAE,OAAO,CAAC;IAK1B,iBAAiB,EAAE,OAAO,CAAC;IAK3B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAKlB,WAAW,CAAC,EAAE,MAAM,CAAC;IAKrB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAK5B,MAAM,EAAE,oBAAoB,CAAC;IAI7B,UAAU,CAAC,EAAE,+BAA+B,EAAE,CAAC;CAChD"}
@@ -5,4 +5,6 @@ export * from './available-slots-query.dto';
5
5
  export * from './available-slots-response.dto';
6
6
  export * from './appointment-status.dto';
7
7
  export * from './appointment.dto';
8
+ export * from './appointment-procedure.dto';
9
+ export * from './update-appointment-procedure.dto';
8
10
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/appointments/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,0BAA0B,CAAC;AACzC,cAAc,mBAAmB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/appointments/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,0BAA0B,CAAC;AACzC,cAAc,mBAAmB,CAAC;AAClC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,oCAAoC,CAAC"}
@@ -21,3 +21,5 @@ __exportStar(require("./available-slots-query.dto"), exports);
21
21
  __exportStar(require("./available-slots-response.dto"), exports);
22
22
  __exportStar(require("./appointment-status.dto"), exports);
23
23
  __exportStar(require("./appointment.dto"), exports);
24
+ __exportStar(require("./appointment-procedure.dto"), exports);
25
+ __exportStar(require("./update-appointment-procedure.dto"), exports);
@@ -0,0 +1,10 @@
1
+ import { AppointmentProcedureDto } from './appointment-procedure.dto';
2
+ declare const UpdateAppointmentProcedureDto_base: import("@nestjs/common").Type<Partial<AppointmentProcedureDto>>;
3
+ /**
4
+ * DTO for partially updating an appointment procedure.
5
+ * All fields are optional.
6
+ */
7
+ export declare class UpdateAppointmentProcedureDto extends UpdateAppointmentProcedureDto_base {
8
+ }
9
+ export {};
10
+ //# sourceMappingURL=update-appointment-procedure.dto.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update-appointment-procedure.dto.d.ts","sourceRoot":"","sources":["../../src/appointments/update-appointment-procedure.dto.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;;AAEtE;;;GAGG;AACH,qBAAa,6BAA8B,SAAQ,kCAElD;CAAG"}
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UpdateAppointmentProcedureDto = void 0;
4
+ const swagger_1 = require("@nestjs/swagger");
5
+ const appointment_procedure_dto_1 = require("./appointment-procedure.dto");
6
+ /**
7
+ * DTO for partially updating an appointment procedure.
8
+ * All fields are optional.
9
+ */
10
+ class UpdateAppointmentProcedureDto extends (0, swagger_1.PartialType)(appointment_procedure_dto_1.AppointmentProcedureDto) {
11
+ }
12
+ exports.UpdateAppointmentProcedureDto = UpdateAppointmentProcedureDto;
@@ -2,6 +2,4 @@ export * from './create-patient.dto';
2
2
  export * from './update-patient.dto';
3
3
  export * from './patient-history-entry.dto';
4
4
  export * from './list-patients-query.dto';
5
- export * from './patient-procedure.dto';
6
- export * from './update-patient-procedure.dto';
7
5
  //# 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;AACxC,cAAc,gCAAgC,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"}
@@ -18,5 +18,3 @@ __exportStar(require("./create-patient.dto"), exports);
18
18
  __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
- __exportStar(require("./patient-procedure.dto"), exports);
22
- __exportStar(require("./update-patient-procedure.dto"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tychat-contracts",
3
- "version": "1.0.65",
3
+ "version": "1.0.67",
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",
@@ -6,13 +6,16 @@ import {
6
6
  IsNumber,
7
7
  IsOptional,
8
8
  IsString,
9
- IsUUID,
10
9
  MaxLength,
11
10
  } from 'class-validator';
12
11
 
13
- export class PatientProcedureDto {
12
+ /**
13
+ * DTO for creating a procedure linked to an appointment.
14
+ * Procedures belong to appointments (not directly to patients).
15
+ */
16
+ export class AppointmentProcedureDto {
14
17
  @ApiProperty({
15
- description: 'Nome do procedimento que o paciente irá realizar ou realizou',
18
+ description: 'Name of the procedure to be performed or already performed',
16
19
  example: 'Consulta clínica',
17
20
  maxLength: 255,
18
21
  })
@@ -22,21 +25,21 @@ export class PatientProcedureDto {
22
25
  name: string;
23
26
 
24
27
  @ApiProperty({
25
- description: 'Valor monetário do procedimento',
28
+ description: 'Monetary value of the procedure',
26
29
  example: 150.5,
27
30
  })
28
31
  @IsNumber({ maxDecimalPlaces: 2 })
29
32
  value: number;
30
33
 
31
34
  @ApiProperty({
32
- description: 'Indica se o procedimento foi finalizado',
35
+ description: 'Indicates whether the procedure has been completed',
33
36
  example: false,
34
37
  })
35
38
  @IsBoolean()
36
39
  finished: boolean;
37
40
 
38
41
  @ApiPropertyOptional({
39
- description: 'Data e hora em que o procedimento foi finalizado (ISO 8601)',
42
+ description: 'Date and time when the procedure was completed (ISO 8601)',
40
43
  example: '2026-03-10T14:30:00.000Z',
41
44
  })
42
45
  @IsOptional()
@@ -44,7 +47,7 @@ export class PatientProcedureDto {
44
47
  finished_at?: string | null;
45
48
 
46
49
  @ApiPropertyOptional({
47
- description: 'Observação adicional sobre o procedimento',
50
+ description: 'Additional observation about the procedure',
48
51
  example: 'Paciente chegou em jejum',
49
52
  maxLength: 2000,
50
53
  })
@@ -52,13 +55,4 @@ export class PatientProcedureDto {
52
55
  @IsOptional()
53
56
  @MaxLength(2000)
54
57
  observation?: string | null;
55
-
56
- @ApiPropertyOptional({
57
- description: 'ID do agendamento (consulta) ao qual o procedimento está vinculado',
58
- example: '550e8400-e29b-41d4-a716-446655440000',
59
- })
60
- @IsOptional()
61
- @IsUUID()
62
- appointmentId?: string | null;
63
58
  }
64
-
@@ -1,5 +1,18 @@
1
1
  import { AppointmentStatusDto } from "./appointment-status.dto";
2
2
 
3
+ /** Procedure as returned nested inside an appointment response. */
4
+ export interface AppointmentProcedureResponseDto {
5
+ id: string;
6
+ appointmentId: string;
7
+ name: string;
8
+ value: number;
9
+ finished: boolean;
10
+ finishedAt: string | null;
11
+ observation: string | null;
12
+ createdAt?: string;
13
+ updatedAt?: string;
14
+ }
15
+
3
16
  export interface AppointmentDto {
4
17
  id: string;
5
18
 
@@ -48,4 +61,8 @@ export interface AppointmentDto {
48
61
  * @example 'pending'
49
62
  */
50
63
  status: AppointmentStatusDto;
64
+ /*
65
+ * Procedures linked to this appointment (loaded via relation)
66
+ */
67
+ procedures?: AppointmentProcedureResponseDto[];
51
68
  }
@@ -4,4 +4,6 @@ export * from './list-appointments-query.dto';
4
4
  export * from './available-slots-query.dto';
5
5
  export * from './available-slots-response.dto';
6
6
  export * from './appointment-status.dto';
7
- export * from './appointment.dto';
7
+ export * from './appointment.dto';
8
+ export * from './appointment-procedure.dto';
9
+ export * from './update-appointment-procedure.dto';
@@ -0,0 +1,10 @@
1
+ import { PartialType } from '@nestjs/swagger';
2
+ import { AppointmentProcedureDto } from './appointment-procedure.dto';
3
+
4
+ /**
5
+ * DTO for partially updating an appointment procedure.
6
+ * All fields are optional.
7
+ */
8
+ export class UpdateAppointmentProcedureDto extends PartialType(
9
+ AppointmentProcedureDto,
10
+ ) {}
@@ -2,6 +2,4 @@ export * from './create-patient.dto';
2
2
  export * from './update-patient.dto';
3
3
  export * from './patient-history-entry.dto';
4
4
  export * from './list-patients-query.dto';
5
- export * from './patient-procedure.dto';
6
- export * from './update-patient-procedure.dto';
7
5
 
@@ -1,4 +0,0 @@
1
- import { PartialType } from '@nestjs/swagger';
2
- import { PatientProcedureDto } from './patient-procedure.dto';
3
-
4
- export class UpdatePatientProcedureDto extends PartialType(PatientProcedureDto) {}