tychat-contracts 1.0.16 → 1.0.17

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,11 @@
1
+ import { OpeningHoursSlotDto } from './opening-hours-slot.dto';
2
+ /**
3
+ * Response DTO for clinic configuration (opening hours, etc.).
4
+ */
5
+ export declare class ClinicConfigurationDto {
6
+ id: string;
7
+ opening_hours: OpeningHoursSlotDto[];
8
+ createdAt: Date;
9
+ updatedAt: Date;
10
+ }
11
+ //# sourceMappingURL=clinic-configuration.dto.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clinic-configuration.dto.d.ts","sourceRoot":"","sources":["../../src/configurations/clinic-configuration.dto.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAE/D;;GAEG;AACH,qBAAa,sBAAsB;IAKjC,EAAE,EAAE,MAAM,CAAC;IAMX,aAAa,EAAE,mBAAmB,EAAE,CAAC;IAMrC,SAAS,EAAE,IAAI,CAAC;IAMhB,SAAS,EAAE,IAAI,CAAC;CACjB"}
@@ -0,0 +1,52 @@
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.ClinicConfigurationDto = void 0;
13
+ const swagger_1 = require("@nestjs/swagger");
14
+ const opening_hours_slot_dto_1 = require("./opening-hours-slot.dto");
15
+ /**
16
+ * Response DTO for clinic configuration (opening hours, etc.).
17
+ */
18
+ class ClinicConfigurationDto {
19
+ id;
20
+ opening_hours;
21
+ createdAt;
22
+ updatedAt;
23
+ }
24
+ exports.ClinicConfigurationDto = ClinicConfigurationDto;
25
+ __decorate([
26
+ (0, swagger_1.ApiProperty)({
27
+ description: 'Configuration ID (UUID)',
28
+ example: '5e8f9e3b-3b9a-4d9a-9f4b-2a1c1b9e9f1a',
29
+ }),
30
+ __metadata("design:type", String)
31
+ ], ClinicConfigurationDto.prototype, "id", void 0);
32
+ __decorate([
33
+ (0, swagger_1.ApiProperty)({
34
+ description: 'Opening hours slots per day of week (0=Sun..6=Sat)',
35
+ type: [opening_hours_slot_dto_1.OpeningHoursSlotDto],
36
+ }),
37
+ __metadata("design:type", Array)
38
+ ], ClinicConfigurationDto.prototype, "opening_hours", void 0);
39
+ __decorate([
40
+ (0, swagger_1.ApiProperty)({
41
+ description: 'Creation timestamp',
42
+ example: '2026-03-10T12:00:00.000Z',
43
+ }),
44
+ __metadata("design:type", Date)
45
+ ], ClinicConfigurationDto.prototype, "createdAt", void 0);
46
+ __decorate([
47
+ (0, swagger_1.ApiProperty)({
48
+ description: 'Last update timestamp',
49
+ example: '2026-03-10T12:00:00.000Z',
50
+ }),
51
+ __metadata("design:type", Date)
52
+ ], ClinicConfigurationDto.prototype, "updatedAt", void 0);
@@ -0,0 +1,4 @@
1
+ export * from './opening-hours-slot.dto';
2
+ export * from './update-clinic-configuration.dto';
3
+ export * from './clinic-configuration.dto';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/configurations/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,mCAAmC,CAAC;AAClD,cAAc,4BAA4B,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("./opening-hours-slot.dto"), exports);
18
+ __exportStar(require("./update-clinic-configuration.dto"), exports);
19
+ __exportStar(require("./clinic-configuration.dto"), exports);
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Day of week: 0 = Sunday, 1 = Monday, ..., 6 = Saturday.
3
+ * open/close: time in HH:mm (24h).
4
+ */
5
+ export declare class OpeningHoursSlotDto {
6
+ dayOfWeek: number;
7
+ open: string;
8
+ close: string;
9
+ }
10
+ //# sourceMappingURL=opening-hours-slot.dto.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"opening-hours-slot.dto.d.ts","sourceRoot":"","sources":["../../src/configurations/opening-hours-slot.dto.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,qBAAa,mBAAmB;IAU9B,SAAS,EAAE,MAAM,CAAC;IAWlB,IAAI,EAAE,MAAM,CAAC;IAWb,KAAK,EAAE,MAAM,CAAC;CACf"}
@@ -0,0 +1,60 @@
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.OpeningHoursSlotDto = void 0;
13
+ const swagger_1 = require("@nestjs/swagger");
14
+ const class_validator_1 = require("class-validator");
15
+ /**
16
+ * Day of week: 0 = Sunday, 1 = Monday, ..., 6 = Saturday.
17
+ * open/close: time in HH:mm (24h).
18
+ */
19
+ class OpeningHoursSlotDto {
20
+ dayOfWeek;
21
+ open;
22
+ close;
23
+ }
24
+ exports.OpeningHoursSlotDto = OpeningHoursSlotDto;
25
+ __decorate([
26
+ (0, swagger_1.ApiProperty)({
27
+ description: 'Day of week (0 = Sunday, 1 = Monday, ..., 6 = Saturday)',
28
+ example: 1,
29
+ minimum: 0,
30
+ maximum: 6,
31
+ }),
32
+ (0, class_validator_1.IsNumber)(),
33
+ (0, class_validator_1.Min)(0),
34
+ (0, class_validator_1.Max)(6),
35
+ __metadata("design:type", Number)
36
+ ], OpeningHoursSlotDto.prototype, "dayOfWeek", void 0);
37
+ __decorate([
38
+ (0, swagger_1.ApiProperty)({
39
+ description: 'Opening time in HH:mm (24h)',
40
+ example: '08:00',
41
+ pattern: '^([01]\\d|2[0-3]):([0-5]\\d)$',
42
+ }),
43
+ (0, class_validator_1.IsString)(),
44
+ (0, class_validator_1.Matches)(/^([01]\d|2[0-3]):([0-5]\d)$/, {
45
+ message: 'open must be HH:mm (24h)',
46
+ }),
47
+ __metadata("design:type", String)
48
+ ], OpeningHoursSlotDto.prototype, "open", void 0);
49
+ __decorate([
50
+ (0, swagger_1.ApiProperty)({
51
+ description: 'Closing time in HH:mm (24h)',
52
+ example: '18:00',
53
+ pattern: '^([01]\\d|2[0-3]):([0-5]\\d)$',
54
+ }),
55
+ (0, class_validator_1.IsString)(),
56
+ (0, class_validator_1.Matches)(/^([01]\d|2[0-3]):([0-5]\d)$/, {
57
+ message: 'close must be HH:mm (24h)',
58
+ }),
59
+ __metadata("design:type", String)
60
+ ], OpeningHoursSlotDto.prototype, "close", void 0);
@@ -0,0 +1,5 @@
1
+ import { OpeningHoursSlotDto } from './opening-hours-slot.dto';
2
+ export declare class UpdateClinicConfigurationDto {
3
+ opening_hours: OpeningHoursSlotDto[];
4
+ }
5
+ //# sourceMappingURL=update-clinic-configuration.dto.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update-clinic-configuration.dto.d.ts","sourceRoot":"","sources":["../../src/configurations/update-clinic-configuration.dto.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAE/D,qBAAa,4BAA4B;IAYvC,aAAa,EAAE,mBAAmB,EAAE,CAAC;CACtC"}
@@ -0,0 +1,34 @@
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.UpdateClinicConfigurationDto = void 0;
13
+ const swagger_1 = require("@nestjs/swagger");
14
+ const class_transformer_1 = require("class-transformer");
15
+ const class_validator_1 = require("class-validator");
16
+ const opening_hours_slot_dto_1 = require("./opening-hours-slot.dto");
17
+ class UpdateClinicConfigurationDto {
18
+ opening_hours;
19
+ }
20
+ exports.UpdateClinicConfigurationDto = UpdateClinicConfigurationDto;
21
+ __decorate([
22
+ (0, swagger_1.ApiProperty)({
23
+ description: 'Opening hours slots per day of week (0=Sun..6=Sat)',
24
+ type: [opening_hours_slot_dto_1.OpeningHoursSlotDto],
25
+ example: [
26
+ { dayOfWeek: 1, open: '08:00', close: '18:00' },
27
+ { dayOfWeek: 2, open: '08:00', close: '18:00' },
28
+ ],
29
+ }),
30
+ (0, class_validator_1.IsArray)(),
31
+ (0, class_validator_1.ValidateNested)({ each: true }),
32
+ (0, class_transformer_1.Type)(() => opening_hours_slot_dto_1.OpeningHoursSlotDto),
33
+ __metadata("design:type", Array)
34
+ ], UpdateClinicConfigurationDto.prototype, "opening_hours", void 0);
package/dist/index.d.ts CHANGED
@@ -2,4 +2,5 @@ export * from './auth';
2
2
  export * from './users';
