tychat-contracts 1.0.112 → 1.0.113

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,5 +1,9 @@
1
+ import type { ParsedFilterDto } from '../filters/parsed-filter.dto';
1
2
  import { AppointmentDto } from './appointment.dto';
2
3
  import { AppointmentStatusDto } from './appointment-status.dto';
4
+ /** Colunas permitidas na listagem de agendamentos (camelCase). */
5
+ export declare const APPOINTMENT_LIST_FILTER_KEYS: readonly ["id", "patientId", "userId", "date", "checkinCompleted", "checkoutCompleted", "exitTime", "observation", "cancellationReason", "status", "appointmentType", "rescheduledFromId", "returnFromAppointmentId", "createdAt", "updatedAt"];
6
+ export type AppointmentListFilterKeyDto = (typeof APPOINTMENT_LIST_FILTER_KEYS)[number];
3
7
  /** Campo principal de ordenação na listagem de agendamentos. */
4
8
  export declare const APPOINTMENT_LIST_SORT_BY: readonly ["date", "checkin_completed", "checkout_completed"];
5
9
  export type AppointmentListSortByDto = (typeof APPOINTMENT_LIST_SORT_BY)[number];
@@ -17,6 +21,7 @@ export declare class ListAppointmentsQueryDto {
17
21
  status?: AppointmentStatusDto;
18
22
  sortBy?: AppointmentListSortByDto;
19
23
  sortOrder?: AppointmentListSortOrderDto;
24
+ filters?: ParsedFilterDto[];
20
25
  }
