tychat-contracts 1.0.25 → 1.0.27
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.
- package/dist/appointments/appointment-status.dto.d.ts +3 -0
- package/dist/appointments/appointment-status.dto.d.ts.map +1 -0
- package/dist/appointments/appointment-status.dto.js +9 -0
- package/dist/appointments/appointment.dto.d.ts +11 -0
- package/dist/appointments/appointment.dto.d.ts.map +1 -0
- package/dist/appointments/appointment.dto.js +2 -0
- package/dist/appointments/create-appointment.dto.d.ts +1 -2
- package/dist/appointments/create-appointment.dto.d.ts.map +1 -1
- package/dist/appointments/create-appointment.dto.js +4 -9
- package/dist/appointments/index.d.ts +2 -0
- package/dist/appointments/index.d.ts.map +1 -1
- package/dist/appointments/index.js +2 -0
- package/dist/appointments/list-appointments-query.dto.d.ts +7 -0
- package/dist/appointments/list-appointments-query.dto.d.ts.map +1 -1
- package/dist/billing/billing-response.dto.d.ts +15 -0
- package/dist/billing/billing-response.dto.d.ts.map +1 -0
- package/dist/billing/billing-response.dto.js +108 -0
- package/dist/billing/create-billing.dto.d.ts +16 -0
- package/dist/billing/create-billing.dto.d.ts.map +1 -0
- package/dist/billing/create-billing.dto.js +105 -0
- package/dist/billing/index.d.ts +5 -0
- package/dist/billing/index.d.ts.map +1 -0
- package/dist/billing/index.js +20 -0
- package/dist/billing/list-billings-query.dto.d.ts +10 -0
- package/dist/billing/list-billings-query.dto.d.ts.map +1 -0
- package/dist/billing/list-billings-query.dto.js +89 -0
- package/dist/billing/update-billing.dto.d.ts +6 -0
- package/dist/billing/update-billing.dto.d.ts.map +1 -0
- package/dist/billing/update-billing.dto.js +8 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/package.json +1 -1
- package/src/appointments/appointment-status.dto.ts +7 -0
- package/src/appointments/appointment.dto.ts +36 -0
- package/src/appointments/create-appointment.dto.ts +2 -7
- package/src/appointments/index.ts +2 -0
- package/src/appointments/list-appointments-query.dto.ts +8 -0
- package/src/billing/billing-response.dto.ts +80 -0
- package/src/billing/create-billing.dto.ts +92 -0
- package/src/billing/index.ts +4 -0
- package/src/billing/list-billings-query.dto.ts +71 -0
- package/src/billing/update-billing.dto.ts +4 -0
- package/src/index.ts +1 -0
- package/tychat-contracts-1.0.17.tgz +0 -0
- package/tychat-contracts-1.0.9.tgz +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"appointment-status.dto.d.ts","sourceRoot":"","sources":["../../src/appointments/appointment-status.dto.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,oBAAoB,0DAKvB,CAAC;AACX,MAAM,MAAM,oBAAoB,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,CAAC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { AppointmentStatusDto } from "./appointment-status.dto";
|
|
2
|
+
export interface AppointmentDto {
|
|
3
|
+
id: string;
|
|
4
|
+
patientId: string;
|
|
5
|
+
userId: string;
|
|
6
|
+
date: string;
|
|
7
|
+
checkinCompleted: boolean;
|
|
8
|
+
checkoutCompleted: boolean;
|
|
9
|
+
status: AppointmentStatusDto;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=appointment.dto.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"appointment.dto.d.ts","sourceRoot":"","sources":["../../src/appointments/appointment.dto.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAEhE,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IAMX,SAAS,EAAE,MAAM,CAAC;IAKlB,MAAM,EAAE,MAAM,CAAC;IAKf,IAAI,EAAE,MAAM,CAAC;IAKb,gBAAgB,EAAE,OAAO,CAAC;IAK1B,iBAAiB,EAAE,OAAO,CAAC;IAK3B,MAAM,EAAE,oBAAoB,CAAC;CAC9B"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
export type AppointmentStatusDto = (typeof APPOINTMENT_STATUSES)[number];
|
|
1
|
+
import { AppointmentStatusDto } from './appointment-status.dto';
|
|
3
2
|
export declare class CreateAppointmentDto {
|
|
4
3
|
patientId: string;
|
|
5
4
|
date: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-appointment.dto.d.ts","sourceRoot":"","sources":["../../src/appointments/create-appointment.dto.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"create-appointment.dto.d.ts","sourceRoot":"","sources":["../../src/appointments/create-appointment.dto.ts"],"names":[],"mappings":"AASA,OAAO,EAAwB,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAItF,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;IAS5B,MAAM,CAAC,EAAE,oBAAoB,CAAC;CAC/B"}
|
|
@@ -9,15 +9,10 @@ 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.CreateAppointmentDto =
|
|
12
|
+
exports.CreateAppointmentDto = void 0;
|
|
13
13
|
const swagger_1 = require("@nestjs/swagger");
|
|
14
14
|
const class_validator_1 = require("class-validator");
|
|
15
|
-
|
|
16
|
-
'pending',
|
|
17
|
-
'processing',
|
|
18
|
-
'sended',
|
|
19
|
-
'finished',
|
|
20
|
-
];
|
|
15
|
+
const appointment_status_dto_1 = require("./appointment-status.dto");
|
|
21
16
|
class CreateAppointmentDto {
|
|
22
17
|
patientId;
|
|
23
18
|
date;
|
|
@@ -76,10 +71,10 @@ __decorate([
|
|
|
76
71
|
__decorate([
|
|
77
72
|
(0, swagger_1.ApiPropertyOptional)({
|
|
78
73
|
description: 'Status do agendamento',
|
|
79
|
-
enum:
|
|
74
|
+
enum: appointment_status_dto_1.APPOINTMENT_STATUSES,
|
|
80
75
|
default: 'pending',
|
|
81
76
|
}),
|
|
82
77
|
(0, class_validator_1.IsOptional)(),
|
|
83
|
-
(0, class_validator_1.IsEnum)(
|
|
78
|
+
(0, class_validator_1.IsEnum)(appointment_status_dto_1.APPOINTMENT_STATUSES),
|
|
84
79
|
__metadata("design:type", String)
|
|
85
80
|
], CreateAppointmentDto.prototype, "status", void 0);
|
|
@@ -3,4 +3,6 @@ export * from './update-appointment.dto';
|
|
|
3
3
|
export * from './list-appointments-query.dto';
|
|
4
4
|
export * from './available-slots-query.dto';
|
|
5
5
|
export * from './available-slots-response.dto';
|
|
6
|
+
export * from './appointment-status.dto';
|
|
7
|
+
export * from './appointment.dto';
|
|
6
8
|
//# 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"}
|
|
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"}
|
|
@@ -19,3 +19,5 @@ __exportStar(require("./update-appointment.dto"), exports);
|
|
|
19
19
|
__exportStar(require("./list-appointments-query.dto"), exports);
|
|
20
20
|
__exportStar(require("./available-slots-query.dto"), exports);
|
|
21
21
|
__exportStar(require("./available-slots-response.dto"), exports);
|
|
22
|
+
__exportStar(require("./appointment-status.dto"), exports);
|
|
23
|
+
__exportStar(require("./appointment.dto"), exports);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { AppointmentDto } from './appointment.dto';
|
|
1
2
|
export declare class ListAppointmentsQueryDto {
|
|
2
3
|
page?: number;
|
|
3
4
|
limit?: number;
|
|
@@ -7,4 +8,10 @@ export declare class ListAppointmentsQueryDto {
|
|
|
7
8
|
checkinCompleted?: boolean;
|
|
8
9
|
patientId?: string;
|
|
9
10
|
}
|
|
11
|
+
export interface AppointmentListResult {
|
|
12
|
+
items: AppointmentDto[];
|
|
13
|
+
total: number;
|
|
14
|
+
page: number;
|
|
15
|
+
limit: number;
|
|
16
|
+
}
|
|
10
17
|
//# sourceMappingURL=list-appointments-query.dto.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list-appointments-query.dto.d.ts","sourceRoot":"","sources":["../../src/appointments/list-appointments-query.dto.ts"],"names":[],"mappings":"
|
|
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;AAEnD,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,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;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"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { BillingGatewayDto, BillingMethodDto, BillingStatusDto } from './create-billing.dto';
|
|
2
|
+
export declare class BillingResponseDto {
|
|
3
|
+
id: string;
|
|
4
|
+
tenantId: string;
|
|
5
|
+
value: number;
|
|
6
|
+
status: BillingStatusDto;
|
|
7
|
+
method: BillingMethodDto;
|
|
8
|
+
gateway: BillingGatewayDto;
|
|
9
|
+
dueDate: string;
|
|
10
|
+
payedAt?: string | null;
|
|
11
|
+
createdAt: string;
|
|
12
|
+
updatedAt: string;
|
|
13
|
+
deletedAt?: string | null;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=billing-response.dto.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"billing-response.dto.d.ts","sourceRoot":"","sources":["../../src/billing/billing-response.dto.ts"],"names":[],"mappings":"AACA,OAAO,EAIL,iBAAiB,EACjB,gBAAgB,EAChB,gBAAgB,EACjB,MAAM,sBAAsB,CAAC;AAE9B,qBAAa,kBAAkB;IAK7B,EAAE,EAAE,MAAM,CAAC;IAMX,QAAQ,EAAE,MAAM,CAAC;IAMjB,KAAK,EAAE,MAAM,CAAC;IAOd,MAAM,EAAE,gBAAgB,CAAC;IAOzB,MAAM,EAAE,gBAAgB,CAAC;IAOzB,OAAO,EAAE,iBAAiB,CAAC;IAM3B,OAAO,EAAE,MAAM,CAAC;IAMhB,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAMxB,SAAS,EAAE,MAAM,CAAC;IAMlB,SAAS,EAAE,MAAM,CAAC;IAMlB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B"}
|
|
@@ -0,0 +1,108 @@
|
|
|
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.BillingResponseDto = void 0;
|
|
13
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
14
|
+
const create_billing_dto_1 = require("./create-billing.dto");
|
|
15
|
+
class BillingResponseDto {
|
|
16
|
+
id;
|
|
17
|
+
tenantId;
|
|
18
|
+
value;
|
|
19
|
+
status;
|
|
20
|
+
method;
|
|
21
|
+
gateway;
|
|
22
|
+
dueDate;
|
|
23
|
+
payedAt;
|
|
24
|
+
createdAt;
|
|
25
|
+
updatedAt;
|
|
26
|
+
deletedAt;
|
|
27
|
+
}
|
|
28
|
+
exports.BillingResponseDto = BillingResponseDto;
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, swagger_1.ApiProperty)({
|
|
31
|
+
description: 'Billing ID (UUID)',
|
|
32
|
+
example: '550e8400-e29b-41d4-a716-446655440111',
|
|
33
|
+
}),
|
|
34
|
+
__metadata("design:type", String)
|
|
35
|
+
], BillingResponseDto.prototype, "id", void 0);
|
|
36
|
+
__decorate([
|
|
37
|
+
(0, swagger_1.ApiProperty)({
|
|
38
|
+
description: 'Tenant ID (UUID)',
|
|
39
|
+
example: '550e8400-e29b-41d4-a716-446655440000',
|
|
40
|
+
}),
|
|
41
|
+
__metadata("design:type", String)
|
|
42
|
+
], BillingResponseDto.prototype, "tenantId", void 0);
|
|
43
|
+
__decorate([
|
|
44
|
+
(0, swagger_1.ApiProperty)({
|
|
45
|
+
description: 'Billing value',
|
|
46
|
+
example: 99.9,
|
|
47
|
+
}),
|
|
48
|
+
__metadata("design:type", Number)
|
|
49
|
+
], BillingResponseDto.prototype, "value", void 0);
|
|
50
|
+
__decorate([
|
|
51
|
+
(0, swagger_1.ApiProperty)({
|
|
52
|
+
description: 'Billing status',
|
|
53
|
+
enum: create_billing_dto_1.BILLING_STATUSES,
|
|
54
|
+
example: 'PENDING',
|
|
55
|
+
}),
|
|
56
|
+
__metadata("design:type", String)
|
|
57
|
+
], BillingResponseDto.prototype, "status", void 0);
|
|
58
|
+
__decorate([
|
|
59
|
+
(0, swagger_1.ApiProperty)({
|
|
60
|
+
description: 'Payment method',
|
|
61
|
+
enum: create_billing_dto_1.BILLING_METHODS,
|
|
62
|
+
example: 'PIX',
|
|
63
|
+
}),
|
|
64
|
+
__metadata("design:type", String)
|
|
65
|
+
], BillingResponseDto.prototype, "method", void 0);
|
|
66
|
+
__decorate([
|
|
67
|
+
(0, swagger_1.ApiProperty)({
|
|
68
|
+
description: 'Payment gateway',
|
|
69
|
+
enum: create_billing_dto_1.BILLING_GATEWAYS,
|
|
70
|
+
example: 'ASAAS',
|
|
71
|
+
}),
|
|
72
|
+
__metadata("design:type", String)
|
|
73
|
+
], BillingResponseDto.prototype, "gateway", void 0);
|
|
74
|
+
__decorate([
|
|
75
|
+
(0, swagger_1.ApiProperty)({
|
|
76
|
+
description: 'Due date (ISO 8601)',
|
|
77
|
+
example: '2026-04-15T00:00:00.000Z',
|
|
78
|
+
}),
|
|
79
|
+
__metadata("design:type", String)
|
|
80
|
+
], BillingResponseDto.prototype, "dueDate", void 0);
|
|
81
|
+
__decorate([
|
|
82
|
+
(0, swagger_1.ApiPropertyOptional)({
|
|
83
|
+
description: 'Date when billing was paid (ISO 8601)',
|
|
84
|
+
example: '2026-04-14T10:00:00.000Z',
|
|
85
|
+
}),
|
|
86
|
+
__metadata("design:type", Object)
|
|
87
|
+
], BillingResponseDto.prototype, "payedAt", void 0);
|
|
88
|
+
__decorate([
|
|
89
|
+
(0, swagger_1.ApiProperty)({
|
|
90
|
+
description: 'Creation timestamp (ISO 8601)',
|
|
91
|
+
example: '2026-03-14T12:00:00.000Z',
|
|
92
|
+
}),
|
|
93
|
+
__metadata("design:type", String)
|
|
94
|
+
], BillingResponseDto.prototype, "createdAt", void 0);
|
|
95
|
+
__decorate([
|
|
96
|
+
(0, swagger_1.ApiProperty)({
|
|
97
|
+
description: 'Last update timestamp (ISO 8601)',
|
|
98
|
+
example: '2026-03-14T12:00:00.000Z',
|
|
99
|
+
}),
|
|
100
|
+
__metadata("design:type", String)
|
|
101
|
+
], BillingResponseDto.prototype, "updatedAt", void 0);
|
|
102
|
+
__decorate([
|
|
103
|
+
(0, swagger_1.ApiPropertyOptional)({
|
|
104
|
+
description: 'Soft deletion timestamp (ISO 8601)',
|
|
105
|
+
example: null,
|
|
106
|
+
}),
|
|
107
|
+
__metadata("design:type", Object)
|
|
108
|
+
], BillingResponseDto.prototype, "deletedAt", void 0);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare const BILLING_STATUSES: readonly ["PENDING", "PAYED", "REFUNDED", "CANCELED", "OVERDUE"];
|
|
2
|
+
export type BillingStatusDto = (typeof BILLING_STATUSES)[number];
|
|
3
|
+
export declare const BILLING_METHODS: readonly ["PIX", "CREDIT_CARD", "DEBIT_CARD", "VOUCHER", "CASH"];
|
|
4
|
+
export type BillingMethodDto = (typeof BILLING_METHODS)[number];
|
|
5
|
+
export declare const BILLING_GATEWAYS: readonly ["ASAAS", "MERCADO_PAGO", "STRIPE"];
|
|
6
|
+
export type BillingGatewayDto = (typeof BILLING_GATEWAYS)[number];
|
|
7
|
+
export declare class CreateBillingDto {
|
|
8
|
+
tenantId: string;
|
|
9
|
+
value: number;
|
|
10
|
+
status?: BillingStatusDto;
|
|
11
|
+
method: BillingMethodDto;
|
|
12
|
+
gateway: BillingGatewayDto;
|
|
13
|
+
dueDate: string;
|
|
14
|
+
payedAt?: string;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=create-billing.dto.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-billing.dto.d.ts","sourceRoot":"","sources":["../../src/billing/create-billing.dto.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,gBAAgB,kEAMnB,CAAC;AACX,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEjE,eAAO,MAAM,eAAe,kEAMlB,CAAC;AACX,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC;AAEhE,eAAO,MAAM,gBAAgB,8CAA+C,CAAC;AAC7E,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAC;AAElE,qBAAa,gBAAgB;IAO3B,QAAQ,EAAE,MAAM,CAAC;IASjB,KAAK,EAAE,MAAM,CAAC;IASd,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAS1B,MAAM,EAAE,gBAAgB,CAAC;IASzB,OAAO,EAAE,iBAAiB,CAAC;IAO3B,OAAO,EAAE,MAAM,CAAC;IAQhB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB"}
|
|
@@ -0,0 +1,105 @@
|
|
|
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.CreateBillingDto = exports.BILLING_GATEWAYS = exports.BILLING_METHODS = exports.BILLING_STATUSES = void 0;
|
|
13
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
exports.BILLING_STATUSES = [
|
|
16
|
+
'PENDING',
|
|
17
|
+
'PAYED',
|
|
18
|
+
'REFUNDED',
|
|
19
|
+
'CANCELED',
|
|
20
|
+
'OVERDUE',
|
|
21
|
+
];
|
|
22
|
+
exports.BILLING_METHODS = [
|
|
23
|
+
'PIX',
|
|
24
|
+
'CREDIT_CARD',
|
|
25
|
+
'DEBIT_CARD',
|
|
26
|
+
'VOUCHER',
|
|
27
|
+
'CASH',
|
|
28
|
+
];
|
|
29
|
+
exports.BILLING_GATEWAYS = ['ASAAS', 'MERCADO_PAGO', 'STRIPE'];
|
|
30
|
+
class CreateBillingDto {
|
|
31
|
+
tenantId;
|
|
32
|
+
value;
|
|
33
|
+
status;
|
|
34
|
+
method;
|
|
35
|
+
gateway;
|
|
36
|
+
dueDate;
|
|
37
|
+
payedAt;
|
|
38
|
+
}
|
|
39
|
+
exports.CreateBillingDto = CreateBillingDto;
|
|
40
|
+
__decorate([
|
|
41
|
+
(0, swagger_1.ApiProperty)({
|
|
42
|
+
description: 'Tenant ID (UUID)',
|
|
43
|
+
example: '550e8400-e29b-41d4-a716-446655440000',
|
|
44
|
+
}),
|
|
45
|
+
(0, class_validator_1.IsUUID)('4'),
|
|
46
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
47
|
+
__metadata("design:type", String)
|
|
48
|
+
], CreateBillingDto.prototype, "tenantId", void 0);
|
|
49
|
+
__decorate([
|
|
50
|
+
(0, swagger_1.ApiProperty)({
|
|
51
|
+
description: 'Billing value',
|
|
52
|
+
example: 99.9,
|
|
53
|
+
minimum: 0.01,
|
|
54
|
+
}),
|
|
55
|
+
(0, class_validator_1.IsNumber)(),
|
|
56
|
+
(0, class_validator_1.Min)(0.01),
|
|
57
|
+
__metadata("design:type", Number)
|
|
58
|
+
], CreateBillingDto.prototype, "value", void 0);
|
|
59
|
+
__decorate([
|
|
60
|
+
(0, swagger_1.ApiPropertyOptional)({
|
|
61
|
+
description: 'Billing status',
|
|
62
|
+
enum: exports.BILLING_STATUSES,
|
|
63
|
+
default: 'PENDING',
|
|
64
|
+
}),
|
|
65
|
+
(0, class_validator_1.IsOptional)(),
|
|
66
|
+
(0, class_validator_1.IsEnum)(exports.BILLING_STATUSES),
|
|
67
|
+
__metadata("design:type", String)
|
|
68
|
+
], CreateBillingDto.prototype, "status", void 0);
|
|
69
|
+
__decorate([
|
|
70
|
+
(0, swagger_1.ApiProperty)({
|
|
71
|
+
description: 'Payment method',
|
|
72
|
+
enum: exports.BILLING_METHODS,
|
|
73
|
+
example: 'PIX',
|
|
74
|
+
}),
|
|
75
|
+
(0, class_validator_1.IsEnum)(exports.BILLING_METHODS),
|
|
76
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
77
|
+
__metadata("design:type", String)
|
|
78
|
+
], CreateBillingDto.prototype, "method", void 0);
|
|
79
|
+
__decorate([
|
|
80
|
+
(0, swagger_1.ApiProperty)({
|
|
81
|
+
description: 'Payment gateway',
|
|
82
|
+
enum: exports.BILLING_GATEWAYS,
|
|
83
|
+
example: 'ASAAS',
|
|
84
|
+
}),
|
|
85
|
+
(0, class_validator_1.IsEnum)(exports.BILLING_GATEWAYS),
|
|
86
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
87
|
+
__metadata("design:type", String)
|
|
88
|
+
], CreateBillingDto.prototype, "gateway", void 0);
|
|
89
|
+
__decorate([
|
|
90
|
+
(0, swagger_1.ApiProperty)({
|
|
91
|
+
description: 'Due date (ISO 8601)',
|
|
92
|
+
example: '2026-04-15T00:00:00.000Z',
|
|
93
|
+
}),
|
|
94
|
+
(0, class_validator_1.IsDateString)(),
|
|
95
|
+
__metadata("design:type", String)
|
|
96
|
+
], CreateBillingDto.prototype, "dueDate", void 0);
|
|
97
|
+
__decorate([
|
|
98
|
+
(0, swagger_1.ApiPropertyOptional)({
|
|
99
|
+
description: 'Date when billing was paid (ISO 8601)',
|
|
100
|
+
example: '2026-04-14T10:00:00.000Z',
|
|
101
|
+
}),
|
|
102
|
+
(0, class_validator_1.IsOptional)(),
|
|
103
|
+
(0, class_validator_1.IsDateString)(),
|
|
104
|
+
__metadata("design:type", String)
|
|
105
|
+
], CreateBillingDto.prototype, "payedAt", void 0);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/billing/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
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("./create-billing.dto"), exports);
|
|
18
|
+
__exportStar(require("./update-billing.dto"), exports);
|
|
19
|
+
__exportStar(require("./list-billings-query.dto"), exports);
|
|
20
|
+
__exportStar(require("./billing-response.dto"), exports);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { BillingGatewayDto, BillingMethodDto, BillingStatusDto } from './create-billing.dto';
|
|
2
|
+
export declare class ListBillingsQueryDto {
|
|
3
|
+
tenantId?: string;
|
|
4
|
+
status?: BillingStatusDto;
|
|
5
|
+
method?: BillingMethodDto;
|
|
6
|
+
gateway?: BillingGatewayDto;
|
|
7
|
+
page?: number;
|
|
8
|
+
limit?: number;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=list-billings-query.dto.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-billings-query.dto.d.ts","sourceRoot":"","sources":["../../src/billing/list-billings-query.dto.ts"],"names":[],"mappings":"AAEA,OAAO,EAIL,iBAAiB,EACjB,gBAAgB,EAChB,gBAAgB,EACjB,MAAM,sBAAsB,CAAC;AAE9B,qBAAa,oBAAoB;IAO/B,QAAQ,CAAC,EAAE,MAAM,CAAC;IASlB,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAS1B,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAS1B,OAAO,CAAC,EAAE,iBAAiB,CAAC;IAW5B,IAAI,CAAC,EAAE,MAAM,CAAC;IAad,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB"}
|
|
@@ -0,0 +1,89 @@
|
|
|
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.ListBillingsQueryDto = void 0;
|
|
13
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
const create_billing_dto_1 = require("./create-billing.dto");
|
|
16
|
+
class ListBillingsQueryDto {
|
|
17
|
+
tenantId;
|
|
18
|
+
status;
|
|
19
|
+
method;
|
|
20
|
+
gateway;
|
|
21
|
+
page;
|
|
22
|
+
limit;
|
|
23
|
+
}
|
|
24
|
+
exports.ListBillingsQueryDto = ListBillingsQueryDto;
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, swagger_1.ApiPropertyOptional)({
|
|
27
|
+
description: 'Tenant ID filter (UUID)',
|
|
28
|
+
example: '550e8400-e29b-41d4-a716-446655440000',
|
|
29
|
+
}),
|
|
30
|
+
(0, class_validator_1.IsOptional)(),
|
|
31
|
+
(0, class_validator_1.IsUUID)('4'),
|
|
32
|
+
__metadata("design:type", String)
|
|
33
|
+
], ListBillingsQueryDto.prototype, "tenantId", void 0);
|
|
34
|
+
__decorate([
|
|
35
|
+
(0, swagger_1.ApiPropertyOptional)({
|
|
36
|
+
description: 'Billing status filter',
|
|
37
|
+
enum: create_billing_dto_1.BILLING_STATUSES,
|
|
38
|
+
example: 'PENDING',
|
|
39
|
+
}),
|
|
40
|
+
(0, class_validator_1.IsOptional)(),
|
|
41
|
+
(0, class_validator_1.IsEnum)(create_billing_dto_1.BILLING_STATUSES),
|
|
42
|
+
__metadata("design:type", String)
|
|
43
|
+
], ListBillingsQueryDto.prototype, "status", void 0);
|
|
44
|
+
__decorate([
|
|
45
|
+
(0, swagger_1.ApiPropertyOptional)({
|
|
46
|
+
description: 'Billing method filter',
|
|
47
|
+
enum: create_billing_dto_1.BILLING_METHODS,
|
|
48
|
+
example: 'PIX',
|
|
49
|
+
}),
|
|
50
|
+
(0, class_validator_1.IsOptional)(),
|
|
51
|
+
(0, class_validator_1.IsEnum)(create_billing_dto_1.BILLING_METHODS),
|
|
52
|
+
__metadata("design:type", String)
|
|
53
|
+
], ListBillingsQueryDto.prototype, "method", void 0);
|
|
54
|
+
__decorate([
|
|
55
|
+
(0, swagger_1.ApiPropertyOptional)({
|
|
56
|
+
description: 'Billing gateway filter',
|
|
57
|
+
enum: create_billing_dto_1.BILLING_GATEWAYS,
|
|
58
|
+
example: 'ASAAS',
|
|
59
|
+
}),
|
|
60
|
+
(0, class_validator_1.IsOptional)(),
|
|
61
|
+
(0, class_validator_1.IsEnum)(create_billing_dto_1.BILLING_GATEWAYS),
|
|
62
|
+
__metadata("design:type", String)
|
|
63
|
+
], ListBillingsQueryDto.prototype, "gateway", void 0);
|
|
64
|
+
__decorate([
|
|
65
|
+
(0, swagger_1.ApiPropertyOptional)({
|
|
66
|
+
description: 'Page number (starting at 1)',
|
|
67
|
+
example: 1,
|
|
68
|
+
minimum: 1,
|
|
69
|
+
default: 1,
|
|
70
|
+
}),
|
|
71
|
+
(0, class_validator_1.IsOptional)(),
|
|
72
|
+
(0, class_validator_1.IsInt)(),
|
|
73
|
+
(0, class_validator_1.Min)(1),
|
|
74
|
+
__metadata("design:type", Number)
|
|
75
|
+
], ListBillingsQueryDto.prototype, "page", void 0);
|
|
76
|
+
__decorate([
|
|
77
|
+
(0, swagger_1.ApiPropertyOptional)({
|
|
78
|
+
description: 'Number of records per page',
|
|
79
|
+
example: 20,
|
|
80
|
+
minimum: 1,
|
|
81
|
+
maximum: 100,
|
|
82
|
+
default: 20,
|
|
83
|
+
}),
|
|
84
|
+
(0, class_validator_1.IsOptional)(),
|
|
85
|
+
(0, class_validator_1.IsInt)(),
|
|
86
|
+
(0, class_validator_1.Min)(1),
|
|
87
|
+
(0, class_validator_1.Max)(100),
|
|
88
|
+
__metadata("design:type", Number)
|
|
89
|
+
], ListBillingsQueryDto.prototype, "limit", void 0);
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { CreateBillingDto } from './create-billing.dto';
|
|
2
|
+
declare const UpdateBillingDto_base: import("@nestjs/common").Type<Partial<CreateBillingDto>>;
|
|
3
|
+
export declare class UpdateBillingDto extends UpdateBillingDto_base {
|
|
4
|
+
}
|
|
5
|
+
export {};
|
|
6
|
+
//# sourceMappingURL=update-billing.dto.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-billing.dto.d.ts","sourceRoot":"","sources":["../../src/billing/update-billing.dto.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;;AAExD,qBAAa,gBAAiB,SAAQ,qBAA6B;CAAG"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UpdateBillingDto = void 0;
|
|
4
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
5
|
+
const create_billing_dto_1 = require("./create-billing.dto");
|
|
6
|
+
class UpdateBillingDto extends (0, swagger_1.PartialType)(create_billing_dto_1.CreateBillingDto) {
|
|
7
|
+
}
|
|
8
|
+
exports.UpdateBillingDto = UpdateBillingDto;
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC"}
|
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { AppointmentStatusDto } from "./appointment-status.dto";
|
|
2
|
+
|
|
3
|
+
export interface AppointmentDto {
|
|
4
|
+
id: string;
|
|
5
|
+
|
|
6
|
+
/*
|
|
7
|
+
* ID do paciente (UUID)
|
|
8
|
+
* @example '550e8400-e29b-41d4-a716-446655440000'
|
|
9
|
+
*/
|
|
10
|
+
patientId: string;
|
|
11
|
+
/*
|
|
12
|
+
* ID do profissional de saúde atrelado ao agendamento (UUID)
|
|
13
|
+
* @example '550e8400-e29b-41d4-a716-446655440001'
|
|
14
|
+
*/
|
|
15
|
+
userId: string;
|
|
16
|
+
/*
|
|
17
|
+
* Data e hora do agendamento (ISO 8601)
|
|
18
|
+
* @example '2026-03-15T14:00:00.000Z'
|
|
19
|
+
*/
|
|
20
|
+
date: string;
|
|
21
|
+
/*
|
|
22
|
+
* Indica se o check-in foi realizado
|
|
23
|
+
* @example false
|
|
24
|
+
*/
|
|
25
|
+
checkinCompleted: boolean;
|
|
26
|
+
/*
|
|
27
|
+
* Indica se o check-out foi realizado
|
|
28
|
+
* @example false
|
|
29
|
+
*/
|
|
30
|
+
checkoutCompleted: boolean;
|
|
31
|
+
/*
|
|
32
|
+
* Status do agendamento
|
|
33
|
+
* @example 'pending'
|
|
34
|
+
*/
|
|
35
|
+
status: AppointmentStatusDto;
|
|
36
|
+
}
|
|
@@ -7,14 +7,9 @@ import {
|
|
|
7
7
|
IsOptional,
|
|
8
8
|
IsUUID,
|
|
9
9
|
} from 'class-validator';
|
|
10
|
+
import { APPOINTMENT_STATUSES, AppointmentStatusDto } from './appointment-status.dto';
|
|
11
|
+
|
|
10
12
|
|
|
11
|
-
export const APPOINTMENT_STATUSES = [
|
|
12
|
-
'pending',
|
|
13
|
-
'processing',
|
|
14
|
-
'sended',
|
|
15
|
-
'finished',
|
|
16
|
-
] as const;
|
|
17
|
-
export type AppointmentStatusDto = (typeof APPOINTMENT_STATUSES)[number];
|
|
18
13
|
|
|
19
14
|
export class CreateAppointmentDto {
|
|
20
15
|
@ApiProperty({
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ApiPropertyOptional } from '@nestjs/swagger';
|
|
2
2
|
import { IsBoolean, IsDateString, IsInt, IsOptional, IsUUID, Max, Min } from 'class-validator';
|
|
3
|
+
import { AppointmentDto } from './appointment.dto';
|
|
3
4
|
|
|
4
5
|
export class ListAppointmentsQueryDto {
|
|
5
6
|
@ApiPropertyOptional({
|
|
@@ -66,3 +67,10 @@ export class ListAppointmentsQueryDto {
|
|
|
66
67
|
@IsUUID('4')
|
|
67
68
|
patientId?: string;
|
|
68
69
|
}
|
|
70
|
+
|
|
71
|
+
export interface AppointmentListResult {
|
|
72
|
+
items: AppointmentDto[];
|
|
73
|
+
total: number;
|
|
74
|
+
page: number;
|
|
75
|
+
limit: number;
|
|
76
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
|
|
2
|
+
import {
|
|
3
|
+
BILLING_GATEWAYS,
|
|
4
|
+
BILLING_METHODS,
|
|
5
|
+
BILLING_STATUSES,
|
|
6
|
+
BillingGatewayDto,
|
|
7
|
+
BillingMethodDto,
|
|
8
|
+
BillingStatusDto,
|
|
9
|
+
} from './create-billing.dto';
|
|
10
|
+
|
|
11
|
+
export class BillingResponseDto {
|
|
12
|
+
@ApiProperty({
|
|
13
|
+
description: 'Billing ID (UUID)',
|
|
14
|
+
example: '550e8400-e29b-41d4-a716-446655440111',
|
|
15
|
+
})
|
|
16
|
+
id: string;
|
|
17
|
+
|
|
18
|
+
@ApiProperty({
|
|
19
|
+
description: 'Tenant ID (UUID)',
|
|
20
|
+
example: '550e8400-e29b-41d4-a716-446655440000',
|
|
21
|
+
})
|
|
22
|
+
tenantId: string;
|
|
23
|
+
|
|
24
|
+
@ApiProperty({
|
|
25
|
+
description: 'Billing value',
|
|
26
|
+
example: 99.9,
|
|
27
|
+
})
|
|
28
|
+
value: number;
|
|
29
|
+
|
|
30
|
+
@ApiProperty({
|
|
31
|
+
description: 'Billing status',
|
|
32
|
+
enum: BILLING_STATUSES,
|
|
33
|
+
example: 'PENDING',
|
|
34
|
+
})
|
|
35
|
+
status: BillingStatusDto;
|
|
36
|
+
|
|
37
|
+
@ApiProperty({
|
|
38
|
+
description: 'Payment method',
|
|
39
|
+
enum: BILLING_METHODS,
|
|
40
|
+
example: 'PIX',
|
|
41
|
+
})
|
|
42
|
+
method: BillingMethodDto;
|
|
43
|
+
|
|
44
|
+
@ApiProperty({
|
|
45
|
+
description: 'Payment gateway',
|
|
46
|
+
enum: BILLING_GATEWAYS,
|
|
47
|
+
example: 'ASAAS',
|
|
48
|
+
})
|
|
49
|
+
gateway: BillingGatewayDto;
|
|
50
|
+
|
|
51
|
+
@ApiProperty({
|
|
52
|
+
description: 'Due date (ISO 8601)',
|
|
53
|
+
example: '2026-04-15T00:00:00.000Z',
|
|
54
|
+
})
|
|
55
|
+
dueDate: string;
|
|
56
|
+
|
|
57
|
+
@ApiPropertyOptional({
|
|
58
|
+
description: 'Date when billing was paid (ISO 8601)',
|
|
59
|
+
example: '2026-04-14T10:00:00.000Z',
|
|
60
|
+
})
|
|
61
|
+
payedAt?: string | null;
|
|
62
|
+
|
|
63
|
+
@ApiProperty({
|
|
64
|
+
description: 'Creation timestamp (ISO 8601)',
|
|
65
|
+
example: '2026-03-14T12:00:00.000Z',
|
|
66
|
+
})
|
|
67
|
+
createdAt: string;
|
|
68
|
+
|
|
69
|
+
@ApiProperty({
|
|
70
|
+
description: 'Last update timestamp (ISO 8601)',
|
|
71
|
+
example: '2026-03-14T12:00:00.000Z',
|
|
72
|
+
})
|
|
73
|
+
updatedAt: string;
|
|
74
|
+
|
|
75
|
+
@ApiPropertyOptional({
|
|
76
|
+
description: 'Soft deletion timestamp (ISO 8601)',
|
|
77
|
+
example: null,
|
|
78
|
+
})
|
|
79
|
+
deletedAt?: string | null;
|
|
80
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
|
|
2
|
+
import {
|
|
3
|
+
IsDateString,
|
|
4
|
+
IsEnum,
|
|
5
|
+
IsNotEmpty,
|
|
6
|
+
IsNumber,
|
|
7
|
+
IsOptional,
|
|
8
|
+
IsUUID,
|
|
9
|
+
Min,
|
|
10
|
+
} from 'class-validator';
|
|
11
|
+
|
|
12
|
+
export const BILLING_STATUSES = [
|
|
13
|
+
'PENDING',
|
|
14
|
+
'PAYED',
|
|
15
|
+
'REFUNDED',
|
|
16
|
+
'CANCELED',
|
|
17
|
+
'OVERDUE',
|
|
18
|
+
] as const;
|
|
19
|
+
export type BillingStatusDto = (typeof BILLING_STATUSES)[number];
|
|
20
|
+
|
|
21
|
+
export const BILLING_METHODS = [
|
|
22
|
+
'PIX',
|
|
23
|
+
'CREDIT_CARD',
|
|
24
|
+
'DEBIT_CARD',
|
|
25
|
+
'VOUCHER',
|
|
26
|
+
'CASH',
|
|
27
|
+
] as const;
|
|
28
|
+
export type BillingMethodDto = (typeof BILLING_METHODS)[number];
|
|
29
|
+
|
|
30
|
+
export const BILLING_GATEWAYS = ['ASAAS', 'MERCADO_PAGO', 'STRIPE'] as const;
|
|
31
|
+
export type BillingGatewayDto = (typeof BILLING_GATEWAYS)[number];
|
|
32
|
+
|
|
33
|
+
export class CreateBillingDto {
|
|
34
|
+
@ApiProperty({
|
|
35
|
+
description: 'Tenant ID (UUID)',
|
|
36
|
+
example: '550e8400-e29b-41d4-a716-446655440000',
|
|
37
|
+
})
|
|
38
|
+
@IsUUID('4')
|
|
39
|
+
@IsNotEmpty()
|
|
40
|
+
tenantId: string;
|
|
41
|
+
|
|
42
|
+
@ApiProperty({
|
|
43
|
+
description: 'Billing value',
|
|
44
|
+
example: 99.9,
|
|
45
|
+
minimum: 0.01,
|
|
46
|
+
})
|
|
47
|
+
@IsNumber()
|
|
48
|
+
@Min(0.01)
|
|
49
|
+
value: number;
|
|
50
|
+
|
|
51
|
+
@ApiPropertyOptional({
|
|
52
|
+
description: 'Billing status',
|
|
53
|
+
enum: BILLING_STATUSES,
|
|
54
|
+
default: 'PENDING',
|
|
55
|
+
})
|
|
56
|
+
@IsOptional()
|
|
57
|
+
@IsEnum(BILLING_STATUSES)
|
|
58
|
+
status?: BillingStatusDto;
|
|
59
|
+
|
|
60
|
+
@ApiProperty({
|
|
61
|
+
description: 'Payment method',
|
|
62
|
+
enum: BILLING_METHODS,
|
|
63
|
+
example: 'PIX',
|
|
64
|
+
})
|
|
65
|
+
@IsEnum(BILLING_METHODS)
|
|
66
|
+
@IsNotEmpty()
|
|
67
|
+
method: BillingMethodDto;
|
|
68
|
+
|
|
69
|
+
@ApiProperty({
|
|
70
|
+
description: 'Payment gateway',
|
|
71
|
+
enum: BILLING_GATEWAYS,
|
|
72
|
+
example: 'ASAAS',
|
|
73
|
+
})
|
|
74
|
+
@IsEnum(BILLING_GATEWAYS)
|
|
75
|
+
@IsNotEmpty()
|
|
76
|
+
gateway: BillingGatewayDto;
|
|
77
|
+
|
|
78
|
+
@ApiProperty({
|
|
79
|
+
description: 'Due date (ISO 8601)',
|
|
80
|
+
example: '2026-04-15T00:00:00.000Z',
|
|
81
|
+
})
|
|
82
|
+
@IsDateString()
|
|
83
|
+
dueDate: string;
|
|
84
|
+
|
|
85
|
+
@ApiPropertyOptional({
|
|
86
|
+
description: 'Date when billing was paid (ISO 8601)',
|
|
87
|
+
example: '2026-04-14T10:00:00.000Z',
|
|
88
|
+
})
|
|
89
|
+
@IsOptional()
|
|
90
|
+
@IsDateString()
|
|
91
|
+
payedAt?: string;
|
|
92
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { ApiPropertyOptional } from '@nestjs/swagger';
|
|
2
|
+
import { IsEnum, IsInt, IsOptional, IsUUID, Max, Min } from 'class-validator';
|
|
3
|
+
import {
|
|
4
|
+
BILLING_GATEWAYS,
|
|
5
|
+
BILLING_METHODS,
|
|
6
|
+
BILLING_STATUSES,
|
|
7
|
+
BillingGatewayDto,
|
|
8
|
+
BillingMethodDto,
|
|
9
|
+
BillingStatusDto,
|
|
10
|
+
} from './create-billing.dto';
|
|
11
|
+
|
|
12
|
+
export class ListBillingsQueryDto {
|
|
13
|
+
@ApiPropertyOptional({
|
|
14
|
+
description: 'Tenant ID filter (UUID)',
|
|
15
|
+
example: '550e8400-e29b-41d4-a716-446655440000',
|
|
16
|
+
})
|
|
17
|
+
@IsOptional()
|
|
18
|
+
@IsUUID('4')
|
|
19
|
+
tenantId?: string;
|
|
20
|
+
|
|
21
|
+
@ApiPropertyOptional({
|
|
22
|
+
description: 'Billing status filter',
|
|
23
|
+
enum: BILLING_STATUSES,
|
|
24
|
+
example: 'PENDING',
|
|
25
|
+
})
|
|
26
|
+
@IsOptional()
|
|
27
|
+
@IsEnum(BILLING_STATUSES)
|
|
28
|
+
status?: BillingStatusDto;
|
|
29
|
+
|
|
30
|
+
@ApiPropertyOptional({
|
|
31
|
+
description: 'Billing method filter',
|
|
32
|
+
enum: BILLING_METHODS,
|
|
33
|
+
example: 'PIX',
|
|
34
|
+
})
|
|
35
|
+
@IsOptional()
|
|
36
|
+
@IsEnum(BILLING_METHODS)
|
|
37
|
+
method?: BillingMethodDto;
|
|
38
|
+
|
|
39
|
+
@ApiPropertyOptional({
|
|
40
|
+
description: 'Billing gateway filter',
|
|
41
|
+
enum: BILLING_GATEWAYS,
|
|
42
|
+
example: 'ASAAS',
|
|
43
|
+
})
|
|
44
|
+
@IsOptional()
|
|
45
|
+
@IsEnum(BILLING_GATEWAYS)
|
|
46
|
+
gateway?: BillingGatewayDto;
|
|
47
|
+
|
|
48
|
+
@ApiPropertyOptional({
|
|
49
|
+
description: 'Page number (starting at 1)',
|
|
50
|
+
example: 1,
|
|
51
|
+
minimum: 1,
|
|
52
|
+
default: 1,
|
|
53
|
+
})
|
|
54
|
+
@IsOptional()
|
|
55
|
+
@IsInt()
|
|
56
|
+
@Min(1)
|
|
57
|
+
page?: number;
|
|
58
|
+
|
|
59
|
+
@ApiPropertyOptional({
|
|
60
|
+
description: 'Number of records per page',
|
|
61
|
+
example: 20,
|
|
62
|
+
minimum: 1,
|
|
63
|
+
maximum: 100,
|
|
64
|
+
default: 20,
|
|
65
|
+
})
|
|
66
|
+
@IsOptional()
|
|
67
|
+
@IsInt()
|
|
68
|
+
@Min(1)
|
|
69
|
+
@Max(100)
|
|
70
|
+
limit?: number;
|
|
71
|
+
}
|
package/src/index.ts
CHANGED
|
Binary file
|
|
Binary file
|