3
3
  export * from './patients';
4
4
  export * from './procedures';
5
+ export * from './configurations';
5
6
  //# 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;AAC3B,cAAc,cAAc,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;AAC7B,cAAc,kBAAkB,CAAC"}
package/dist/index.js CHANGED
@@ -18,3 +18,4 @@ __exportStar(require("./auth"), exports);
18
18
  __exportStar(require("./users"), exports);
19
19
  __exportStar(require("./patients"), exports);
20
20
  __exportStar(require("./procedures"), exports);
21
+ __exportStar(require("./configurations"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tychat-contracts",
3
- "version": "1.0.16",
3
+ "version": "1.0.17",
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",
@@ -0,0 +1,31 @@
1
+ import { ApiProperty } from '@nestjs/swagger';
2
+ import { OpeningHoursSlotDto } from './opening-hours-slot.dto';
3
+
4
+ /**
5
+ * Response DTO for clinic configuration (opening hours, etc.).
6
+ */
7
+ export class ClinicConfigurationDto {
8
+ @ApiProperty({
9
+ description: 'Configuration ID (UUID)',
10
+ example: '5e8f9e3b-3b9a-4d9a-9f4b-2a1c1b9e9f1a',
11
+ })
12
+ id: string;
13
+
14
+ @ApiProperty({
15
+ description: 'Opening hours slots per day of week (0=Sun..6=Sat)',
16
+ type: [OpeningHoursSlotDto],
17
+ })
18
+ opening_hours: OpeningHoursSlotDto[];
19
+
20
+ @ApiProperty({
21
+ description: 'Creation timestamp',
22
+ example: '2026-03-10T12:00:00.000Z',
23
+ })
24
+ createdAt: Date;
25
+
26
+ @ApiProperty({
27
+ description: 'Last update timestamp',
28
+ example: '2026-03-10T12:00:00.000Z',
29
+ })
30
+ updatedAt: Date;
31
+ }
@@ -0,0 +1,3 @@
1
+ export * from './opening-hours-slot.dto';
2
+ export * from './update-clinic-configuration.dto';
3
+ export * from './clinic-configuration.dto';
@@ -0,0 +1,41 @@
1
+ import { ApiProperty } from '@nestjs/swagger';
2
+ import { IsNumber, IsString, Matches, Max, Min } from 'class-validator';
3
+
4
+ /**
5
+ * Day of week: 0 = Sunday, 1 = Monday, ..., 6 = Saturday.
6
+ * open/close: time in HH:mm (24h).
7
+ */
8
+ export class OpeningHoursSlotDto {
9
+ @ApiProperty({
10
+ description: 'Day of week (0 = Sunday, 1 = Monday, ..., 6 = Saturday)',
11
+ example: 1,
12
+ minimum: 0,
13
+ maximum: 6,
14
+ })
15
+ @IsNumber()
16
+ @Min(0)
17
+ @Max(6)
18
+ dayOfWeek: number;
19
+
20
+ @ApiProperty({
21
+ description: 'Opening time in HH:mm (24h)',
22
+ example: '08:00',
23
+ pattern: '^([01]\\d|2[0-3]):([0-5]\\d)$',
24
+ })
25
+ @IsString()
26
+ @Matches(/^([01]\d|2[0-3]):([0-5]\d)$/, {
27
+ message: 'open must be HH:mm (24h)',
28
+ })
29
+ open: string;
30
+
31
+ @ApiProperty({
32
+ description: 'Closing time in HH:mm (24h)',
33
+ example: '18:00',
34
+ pattern: '^([01]\\d|2[0-3]):([0-5]\\d)$',
35
+ })
36
+ @IsString()
37
+ @Matches(/^([01]\d|2[0-3]):([0-5]\d)$/, {
38
+ message: 'close must be HH:mm (24h)',
39
+ })
40
+ close: string;
41
+ }
@@ -0,0 +1,22 @@
1
+ import { ApiProperty } from '@nestjs/swagger';
2
+ import { Type } from 'class-transformer';
3
+ import {
4
+ IsArray,
5
+ ValidateNested,
6
+ } from 'class-validator';
7
+ import { OpeningHoursSlotDto } from './opening-hours-slot.dto';
8
+
9
+ export class UpdateClinicConfigurationDto {
10
+ @ApiProperty({
11
+ description: 'Opening hours slots per day of week (0=Sun..6=Sat)',
12
+ type: [OpeningHoursSlotDto],
13
+ example: [
14
+ { dayOfWeek: 1, open: '08:00', close: '18:00' },
15
+ { dayOfWeek: 2, open: '08:00', close: '18:00' },
16
+ ],
17
+ })
18
+ @IsArray()
19
+ @ValidateNested({ each: true })
20
+ @Type(() => OpeningHoursSlotDto)
21
+ opening_hours: OpeningHoursSlotDto[];
22
+ }
package/src/index.ts CHANGED
@@ -2,3 +2,4 @@ export * from './auth';
2
2
  export * from './users';
3
3
  export * from './patients';
4
4
  export * from './procedures';
5
+ export * from './configurations';
Binary file