tychat-contracts 1.0.115 → 1.0.120

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.
Files changed (35) hide show
  1. package/dist/appointments/appointment-status.dto.d.ts +1 -1
  2. package/dist/appointments/appointment-status.dto.d.ts.map +1 -1
  3. package/dist/appointments/appointment-status.dto.js +1 -0
  4. package/dist/appointments/care-queue.dto.d.ts +21 -0
  5. package/dist/appointments/care-queue.dto.d.ts.map +1 -0
  6. package/dist/appointments/care-queue.dto.js +99 -0
  7. package/dist/appointments/index.d.ts +1 -0
  8. package/dist/appointments/index.d.ts.map +1 -1
  9. package/dist/appointments/index.js +1 -0
  10. package/dist/appointments/list-appointments-query.dto.js +1 -1
  11. package/dist/billing/list-billings-query.dto.d.ts +1 -3
  12. package/dist/billing/list-billings-query.dto.d.ts.map +1 -1
  13. package/dist/billing/list-billings-query.dto.js +0 -20
  14. package/dist/conversations/conversation-contact-filters-query.validator.spec.js +1 -1
  15. package/dist/conversations/followup-log-list-query.dto.js +1 -1
  16. package/dist/conversations/list-conversation-contacts-query.dto.js +1 -1
  17. package/dist/conversations/list-conversation-sessions-query.dto.js +1 -1
  18. package/dist/filters/parsed-filter.dto.d.ts +4 -2
  19. package/dist/filters/parsed-filter.dto.d.ts.map +1 -1
  20. package/dist/filters/parsed-filter.dto.js +4 -0
  21. package/dist/patients/list-patients-query.dto.js +1 -1
  22. package/dist/procedures/list-procedures-query.dto.js +1 -1
  23. package/package.json +1 -1
  24. package/src/appointments/appointment-status.dto.ts +1 -0
  25. package/src/appointments/care-queue.dto.ts +60 -0
  26. package/src/appointments/index.ts +2 -1
  27. package/src/appointments/list-appointments-query.dto.ts +1 -1
  28. package/src/billing/list-billings-query.dto.ts +0 -18
  29. package/src/conversations/conversation-contact-filters-query.validator.spec.ts +1 -1
  30. package/src/conversations/followup-log-list-query.dto.ts +1 -1
  31. package/src/conversations/list-conversation-contacts-query.dto.ts +1 -1
  32. package/src/conversations/list-conversation-sessions-query.dto.ts +1 -1
  33. package/src/filters/parsed-filter.dto.ts +5 -1
  34. package/src/patients/list-patients-query.dto.ts +1 -1
  35. package/src/procedures/list-procedures-query.dto.ts +1 -1
@@ -1,4 +1,4 @@
1
- export declare const APPOINTMENT_STATUSES: readonly ["pending", "processing", "sended", "finished", "canceled", "no_show"];
1
+ export declare const APPOINTMENT_STATUSES: readonly ["pending", "processing", "in_care", "sended", "finished", "canceled", "no_show"];
2
2
  export type AppointmentStatusDto = (typeof APPOINTMENT_STATUSES)[number];
