tychat-contracts 1.0.90 → 1.0.92

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.
@@ -4,4 +4,5 @@ export * from './create-analytic-event.dto';
4
4
  export * from './analytics-query.dto';
5
5
  export * from './analytics-kafka-topics';
6
6
  export * from './analytics-emitter.helper';
7
+ export * from './should-skip-analytics-tenant-lookup';
7
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/analytics/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,qCAAqC,CAAC;AACpD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/analytics/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,qCAAqC,CAAC;AACpD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uCAAuC,CAAC"}
@@ -20,3 +20,4 @@ __exportStar(require("./create-analytic-event.dto"), exports);
20
20
  __exportStar(require("./analytics-query.dto"), exports);
21
21
  __exportStar(require("./analytics-kafka-topics"), exports);
22
22
  __exportStar(require("./analytics-emitter.helper"), exports);
23
+ __exportStar(require("./should-skip-analytics-tenant-lookup"), exports);
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Tenants that must not trigger tenant-service DB resolution for analytics ingestion.
3
+ * Events for these slugs are acknowledged without persistence (no per-tenant DB row).
4
+ */
5
+ export declare const TYCHAT_ANALYTICS_SKIP_TENANT_LOOKUP_SLUG = "__tychat_system__";
6
+ export declare function shouldSkipAnalyticsTenantLookup(tenantSlug: string): boolean;
7
+ //# sourceMappingURL=should-skip-analytics-tenant-lookup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"should-skip-analytics-tenant-lookup.d.ts","sourceRoot":"","sources":["../../src/analytics/should-skip-analytics-tenant-lookup.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,wCAAwC,sBAAsB,CAAC;AAE5E,wBAAgB,+BAA+B,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAG3E"}
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TYCHAT_ANALYTICS_SKIP_TENANT_LOOKUP_SLUG = void 0;
4
+ exports.shouldSkipAnalyticsTenantLookup = shouldSkipAnalyticsTenantLookup;
5
+ /**
6
+ * Tenants that must not trigger tenant-service DB resolution for analytics ingestion.
7
+ * Events for these slugs are acknowledged without persistence (no per-tenant DB row).
8
+ */
9
+ exports.TYCHAT_ANALYTICS_SKIP_TENANT_LOOKUP_SLUG = '__tychat_system__';
10
+ function shouldSkipAnalyticsTenantLookup(tenantSlug) {
11
+ const t = tenantSlug?.trim();
12
+ return t === exports.TYCHAT_ANALYTICS_SKIP_TENANT_LOOKUP_SLUG;
13
+ }
@@ -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,kBAAk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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);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tychat-contracts",
3
- "version": "1.0.90",
3
+ "version": "1.0.92",
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",
@@ -4,3 +4,4 @@ export * from './create-analytic-event.dto';
4
4
  export * from './analytics-query.dto';
5
5
  export * from './analytics-kafka-topics';
6
6
  export * from './analytics-emitter.helper';
7
+ export * from './should-skip-analytics-tenant-lookup';
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Tenants that must not trigger tenant-service DB resolution for analytics ingestion.
3
+ * Events for these slugs are acknowledged without persistence (no per-tenant DB row).
4
+ */
5
+ export const TYCHAT_ANALYTICS_SKIP_TENANT_LOOKUP_SLUG = '__tychat_system__';
6
+
7
+ export function shouldSkipAnalyticsTenantLookup(tenantSlug: string): boolean {
8
+ const t = tenantSlug?.trim();
9
+ return t === TYCHAT_ANALYTICS_SKIP_TENANT_LOOKUP_SLUG;
10
+ }
@@ -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
  }