21
26
  export interface AppointmentListResult {
22
27
  items: AppointmentDto[];
@@ -1 +1 @@
1
- {"version":3,"file":"list-appointments-query.dto.d.ts","sourceRoot":"","sources":["../../src/appointments/list-appointments-query.dto.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAwB,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAEtF,gEAAgE;AAChE,eAAO,MAAM,wBAAwB,8DAI3B,CAAC;AACX,MAAM,MAAM,wBAAwB,GAAG,CAAC,OAAO,wBAAwB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEjF,eAAO,MAAM,2BAA2B,0BAA2B,CAAC;AACpE,MAAM,MAAM,2BAA2B,GAAG,CAAC,OAAO,2BAA2B,CAAC,CAAC,MAAM,CAAC,CAAC;AAEvF,qBAAa,wBAAwB;IAUnC,IAAI,CAAC,EAAE,MAAM,CAAC;IAad,KAAK,CAAC,EAAE,MAAM,CAAC;IAQf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAQlB,MAAM,CAAC,EAAE,MAAM,CAAC;IAQhB,MAAM,CAAC,EAAE,MAAM,CAAC;IAQhB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAQ3B,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAQ5B,SAAS,CAAC,EAAE,MAAM,CAAC;IAUnB,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAU9B,MAAM,CAAC,EAAE,wBAAwB,CAAC;IAUlC,SAAS,CAAC,EAAE,2BAA2B,CAAC;CACzC;AAED,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,cAAc,EAAE,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf"}
1
+ {"version":3,"file":"list-appointments-query.dto.d.ts","sourceRoot":"","sources":["../../src/appointments/list-appointments-query.dto.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAwB,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAEtF,kEAAkE;AAClE,eAAO,MAAM,4BAA4B,iPAgB/B,CAAC;AACX,MAAM,MAAM,2BAA2B,GAAG,CAAC,OAAO,4BAA4B,CAAC,CAAC,MAAM,CAAC,CAAC;AAExF,gEAAgE;AAChE,eAAO,MAAM,wBAAwB,8DAI3B,CAAC;AACX,MAAM,MAAM,wBAAwB,GAAG,CAAC,OAAO,wBAAwB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEjF,eAAO,MAAM,2BAA2B,0BAA2B,CAAC;AACpE,MAAM,MAAM,2BAA2B,GAAG,CAAC,OAAO,2BAA2B,CAAC,CAAC,MAAM,CAAC,CAAC;AAEvF,qBAAa,wBAAwB;IAUnC,IAAI,CAAC,EAAE,MAAM,CAAC;IAad,KAAK,CAAC,EAAE,MAAM,CAAC;IAQf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAQlB,MAAM,CAAC,EAAE,MAAM,CAAC;IAQhB,MAAM,CAAC,EAAE,MAAM,CAAC;IAQhB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAQ3B,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAQ5B,SAAS,CAAC,EAAE,MAAM,CAAC;IAUnB,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAU9B,MAAM,CAAC,EAAE,wBAAwB,CAAC;IAUlC,SAAS,CAAC,EAAE,2BAA2B,CAAC;IAWxC,OAAO,CAAC,EAAE,eAAe,EAAE,CAAC;CAC7B;AAED,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,cAAc,EAAE,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf"}
@@ -9,10 +9,28 @@ var __metadata = (this && this.__metadata) || function (k, v) {
9
9
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.ListAppointmentsQueryDto = exports.APPOINTMENT_LIST_SORT_ORDER = exports.APPOINTMENT_LIST_SORT_BY = void 0;
12
+ exports.ListAppointmentsQueryDto = exports.APPOINTMENT_LIST_SORT_ORDER = exports.APPOINTMENT_LIST_SORT_BY = exports.APPOINTMENT_LIST_FILTER_KEYS = void 0;
13
13
  const swagger_1 = require("@nestjs/swagger");
14
14
  const class_validator_1 = require("class-validator");
15
15
  const appointment_status_dto_1 = require("./appointment-status.dto");
16
+ /** Colunas permitidas na listagem de agendamentos (camelCase). */
17
+ exports.APPOINTMENT_LIST_FILTER_KEYS = [
18
+ 'id',
19
+ 'patientId',
20
+ 'userId',
21
+ 'date',
22
+ 'checkinCompleted',
23
+ 'checkoutCompleted',
24
+ 'exitTime',
25
+ 'observation',
26
+ 'cancellationReason',
27
+ 'status',
28
+ 'appointmentType',
29
+ 'rescheduledFromId',
30
+ 'returnFromAppointmentId',
31
+ 'createdAt',
32
+ 'updatedAt',
33
+ ];
16
34
  /** Campo principal de ordenação na listagem de agendamentos. */
17
35
  exports.APPOINTMENT_LIST_SORT_BY = [
18
36
  'date',
@@ -32,6 +50,7 @@ class ListAppointmentsQueryDto {
32
50
  status;
33
51
  sortBy;
34
52
  sortOrder;
53
+ filters;
35
54
  }
36
55
  exports.ListAppointmentsQueryDto = ListAppointmentsQueryDto;
37
56
  __decorate([
@@ -145,3 +164,14 @@ __decorate([
145
164
  (0, class_validator_1.IsIn)(exports.APPOINTMENT_LIST_SORT_ORDER),
146
165
  __metadata("design:type", String)
147
166
  ], ListAppointmentsQueryDto.prototype, "sortOrder", void 0);
167
+ __decorate([
168
+ (0, swagger_1.ApiPropertyOptional)({
169
+ description: 'JSON string with an array of filter objects `{ key, op, value }`. ' +
170
+ 'Example: `[{"key":"status","op":"==","value":"pending"}]`. ' +
171
+ 'Ops: ==, !=, >, <, >=, <=, in (value must be array for `in`).',
172
+ type: String,
173
+ example: '[{"key":"status","op":"==","value":"pending"}]',
174
+ }),
175
+ (0, class_validator_1.IsOptional)(),
176
+ __metadata("design:type", Array)
177
+ ], ListAppointmentsQueryDto.prototype, "filters", void 0);
@@ -1,5 +1,8 @@
1
+ import type { ParsedFilterDto } from '../filters/parsed-filter.dto';
1
2
  import { ConversationIntentionDto } from './conversation-intention.dto';
2
3
  import { FollowupTypeDto } from './followup-type.dto';
4
+ export declare const FOLLOWUP_LOG_LIST_FILTER_KEYS: readonly ["id", "sessionUuid", "patientId", "attempt", "message", "intention", "followupType", "appointmentId", "sentAt"];
5
+ export type FollowupLogListFilterKeyDto = (typeof FOLLOWUP_LOG_LIST_FILTER_KEYS)[number];
3
6
  /**
4
7
  * Query parameters for listing follow-up logs (HTTP query + Kafka payload).
5
8
  */
@@ -10,5 +13,6 @@ export declare class FollowupLogListQueryDto {
10
13
  sessionUuid?: string;
11
14
  intention?: ConversationIntentionDto;
12
15
  followupType?: FollowupTypeDto;
16
+ filters?: ParsedFilterDto[];
13
17
  }
14
18
  //# sourceMappingURL=followup-log-list-query.dto.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"followup-log-list-query.dto.d.ts","sourceRoot":"","sources":["../../src/conversations/followup-log-list-query.dto.ts"],"names":[],"mappings":"AAUA,OAAO,EAEL,wBAAwB,EACzB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAkB,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEtE;;GAEG;AACH,qBAAa,uBAAuB;IAMlC,IAAI,CAAC,EAAE,MAAM,CAAC;IAQd,KAAK,CAAC,EAAE,MAAM,CAAC;IAKf,SAAS,CAAC,EAAE,MAAM,CAAC;IAKnB,WAAW,CAAC,EAAE,MAAM,CAAC;IAQrB,SAAS,CAAC,EAAE,wBAAwB,CAAC;IAQrC,YAAY,CAAC,EAAE,eAAe,CAAC;CAChC"}
1
+ {"version":3,"file":"followup-log-list-query.dto.d.ts","sourceRoot":"","sources":["../../src/conversations/followup-log-list-query.dto.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EAEL,wBAAwB,EACzB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAkB,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEtE,eAAO,MAAM,6BAA6B,2HAUhC,CAAC;AACX,MAAM,MAAM,2BAA2B,GAAG,CAAC,OAAO,6BAA6B,CAAC,CAAC,MAAM,CAAC,CAAC;AAEzF;;GAEG;AACH,qBAAa,uBAAuB;IAMlC,IAAI,CAAC,EAAE,MAAM,CAAC;IAQd,KAAK,CAAC,EAAE,MAAM,CAAC;IAKf,SAAS,CAAC,EAAE,MAAM,CAAC;IAKnB,WAAW,CAAC,EAAE,MAAM,CAAC;IAQrB,SAAS,CAAC,EAAE,wBAAwB,CAAC;IAQrC,YAAY,CAAC,EAAE,eAAe,CAAC;IAW/B,OAAO,CAAC,EAAE,eAAe,EAAE,CAAC;CAC7B"}
@@ -9,12 +9,23 @@ var __metadata = (this && this.__metadata) || function (k, v) {
9
9
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.FollowupLogListQueryDto = void 0;
12
+ exports.FollowupLogListQueryDto = exports.FOLLOWUP_LOG_LIST_FILTER_KEYS = void 0;
13
13
  const swagger_1 = require("@nestjs/swagger");
14
14
  const class_transformer_1 = require("class-transformer");
15
15
  const class_validator_1 = require("class-validator");
16
16
  const conversation_intention_dto_1 = require("./conversation-intention.dto");
17
17
  const followup_type_dto_1 = require("./followup-type.dto");
18
+ exports.FOLLOWUP_LOG_LIST_FILTER_KEYS = [
19
+ 'id',
20
+ 'sessionUuid',
21
+ 'patientId',
22
+ 'attempt',
23
+ 'message',
24
+ 'intention',
25
+ 'followupType',
26
+ 'appointmentId',
27
+ 'sentAt',
28
+ ];
18
29
  /**
19
30
  * Query parameters for listing follow-up logs (HTTP query + Kafka payload).
20
31
  */
@@ -25,6 +36,7 @@ class FollowupLogListQueryDto {
25
36
  sessionUuid;
26
37
  intention;
27
38
  followupType;
39
+ filters;
28
40
  }
29
41
  exports.FollowupLogListQueryDto = FollowupLogListQueryDto;
30
42
  __decorate([
@@ -74,3 +86,14 @@ __decorate([
74
86
  (0, class_validator_1.IsIn)([...followup_type_dto_1.FOLLOWUP_TYPES]),
75
87
  __metadata("design:type", String)
76
88
  ], FollowupLogListQueryDto.prototype, "followupType", void 0);
89
+ __decorate([
90
+ (0, swagger_1.ApiPropertyOptional)({
91
+ description: 'JSON string with an array of filter objects `{ key, op, value }`. ' +
92
+ 'Example: `[{"key":"followupType","op":"==","value":"abandonment"}]`. ' +
93
+ 'Ops: ==, !=, >, <, >=, <=, in (value must be array for `in`).',
94
+ type: String,
95
+ example: '[{"key":"followupType","op":"==","value":"abandonment"}]',
96
+ }),
97
+ (0, class_validator_1.IsOptional)(),
98
+ __metadata("design:type", Array)
99
+ ], FollowupLogListQueryDto.prototype, "filters", void 0);
@@ -3,6 +3,7 @@ export * from './conversation-intention.dto';
3
3
  export * from './list-conversation-contacts-filters.dto';
4
4
  export * from './conversation-contact-filters-query.validator';
5
5
  export * from './list-conversation-contacts-query.dto';
6
+ export * from './list-conversation-sessions-query.dto';
6
7
  export * from './create-conversation-session.dto';
7
8
  export * from './conversation-session-response.dto';
8
9
  export * from './create-conversation.dto';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/conversations/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,0CAA0C,CAAC;AACzD,cAAc,gDAAgD,CAAC;AAC/D,cAAc,wCAAwC,CAAC;AACvD,cAAc,mCAAmC,CAAC;AAClD,cAAc,qCAAqC,CAAC;AACpD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,qBAAqB,CAAC;AACpC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,kCAAkC,CAAC;AACjD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,uBAAuB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/conversations/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,0CAA0C,CAAC;AACzD,cAAc,gDAAgD,CAAC;AAC/D,cAAc,wCAAwC,CAAC;AACvD,cAAc,wCAAwC,CAAC;AACvD,cAAc,mCAAmC,CAAC;AAClD,cAAc,qCAAqC,CAAC;AACpD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,qBAAqB,CAAC;AACpC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,kCAAkC,CAAC;AACjD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,uBAAuB,CAAC"}
@@ -19,6 +19,7 @@ __exportStar(require("./conversation-intention.dto"), exports);
19
19
  __exportStar(require("./list-conversation-contacts-filters.dto"), exports);
20
20
  __exportStar(require("./conversation-contact-filters-query.validator"), exports);
21
21
  __exportStar(require("./list-conversation-contacts-query.dto"), exports);
22
+ __exportStar(require("./list-conversation-sessions-query.dto"), exports);
22
23
  __exportStar(require("./create-conversation-session.dto"), exports);
23
24
  __exportStar(require("./conversation-session-response.dto"), exports);
24
25
  __exportStar(require("./create-conversation.dto"), exports);
@@ -0,0 +1,14 @@
1
+ import type { ParsedFilterDto } from '../filters/parsed-filter.dto';
2
+ /**
3
+ * Allowed `conversation_sessions` columns for structured filters (camelCase).
4
+ * Same whitelist as contact list session filters.
5
+ */
6
+ export declare const CONVERSATION_SESSION_LIST_FILTER_KEYS: readonly ["id", "sessionUuid", "patientId", "unitId", "tenantEvogoInstanceId", "conversationType", "intention", "unreadCount", "startedAt", "expiresAt"];
7
+ export type ConversationSessionListFilterKeyDto = (typeof CONVERSATION_SESSION_LIST_FILTER_KEYS)[number];
8
+ export declare class ListConversationSessionsQueryDto {
9
+ page?: number;
10
+ limit?: number;
11
+ patientId?: string;
12
+ filters?: ParsedFilterDto[];
13
+ }
14
+ //# sourceMappingURL=list-conversation-sessions-query.dto.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list-conversation-sessions-query.dto.d.ts","sourceRoot":"","sources":["../../src/conversations/list-conversation-sessions-query.dto.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAEpE;;;GAGG;AACH,eAAO,MAAM,qCAAqC,0JAWxC,CAAC;AACX,MAAM,MAAM,mCAAmC,GAC7C,CAAC,OAAO,qCAAqC,CAAC,CAAC,MAAM,CAAC,CAAC;AAEzD,qBAAa,gCAAgC;IAM3C,IAAI,CAAC,EAAE,MAAM,CAAC;IAQd,KAAK,CAAC,EAAE,MAAM,CAAC;IAKf,SAAS,CAAC,EAAE,MAAM,CAAC;IAWnB,OAAO,CAAC,EAAE,eAAe,EAAE,CAAC;CAC7B"}
@@ -0,0 +1,72 @@
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.ListConversationSessionsQueryDto = exports.CONVERSATION_SESSION_LIST_FILTER_KEYS = 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
+ /**
17
+ * Allowed `conversation_sessions` columns for structured filters (camelCase).
18
+ * Same whitelist as contact list session filters.
19
+ */
20
+ exports.CONVERSATION_SESSION_LIST_FILTER_KEYS = [
21
+ 'id',
22
+ 'sessionUuid',
23
+ 'patientId',
24
+ 'unitId',
25
+ 'tenantEvogoInstanceId',
26
+ 'conversationType',
27
+ 'intention',
28
+ 'unreadCount',
29
+ 'startedAt',
30
+ 'expiresAt',
31
+ ];
32
+ class ListConversationSessionsQueryDto {
33
+ page;
34
+ limit;
35
+ patientId;
36
+ filters;
37
+ }
38
+ exports.ListConversationSessionsQueryDto = ListConversationSessionsQueryDto;
39
+ __decorate([
40
+ (0, swagger_1.ApiPropertyOptional)({ minimum: 1, default: 1 }),
41
+ (0, class_validator_1.IsOptional)(),
42
+ (0, class_transformer_1.Type)(() => Number),
43
+ (0, class_validator_1.IsInt)(),
44
+ (0, class_validator_1.Min)(1),
45
+ __metadata("design:type", Number)
46
+ ], ListConversationSessionsQueryDto.prototype, "page", void 0);
47
+ __decorate([
48
+ (0, swagger_1.ApiPropertyOptional)({ minimum: 1, maximum: 100, default: 20 }),
49
+ (0, class_validator_1.IsOptional)(),
50
+ (0, class_transformer_1.Type)(() => Number),
51
+ (0, class_validator_1.IsInt)(),
52
+ (0, class_validator_1.Min)(1),
53
+ (0, class_validator_1.Max)(100),
54
+ __metadata("design:type", Number)
55
+ ], ListConversationSessionsQueryDto.prototype, "limit", void 0);
56
+ __decorate([
57
+ (0, swagger_1.ApiPropertyOptional)({ format: 'uuid', description: 'Filtrar sessões deste paciente' }),
58
+ (0, class_validator_1.IsOptional)(),
59
+ (0, class_validator_1.IsUUID)('4'),
60
+ __metadata("design:type", String)
61
+ ], ListConversationSessionsQueryDto.prototype, "patientId", void 0);
62
+ __decorate([
63
+ (0, swagger_1.ApiPropertyOptional)({
64
+ description: 'JSON string with an array of filter objects `{ key, op, value }`. ' +
65
+ 'Example: `[{"key":"conversationType","op":"==","value":"ia"}]`. ' +
66
+ 'Ops: ==, !=, >, <, >=, <=, in (value must be array for `in`).',
67
+ type: String,
68
+ example: '[{"key":"intention","op":"==","value":"confirm_appointment"}]',
69
+ }),
70
+ (0, class_validator_1.IsOptional)(),
71
+ __metadata("design:type", Array)
72
+ ], ListConversationSessionsQueryDto.prototype, "filters", void 0);
@@ -1,5 +1,9 @@
1
+ import type { ParsedFilterDto } from '../filters/parsed-filter.dto';
2
+ export declare const PROCEDURE_LIST_FILTER_KEYS: readonly ["id", "name", "category", "description", "blockTime", "defaultValue", "returnDays", "value", "duration", "sideEffects", "specialtyId", "createdAt", "updatedAt", "deletedAt"];
3
+ export type ProcedureListFilterKeyDto = (typeof PROCEDURE_LIST_FILTER_KEYS)[number];
1
4
  export declare class ListProceduresQueryDto {
2
5
  page?: number;
3
6
  limit?: number;
7
+ filters?: ParsedFilterDto[];
4
8
  }
5
9
  //# sourceMappingURL=list-procedures-query.dto.d.ts.map
@@ -1 +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"}
1
+ {"version":3,"file":"list-procedures-query.dto.d.ts","sourceRoot":"","sources":["../../src/procedures/list-procedures-query.dto.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAEpE,eAAO,MAAM,0BAA0B,yLAe7B,CAAC;AACX,MAAM,MAAM,yBAAyB,GAAG,CAAC,OAAO,0BAA0B,CAAC,CAAC,MAAM,CAAC,CAAC;AAEpF,qBAAa,sBAAsB;IAUjC,IAAI,CAAC,EAAE,MAAM,CAAC;IAad,KAAK,CAAC,EAAE,MAAM,CAAC;IAYf,OAAO,CAAC,EAAE,eAAe,EAAE,CAAC;CAC7B"}
@@ -9,12 +9,29 @@ var __metadata = (this && this.__metadata) || function (k, v) {
9
9
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.ListProceduresQueryDto = void 0;
12
+ exports.ListProceduresQueryDto = exports.PROCEDURE_LIST_FILTER_KEYS = void 0;
13
13
  const swagger_1 = require("@nestjs/swagger");
14
14
  const class_validator_1 = require("class-validator");
15
+ exports.PROCEDURE_LIST_FILTER_KEYS = [
16
+ 'id',
17
+ 'name',
18
+ 'category',
19
+ 'description',
20
+ 'blockTime',
21
+ 'defaultValue',
22
+ 'returnDays',
23
+ 'value',
24
+ 'duration',
25
+ 'sideEffects',
26
+ 'specialtyId',
27
+ 'createdAt',
28
+ 'updatedAt',
29
+ 'deletedAt',
30
+ ];
15
31
  class ListProceduresQueryDto {
16
32
  page;
17
33
  limit;
34
+ filters;
18
35
  }
19
36
  exports.ListProceduresQueryDto = ListProceduresQueryDto;
20
37
  __decorate([
@@ -43,3 +60,15 @@ __decorate([
43
60
  (0, class_validator_1.Max)(100),
44
61
  __metadata("design:type", Number)
45
62
  ], ListProceduresQueryDto.prototype, "limit", void 0);
63
+ __decorate([
64
+ (0, swagger_1.ApiPropertyOptional)({
65
+ description: 'JSON string with an array of filter objects `{ key, op, value }`. ' +
66
+ 'Example: `[{"key":"specialtyId","op":"==","value":"550e8400-e29b-41d4-a716-446655440000"}]`. ' +
67
+ 'Ops: ==, !=, >, <, >=, <=, in (value must be array for `in`). ' +
68
+ 'Use key `sideEffects` for the `side_effects` column.',
69
+ type: String,
70
+ example: '[{"key":"name","op":"==","value":"Consulta"}]',
71
+ }),
72
+ (0, class_validator_1.IsOptional)(),
73
+ __metadata("design:type", Array)
74
+ ], ListProceduresQueryDto.prototype, "filters", void 0);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tychat-contracts",
3
- "version": "1.0.112",
3
+ "version": "1.0.113",
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",
@@ -1,8 +1,29 @@
1
1
  import { ApiPropertyOptional } from '@nestjs/swagger';
2
2
  import { IsBoolean, IsDateString, IsIn, IsInt, IsOptional, IsString, IsUUID, Max, Min } from 'class-validator';
3
+ import type { ParsedFilterDto } from '../filters/parsed-filter.dto';
3
4
  import { AppointmentDto } from './appointment.dto';
4
5
  import { APPOINTMENT_STATUSES, AppointmentStatusDto } from './appointment-status.dto';
5
6
 
7
+ /** Colunas permitidas na listagem de agendamentos (camelCase). */
8
+ export const APPOINTMENT_LIST_FILTER_KEYS = [
9
+ 'id',
10
+ 'patientId',
11
+ 'userId',
12
+ 'date',
13
+ 'checkinCompleted',
14
+ 'checkoutCompleted',
15
+ 'exitTime',
16
+ 'observation',
17
+ 'cancellationReason',
18
+ 'status',
19
+ 'appointmentType',
20
+ 'rescheduledFromId',
21
+ 'returnFromAppointmentId',
22
+ 'createdAt',
23
+ 'updatedAt',
24
+ ] as const;
25
+ export type AppointmentListFilterKeyDto = (typeof APPOINTMENT_LIST_FILTER_KEYS)[number];
26
+
6
27
  /** Campo principal de ordenação na listagem de agendamentos. */
7
28
  export const APPOINTMENT_LIST_SORT_BY = [
8
29
  'date',
@@ -116,6 +137,17 @@ export class ListAppointmentsQueryDto {
116
137
  @IsOptional()
117
138
  @IsIn(APPOINTMENT_LIST_SORT_ORDER)
118
139
  sortOrder?: AppointmentListSortOrderDto;
140
+
141
+ @ApiPropertyOptional({
142
+ description:
143
+ 'JSON string with an array of filter objects `{ key, op, value }`. ' +
144
+ 'Example: `[{"key":"status","op":"==","value":"pending"}]`. ' +
145
+ 'Ops: ==, !=, >, <, >=, <=, in (value must be array for `in`).',
146
+ type: String,
147
+ example: '[{"key":"status","op":"==","value":"pending"}]',
148
+ })
149
+ @IsOptional()
150
+ filters?: ParsedFilterDto[];
119
151
  }
120
152
 
121
153
  export interface AppointmentListResult {
@@ -8,12 +8,26 @@ import {
8
8
  Max,
9
9
  Min,
10
10
  } from 'class-validator';
11
+ import type { ParsedFilterDto } from '../filters/parsed-filter.dto';
11
12
  import {
12
13
  CONVERSATION_INTENTIONS,
13
14
  ConversationIntentionDto,
14
15
  } from './conversation-intention.dto';
15
16
  import { FOLLOWUP_TYPES, FollowupTypeDto } from './followup-type.dto';
16
17
 
18
+ export const FOLLOWUP_LOG_LIST_FILTER_KEYS = [
19
+ 'id',
20
+ 'sessionUuid',
21
+ 'patientId',
22
+ 'attempt',
23
+ 'message',
24
+ 'intention',
25
+ 'followupType',
26
+ 'appointmentId',
27
+ 'sentAt',
28
+ ] as const;
29
+ export type FollowupLogListFilterKeyDto = (typeof FOLLOWUP_LOG_LIST_FILTER_KEYS)[number];
30
+
17
31
  /**
18
32
  * Query parameters for listing follow-up logs (HTTP query + Kafka payload).
19
33
  */
@@ -58,4 +72,15 @@ export class FollowupLogListQueryDto {
58
72
  @IsOptional()
59
73
  @IsIn([...FOLLOWUP_TYPES])
60
74
  followupType?: FollowupTypeDto;
75
+
76
+ @ApiPropertyOptional({
77
+ description:
78
+ 'JSON string with an array of filter objects `{ key, op, value }`. ' +
79
+ 'Example: `[{"key":"followupType","op":"==","value":"abandonment"}]`. ' +
80
+ 'Ops: ==, !=, >, <, >=, <=, in (value must be array for `in`).',
81
+ type: String,
82
+ example: '[{"key":"followupType","op":"==","value":"abandonment"}]',
83
+ })
84
+ @IsOptional()
85
+ filters?: ParsedFilterDto[];
61
86
  }
@@ -3,6 +3,7 @@ export * from './conversation-intention.dto';
3
3
  export * from './list-conversation-contacts-filters.dto';
4
4
  export * from './conversation-contact-filters-query.validator';
5
5
  export * from './list-conversation-contacts-query.dto';
6
+ export * from './list-conversation-sessions-query.dto';
6
7
  export * from './create-conversation-session.dto';
7
8
  export * from './conversation-session-response.dto';
8
9
  export * from './create-conversation.dto';
@@ -0,0 +1,56 @@
1
+ import { ApiPropertyOptional } from '@nestjs/swagger';
2
+ import { Type } from 'class-transformer';
3
+ import { IsInt, IsOptional, IsUUID, Max, Min } from 'class-validator';
4
+ import type { ParsedFilterDto } from '../filters/parsed-filter.dto';
5
+
6
+ /**
7
+ * Allowed `conversation_sessions` columns for structured filters (camelCase).
8
+ * Same whitelist as contact list session filters.
9
+ */
10
+ export const CONVERSATION_SESSION_LIST_FILTER_KEYS = [
11
+ 'id',
12
+ 'sessionUuid',
13
+ 'patientId',
14
+ 'unitId',
15
+ 'tenantEvogoInstanceId',
16
+ 'conversationType',
17
+ 'intention',
18
+ 'unreadCount',
19
+ 'startedAt',
20
+ 'expiresAt',
21
+ ] as const;
22
+ export type ConversationSessionListFilterKeyDto =
23
+ (typeof CONVERSATION_SESSION_LIST_FILTER_KEYS)[number];
24
+
25
+ export class ListConversationSessionsQueryDto {
26
+ @ApiPropertyOptional({ minimum: 1, default: 1 })
27
+ @IsOptional()
28
+ @Type(() => Number)
29
+ @IsInt()
30
+ @Min(1)
31
+ page?: number;
32
+
33
+ @ApiPropertyOptional({ minimum: 1, maximum: 100, default: 20 })
34
+ @IsOptional()
35
+ @Type(() => Number)
36
+ @IsInt()
37
+ @Min(1)
38
+ @Max(100)
39
+ limit?: number;
40
+
41
+ @ApiPropertyOptional({ format: 'uuid', description: 'Filtrar sessões deste paciente' })
42
+ @IsOptional()
43
+ @IsUUID('4')
44
+ patientId?: string;
45
+
46
+ @ApiPropertyOptional({
47
+ description:
48
+ 'JSON string with an array of filter objects `{ key, op, value }`. ' +
49
+ 'Example: `[{"key":"conversationType","op":"==","value":"ia"}]`. ' +
50
+ 'Ops: ==, !=, >, <, >=, <=, in (value must be array for `in`).',
51
+ type: String,
52
+ example: '[{"key":"intention","op":"==","value":"confirm_appointment"}]',
53
+ })
54
+ @IsOptional()
55
+ filters?: ParsedFilterDto[];
56
+ }
@@ -1,5 +1,24 @@
1
1
  import { ApiPropertyOptional } from '@nestjs/swagger';
2
2
  import { IsInt, IsOptional, Max, Min } from 'class-validator';
3
+ import type { ParsedFilterDto } from '../filters/parsed-filter.dto';
4
+
5
+ export const PROCEDURE_LIST_FILTER_KEYS = [
6
+ 'id',
7
+ 'name',
8
+ 'category',
9
+ 'description',
10
+ 'blockTime',
11
+ 'defaultValue',
12
+ 'returnDays',
13
+ 'value',
14
+ 'duration',
15
+ 'sideEffects',
16
+ 'specialtyId',
17
+ 'createdAt',
18
+ 'updatedAt',
19
+ 'deletedAt',
20
+ ] as const;
21
+ export type ProcedureListFilterKeyDto = (typeof PROCEDURE_LIST_FILTER_KEYS)[number];
3
22
 
4
23
  export class ListProceduresQueryDto {
5
24
  @ApiPropertyOptional({
@@ -25,4 +44,16 @@ export class ListProceduresQueryDto {
25
44
  @Min(1)
26
45
  @Max(100)
27
46
  limit?: number;
47
+
48
+ @ApiPropertyOptional({
49
+ description:
50
+ 'JSON string with an array of filter objects `{ key, op, value }`. ' +
51
+ 'Example: `[{"key":"specialtyId","op":"==","value":"550e8400-e29b-41d4-a716-446655440000"}]`. ' +
52
+ 'Ops: ==, !=, >, <, >=, <=, in (value must be array for `in`). ' +
53
+ 'Use key `sideEffects` for the `side_effects` column.',
54
+ type: String,
55
+ example: '[{"key":"name","op":"==","value":"Consulta"}]',
56
+ })
57
+ @IsOptional()
58
+ filters?: ParsedFilterDto[];
28
59
  }