3
3
  /**
4
4
  * Appointment types to differentiate regular appointments from return visits.
@@ -1 +1 @@
1
- {"version":3,"file":"appointment-status.dto.d.ts","sourceRoot":"","sources":["../../src/appointments/appointment-status.dto.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,oBAAoB,iFAOvB,CAAC;AACX,MAAM,MAAM,oBAAoB,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEzE;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,gCAAiC,CAAC;AAChE,MAAM,MAAM,kBAAkB,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC"}
1
+ {"version":3,"file":"appointment-status.dto.d.ts","sourceRoot":"","sources":["../../src/appointments/appointment-status.dto.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,oBAAoB,4FAQvB,CAAC;AACX,MAAM,MAAM,oBAAoB,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEzE;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,gCAAiC,CAAC;AAChE,MAAM,MAAM,kBAAkB,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC"}
@@ -4,6 +4,7 @@ exports.APPOINTMENT_TYPES = exports.APPOINTMENT_STATUSES = void 0;
4
4
  exports.APPOINTMENT_STATUSES = [
5
5
  'pending',
6
6
  'processing',
7
+ 'in_care',
7
8
  'sended',
8
9
  'finished',
9
10
  'canceled',
@@ -0,0 +1,21 @@
1
+ export type CareQueueSegmentDto = 'past' | 'current' | 'upcoming';
2
+ /** Item da fila de espera de atendimento (check-in → ordem por horário do agendamento). */
3
+ export declare class CareQueueEntryDto {
4
+ appointmentId: string;
5
+ patientId: string;
6
+ patientName: string;
7
+ doctorUserId: string;
8
+ doctorName: string;
9
+ specialtyId: string;
10
+ specialtyName: string;
11
+ appointmentDate: string;
12
+ status: string;
13
+ ticketCode: string;
14
+ queuePosition: number;
15
+ segment: CareQueueSegmentDto;
16
+ }
17
+ export declare class CareQueueResponseDto {
18
+ specialtyTicketPrefix: string;
19
+ items: CareQueueEntryDto[];
20
+ }
21
+ //# sourceMappingURL=care-queue.dto.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"care-queue.dto.d.ts","sourceRoot":"","sources":["../../src/appointments/care-queue.dto.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,SAAS,GAAG,UAAU,CAAC;AAElE,2FAA2F;AAC3F,qBAAa,iBAAiB;IAE5B,aAAa,EAAE,MAAM,CAAC;IAGtB,SAAS,EAAE,MAAM,CAAC;IAGlB,WAAW,EAAE,MAAM,CAAC;IAGpB,YAAY,EAAE,MAAM,CAAC;IAGrB,UAAU,EAAE,MAAM,CAAC;IAGnB,WAAW,EAAE,MAAM,CAAC;IAGpB,aAAa,EAAE,MAAM,CAAC;IAGtB,eAAe,EAAE,MAAM,CAAC;IAGxB,MAAM,EAAE,MAAM,CAAC;IAMf,UAAU,EAAE,MAAM,CAAC;IAGnB,aAAa,EAAE,MAAM,CAAC;IAMtB,OAAO,EAAE,mBAAmB,CAAC;CAC9B;AAED,qBAAa,oBAAoB;IAM/B,qBAAqB,EAAE,MAAM,CAAC;IAG9B,KAAK,EAAE,iBAAiB,EAAE,CAAC;CAC5B"}
@@ -0,0 +1,99 @@
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.CareQueueResponseDto = exports.CareQueueEntryDto = void 0;
13
+ const swagger_1 = require("@nestjs/swagger");
14
+ /** Item da fila de espera de atendimento (check-in → ordem por horário do agendamento). */
15
+ class CareQueueEntryDto {
16
+ appointmentId;
17
+ patientId;
18
+ patientName;
19
+ doctorUserId;
20
+ doctorName;
21
+ specialtyId;
22
+ specialtyName;
23
+ appointmentDate;
24
+ status;
25
+ ticketCode;
26
+ queuePosition;
27
+ segment;
28
+ }
29
+ exports.CareQueueEntryDto = CareQueueEntryDto;
30
+ __decorate([
31
+ (0, swagger_1.ApiProperty)({ description: 'ID do agendamento (UUID)' }),
32
+ __metadata("design:type", String)
33
+ ], CareQueueEntryDto.prototype, "appointmentId", void 0);
34
+ __decorate([
35
+ (0, swagger_1.ApiProperty)({ description: 'ID do paciente (UUID)' }),
36
+ __metadata("design:type", String)
37
+ ], CareQueueEntryDto.prototype, "patientId", void 0);
38
+ __decorate([
39
+ (0, swagger_1.ApiProperty)({ description: 'Nome do paciente' }),
40
+ __metadata("design:type", String)
41
+ ], CareQueueEntryDto.prototype, "patientName", void 0);
42
+ __decorate([
43
+ (0, swagger_1.ApiProperty)({ description: 'userId do profissional (UUID)' }),
44
+ __metadata("design:type", String)
45
+ ], CareQueueEntryDto.prototype, "doctorUserId", void 0);
46
+ __decorate([
47
+ (0, swagger_1.ApiProperty)({ description: 'Nome do profissional' }),
48
+ __metadata("design:type", String)
49
+ ], CareQueueEntryDto.prototype, "doctorName", void 0);
50
+ __decorate([
51
+ (0, swagger_1.ApiProperty)({ description: 'ID da especialidade usada no ticket (UUID)' }),
52
+ __metadata("design:type", String)
53
+ ], CareQueueEntryDto.prototype, "specialtyId", void 0);
54
+ __decorate([
55
+ (0, swagger_1.ApiProperty)({ description: 'Nome da especialidade' }),
56
+ __metadata("design:type", String)
57
+ ], CareQueueEntryDto.prototype, "specialtyName", void 0);
58
+ __decorate([
59
+ (0, swagger_1.ApiProperty)({ description: 'Data/hora do agendamento (ISO 8601)' }),
60
+ __metadata("design:type", String)
61
+ ], CareQueueEntryDto.prototype, "appointmentDate", void 0);
62
+ __decorate([
63
+ (0, swagger_1.ApiProperty)({ description: 'Status do agendamento' }),
64
+ __metadata("design:type", String)
65
+ ], CareQueueEntryDto.prototype, "status", void 0);
66
+ __decorate([
67
+ (0, swagger_1.ApiProperty)({
68
+ description: 'Código na fila (prefixo da especialidade + posição)',
69
+ example: 'CAR-003',
70
+ }),
71
+ __metadata("design:type", String)
72
+ ], CareQueueEntryDto.prototype, "ticketCode", void 0);
73
+ __decorate([
74
+ (0, swagger_1.ApiProperty)({ description: 'Posição na fila do dia (1-based), por horário' }),
75
+ __metadata("design:type", Number)
76
+ ], CareQueueEntryDto.prototype, "queuePosition", void 0);
77
+ __decorate([
78
+ (0, swagger_1.ApiProperty)({
79
+ enum: ['past', 'current', 'upcoming'],
80
+ description: 'Atendidos, em atendimento agora, ou aguardando',
81
+ }),
82
+ __metadata("design:type", String)
83
+ ], CareQueueEntryDto.prototype, "segment", void 0);
84
+ class CareQueueResponseDto {
85
+ specialtyTicketPrefix;
86
+ items;
87
+ }
88
+ exports.CareQueueResponseDto = CareQueueResponseDto;
89
+ __decorate([
90
+ (0, swagger_1.ApiProperty)({
91
+ description: 'Prefixo de 3 letras usado nos tickets (primeira especialidade do perfil do médico)',
92
+ example: 'CAR',
93
+ }),
94
+ __metadata("design:type", String)
95
+ ], CareQueueResponseDto.prototype, "specialtyTicketPrefix", void 0);
96
+ __decorate([
97
+ (0, swagger_1.ApiProperty)({ type: [CareQueueEntryDto] }),
98
+ __metadata("design:type", Array)
99
+ ], CareQueueResponseDto.prototype, "items", void 0);
@@ -7,4 +7,5 @@ export * from './appointment-status.dto';
7
7
  export * from './appointment.dto';
