tychat-contracts 1.0.89 → 1.0.91

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,3 +1,4 @@
1
+ import { AppointmentProcedureDto } from './appointment-procedure.dto';
1
2
  import { AppointmentStatusDto, AppointmentTypeDto } from './appointment-status.dto';
2
3
  export declare class CreateAppointmentDto {
3
4
  patientId: string;
@@ -12,5 +13,6 @@ export declare class CreateAppointmentDto {
12
13
  appointmentType?: AppointmentTypeDto;
13
14
  rescheduledFromId?: string;
14
15
  returnFromAppointmentId?: string;
16
+ initialProcedures?: AppointmentProcedureDto[];
15
17
  }
16
18
  //# sourceMappingURL=create-appointment.dto.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"create-appointment.dto.d.ts","sourceRoot":"","sources":["../../src/appointments/create-appointment.dto.ts"],"names":[],"mappings":"AAUA,OAAO,EAGL,oBAAoB,EACpB,kBAAkB,EACnB,MAAM,0BAA0B,CAAC;AAIlC,qBAAa,oBAAoB;IAO/B,SAAS,EAAE,MAAM,CAAC;IAOlB,IAAI,EAAE,MAAM,CAAC;IAQb,MAAM,EAAE,MAAM,CAAC;IASf,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAS3B,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAQ5B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAQlB,WAAW,CAAC,EAAE,MAAM,CAAC;IAQrB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAS5B,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAS9B,eAAe,CAAC,EAAE,kBAAkB,CAAC;IAQrC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAQ3B,uBAAuB,CAAC,EAAE,MAAM,CAAC;CAClC"}
1
+ {"version":3,"file":"create-appointment.dto.d.ts","sourceRoot":"","sources":["../../src/appointments/create-appointment.dto.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AACtE,OAAO,EAGL,oBAAoB,EACpB,kBAAkB,EACnB,MAAM,0BAA0B,CAAC;AAIlC,qBAAa,oBAAoB;IAO/B,SAAS,EAAE,MAAM,CAAC;IAOlB,IAAI,EAAE,MAAM,CAAC;IAQb,MAAM,EAAE,MAAM,CAAC;IASf,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAS3B,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAQ5B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAQlB,WAAW,CAAC,EAAE,MAAM,CAAC;IAQrB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAS5B,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAS9B,eAAe,CAAC,EAAE,kBAAkB,CAAC;IAQrC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAQ3B,uBAAuB,CAAC,EAAE,MAAM,CAAC;IAWjC,iBAAiB,CAAC,EAAE,uBAAuB,EAAE,CAAC;CAC/C"}
@@ -11,7 +11,9 @@ var __metadata = (this && this.__metadata) || function (k, v) {
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.CreateAppointmentDto = void 0;
13
13
  const swagger_1 = require("@nestjs/swagger");
14
+ const class_transformer_1 = require("class-transformer");
14
15
  const class_validator_1 = require("class-validator");
16
+ const appointment_procedure_dto_1 = require("./appointment-procedure.dto");
15
17
  const appointment_status_dto_1 = require("./appointment-status.dto");
16
18
  class CreateAppointmentDto {
17
19
  patientId;
@@ -26,6 +28,7 @@ class CreateAppointmentDto {
26
28
  appointmentType;
27
29
  rescheduledFromId;
28
30
  returnFromAppointmentId;
31
+ initialProcedures;
29
32
  }
30
33
  exports.CreateAppointmentDto = CreateAppointmentDto;
31
34
  __decorate([
@@ -139,3 +142,14 @@ __decorate([
139
142
  (0, class_validator_1.IsUUID)('4'),
140
143
  __metadata("design:type", String)
141
144
  ], CreateAppointmentDto.prototype, "returnFromAppointmentId", void 0);
145
+ __decorate([
146
+ (0, swagger_1.ApiPropertyOptional)({
147
+ description: 'Procedimentos a gravar junto com o agendamento (analytics `appointment.created` inclui a lista)',
148
+ type: [appointment_procedure_dto_1.AppointmentProcedureDto],
149
+ }),
150
+ (0, class_validator_1.IsOptional)(),
151
+ (0, class_validator_1.IsArray)(),
152
+ (0, class_validator_1.ValidateNested)({ each: true }),
153
+ (0, class_transformer_1.Type)(() => appointment_procedure_dto_1.AppointmentProcedureDto),
154
+ __metadata("design:type", Array)
155
+ ], CreateAppointmentDto.prototype, "initialProcedures", void 0);
@@ -1,6 +1,8 @@
1
1
  import { CreatePatientDto } from './create-patient.dto';
2
+ import { type PatientStatusDto } from './patient-status.dto';
2
3
  declare const UpdatePatientDto_base: import("@nestjs/common").Type<Partial<CreatePatientDto>>;
3
4
  export declare class UpdatePatientDto extends UpdatePatientDto_base {
5
+ status?: PatientStatusDto;
4
6
  }
5
7
  export {};
6
8
  //# sourceMappingURL=update-patient.dto.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"update-patient.dto.d.ts","sourceRoot":"","sources":["../../src/patients/update-patient.dto.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;;AAExD,qBAAa,gBAAiB,SAAQ,qBAA6B;CAAG"}
1
+ {"version":3,"file":"update-patient.dto.d.ts","sourceRoot":"","sources":["../../src/patients/update-patient.dto.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAoB,KAAK,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;;AAE/E,qBAAa,gBAAiB,SAAQ,qBAA6B;IAOjE,MAAM,CAAC,EAAE,gBAAgB,CAAC;CAC3B"}
@@ -1,8 +1,29 @@
1
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
+ };
2
11
  Object.defineProperty(exports, "__esModule", { value: true });
3
12
  exports.UpdatePatientDto = void 0;
4
13
  const swagger_1 = require("@nestjs/swagger");
14
+ const class_validator_1 = require("class-validator");
5
15
  const create_patient_dto_1 = require("./create-patient.dto");
16
+ const patient_status_dto_1 = require("./patient-status.dto");
6
17
  class UpdatePatientDto extends (0, swagger_1.PartialType)(create_patient_dto_1.CreatePatientDto) {
18
+ status;
7
19
  }
8
20
  exports.UpdatePatientDto = UpdatePatientDto;
21
+ __decorate([
22
+ (0, swagger_1.ApiPropertyOptional)({
23
+ description: 'Status de engajamento do paciente (active | inactive)',
24
+ enum: patient_status_dto_1.PATIENT_STATUSES,
25
+ }),
26
+ (0, class_validator_1.IsOptional)(),
27
+ (0, class_validator_1.IsIn)([...patient_status_dto_1.PATIENT_STATUSES]),
28
+ __metadata("design:type", String)
29
+ ], UpdatePatientDto.prototype, "status", void 0);
package/package.json CHANGED
@@ -1,27 +1,27 @@
1
- {
2
- "name": "tychat-contracts",
3
- "version": "1.0.89",
4
- "description": "DTOs compartilhados com class-validator (API e microserviços)",
5
- "main": "dist/index.js",
6
- "types": "dist/index.d.ts",
7
- "private": false,
8
- "scripts": {
9
- "build": "tsc",
10
- "prepublishOnly": "npm run build"
11
- },
12
- "dependencies": {
13
- "class-transformer": "^0.5.1",
14
- "class-validator": "^0.14.1",
15
- "ioredis": "^5.10.0",
16
- "jest": "^30.3.0",
17
- "reflect-metadata": "*"
18
- },
19
- "devDependencies": {
20
- "@nestjs/swagger": "^11.2.6",
21
- "typescript": "^5.7.3"
22
- },
23
- "peerDependencies": {
24
- "@nestjs/swagger": "^11.2.6",
25
- "reflect-metadata": "*"
26
- }
27
- }
1
+ {
2
+ "name": "tychat-contracts",
3
+ "version": "1.0.91",
4
+ "description": "DTOs compartilhados com class-validator (API e microserviços)",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "private": false,
8
+ "scripts": {
9
+ "build": "tsc",
10
+ "prepublishOnly": "npm run build"
11
+ },
12
+ "dependencies": {
13
+ "class-transformer": "^0.5.1",
14
+ "class-validator": "^0.14.1",
15
+ "ioredis": "^5.10.0",
16
+ "jest": "^30.3.0",
17
+ "reflect-metadata": "*"
18
+ },
19
+ "devDependencies": {
20
+ "@nestjs/swagger": "^11.2.6",
21
+ "typescript": "^5.7.3"
22
+ },
23
+ "peerDependencies": {
24
+ "@nestjs/swagger": "^11.2.6",
25
+ "reflect-metadata": "*"
26
+ }
27
+ }
@@ -1,5 +1,7 @@
1
1
  import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
2
+ import { Type } from 'class-transformer';
2
3
  import {
4
+ IsArray,
3
5
  IsBoolean,
4
6
  IsDateString,
5
7
  IsEnum,
@@ -7,7 +9,9 @@ import {
7
9
  IsOptional,
8
10
  IsString,
9
11
  IsUUID,
12
+ ValidateNested,
10
13
  } from 'class-validator';
14
+ import { AppointmentProcedureDto } from './appointment-procedure.dto';
11
15
  import {
12
16
  APPOINTMENT_STATUSES,
13
17
  APPOINTMENT_TYPES,
@@ -116,4 +120,15 @@ export class CreateAppointmentDto {
116
120
  @IsOptional()
117
121
  @IsUUID('4')
118
122
  returnFromAppointmentId?: string;
123
+
124
+ @ApiPropertyOptional({
125
+ description:
126
+ 'Procedimentos a gravar junto com o agendamento (analytics `appointment.created` inclui a lista)',
127
+ type: [AppointmentProcedureDto],
128
+ })
129
+ @IsOptional()
130
+ @IsArray()
131
+ @ValidateNested({ each: true })
132
+ @Type(() => AppointmentProcedureDto)
133
+ initialProcedures?: AppointmentProcedureDto[];
119
134
  }
@@ -1,5 +1,15 @@
1
- import { PartialType } from '@nestjs/swagger';
1
+ import { ApiPropertyOptional, PartialType } from '@nestjs/swagger';
2
+ import { IsIn, IsOptional } from 'class-validator';
2
3
  import { CreatePatientDto } from './create-patient.dto';
4
+ import { PATIENT_STATUSES, type PatientStatusDto } from './patient-status.dto';
3
5
 
4
- export class UpdatePatientDto extends PartialType(CreatePatientDto) {}
6
+ export class UpdatePatientDto extends PartialType(CreatePatientDto) {
7
+ @ApiPropertyOptional({
8
+ description: 'Status de engajamento do paciente (active | inactive)',
9
+ enum: PATIENT_STATUSES,
10
+ })
11
+ @IsOptional()
12
+ @IsIn([...PATIENT_STATUSES])
13
+ status?: PatientStatusDto;
14
+ }
5
15