tychat-contracts 1.0.85 → 1.0.87
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/billing/list-billings-query.dto.d.ts +3 -0
- package/dist/billing/list-billings-query.dto.d.ts.map +1 -1
- package/dist/billing/list-billings-query.dto.js +21 -0
- package/dist/cashback/cashback-balance-response.dto.d.ts +15 -0
- package/dist/cashback/cashback-balance-response.dto.d.ts.map +1 -0
- package/dist/cashback/cashback-balance-response.dto.js +64 -0
- package/dist/cashback/cashback-config-response.dto.d.ts +19 -0
- package/dist/cashback/cashback-config-response.dto.d.ts.map +1 -0
- package/dist/cashback/cashback-config-response.dto.js +80 -0
- package/dist/cashback/cashback-enums.d.ts +32 -0
- package/dist/cashback/cashback-enums.d.ts.map +1 -0
- package/dist/cashback/cashback-enums.js +37 -0
- package/dist/cashback/cashback-kafka-payloads.d.ts +83 -0
- package/dist/cashback/cashback-kafka-payloads.d.ts.map +1 -0
- package/dist/cashback/cashback-kafka-payloads.js +2 -0
- package/dist/cashback/cashback-kafka-topics.d.ts +18 -0
- package/dist/cashback/cashback-kafka-topics.d.ts.map +1 -0
- package/dist/cashback/cashback-kafka-topics.js +23 -0
- package/dist/cashback/index.d.ts +8 -0
- package/dist/cashback/index.d.ts.map +1 -0
- package/dist/cashback/index.js +23 -0
- package/dist/cashback/referral-code-response.dto.d.ts +21 -0
- package/dist/cashback/referral-code-response.dto.d.ts.map +1 -0
- package/dist/cashback/referral-code-response.dto.js +90 -0
- package/dist/cashback/use-referral-code-response.dto.d.ts +9 -0
- package/dist/cashback/use-referral-code-response.dto.d.ts.map +1 -0
- package/dist/cashback/use-referral-code-response.dto.js +34 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/payment-gateway/create-gateway-payment.dto.d.ts +1 -1
- package/dist/payment-gateway/create-gateway-payment.dto.d.ts.map +1 -1
- package/dist/payment-gateway/create-gateway-payment.dto.js +3 -3
- package/dist/payment-gateway/index.d.ts +5 -0
- package/dist/payment-gateway/index.d.ts.map +1 -1
- package/dist/payment-gateway/index.js +5 -0
- package/dist/payment-gateway/initiate-billing-payment-response.dto.d.ts +13 -0
- package/dist/payment-gateway/initiate-billing-payment-response.dto.d.ts.map +1 -0
- package/dist/payment-gateway/initiate-billing-payment-response.dto.js +48 -0
- package/dist/payment-gateway/initiate-billing-payment.mapper.d.ts +7 -0
- package/dist/payment-gateway/initiate-billing-payment.mapper.d.ts.map +1 -0
- package/dist/payment-gateway/initiate-billing-payment.mapper.js +17 -0
- package/dist/payment-gateway/payment-gateway-routing-matrix.d.ts +3 -0
- package/dist/payment-gateway/payment-gateway-routing-matrix.d.ts.map +1 -0
- package/dist/payment-gateway/payment-gateway-routing-matrix.js +15 -0
- package/dist/payment-gateway/payment-gateway-routing.dto.d.ts +14 -0
- package/dist/payment-gateway/payment-gateway-routing.dto.d.ts.map +1 -0
- package/dist/payment-gateway/payment-gateway-routing.dto.js +89 -0
- package/dist/payment-gateway/platform-configuration.topics.d.ts +3 -0
- package/dist/payment-gateway/platform-configuration.topics.d.ts.map +1 -0
- package/dist/payment-gateway/platform-configuration.topics.js +5 -0
- package/package.json +1 -1
- package/src/billing/list-billings-query.dto.ts +22 -0
- package/src/cashback/cashback-balance-response.dto.ts +33 -0
- package/src/cashback/cashback-config-response.dto.ts +43 -0
- package/src/cashback/cashback-enums.ts +33 -0
- package/src/cashback/cashback-kafka-payloads.ts +102 -0
- package/src/cashback/cashback-kafka-topics.ts +23 -0
- package/src/cashback/index.ts +7 -0
- package/src/cashback/referral-code-response.dto.ts +49 -0
- package/src/cashback/use-referral-code-response.dto.ts +15 -0
- package/src/index.ts +1 -0
- package/src/payment-gateway/create-gateway-payment.dto.ts +5 -4
- package/src/payment-gateway/index.ts +5 -0
- package/src/payment-gateway/initiate-billing-payment-response.dto.ts +25 -0
- package/src/payment-gateway/initiate-billing-payment.mapper.ts +19 -0
- package/src/payment-gateway/payment-gateway-routing-matrix.ts +18 -0
- package/src/payment-gateway/payment-gateway-routing.dto.ts +84 -0
- package/src/payment-gateway/platform-configuration.topics.ts +2 -0
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { BillingStatusDto } from './create-billing.dto';
|
|
2
|
+
import { type GatewayPaymentMethodDto, type PaymentGatewayDto } from '../payment-gateway/payment-gateway.enums';
|
|
2
3
|
export declare class ListBillingsQueryDto {
|
|
3
4
|
tenantId?: string;
|
|
4
5
|
status?: BillingStatusDto;
|
|
5
6
|
paymentId?: string;
|
|
7
|
+
method?: GatewayPaymentMethodDto;
|
|
8
|
+
gateway?: PaymentGatewayDto;
|
|
6
9
|
page?: number;
|
|
7
10
|
limit?: number;
|
|
8
11
|
}
|
|
@@ -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;
|
|
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"}
|
|
@@ -13,10 +13,13 @@ exports.ListBillingsQueryDto = void 0;
|
|
|
13
13
|
const swagger_1 = require("@nestjs/swagger");
|
|
14
14
|
const class_validator_1 = require("class-validator");
|
|
15
15
|
const create_billing_dto_1 = require("./create-billing.dto");
|
|
16
|
+
const payment_gateway_enums_1 = require("../payment-gateway/payment-gateway.enums");
|
|
16
17
|
class ListBillingsQueryDto {
|
|
17
18
|
tenantId;
|
|
18
19
|
status;
|
|
19
20
|
paymentId;
|
|
21
|
+
method;
|
|
22
|
+
gateway;
|
|
20
23
|
page;
|
|
21
24
|
limit;
|
|
22
25
|
}
|
|
@@ -49,6 +52,24 @@ __decorate([
|
|
|
49
52
|
(0, class_validator_1.IsUUID)('4'),
|
|
50
53
|
__metadata("design:type", String)
|
|
51
54
|
], ListBillingsQueryDto.prototype, "paymentId", void 0);
|
|
55
|
+
__decorate([
|
|
56
|
+
(0, swagger_1.ApiPropertyOptional)({
|
|
57
|
+
description: 'Filtro por método de pagamento associado à cobrança',
|
|
58
|
+
enum: payment_gateway_enums_1.GATEWAY_PAYMENT_METHODS,
|
|
59
|
+
}),
|
|
60
|
+
(0, class_validator_1.IsOptional)(),
|
|
61
|
+
(0, class_validator_1.IsEnum)(payment_gateway_enums_1.GATEWAY_PAYMENT_METHODS),
|
|
62
|
+
__metadata("design:type", String)
|
|
63
|
+
], 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);
|
|
52
73
|
__decorate([
|
|
53
74
|
(0, swagger_1.ApiPropertyOptional)({
|
|
54
75
|
description: 'Page number (starting at 1)',
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Response DTO for cashback balance
|
|
3
|
+
*/
|
|
4
|
+
export declare class CashbackBalanceResponseDto {
|
|
5
|
+
id: string;
|
|
6
|
+
patientId: string;
|
|
7
|
+
availableBalance: number;
|
|
8
|
+
pendingBalance: number;
|
|
9
|
+
totalEarned: number;
|
|
10
|
+
totalUsed: number;
|
|
11
|
+
totalExpired: number;
|
|
12
|
+
createdAt: string;
|
|
13
|
+
updatedAt: string;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=cashback-balance-response.dto.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cashback-balance-response.dto.d.ts","sourceRoot":"","sources":["../../src/cashback/cashback-balance-response.dto.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,qBAAa,0BAA0B;IAErC,EAAE,EAAE,MAAM,CAAC;IAGX,SAAS,EAAE,MAAM,CAAC;IAGlB,gBAAgB,EAAE,MAAM,CAAC;IAGzB,cAAc,EAAE,MAAM,CAAC;IAGvB,WAAW,EAAE,MAAM,CAAC;IAGpB,SAAS,EAAE,MAAM,CAAC;IAGlB,YAAY,EAAE,MAAM,CAAC;IAGrB,SAAS,EAAE,MAAM,CAAC;IAGlB,SAAS,EAAE,MAAM,CAAC;CACnB"}
|
|
@@ -0,0 +1,64 @@
|
|
|
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.CashbackBalanceResponseDto = void 0;
|
|
13
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
14
|
+
/**
|
|
15
|
+
* Response DTO for cashback balance
|
|
16
|
+
*/
|
|
17
|
+
class CashbackBalanceResponseDto {
|
|
18
|
+
id;
|
|
19
|
+
patientId;
|
|
20
|
+
availableBalance;
|
|
21
|
+
pendingBalance;
|
|
22
|
+
totalEarned;
|
|
23
|
+
totalUsed;
|
|
24
|
+
totalExpired;
|
|
25
|
+
createdAt;
|
|
26
|
+
updatedAt;
|
|
27
|
+
}
|
|
28
|
+
exports.CashbackBalanceResponseDto = CashbackBalanceResponseDto;
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, swagger_1.ApiProperty)({ description: 'Balance ID (UUID)' }),
|
|
31
|
+
__metadata("design:type", String)
|
|
32
|
+
], CashbackBalanceResponseDto.prototype, "id", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, swagger_1.ApiProperty)({ description: 'Patient ID' }),
|
|
35
|
+
__metadata("design:type", String)
|
|
36
|
+
], CashbackBalanceResponseDto.prototype, "patientId", void 0);
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, swagger_1.ApiProperty)({ description: 'Available (usable) balance' }),
|
|
39
|
+
__metadata("design:type", Number)
|
|
40
|
+
], CashbackBalanceResponseDto.prototype, "availableBalance", void 0);
|
|
41
|
+
__decorate([
|
|
42
|
+
(0, swagger_1.ApiProperty)({ description: 'Pending balance (future use)' }),
|
|
43
|
+
__metadata("design:type", Number)
|
|
44
|
+
], CashbackBalanceResponseDto.prototype, "pendingBalance", void 0);
|
|
45
|
+
__decorate([
|
|
46
|
+
(0, swagger_1.ApiProperty)({ description: 'Lifetime total earned' }),
|
|
47
|
+
__metadata("design:type", Number)
|
|
48
|
+
], CashbackBalanceResponseDto.prototype, "totalEarned", void 0);
|
|
49
|
+
__decorate([
|
|
50
|
+
(0, swagger_1.ApiProperty)({ description: 'Lifetime total used/redeemed' }),
|
|
51
|
+
__metadata("design:type", Number)
|
|
52
|
+
], CashbackBalanceResponseDto.prototype, "totalUsed", void 0);
|
|
53
|
+
__decorate([
|
|
54
|
+
(0, swagger_1.ApiProperty)({ description: 'Lifetime total expired' }),
|
|
55
|
+
__metadata("design:type", Number)
|
|
56
|
+
], CashbackBalanceResponseDto.prototype, "totalExpired", void 0);
|
|
57
|
+
__decorate([
|
|
58
|
+
(0, swagger_1.ApiProperty)({ description: 'Creation timestamp' }),
|
|
59
|
+
__metadata("design:type", String)
|
|
60
|
+
], CashbackBalanceResponseDto.prototype, "createdAt", void 0);
|
|
61
|
+
__decorate([
|
|
62
|
+
(0, swagger_1.ApiProperty)({ description: 'Last update timestamp' }),
|
|
63
|
+
__metadata("design:type", String)
|
|
64
|
+
], CashbackBalanceResponseDto.prototype, "updatedAt", void 0);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { CashbackDiscountTypeDto, CashbackExpirationTypeDto } from './cashback-enums';
|
|
2
|
+
/**
|
|
3
|
+
* Response DTO for cashback configuration
|
|
4
|
+
*/
|
|
5
|
+
export declare class CashbackConfigResponseDto {
|
|
6
|
+
id: string;
|
|
7
|
+
isActive: boolean;
|
|
8
|
+
cashbackPercentage: number;
|
|
9
|
+
discountType: CashbackDiscountTypeDto;
|
|
10
|
+
discountValue: number;
|
|
11
|
+
expirationType: CashbackExpirationTypeDto;
|
|
12
|
+
expirationDays?: number | null;
|
|
13
|
+
maxTotalUses?: number | null;
|
|
14
|
+
maxUsesPerPatient?: number | null;
|
|
15
|
+
codeExpirationDays?: number | null;
|
|
16
|
+
createdAt: string;
|
|
17
|
+
updatedAt: string;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=cashback-config-response.dto.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cashback-config-response.dto.d.ts","sourceRoot":"","sources":["../../src/cashback/cashback-config-response.dto.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,uBAAuB,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAEtF;;GAEG;AACH,qBAAa,yBAAyB;IAEpC,EAAE,EAAE,MAAM,CAAC;IAGX,QAAQ,EAAE,OAAO,CAAC;IAGlB,kBAAkB,EAAE,MAAM,CAAC;IAG3B,YAAY,EAAE,uBAAuB,CAAC;IAGtC,aAAa,EAAE,MAAM,CAAC;IAGtB,cAAc,EAAE,yBAAyB,CAAC;IAG1C,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAG/B,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAG7B,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAGlC,kBAAkB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAGnC,SAAS,EAAE,MAAM,CAAC;IAGlB,SAAS,EAAE,MAAM,CAAC;CACnB"}
|
|
@@ -0,0 +1,80 @@
|
|
|
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.CashbackConfigResponseDto = void 0;
|
|
13
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
14
|
+
const cashback_enums_1 = require("./cashback-enums");
|
|
15
|
+
/**
|
|
16
|
+
* Response DTO for cashback configuration
|
|
17
|
+
*/
|
|
18
|
+
class CashbackConfigResponseDto {
|
|
19
|
+
id;
|
|
20
|
+
isActive;
|
|
21
|
+
cashbackPercentage;
|
|
22
|
+
discountType;
|
|
23
|
+
discountValue;
|
|
24
|
+
expirationType;
|
|
25
|
+
expirationDays;
|
|
26
|
+
maxTotalUses;
|
|
27
|
+
maxUsesPerPatient;
|
|
28
|
+
codeExpirationDays;
|
|
29
|
+
createdAt;
|
|
30
|
+
updatedAt;
|
|
31
|
+
}
|
|
32
|
+
exports.CashbackConfigResponseDto = CashbackConfigResponseDto;
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, swagger_1.ApiProperty)({ description: 'Config ID (UUID)' }),
|
|
35
|
+
__metadata("design:type", String)
|
|
36
|
+
], CashbackConfigResponseDto.prototype, "id", void 0);
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, swagger_1.ApiProperty)({ description: 'Whether cashback system is active' }),
|
|
39
|
+
__metadata("design:type", Boolean)
|
|
40
|
+
], CashbackConfigResponseDto.prototype, "isActive", void 0);
|
|
41
|
+
__decorate([
|
|
42
|
+
(0, swagger_1.ApiProperty)({ description: 'Cashback percentage for referrer', example: 10.0 }),
|
|
43
|
+
__metadata("design:type", Number)
|
|
44
|
+
], CashbackConfigResponseDto.prototype, "cashbackPercentage", void 0);
|
|
45
|
+
__decorate([
|
|
46
|
+
(0, swagger_1.ApiProperty)({ description: 'Discount type for referred patient', enum: cashback_enums_1.CashbackDiscountTypeDto }),
|
|
47
|
+
__metadata("design:type", String)
|
|
48
|
+
], CashbackConfigResponseDto.prototype, "discountType", void 0);
|
|
49
|
+
__decorate([
|
|
50
|
+
(0, swagger_1.ApiProperty)({ description: 'Discount value', example: 10.0 }),
|
|
51
|
+
__metadata("design:type", Number)
|
|
52
|
+
], CashbackConfigResponseDto.prototype, "discountValue", void 0);
|
|
53
|
+
__decorate([
|
|
54
|
+
(0, swagger_1.ApiProperty)({ description: 'Expiration type', enum: cashback_enums_1.CashbackExpirationTypeDto }),
|
|
55
|
+
__metadata("design:type", String)
|
|
56
|
+
], CashbackConfigResponseDto.prototype, "expirationType", void 0);
|
|
57
|
+
__decorate([
|
|
58
|
+
(0, swagger_1.ApiPropertyOptional)({ description: 'Expiration days (PERIOD_PER_PATIENT)' }),
|
|
59
|
+
__metadata("design:type", Object)
|
|
60
|
+
], CashbackConfigResponseDto.prototype, "expirationDays", void 0);
|
|
61
|
+
__decorate([
|
|
62
|
+
(0, swagger_1.ApiPropertyOptional)({ description: 'Max total uses (LIMITED)' }),
|
|
63
|
+
__metadata("design:type", Object)
|
|
64
|
+
], CashbackConfigResponseDto.prototype, "maxTotalUses", void 0);
|
|
65
|
+
__decorate([
|
|
66
|
+
(0, swagger_1.ApiPropertyOptional)({ description: 'Max uses per patient (LIMITED)' }),
|
|
67
|
+
__metadata("design:type", Object)
|
|
68
|
+
], CashbackConfigResponseDto.prototype, "maxUsesPerPatient", void 0);
|
|
69
|
+
__decorate([
|
|
70
|
+
(0, swagger_1.ApiPropertyOptional)({ description: 'Code expiration days (LIMITED)' }),
|
|
71
|
+
__metadata("design:type", Object)
|
|
72
|
+
], CashbackConfigResponseDto.prototype, "codeExpirationDays", void 0);
|
|
73
|
+
__decorate([
|
|
74
|
+
(0, swagger_1.ApiProperty)({ description: 'Creation timestamp' }),
|
|
75
|
+
__metadata("design:type", String)
|
|
76
|
+
], CashbackConfigResponseDto.prototype, "createdAt", void 0);
|
|
77
|
+
__decorate([
|
|
78
|
+
(0, swagger_1.ApiProperty)({ description: 'Last update timestamp' }),
|
|
79
|
+
__metadata("design:type", String)
|
|
80
|
+
], CashbackConfigResponseDto.prototype, "updatedAt", void 0);
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Expiration type for referral codes
|
|
3
|
+
*/
|
|
4
|
+
export declare enum CashbackExpirationTypeDto {
|
|
5
|
+
/** Each referred patient can only use the code once */
|
|
6
|
+
SINGLE_USE_PER_PATIENT = "SINGLE_USE_PER_PATIENT",
|
|
7
|
+
/** Code stays active for a limited period per patient */
|
|
8
|
+
PERIOD_PER_PATIENT = "PERIOD_PER_PATIENT",
|
|
9
|
+
/** Code has total use limit and optional per-patient limit */
|
|
10
|
+
LIMITED = "LIMITED"
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Discount type for referred patients
|
|
14
|
+
*/
|
|
15
|
+
export declare enum CashbackDiscountTypeDto {
|
|
16
|
+
/** Discount is a percentage of the checkout amount */
|
|
17
|
+
PERCENTAGE = "PERCENTAGE",
|
|
18
|
+
/** Discount is a fixed amount */
|
|
19
|
+
FIXED = "FIXED"
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Cashback ledger transaction type
|
|
23
|
+
*/
|
|
24
|
+
export declare enum CashbackLedgerTypeDto {
|
|
25
|
+
/** Cashback earned from referral */
|
|
26
|
+
CREDIT = "CREDIT",
|
|
27
|
+
/** Cashback redeemed/used */
|
|
28
|
+
DEBIT = "DEBIT",
|
|
29
|
+
/** Credits expired */
|
|
30
|
+
EXPIRATION = "EXPIRATION"
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=cashback-enums.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cashback-enums.d.ts","sourceRoot":"","sources":["../../src/cashback/cashback-enums.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,oBAAY,yBAAyB;IACnC,uDAAuD;IACvD,sBAAsB,2BAA2B;IACjD,yDAAyD;IACzD,kBAAkB,uBAAuB;IACzC,8DAA8D;IAC9D,OAAO,YAAY;CACpB;AAED;;GAEG;AACH,oBAAY,uBAAuB;IACjC,sDAAsD;IACtD,UAAU,eAAe;IACzB,iCAAiC;IACjC,KAAK,UAAU;CAChB;AAED;;GAEG;AACH,oBAAY,qBAAqB;IAC/B,oCAAoC;IACpC,MAAM,WAAW;IACjB,6BAA6B;IAC7B,KAAK,UAAU;IACf,sBAAsB;IACtB,UAAU,eAAe;CAC1B"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CashbackLedgerTypeDto = exports.CashbackDiscountTypeDto = exports.CashbackExpirationTypeDto = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Expiration type for referral codes
|
|
6
|
+
*/
|
|
7
|
+
var CashbackExpirationTypeDto;
|
|
8
|
+
(function (CashbackExpirationTypeDto) {
|
|
9
|
+
/** Each referred patient can only use the code once */
|
|
10
|
+
CashbackExpirationTypeDto["SINGLE_USE_PER_PATIENT"] = "SINGLE_USE_PER_PATIENT";
|
|
11
|
+
/** Code stays active for a limited period per patient */
|
|
12
|
+
CashbackExpirationTypeDto["PERIOD_PER_PATIENT"] = "PERIOD_PER_PATIENT";
|
|
13
|
+
/** Code has total use limit and optional per-patient limit */
|
|
14
|
+
CashbackExpirationTypeDto["LIMITED"] = "LIMITED";
|
|
15
|
+
})(CashbackExpirationTypeDto || (exports.CashbackExpirationTypeDto = CashbackExpirationTypeDto = {}));
|
|
16
|
+
/**
|
|
17
|
+
* Discount type for referred patients
|
|
18
|
+
*/
|
|
19
|
+
var CashbackDiscountTypeDto;
|
|
20
|
+
(function (CashbackDiscountTypeDto) {
|
|
21
|
+
/** Discount is a percentage of the checkout amount */
|
|
22
|
+
CashbackDiscountTypeDto["PERCENTAGE"] = "PERCENTAGE";
|
|
23
|
+
/** Discount is a fixed amount */
|
|
24
|
+
CashbackDiscountTypeDto["FIXED"] = "FIXED";
|
|
25
|
+
})(CashbackDiscountTypeDto || (exports.CashbackDiscountTypeDto = CashbackDiscountTypeDto = {}));
|
|
26
|
+
/**
|
|
27
|
+
* Cashback ledger transaction type
|
|
28
|
+
*/
|
|
29
|
+
var CashbackLedgerTypeDto;
|
|
30
|
+
(function (CashbackLedgerTypeDto) {
|
|
31
|
+
/** Cashback earned from referral */
|
|
32
|
+
CashbackLedgerTypeDto["CREDIT"] = "CREDIT";
|
|
33
|
+
/** Cashback redeemed/used */
|
|
34
|
+
CashbackLedgerTypeDto["DEBIT"] = "DEBIT";
|
|
35
|
+
/** Credits expired */
|
|
36
|
+
CashbackLedgerTypeDto["EXPIRATION"] = "EXPIRATION";
|
|
37
|
+
})(CashbackLedgerTypeDto || (exports.CashbackLedgerTypeDto = CashbackLedgerTypeDto = {}));
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { CashbackDiscountTypeDto, CashbackExpirationTypeDto } from './cashback-enums';
|
|
2
|
+
export interface GetCashbackConfigPayload {
|
|
3
|
+
tenant: string;
|
|
4
|
+
}
|
|
5
|
+
export interface UpdateCashbackConfigPayload {
|
|
6
|
+
tenant: string;
|
|
7
|
+
isActive?: boolean;
|
|
8
|
+
cashbackPercentage?: number;
|
|
9
|
+
discountType?: CashbackDiscountTypeDto;
|
|
10
|
+
discountValue?: number;
|
|
11
|
+
expirationType?: CashbackExpirationTypeDto;
|
|
12
|
+
expirationDays?: number | null;
|
|
13
|
+
maxTotalUses?: number | null;
|
|
14
|
+
maxUsesPerPatient?: number | null;
|
|
15
|
+
codeExpirationDays?: number | null;
|
|
16
|
+
}
|
|
17
|
+
export interface GenerateReferralCodePayload {
|
|
18
|
+
tenant: string;
|
|
19
|
+
patientId: string;
|
|
20
|
+
/** Se true, não cria código novo quando cashback global está inativo (resposta null). */
|
|
21
|
+
onlyIfActive?: boolean;
|
|
22
|
+
}
|
|
23
|
+
export interface ValidateReferralCodePayload {
|
|
24
|
+
tenant: string;
|
|
25
|
+
code: string;
|
|
26
|
+
referredPatientId: string;
|
|
27
|
+
}
|
|
28
|
+
export interface UseReferralCodePayload {
|
|
29
|
+
tenant: string;
|
|
30
|
+
code: string;
|
|
31
|
+
referredPatientId: string;
|
|
32
|
+
checkoutId: string;
|
|
33
|
+
checkoutAmount: number;
|
|
34
|
+
}
|
|
35
|
+
/** Vínculo de código no cadastro do paciente (sem checkout). */
|
|
36
|
+
export interface LinkReferralAtRegistrationPayload {
|
|
37
|
+
tenant: string;
|
|
38
|
+
code: string;
|
|
39
|
+
referredPatientId: string;
|
|
40
|
+
}
|
|
41
|
+
export interface GetReferralByPatientPayload {
|
|
42
|
+
tenant: string;
|
|
43
|
+
patientId: string;
|
|
44
|
+
}
|
|
45
|
+
export interface GetReferralByCodePayload {
|
|
46
|
+
tenant: string;
|
|
47
|
+
code: string;
|
|
48
|
+
}
|
|
49
|
+
export interface GetReferralUsagesPayload {
|
|
50
|
+
tenant: string;
|
|
51
|
+
referralCodeId: string;
|
|
52
|
+
}
|
|
53
|
+
export interface GetCashbackBalancePayload {
|
|
54
|
+
tenant: string;
|
|
55
|
+
patientId: string;
|
|
56
|
+
}
|
|
57
|
+
export interface CreditCashbackPayload {
|
|
58
|
+
tenant: string;
|
|
59
|
+
patientId: string;
|
|
60
|
+
amount: number;
|
|
61
|
+
description: string;
|
|
62
|
+
referenceId?: string;
|
|
63
|
+
referenceType?: string;
|
|
64
|
+
expiresAt?: string;
|
|
65
|
+
}
|
|
66
|
+
export interface DebitCashbackPayload {
|
|
67
|
+
tenant: string;
|
|
68
|
+
patientId: string;
|
|
69
|
+
amount: number;
|
|
70
|
+
description: string;
|
|
71
|
+
referenceId?: string;
|
|
72
|
+
referenceType?: string;
|
|
73
|
+
}
|
|
74
|
+
export interface GetCashbackLedgerPayload {
|
|
75
|
+
tenant: string;
|
|
76
|
+
patientId: string;
|
|
77
|
+
page?: number;
|
|
78
|
+
limit?: number;
|
|
79
|
+
}
|
|
80
|
+
export interface ExpireCashbackCreditsPayload {
|
|
81
|
+
tenant: string;
|
|
82
|
+
}
|
|
83
|
+
//# sourceMappingURL=cashback-kafka-payloads.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cashback-kafka-payloads.d.ts","sourceRoot":"","sources":["../../src/cashback/cashback-kafka-payloads.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAItF,MAAM,WAAW,wBAAwB;IACvC,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,2BAA2B;IAC1C,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,YAAY,CAAC,EAAE,uBAAuB,CAAC;IACvC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,cAAc,CAAC,EAAE,yBAAyB,CAAC;IAC3C,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,kBAAkB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACpC;AAID,MAAM,WAAW,2BAA2B;IAC1C,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,yFAAyF;IACzF,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,2BAA2B;IAC1C,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,iBAAiB,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,iBAAiB,EAAE,MAAM,CAAC;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,gEAAgE;AAChE,MAAM,WAAW,iCAAiC;IAChD,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,iBAAiB,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,WAAW,2BAA2B;IAC1C,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,wBAAwB;IACvC,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,wBAAwB;IACvC,MAAM,EAAE,MAAM,CAAC;IACf,cAAc,EAAE,MAAM,CAAC;CACxB;AAID,MAAM,WAAW,yBAAyB;IACxC,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,wBAAwB;IACvC,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,4BAA4B;IAC3C,MAAM,EAAE,MAAM,CAAC;CAChB"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Kafka topic constants for the cashback microservice.
|
|
3
|
+
* All topics follow the pattern: cashback.<module>.<action>
|
|
4
|
+
*/
|
|
5
|
+
export declare const TOPIC_CASHBACK_CONFIG_GET = "cashback.config.get";
|
|
6
|
+
export declare const TOPIC_CASHBACK_CONFIG_UPDATE = "cashback.config.update";
|
|
7
|
+
export declare const TOPIC_CASHBACK_REFERRAL_GENERATE = "cashback.referral.generate";
|
|
8
|
+
export declare const TOPIC_CASHBACK_REFERRAL_VALIDATE = "cashback.referral.validate";
|
|
9
|
+
export declare const TOPIC_CASHBACK_REFERRAL_USE = "cashback.referral.use";
|
|
10
|
+
export declare const TOPIC_CASHBACK_REFERRAL_GET_BY_PATIENT = "cashback.referral.getByPatient";
|
|
11
|
+
export declare const TOPIC_CASHBACK_REFERRAL_GET_BY_CODE = "cashback.referral.getByCode";
|
|
12
|
+
export declare const TOPIC_CASHBACK_REFERRAL_GET_USAGES = "cashback.referral.getUsagesByCode";
|
|
13
|
+
export declare const TOPIC_CASHBACK_BALANCE_GET = "cashback.balance.get";
|
|
14
|
+
export declare const TOPIC_CASHBACK_BALANCE_CREDIT = "cashback.balance.credit";
|
|
15
|
+
export declare const TOPIC_CASHBACK_BALANCE_DEBIT = "cashback.balance.debit";
|
|
16
|
+
export declare const TOPIC_CASHBACK_LEDGER_GET = "cashback.ledger.get";
|
|
17
|
+
export declare const TOPIC_CASHBACK_CREDITS_EXPIRE = "cashback.credits.expire";
|
|
18
|
+
//# sourceMappingURL=cashback-kafka-topics.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cashback-kafka-topics.d.ts","sourceRoot":"","sources":["../../src/cashback/cashback-kafka-topics.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,eAAO,MAAM,yBAAyB,wBAAwB,CAAC;AAC/D,eAAO,MAAM,4BAA4B,2BAA2B,CAAC;AAGrE,eAAO,MAAM,gCAAgC,+BAA+B,CAAC;AAC7E,eAAO,MAAM,gCAAgC,+BAA+B,CAAC;AAC7E,eAAO,MAAM,2BAA2B,0BAA0B,CAAC;AACnE,eAAO,MAAM,sCAAsC,mCAAmC,CAAC;AACvF,eAAO,MAAM,mCAAmC,gCAAgC,CAAC;AACjF,eAAO,MAAM,kCAAkC,sCAAsC,CAAC;AAGtF,eAAO,MAAM,0BAA0B,yBAAyB,CAAC;AACjE,eAAO,MAAM,6BAA6B,4BAA4B,CAAC;AACvE,eAAO,MAAM,4BAA4B,2BAA2B,CAAC;AACrE,eAAO,MAAM,yBAAyB,wBAAwB,CAAC;AAC/D,eAAO,MAAM,6BAA6B,4BAA4B,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Kafka topic constants for the cashback microservice.
|
|
4
|
+
* All topics follow the pattern: cashback.<module>.<action>
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.TOPIC_CASHBACK_CREDITS_EXPIRE = exports.TOPIC_CASHBACK_LEDGER_GET = exports.TOPIC_CASHBACK_BALANCE_DEBIT = exports.TOPIC_CASHBACK_BALANCE_CREDIT = exports.TOPIC_CASHBACK_BALANCE_GET = exports.TOPIC_CASHBACK_REFERRAL_GET_USAGES = exports.TOPIC_CASHBACK_REFERRAL_GET_BY_CODE = exports.TOPIC_CASHBACK_REFERRAL_GET_BY_PATIENT = exports.TOPIC_CASHBACK_REFERRAL_USE = exports.TOPIC_CASHBACK_REFERRAL_VALIDATE = exports.TOPIC_CASHBACK_REFERRAL_GENERATE = exports.TOPIC_CASHBACK_CONFIG_UPDATE = exports.TOPIC_CASHBACK_CONFIG_GET = void 0;
|
|
8
|
+
// ─── Promotion / Config ───
|
|
9
|
+
exports.TOPIC_CASHBACK_CONFIG_GET = 'cashback.config.get';
|
|
10
|
+
exports.TOPIC_CASHBACK_CONFIG_UPDATE = 'cashback.config.update';
|
|
11
|
+
// ─── Referral ───
|
|
12
|
+
exports.TOPIC_CASHBACK_REFERRAL_GENERATE = 'cashback.referral.generate';
|
|
13
|
+
exports.TOPIC_CASHBACK_REFERRAL_VALIDATE = 'cashback.referral.validate';
|
|
14
|
+
exports.TOPIC_CASHBACK_REFERRAL_USE = 'cashback.referral.use';
|
|
15
|
+
exports.TOPIC_CASHBACK_REFERRAL_GET_BY_PATIENT = 'cashback.referral.getByPatient';
|
|
16
|
+
exports.TOPIC_CASHBACK_REFERRAL_GET_BY_CODE = 'cashback.referral.getByCode';
|
|
17
|
+
exports.TOPIC_CASHBACK_REFERRAL_GET_USAGES = 'cashback.referral.getUsagesByCode';
|
|
18
|
+
// ─── Balance / Ledger ───
|
|
19
|
+
exports.TOPIC_CASHBACK_BALANCE_GET = 'cashback.balance.get';
|
|
20
|
+
exports.TOPIC_CASHBACK_BALANCE_CREDIT = 'cashback.balance.credit';
|
|
21
|
+
exports.TOPIC_CASHBACK_BALANCE_DEBIT = 'cashback.balance.debit';
|
|
22
|
+
exports.TOPIC_CASHBACK_LEDGER_GET = 'cashback.ledger.get';
|
|
23
|
+
exports.TOPIC_CASHBACK_CREDITS_EXPIRE = 'cashback.credits.expire';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from './cashback-enums';
|
|
2
|
+
export * from './cashback-kafka-topics';
|
|
3
|
+
export * from './cashback-kafka-payloads';
|
|
4
|
+
export * from './cashback-config-response.dto';
|
|
5
|
+
export * from './referral-code-response.dto';
|
|
6
|
+
export * from './use-referral-code-response.dto';
|
|
7
|
+
export * from './cashback-balance-response.dto';
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cashback/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,yBAAyB,CAAC;AACxC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,kCAAkC,CAAC;AACjD,cAAc,iCAAiC,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
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("./cashback-enums"), exports);
|
|
18
|
+
__exportStar(require("./cashback-kafka-topics"), exports);
|
|
19
|
+
__exportStar(require("./cashback-kafka-payloads"), exports);
|
|
20
|
+
__exportStar(require("./cashback-config-response.dto"), exports);
|
|
21
|
+
__exportStar(require("./referral-code-response.dto"), exports);
|
|
22
|
+
__exportStar(require("./use-referral-code-response.dto"), exports);
|
|
23
|
+
__exportStar(require("./cashback-balance-response.dto"), exports);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { CashbackDiscountTypeDto, CashbackExpirationTypeDto } from './cashback-enums';
|
|
2
|
+
/**
|
|
3
|
+
* Response DTO for a referral code
|
|
4
|
+
*/
|
|
5
|
+
export declare class ReferralCodeResponseDto {
|
|
6
|
+
id: string;
|
|
7
|
+
patientId: string;
|
|
8
|
+
code: string;
|
|
9
|
+
cashbackPercentage: number;
|
|
10
|
+
discountType: CashbackDiscountTypeDto;
|
|
11
|
+
discountValue: number;
|
|
12
|
+
expirationType: CashbackExpirationTypeDto;
|
|
13
|
+
expirationDays?: number | null;
|
|
14
|
+
maxTotalUses?: number | null;
|
|
15
|
+
maxUsesPerPatient?: number | null;
|
|
16
|
+
codeExpiresAt?: string | null;
|
|
17
|
+
totalUsesCount: number;
|
|
18
|
+
isActive: boolean;
|
|
19
|
+
createdAt: string;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=referral-code-response.dto.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"referral-code-response.dto.d.ts","sourceRoot":"","sources":["../../src/cashback/referral-code-response.dto.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,uBAAuB,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAEtF;;GAEG;AACH,qBAAa,uBAAuB;IAElC,EAAE,EAAE,MAAM,CAAC;IAGX,SAAS,EAAE,MAAM,CAAC;IAGlB,IAAI,EAAE,MAAM,CAAC;IAGb,kBAAkB,EAAE,MAAM,CAAC;IAG3B,YAAY,EAAE,uBAAuB,CAAC;IAGtC,aAAa,EAAE,MAAM,CAAC;IAGtB,cAAc,EAAE,yBAAyB,CAAC;IAG1C,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAG/B,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAG7B,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAGlC,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAG9B,cAAc,EAAE,MAAM,CAAC;IAGvB,QAAQ,EAAE,OAAO,CAAC;IAGlB,SAAS,EAAE,MAAM,CAAC;CACnB"}
|
|
@@ -0,0 +1,90 @@
|
|
|
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.ReferralCodeResponseDto = void 0;
|
|
13
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
14
|
+
const cashback_enums_1 = require("./cashback-enums");
|
|
15
|
+
/**
|
|
16
|
+
* Response DTO for a referral code
|
|
17
|
+
*/
|
|
18
|
+
class ReferralCodeResponseDto {
|
|
19
|
+
id;
|
|
20
|
+
patientId;
|
|
21
|
+
code;
|
|
22
|
+
cashbackPercentage;
|
|
23
|
+
discountType;
|
|
24
|
+
discountValue;
|
|
25
|
+
expirationType;
|
|
26
|
+
expirationDays;
|
|
27
|
+
maxTotalUses;
|
|
28
|
+
maxUsesPerPatient;
|
|
29
|
+
codeExpiresAt;
|
|
30
|
+
totalUsesCount;
|
|
31
|
+
isActive;
|
|
32
|
+
createdAt;
|
|
33
|
+
}
|
|
34
|
+
exports.ReferralCodeResponseDto = ReferralCodeResponseDto;
|
|
35
|
+
__decorate([
|
|
36
|
+
(0, swagger_1.ApiProperty)({ description: 'Referral code ID (UUID)' }),
|
|
37
|
+
__metadata("design:type", String)
|
|
38
|
+
], ReferralCodeResponseDto.prototype, "id", void 0);
|
|
39
|
+
__decorate([
|
|
40
|
+
(0, swagger_1.ApiProperty)({ description: 'Patient ID who owns this code' }),
|
|
41
|
+
__metadata("design:type", String)
|
|
42
|
+
], ReferralCodeResponseDto.prototype, "patientId", void 0);
|
|
43
|
+
__decorate([
|
|
44
|
+
(0, swagger_1.ApiProperty)({ description: 'The 8-character referral code', example: 'ABCD1234' }),
|
|
45
|
+
__metadata("design:type", String)
|
|
46
|
+
], ReferralCodeResponseDto.prototype, "code", void 0);
|
|
47
|
+
__decorate([
|
|
48
|
+
(0, swagger_1.ApiProperty)({ description: 'Cashback percentage snapshot' }),
|
|
49
|
+
__metadata("design:type", Number)
|
|
50
|
+
], ReferralCodeResponseDto.prototype, "cashbackPercentage", void 0);
|
|
51
|
+
__decorate([
|
|
52
|
+
(0, swagger_1.ApiProperty)({ description: 'Discount type snapshot', enum: cashback_enums_1.CashbackDiscountTypeDto }),
|
|
53
|
+
__metadata("design:type", String)
|
|
54
|
+
], ReferralCodeResponseDto.prototype, "discountType", void 0);
|
|
55
|
+
__decorate([
|
|
56
|
+
(0, swagger_1.ApiProperty)({ description: 'Discount value snapshot' }),
|
|
57
|
+
__metadata("design:type", Number)
|
|
58
|
+
], ReferralCodeResponseDto.prototype, "discountValue", void 0);
|
|
59
|
+
__decorate([
|
|
60
|
+
(0, swagger_1.ApiProperty)({ description: 'Expiration type snapshot', enum: cashback_enums_1.CashbackExpirationTypeDto }),
|
|
61
|
+
__metadata("design:type", String)
|
|
62
|
+
], ReferralCodeResponseDto.prototype, "expirationType", void 0);
|
|
63
|
+
__decorate([
|
|
64
|
+
(0, swagger_1.ApiPropertyOptional)({ description: 'Expiration days snapshot' }),
|
|
65
|
+
__metadata("design:type", Object)
|
|
66
|
+
], ReferralCodeResponseDto.prototype, "expirationDays", void 0);
|
|
67
|
+
__decorate([
|
|
68
|
+
(0, swagger_1.ApiPropertyOptional)({ description: 'Max total uses snapshot' }),
|
|
69
|
+
__metadata("design:type", Object)
|
|
70
|
+
], ReferralCodeResponseDto.prototype, "maxTotalUses", void 0);
|
|
71
|
+
__decorate([
|
|
72
|
+
(0, swagger_1.ApiPropertyOptional)({ description: 'Max uses per patient snapshot' }),
|
|
73
|
+
__metadata("design:type", Object)
|
|
74
|
+
], ReferralCodeResponseDto.prototype, "maxUsesPerPatient", void 0);
|
|
75
|
+
__decorate([
|
|
76
|
+
(0, swagger_1.ApiPropertyOptional)({ description: 'Code expiration date' }),
|
|
77
|
+
__metadata("design:type", Object)
|
|
78
|
+
], ReferralCodeResponseDto.prototype, "codeExpiresAt", void 0);
|
|
79
|
+
__decorate([
|
|
80
|
+
(0, swagger_1.ApiProperty)({ description: 'Total number of times used' }),
|
|
81
|
+
__metadata("design:type", Number)
|
|
82
|
+
], ReferralCodeResponseDto.prototype, "totalUsesCount", void 0);
|
|
83
|
+
__decorate([
|
|
84
|
+
(0, swagger_1.ApiProperty)({ description: 'Whether code is active' }),
|
|
85
|
+
__metadata("design:type", Boolean)
|
|
86
|
+
], ReferralCodeResponseDto.prototype, "isActive", void 0);
|
|
87
|
+
__decorate([
|
|
88
|
+
(0, swagger_1.ApiProperty)({ description: 'Creation timestamp' }),
|
|
89
|
+
__metadata("design:type", String)
|
|
90
|
+
], ReferralCodeResponseDto.prototype, "createdAt", void 0);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-referral-code-response.dto.d.ts","sourceRoot":"","sources":["../../src/cashback/use-referral-code-response.dto.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,qBAAa,0BAA0B;IAErC,cAAc,EAAE,MAAM,CAAC;IAGvB,cAAc,EAAE,MAAM,CAAC;IAGvB,iBAAiB,EAAE,MAAM,CAAC;CAC3B"}
|