8
8
  export * from './appointment-procedure.dto';
9
9
  export * from './update-appointment-procedure.dto';
10
+ export * from './care-queue.dto';
10
11
  //# 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;AAClC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,oCAAoC,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;AACnD,cAAc,kBAAkB,CAAC"}
@@ -23,3 +23,4 @@ __exportStar(require("./appointment-status.dto"), exports);
23
23
  __exportStar(require("./appointment.dto"), exports);
24
24
  __exportStar(require("./appointment-procedure.dto"), exports);
25
25
  __exportStar(require("./update-appointment-procedure.dto"), exports);
26
+ __exportStar(require("./care-queue.dto"), exports);
@@ -168,7 +168,7 @@ __decorate([
168
168
  (0, swagger_1.ApiPropertyOptional)({
169
169
  description: 'JSON string with an array of filter objects `{ key, op, value }`. ' +
170
170
  'Example: `[{"key":"status","op":"==","value":"pending"}]`. ' +
171
- 'Ops: ==, !=, >, <, >=, <=, in (value must be array for `in`).',
171
+ 'Ops: ==, !=, >, <, >=, <=, in (value must be array for `in`), like, unlike (string pattern).',
172
172
  type: String,
173
173
  example: '[{"key":"status","op":"==","value":"pending"}]',
174
174
  }),
@@ -1,11 +1,9 @@
1
1
  import { BillingStatusDto } from './create-billing.dto';
2
- import { type GatewayPaymentMethodDto, type PaymentGatewayDto } from '../payment-gateway/payment-gateway.enums';
2
+ import { type GatewayPaymentMethodDto } from '../payment-gateway/payment-gateway.enums';
3
3
  export declare class ListBillingsQueryDto {
4
4
  tenantId?: string;
5
5
  status?: BillingStatusDto;
6
- paymentId?: string;
7
6
  method?: GatewayPaymentMethodDto;
8
- gateway?: PaymentGatewayDto;
9
7
  page?: number;
10
8
  limit?: number;
11
9
  }
@@ -1 +1 @@
1
- {"version":3,"file":"list-billings-query.dto.d.ts","sourceRoot":"","sources":["../../src/billing/list-billings-query.dto.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,gBAAgB,EACjB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAEL,KAAK,uBAAuB,EAE5B,KAAK,iBAAiB,EACvB,MAAM,0CAA0C,CAAC;AAElD,qBAAa,oBAAoB;IAO/B,QAAQ,CAAC,EAAE,MAAM,CAAC;IASlB,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAQ1B,SAAS,CAAC,EAAE,MAAM,CAAC;IAQnB,MAAM,CAAC,EAAE,uBAAuB,CAAC;IAQjC,OAAO,CAAC,EAAE,iBAAiB,CAAC;IAW5B,IAAI,CAAC,EAAE,MAAM,CAAC;IAad,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB"}
1
+ {"version":3,"file":"list-billings-query.dto.d.ts","sourceRoot":"","sources":["../../src/billing/list-billings-query.dto.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,gBAAgB,EACjB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAEL,KAAK,uBAAuB,EAC7B,MAAM,0CAA0C,CAAC;AAElD,qBAAa,oBAAoB;IAO/B,QAAQ,CAAC,EAAE,MAAM,CAAC;IASlB,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAQ1B,MAAM,CAAC,EAAE,uBAAuB,CAAC;IAWjC,IAAI,CAAC,EAAE,MAAM,CAAC;IAad,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB"}
@@ -17,9 +17,7 @@ const payment_gateway_enums_1 = require("../payment-gateway/payment-gateway.enum
17
17
  class ListBillingsQueryDto {
18
18
  tenantId;
19
19
  status;
20
- paymentId;
21
20
  method;
22
- gateway;
23
21
  page;
24
22
  limit;
25
23
  }
@@ -43,15 +41,6 @@ __decorate([
43
41
  (0, class_validator_1.IsEnum)(create_billing_dto_1.BILLING_STATUSES),
44
42
  __metadata("design:type", String)
45
43
  ], ListBillingsQueryDto.prototype, "status", void 0);
46
- __decorate([
47
- (0, swagger_1.ApiPropertyOptional)({
48
- description: 'Payment ID filter (UUID)',
49
- example: '550e8400-e29b-41d4-a716-446655440002',
50
- }),
51
- (0, class_validator_1.IsOptional)(),
52
- (0, class_validator_1.IsUUID)('4'),
53
- __metadata("design:type", String)
54
- ], ListBillingsQueryDto.prototype, "paymentId", void 0);
55
44
  __decorate([
56
45
  (0, swagger_1.ApiPropertyOptional)({
57
46
  description: 'Filtro por método de pagamento associado à cobrança',
@@ -61,15 +50,6 @@ __decorate([
61
50
  (0, class_validator_1.IsEnum)(payment_gateway_enums_1.GATEWAY_PAYMENT_METHODS),
62
51
  __metadata("design:type", String)
63
52
  ], ListBillingsQueryDto.prototype, "method", void 0);
64
- __decorate([
65
- (0, swagger_1.ApiPropertyOptional)({
66
- description: 'Filtro por gateway de pagamento',
67
- enum: payment_gateway_enums_1.PAYMENT_GATEWAYS,
68
- }),
69
- (0, class_validator_1.IsOptional)(),
70
- (0, class_validator_1.IsEnum)(payment_gateway_enums_1.PAYMENT_GATEWAYS),
71
- __metadata("design:type", String)
72
- ], ListBillingsQueryDto.prototype, "gateway", void 0);
73
53
  __decorate([
74
54
  (0, swagger_1.ApiPropertyOptional)({
75
55
  description: 'Page number (starting at 1)',
@@ -140,7 +140,7 @@ describe('ConversationContactFiltersQueryConstraint', () => {
140
140
  });
141
141
  it('should reject a filter with invalid operator', async () => {
142
142
  const raw = {
143
- filters: '{"key":"intention","op":"like","value":"x"}',
143
+ filters: '{"key":"intention","op":"contains","value":"x"}',
144
144
  };
145
145
  const dto = simulateValidationPipe(raw);
146
146
  const errors = await (0, class_validator_1.validate)(dto, {
@@ -90,7 +90,7 @@ __decorate([
90
90
  (0, swagger_1.ApiPropertyOptional)({
91
91
  description: 'JSON string with an array of filter objects `{ key, op, value }`. ' +
92
92
  'Example: `[{"key":"followupType","op":"==","value":"abandonment"}]`. ' +
93
- 'Ops: ==, !=, >, <, >=, <=, in (value must be array for `in`).',
93
+ 'Ops: ==, !=, >, <, >=, <=, in (value must be array for `in`), like, unlike (string pattern).',
94
94
  type: String,
95
95
  example: '[{"key":"followupType","op":"==","value":"abandonment"}]',
96
96
  }),
@@ -64,7 +64,7 @@ __decorate([
64
64
  (0, swagger_1.ApiPropertyOptional)({
65
65
  description: 'JSON string with an array of filter objects `{ key, op, value }`. ' +
66
66
  'Example: `[{"key":"intention","op":"==","value":"clinic_info"}]`. ' +
67
- 'Ops: ==, !=, >, <, >=, <=, in (value must be array for `in`).',
67
+ 'Ops: ==, !=, >, <, >=, <=, in (value must be array for `in`), like, unlike (value must be string pattern for SQL LIKE).',
68
68
  type: String,
69
69
  example: '[{"key":"intention","op":"==","value":"clinic_info"}]',
70
70
  }),
@@ -63,7 +63,7 @@ __decorate([
63
63
  (0, swagger_1.ApiPropertyOptional)({
64
64
  description: 'JSON string with an array of filter objects `{ key, op, value }`. ' +
65
65
  'Example: `[{"key":"conversationType","op":"==","value":"ia"}]`. ' +
66
- 'Ops: ==, !=, >, <, >=, <=, in (value must be array for `in`).',
66
+ 'Ops: ==, !=, >, <, >=, <=, in (value must be array for `in`), like, unlike (string pattern).',
67
67
  type: String,
68
68
  example: '[{"key":"intention","op":"==","value":"confirm_appointment"}]',
69
69
  }),
@@ -8,8 +8,10 @@
8
8
  * - `>=` : Greater than or equal
9
9
  * - `<=` : Less than or equal
10
10
  * - `in` : Value is one of the elements in the array
11
+ * - `like` : SQL `LIKE` (value must be a string pattern, e.g. `%foo%`)
12
+ * - `unlike` : SQL `NOT LIKE` (value must be a string pattern)
11
13
  */
12
- export declare const VALID_FILTER_OPS: readonly ["==", "!=", ">", "<", ">=", "<=", "in"];
14
+ export declare const VALID_FILTER_OPS: readonly ["==", "!=", ">", "<", ">=", "<=", "in", "like", "unlike"];
13
15
  export type FilterOp = (typeof VALID_FILTER_OPS)[number];
14
16
  /**
15
17
  * Generic parsed filter object.
@@ -23,7 +25,7 @@ export interface ParsedFilterDto {
23
25
  key: string;
24
26
  /** Comparison operator. */
25
27
  op: FilterOp;
26
- /** Scalar value (string | number) or, for `in`, an array of string | number. */
28
+ /** Scalar value (string | number), array for `in`, or string pattern for `like` / `unlike`. */
27
29
  value: string | number | (string | number)[];
28
30
  }
29
31
  //# sourceMappingURL=parsed-filter.dto.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"parsed-filter.dto.d.ts","sourceRoot":"","sources":["../../src/filters/parsed-filter.dto.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,eAAO,MAAM,gBAAgB,mDAQnB,CAAC;AACX,MAAM,MAAM,QAAQ,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEzD;;;;;;GAMG;AACH,MAAM,WAAW,eAAe;IAC9B,qFAAqF;IACrF,GAAG,EAAE,MAAM,CAAC;IACZ,2BAA2B;IAC3B,EAAE,EAAE,QAAQ,CAAC;IACb,gFAAgF;IAChF,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;CAC9C"}
1
+ {"version":3,"file":"parsed-filter.dto.d.ts","sourceRoot":"","sources":["../../src/filters/parsed-filter.dto.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,gBAAgB,qEAUnB,CAAC;AACX,MAAM,MAAM,QAAQ,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEzD;;;;;;GAMG;AACH,MAAM,WAAW,eAAe;IAC9B,qFAAqF;IACrF,GAAG,EAAE,MAAM,CAAC;IACZ,2BAA2B;IAC3B,EAAE,EAAE,QAAQ,CAAC;IACb,+FAA+F;IAC/F,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;CAC9C"}
@@ -11,6 +11,8 @@ exports.VALID_FILTER_OPS = void 0;
11
11
  * - `>=` : Greater than or equal
12
12
  * - `<=` : Less than or equal
13
13
  * - `in` : Value is one of the elements in the array
14
+ * - `like` : SQL `LIKE` (value must be a string pattern, e.g. `%foo%`)
15
+ * - `unlike` : SQL `NOT LIKE` (value must be a string pattern)
14
16
  */
15
17
  exports.VALID_FILTER_OPS = [
16
18
  '==',
@@ -20,4 +22,6 @@ exports.VALID_FILTER_OPS = [
20
22
  '>=',
21
23
  '<=',
22
24
  'in',
25
+ 'like',
26
+ 'unlike',
23
27
  ];
@@ -67,7 +67,7 @@ __decorate([
67
67
  (0, swagger_1.ApiPropertyOptional)({
68
68
  description: 'JSON string with an array of filter objects `{ key, op, value }`. ' +
69
69
  'Example: `[{"key":"cpf","op":"==","value":"12211117411"}]`. ' +
70
- 'Ops: ==, !=, >, <, >=, <=, in (value must be array for `in`).',
70
+ 'Ops: ==, !=, >, <, >=, <=, in (value must be array for `in`), like, unlike (string pattern).',
71
71
  type: String,
72
72
  example: '[{"key":"cpf","op":"==","value":"12211117411"}]',
73
73
  }),
@@ -64,7 +64,7 @@ __decorate([
64
64
  (0, swagger_1.ApiPropertyOptional)({
65
65
  description: 'JSON string with an array of filter objects `{ key, op, value }`. ' +
66
66
  'Example: `[{"key":"specialtyId","op":"==","value":"550e8400-e29b-41d4-a716-446655440000"}]`. ' +
67
- 'Ops: ==, !=, >, <, >=, <=, in (value must be array for `in`). ' +
67
+ 'Ops: ==, !=, >, <, >=, <=, in (value must be array for `in`), like, unlike (string pattern). ' +
68
68
  'Use key `sideEffects` for the `side_effects` column.',
69
69
  type: String,
70
70
  example: '[{"key":"name","op":"==","value":"Consulta"}]',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tychat-contracts",
3
- "version": "1.0.115",
3
+ "version": "1.0.120",
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,6 +1,7 @@
1
1
  export const APPOINTMENT_STATUSES = [
2
2
  'pending',
3
3
  'processing',
4
+ 'in_care',
4
5
  'sended',
5
6
  'finished',
6
7
  'canceled',
@@ -0,0 +1,60 @@
1
+ import { ApiProperty } from '@nestjs/swagger';
2
+
3
+ export type CareQueueSegmentDto = 'past' | 'current' | 'upcoming';
4
+
5
+ /** Item da fila de espera de atendimento (check-in → ordem por horário do agendamento). */
6
+ export class CareQueueEntryDto {
7
+ @ApiProperty({ description: 'ID do agendamento (UUID)' })
8
+ appointmentId: string;
9
+
10
+ @ApiProperty({ description: 'ID do paciente (UUID)' })
11
+ patientId: string;
12
+
13
+ @ApiProperty({ description: 'Nome do paciente' })
14
+ patientName: string;
15
+
16
+ @ApiProperty({ description: 'userId do profissional (UUID)' })
17
+ doctorUserId: string;
18
+
19
+ @ApiProperty({ description: 'Nome do profissional' })
20
+ doctorName: string;
21
+
22
+ @ApiProperty({ description: 'ID da especialidade usada no ticket (UUID)' })
23
+ specialtyId: string;
24
+
25
+ @ApiProperty({ description: 'Nome da especialidade' })
26
+ specialtyName: string;
27
+
28
+ @ApiProperty({ description: 'Data/hora do agendamento (ISO 8601)' })
29
+ appointmentDate: string;
30
+
31
+ @ApiProperty({ description: 'Status do agendamento' })
32
+ status: string;
33
+
34
+ @ApiProperty({
35
+ description: 'Código na fila (prefixo da especialidade + posição)',
36
+ example: 'CAR-003',
37
+ })
38
+ ticketCode: string;
39
+
40
+ @ApiProperty({ description: 'Posição na fila do dia (1-based), por horário' })
41
+ queuePosition: number;
42
+
43
+ @ApiProperty({
44
+ enum: ['past', 'current', 'upcoming'],
45
+ description: 'Atendidos, em atendimento agora, ou aguardando',
46
+ })
47
+ segment: CareQueueSegmentDto;
48
+ }
49
+
50
+ export class CareQueueResponseDto {
51
+ @ApiProperty({
52
+ description:
53
+ 'Prefixo de 3 letras usado nos tickets (primeira especialidade do perfil do médico)',
54
+ example: 'CAR',
55
+ })
56
+ specialtyTicketPrefix: string;
57
+
58
+ @ApiProperty({ type: [CareQueueEntryDto] })
59
+ items: CareQueueEntryDto[];
60
+ }
@@ -6,4 +6,5 @@ export * from './available-slots-response.dto';
6
6
  export * from './appointment-status.dto';
7
7
  export * from './appointment.dto';
8
8
  export * from './appointment-procedure.dto';
9
- export * from './update-appointment-procedure.dto';
9
+ export * from './update-appointment-procedure.dto';
10
+ export * from './care-queue.dto';
@@ -142,7 +142,7 @@ export class ListAppointmentsQueryDto {
142
142
  description:
143
143
  'JSON string with an array of filter objects `{ key, op, value }`. ' +
144
144
  'Example: `[{"key":"status","op":"==","value":"pending"}]`. ' +
145
- 'Ops: ==, !=, >, <, >=, <=, in (value must be array for `in`).',
145
+ 'Ops: ==, !=, >, <, >=, <=, in (value must be array for `in`), like, unlike (string pattern).',
146
146
  type: String,
147
147
  example: '[{"key":"status","op":"==","value":"pending"}]',
148
148
  })
@@ -7,8 +7,6 @@ import {
7
7
  import {
8
8
  GATEWAY_PAYMENT_METHODS,
9
9
  type GatewayPaymentMethodDto,
10
- PAYMENT_GATEWAYS,
11
- type PaymentGatewayDto,
12
10
  } from '../payment-gateway/payment-gateway.enums';
13
11
 
14
12
  export class ListBillingsQueryDto {
@@ -29,14 +27,6 @@ export class ListBillingsQueryDto {
29
27
  @IsEnum(BILLING_STATUSES)
30
28
  status?: BillingStatusDto;
31
29
 
32
- @ApiPropertyOptional({
33
- description: 'Payment ID filter (UUID)',
34
- example: '550e8400-e29b-41d4-a716-446655440002',
35
- })
36
- @IsOptional()
37
- @IsUUID('4')
38
- paymentId?: string;
39
-
40
30
  @ApiPropertyOptional({
41
31
  description: 'Filtro por método de pagamento associado à cobrança',
42
32
  enum: GATEWAY_PAYMENT_METHODS,
@@ -45,14 +35,6 @@ export class ListBillingsQueryDto {
45
35
  @IsEnum(GATEWAY_PAYMENT_METHODS)
46
36
  method?: GatewayPaymentMethodDto;
47
37
 
48
- @ApiPropertyOptional({
49
- description: 'Filtro por gateway de pagamento',
50
- enum: PAYMENT_GATEWAYS,
51
- })
52
- @IsOptional()
53
- @IsEnum(PAYMENT_GATEWAYS)
54
- gateway?: PaymentGatewayDto;
55
-
56
38
  @ApiPropertyOptional({
57
39
  description: 'Page number (starting at 1)',
58
40
  example: 1,
@@ -153,7 +153,7 @@ describe('ConversationContactFiltersQueryConstraint', () => {
153
153
 
154
154
  it('should reject a filter with invalid operator', async () => {
155
155
  const raw = {
156
- filters: '{"key":"intention","op":"like","value":"x"}',
156
+ filters: '{"key":"intention","op":"contains","value":"x"}',
157
157
  };
158
158
  const dto = simulateValidationPipe(raw);
159
159
  const errors = await validate(dto, {
@@ -77,7 +77,7 @@ export class FollowupLogListQueryDto {
77
77
  description:
78
78
  'JSON string with an array of filter objects `{ key, op, value }`. ' +
79
79
  'Example: `[{"key":"followupType","op":"==","value":"abandonment"}]`. ' +
80
- 'Ops: ==, !=, >, <, >=, <=, in (value must be array for `in`).',
80
+ 'Ops: ==, !=, >, <, >=, <=, in (value must be array for `in`), like, unlike (string pattern).',
81
81
  type: String,
82
82
  example: '[{"key":"followupType","op":"==","value":"abandonment"}]',
83
83
  })
@@ -50,7 +50,7 @@ export class ListConversationContactsQueryDto {
50
50
  description:
51
51
  'JSON string with an array of filter objects `{ key, op, value }`. ' +
52
52
  'Example: `[{"key":"intention","op":"==","value":"clinic_info"}]`. ' +
53
- 'Ops: ==, !=, >, <, >=, <=, in (value must be array for `in`).',
53
+ 'Ops: ==, !=, >, <, >=, <=, in (value must be array for `in`), like, unlike (value must be string pattern for SQL LIKE).',
54
54
  type: String,
55
55
  example: '[{"key":"intention","op":"==","value":"clinic_info"}]',
56
56
  })
@@ -47,7 +47,7 @@ export class ListConversationSessionsQueryDto {
47
47
  description:
48
48
  'JSON string with an array of filter objects `{ key, op, value }`. ' +
49
49
  'Example: `[{"key":"conversationType","op":"==","value":"ia"}]`. ' +
50
- 'Ops: ==, !=, >, <, >=, <=, in (value must be array for `in`).',
50
+ 'Ops: ==, !=, >, <, >=, <=, in (value must be array for `in`), like, unlike (string pattern).',
51
51
  type: String,
52
52
  example: '[{"key":"intention","op":"==","value":"confirm_appointment"}]',
53
53
  })
@@ -8,6 +8,8 @@
8
8
  * - `>=` : Greater than or equal
9
9
  * - `<=` : Less than or equal
10
10
  * - `in` : Value is one of the elements in the array
11
+ * - `like` : SQL `LIKE` (value must be a string pattern, e.g. `%foo%`)
12
+ * - `unlike` : SQL `NOT LIKE` (value must be a string pattern)
11
13
  */
12
14
  export const VALID_FILTER_OPS = [
13
15
  '==',
@@ -17,6 +19,8 @@ export const VALID_FILTER_OPS = [
17
19
  '>=',
18
20
  '<=',
19
21
  'in',
22
+ 'like',
23
+ 'unlike',
20
24
  ] as const;
21
25
  export type FilterOp = (typeof VALID_FILTER_OPS)[number];
22
26
 
@@ -32,6 +36,6 @@ export interface ParsedFilterDto {
32
36
  key: string;
33
37
  /** Comparison operator. */
34
38
  op: FilterOp;
35
- /** Scalar value (string | number) or, for `in`, an array of string | number. */
39
+ /** Scalar value (string | number), array for `in`, or string pattern for `like` / `unlike`. */
36
40
  value: string | number | (string | number)[];
37
41
  }
@@ -52,7 +52,7 @@ export class ListPatientsQueryDto {
52
52
  description:
53
53
  'JSON string with an array of filter objects `{ key, op, value }`. ' +
54
54
  'Example: `[{"key":"cpf","op":"==","value":"12211117411"}]`. ' +
55
- 'Ops: ==, !=, >, <, >=, <=, in (value must be array for `in`).',
55
+ 'Ops: ==, !=, >, <, >=, <=, in (value must be array for `in`), like, unlike (string pattern).',
56
56
  type: String,
57
57
  example: '[{"key":"cpf","op":"==","value":"12211117411"}]',
58
58
  })
@@ -49,7 +49,7 @@ export class ListProceduresQueryDto {
49
49
  description:
50
50
  'JSON string with an array of filter objects `{ key, op, value }`. ' +
51
51
  'Example: `[{"key":"specialtyId","op":"==","value":"550e8400-e29b-41d4-a716-446655440000"}]`. ' +
52
- 'Ops: ==, !=, >, <, >=, <=, in (value must be array for `in`). ' +
52
+ 'Ops: ==, !=, >, <, >=, <=, in (value must be array for `in`), like, unlike (string pattern). ' +
53
53
  'Use key `sideEffects` for the `side_effects` column.',
54
54
  type: String,
55
55
  example: '[{"key":"name","op":"==","value":"Consulta"}]',