@explorins/pers-shared 2.1.85 → 2.1.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/cjs/shared-lib/dto/analytics/retention-analytics.dto.d.ts +16 -5
- package/dist/cjs/shared-lib/dto/analytics/retention-analytics.dto.d.ts.map +1 -1
- package/dist/cjs/shared-lib/dto/analytics/retention-analytics.dto.js +41 -33
- package/dist/cjs/shared-lib/dto/analytics/retention-analytics.dto.js.map +1 -1
- package/dist/cjs/shared-lib/dto/pagination/pagination.response.dto.d.ts +12 -2
- package/dist/cjs/shared-lib/dto/pagination/pagination.response.dto.d.ts.map +1 -1
- package/dist/cjs/shared-lib/dto/pagination/pagination.response.dto.js +16 -3
- package/dist/cjs/shared-lib/dto/pagination/pagination.response.dto.js.map +1 -1
- package/dist/cjs/shared-lib/dto/transaction/transaction.dto.d.ts +5 -0
- package/dist/cjs/shared-lib/dto/transaction/transaction.dto.d.ts.map +1 -1
- package/dist/cjs/shared-lib/dto/transaction/transaction.dto.js +43 -0
- package/dist/cjs/shared-lib/dto/transaction/transaction.dto.js.map +1 -1
- package/dist/cjs/shared-lib/types/index.d.ts +1 -0
- package/dist/cjs/shared-lib/types/index.d.ts.map +1 -1
- package/dist/cjs/shared-lib/types/index.js +1 -0
- package/dist/cjs/shared-lib/types/index.js.map +1 -1
- package/dist/cjs/shared-lib/types/transaction-include-relation.type.d.ts +29 -0
- package/dist/cjs/shared-lib/types/transaction-include-relation.type.d.ts.map +1 -0
- package/dist/cjs/shared-lib/types/transaction-include-relation.type.js +19 -0
- package/dist/cjs/shared-lib/types/transaction-include-relation.type.js.map +1 -0
- package/dist/esm/shared-lib/dto/analytics/retention-analytics.dto.d.ts +16 -5
- package/dist/esm/shared-lib/dto/analytics/retention-analytics.dto.d.ts.map +1 -1
- package/dist/esm/shared-lib/dto/analytics/retention-analytics.dto.js +36 -28
- package/dist/esm/shared-lib/dto/analytics/retention-analytics.dto.js.map +1 -1
- package/dist/esm/shared-lib/dto/pagination/pagination.response.dto.d.ts +12 -2
- package/dist/esm/shared-lib/dto/pagination/pagination.response.dto.d.ts.map +1 -1
- package/dist/esm/shared-lib/dto/pagination/pagination.response.dto.js +15 -3
- package/dist/esm/shared-lib/dto/pagination/pagination.response.dto.js.map +1 -1
- package/dist/esm/shared-lib/dto/transaction/transaction.dto.d.ts +5 -0
- package/dist/esm/shared-lib/dto/transaction/transaction.dto.d.ts.map +1 -1
- package/dist/esm/shared-lib/dto/transaction/transaction.dto.js +41 -1
- package/dist/esm/shared-lib/dto/transaction/transaction.dto.js.map +1 -1
- package/dist/esm/shared-lib/types/index.d.ts +1 -0
- package/dist/esm/shared-lib/types/index.d.ts.map +1 -1
- package/dist/esm/shared-lib/types/index.js +1 -0
- package/dist/esm/shared-lib/types/index.js.map +1 -1
- package/dist/esm/shared-lib/types/transaction-include-relation.type.d.ts +29 -0
- package/dist/esm/shared-lib/types/transaction-include-relation.type.d.ts.map +1 -0
- package/dist/esm/shared-lib/types/transaction-include-relation.type.js +15 -0
- package/dist/esm/shared-lib/types/transaction-include-relation.type.js.map +1 -0
- package/package.json +1 -1
|
@@ -25,15 +25,26 @@ export declare class RetentionAnalyticsRequestDTO {
|
|
|
25
25
|
monthsBack?: number;
|
|
26
26
|
filters?: RetentionAnalyticsFiltersDTO;
|
|
27
27
|
}
|
|
28
|
+
/**
|
|
29
|
+
* Retention data for a month offset within a cohort
|
|
30
|
+
* Tracks how many users from the original cohort are still active
|
|
31
|
+
*/
|
|
32
|
+
export declare class CohortRetentionMonthDTO {
|
|
33
|
+
retainedUsers: number;
|
|
34
|
+
retentionRate: number;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Cohort retention result for a single month
|
|
38
|
+
* Contains the cohort (new users in month) and their retention over subsequent months
|
|
39
|
+
*/
|
|
28
40
|
export declare class RetentionMonthResultDTO {
|
|
29
41
|
monthKey: string;
|
|
30
42
|
startDate: Date;
|
|
31
43
|
endDate: Date;
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
transactionCount: number;
|
|
44
|
+
cohortSize: number;
|
|
45
|
+
monthlyRetention: {
|
|
46
|
+
[monthOffset: string]: CohortRetentionMonthDTO;
|
|
47
|
+
};
|
|
37
48
|
byTriggerType?: {
|
|
38
49
|
[key: string]: {
|
|
39
50
|
count: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"retention-analytics.dto.d.ts","sourceRoot":"","sources":["../../../../../src/shared-lib/dto/analytics/retention-analytics.dto.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAErE,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAE7D;;;;;;;;;;;;;;;GAeG;AAIH,qBAAa,4BAA4B;IAQvC,SAAS,CAAC,EAAE,eAAe,CAAC;IAQ5B,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAID,qBAAa,4BAA4B;IAOvC,UAAU,CAAC,EAAE,IAAI,CAAC;IAalB,UAAU,CAAC,EAAE,MAAM,CAAC;IASpB,OAAO,CAAC,EAAE,4BAA4B,CAAC;CACxC;AAID,qBAAa,uBAAuB;IAKlC,
|
|
1
|
+
{"version":3,"file":"retention-analytics.dto.d.ts","sourceRoot":"","sources":["../../../../../src/shared-lib/dto/analytics/retention-analytics.dto.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAErE,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAE7D;;;;;;;;;;;;;;;GAeG;AAIH,qBAAa,4BAA4B;IAQvC,SAAS,CAAC,EAAE,eAAe,CAAC;IAQ5B,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAID,qBAAa,4BAA4B;IAOvC,UAAU,CAAC,EAAE,IAAI,CAAC;IAalB,UAAU,CAAC,EAAE,MAAM,CAAC;IASpB,OAAO,CAAC,EAAE,4BAA4B,CAAC;CACxC;AAID;;;GAGG;AACH,qBAAa,uBAAuB;IAKlC,aAAa,EAAG,MAAM,CAAC;IAMvB,aAAa,EAAG,MAAM,CAAC;CACxB;AAED;;;GAGG;AACH,qBAAa,uBAAuB;IAKlC,QAAQ,EAAG,MAAM,CAAC;IAMlB,SAAS,EAAG,IAAI,CAAC;IAMjB,OAAO,EAAG,IAAI,CAAC;IAMf,UAAU,EAAG,MAAM,CAAC;IAWpB,gBAAgB,EAAG;QACjB,CAAC,WAAW,EAAE,MAAM,GAAG,uBAAuB,CAAC;KAChD,CAAC;IASF,aAAa,CAAC,EAAE;QACd,CAAC,GAAG,EAAE,MAAM,GAAG;YACb,KAAK,EAAE,MAAM,CAAC;YACd,WAAW,EAAE,MAAM,CAAC;SACrB,CAAC;KACH,CAAC;CACH;AAID,qBAAa,6BAA6B;IAKxC,OAAO,EAAG,uBAAuB,EAAE,CAAC;IAMpC,WAAW,EAAG,MAAM,CAAC;IAMrB,QAAQ,EAAG,qBAAqB,GAAG;QACjC;;WAEG;QACH,iBAAiB,EAAE,gBAAgB,CAAC;KACrC,CAAC;CACH"}
|
|
@@ -9,7 +9,7 @@ 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.RetentionAnalyticsResponseDTO = exports.RetentionMonthResultDTO = exports.RetentionAnalyticsRequestDTO = exports.RetentionAnalyticsFiltersDTO = void 0;
|
|
12
|
+
exports.RetentionAnalyticsResponseDTO = exports.RetentionMonthResultDTO = exports.CohortRetentionMonthDTO = exports.RetentionAnalyticsRequestDTO = exports.RetentionAnalyticsFiltersDTO = void 0;
|
|
13
13
|
const class_validator_1 = require("class-validator");
|
|
14
14
|
const class_transformer_1 = require("class-transformer");
|
|
15
15
|
const swagger_1 = require("@nestjs/swagger");
|
|
@@ -96,15 +96,39 @@ __decorate([
|
|
|
96
96
|
__metadata("design:type", RetentionAnalyticsFiltersDTO)
|
|
97
97
|
], RetentionAnalyticsRequestDTO.prototype, "filters", void 0);
|
|
98
98
|
// ========== MONTH RESULT ==========
|
|
99
|
+
/**
|
|
100
|
+
* Retention data for a month offset within a cohort
|
|
101
|
+
* Tracks how many users from the original cohort are still active
|
|
102
|
+
*/
|
|
103
|
+
class CohortRetentionMonthDTO {
|
|
104
|
+
retainedUsers;
|
|
105
|
+
retentionRate;
|
|
106
|
+
}
|
|
107
|
+
exports.CohortRetentionMonthDTO = CohortRetentionMonthDTO;
|
|
108
|
+
__decorate([
|
|
109
|
+
(0, swagger_1.ApiProperty)({
|
|
110
|
+
description: 'Number of users from original cohort still active in this month offset',
|
|
111
|
+
example: 85
|
|
112
|
+
}),
|
|
113
|
+
__metadata("design:type", Number)
|
|
114
|
+
], CohortRetentionMonthDTO.prototype, "retainedUsers", void 0);
|
|
115
|
+
__decorate([
|
|
116
|
+
(0, swagger_1.ApiProperty)({
|
|
117
|
+
description: 'Retention rate: (retainedUsers / cohortSize) * 100',
|
|
118
|
+
example: 70.8
|
|
119
|
+
}),
|
|
120
|
+
__metadata("design:type", Number)
|
|
121
|
+
], CohortRetentionMonthDTO.prototype, "retentionRate", void 0);
|
|
122
|
+
/**
|
|
123
|
+
* Cohort retention result for a single month
|
|
124
|
+
* Contains the cohort (new users in month) and their retention over subsequent months
|
|
125
|
+
*/
|
|
99
126
|
class RetentionMonthResultDTO {
|
|
100
127
|
monthKey;
|
|
101
128
|
startDate;
|
|
102
129
|
endDate;
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
returningUsers;
|
|
106
|
-
retentionRate;
|
|
107
|
-
transactionCount;
|
|
130
|
+
cohortSize;
|
|
131
|
+
monthlyRetention;
|
|
108
132
|
byTriggerType;
|
|
109
133
|
}
|
|
110
134
|
exports.RetentionMonthResultDTO = RetentionMonthResultDTO;
|
|
@@ -131,39 +155,23 @@ __decorate([
|
|
|
131
155
|
], RetentionMonthResultDTO.prototype, "endDate", void 0);
|
|
132
156
|
__decorate([
|
|
133
157
|
(0, swagger_1.ApiProperty)({
|
|
134
|
-
description: '
|
|
135
|
-
example: 450
|
|
136
|
-
}),
|
|
137
|
-
__metadata("design:type", Number)
|
|
138
|
-
], RetentionMonthResultDTO.prototype, "activeUsers", void 0);
|
|
139
|
-
__decorate([
|
|
140
|
-
(0, swagger_1.ApiProperty)({
|
|
141
|
-
description: 'Number of users making their first transaction ever',
|
|
158
|
+
description: 'Number of users who made their first transaction in this month (cohort size)',
|
|
142
159
|
example: 120
|
|
143
160
|
}),
|
|
144
161
|
__metadata("design:type", Number)
|
|
145
|
-
], RetentionMonthResultDTO.prototype, "
|
|
146
|
-
__decorate([
|
|
147
|
-
(0, swagger_1.ApiProperty)({
|
|
148
|
-
description: 'Number of users who were active in previous month and returned',
|
|
149
|
-
example: 330
|
|
150
|
-
}),
|
|
151
|
-
__metadata("design:type", Number)
|
|
152
|
-
], RetentionMonthResultDTO.prototype, "returningUsers", void 0);
|
|
162
|
+
], RetentionMonthResultDTO.prototype, "cohortSize", void 0);
|
|
153
163
|
__decorate([
|
|
154
164
|
(0, swagger_1.ApiProperty)({
|
|
155
|
-
description: 'Retention
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
description: 'Total number of transactions in this month',
|
|
163
|
-
example: 1250
|
|
165
|
+
description: 'Retention data for this cohort over subsequent months. Key is month offset (0=same month, 1=next month, 2=2 months later, etc.)',
|
|
166
|
+
type: 'object',
|
|
167
|
+
example: {
|
|
168
|
+
'0': { retainedUsers: 120, retentionRate: 100 },
|
|
169
|
+
'1': { retainedUsers: 85, retentionRate: 70.8 },
|
|
170
|
+
'2': { retainedUsers: 65, retentionRate: 54.2 }
|
|
171
|
+
}
|
|
164
172
|
}),
|
|
165
|
-
__metadata("design:type",
|
|
166
|
-
], RetentionMonthResultDTO.prototype, "
|
|
173
|
+
__metadata("design:type", Object)
|
|
174
|
+
], RetentionMonthResultDTO.prototype, "monthlyRetention", void 0);
|
|
167
175
|
__decorate([
|
|
168
176
|
(0, swagger_1.ApiPropertyOptional)({
|
|
169
177
|
description: 'Breakdown of transactions by trigger type',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"retention-analytics.dto.js","sourceRoot":"","sources":["../../../../../src/shared-lib/dto/analytics/retention-analytics.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAA8G;AAC9G,yDAAyC;AACzC,6CAAmE;AAEnE,qEAAiE;AAGjE;;;;;;;;;;;;;;;GAeG;AAEH,wCAAwC;AAExC,MAAa,4BAA4B;IAQvC,SAAS,CAAmB;IAQ5B,kBAAkB,CAAU;CAC7B;AAjBD,oEAiBC;AATC;IAPC,IAAA,6BAAmB,EAAC;QACnB,WAAW,EAAE,+BAA+B;QAC5C,IAAI,EAAE,oCAAgB;QACtB,OAAO,EAAE,oCAAgB,CAAC,MAAM;KACjC,CAAC;IACD,IAAA,4BAAU,GAAE;IACZ,IAAA,wBAAM,EAAC,oCAAgB,CAAC;;+DACG;AAQ5B;IANC,IAAA,6BAAmB,EAAC;QACnB,WAAW,EAAE,gCAAgC;QAC7C,OAAO,EAAE,UAAU;KACpB,CAAC;IACD,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;wEACiB;AAG9B,gCAAgC;AAEhC,MAAa,4BAA4B;IAOvC,UAAU,CAAQ;IAalB,UAAU,CAAU;IASpB,OAAO,CAAgC;CACxC;AA9BD,oEA8BC;AAvBC;IANC,IAAA,6BAAmB,EAAC;QACnB,WAAW,EAAE,mEAAmE;QAChF,OAAO,EAAE,sBAAsB;KAChC,CAAC;IACD,IAAA,4BAAU,GAAE;IACZ,IAAA,8BAAY,GAAE;8BACF,IAAI;gEAAC;AAalB;IAXC,IAAA,6BAAmB,EAAC;QACnB,WAAW,EAAE,iDAAiD;QAC9D,OAAO,EAAE,CAAC;QACV,OAAO,EAAE,EAAE;QACX,OAAO,EAAE,EAAE;QACX,OAAO,EAAE,EAAE;KACZ,CAAC;IACD,IAAA,4BAAU,GAAE;IACZ,IAAA,uBAAK,GAAE;IACP,IAAA,qBAAG,EAAC,CAAC,CAAC;IACN,IAAA,qBAAG,EAAC,EAAE,CAAC;;gEACY;AASpB;IAPC,IAAA,6BAAmB,EAAC;QACnB,WAAW,EAAE,sCAAsC;QACnD,IAAI,EAAE,4BAA4B;KACnC,CAAC;IACD,IAAA,4BAAU,GAAE;IACZ,IAAA,gCAAc,GAAE;IAChB,IAAA,wBAAI,EAAC,GAAG,EAAE,CAAC,4BAA4B,CAAC;8BAC/B,4BAA4B;6DAAC;AAGzC,qCAAqC;AAErC,MAAa,uBAAuB;IAKlC,
|
|
1
|
+
{"version":3,"file":"retention-analytics.dto.js","sourceRoot":"","sources":["../../../../../src/shared-lib/dto/analytics/retention-analytics.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAA8G;AAC9G,yDAAyC;AACzC,6CAAmE;AAEnE,qEAAiE;AAGjE;;;;;;;;;;;;;;;GAeG;AAEH,wCAAwC;AAExC,MAAa,4BAA4B;IAQvC,SAAS,CAAmB;IAQ5B,kBAAkB,CAAU;CAC7B;AAjBD,oEAiBC;AATC;IAPC,IAAA,6BAAmB,EAAC;QACnB,WAAW,EAAE,+BAA+B;QAC5C,IAAI,EAAE,oCAAgB;QACtB,OAAO,EAAE,oCAAgB,CAAC,MAAM;KACjC,CAAC;IACD,IAAA,4BAAU,GAAE;IACZ,IAAA,wBAAM,EAAC,oCAAgB,CAAC;;+DACG;AAQ5B;IANC,IAAA,6BAAmB,EAAC;QACnB,WAAW,EAAE,gCAAgC;QAC7C,OAAO,EAAE,UAAU;KACpB,CAAC;IACD,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;wEACiB;AAG9B,gCAAgC;AAEhC,MAAa,4BA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AAI,EAAE,CAAC,uBAAuB,CAAC;KAChC,CAAC;;8DACkC;AAMpC;IAJC,IAAA,qBAAW,EAAC;QACX,WAAW,EAAE,iCAAiC;QAC9C,OAAO,EAAE,EAAE;KACZ,CAAC;;kEACmB;AAMrB;IAJC,IAAA,qBAAW,EAAC;QACX,WAAW,EAAE,gBAAgB;QAC7B,IAAI,EAAE,QAAQ;KACf,CAAC;;+DAMA"}
|
|
@@ -5,11 +5,21 @@ import { type PaginatedResponse, type PaginationMetadata } from "../../interface
|
|
|
5
5
|
export declare class PaginatedResponseDTO<T> implements PaginatedResponse<T> {
|
|
6
6
|
readonly data: ReadonlyArray<T>;
|
|
7
7
|
readonly pagination: PaginationMetadata;
|
|
8
|
-
|
|
8
|
+
readonly metadata?: {
|
|
9
|
+
includes?: string[];
|
|
10
|
+
[key: string]: any;
|
|
11
|
+
};
|
|
12
|
+
constructor(data: T[], page: number | null, limit: number | null, total: number, metadata?: {
|
|
13
|
+
includes?: string[];
|
|
14
|
+
[key: string]: any;
|
|
15
|
+
});
|
|
9
16
|
/**
|
|
10
17
|
* ✅ FACTORY: Create paginated response from service layer
|
|
11
18
|
*/
|
|
12
|
-
static create<T>(data: T[], page: number, limit: number, total: number
|
|
19
|
+
static create<T>(data: T[], page: number, limit: number, total: number, metadata?: {
|
|
20
|
+
includes?: string[];
|
|
21
|
+
[key: string]: any;
|
|
22
|
+
}): PaginatedResponseDTO<T>;
|
|
13
23
|
/**
|
|
14
24
|
* ✅ FACTORY: Create empty paginated response
|
|
15
25
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pagination.response.dto.d.ts","sourceRoot":"","sources":["../../../../../src/shared-lib/dto/pagination/pagination.response.dto.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,iBAAiB,EAAE,KAAK,kBAAkB,EAAE,MAAM,4CAA4C,CAAC;AAG7G;;GAEG;AACH,qBAAa,oBAAoB,CAAC,CAAC,CAAE,YAAW,iBAAiB,CAA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AK,CAAC,CAAC,EAAE,IAAI,GAAE,MAAU,EAAE,KAAK,GAAE,MAAW,GAAG,oBAAoB,CAAC,CAAC,CAAC;CAG/E"}
|
|
@@ -17,7 +17,8 @@ const swagger_1 = require("@nestjs/swagger");
|
|
|
17
17
|
class PaginatedResponseDTO {
|
|
18
18
|
data;
|
|
19
19
|
pagination;
|
|
20
|
-
|
|
20
|
+
metadata;
|
|
21
|
+
constructor(data, page, limit, total, metadata) {
|
|
21
22
|
this.data = Object.freeze([...data]);
|
|
22
23
|
this.pagination = Object.freeze({
|
|
23
24
|
page,
|
|
@@ -27,12 +28,13 @@ class PaginatedResponseDTO {
|
|
|
27
28
|
hasNext: (page || 1) * (limit || 1) < total,
|
|
28
29
|
hasPrev: (page || 1) > 1
|
|
29
30
|
});
|
|
31
|
+
this.metadata = metadata ? Object.freeze(metadata) : undefined;
|
|
30
32
|
}
|
|
31
33
|
/**
|
|
32
34
|
* ✅ FACTORY: Create paginated response from service layer
|
|
33
35
|
*/
|
|
34
|
-
static create(data, page, limit, total) {
|
|
35
|
-
return new PaginatedResponseDTO(data, page, limit, total);
|
|
36
|
+
static create(data, page, limit, total, metadata) {
|
|
37
|
+
return new PaginatedResponseDTO(data, page, limit, total, metadata);
|
|
36
38
|
}
|
|
37
39
|
/**
|
|
38
40
|
* ✅ FACTORY: Create empty paginated response
|
|
@@ -63,4 +65,15 @@ __decorate([
|
|
|
63
65
|
}),
|
|
64
66
|
__metadata("design:type", Object)
|
|
65
67
|
], PaginatedResponseDTO.prototype, "pagination", void 0);
|
|
68
|
+
__decorate([
|
|
69
|
+
(0, swagger_1.ApiProperty)({
|
|
70
|
+
description: 'Additional metadata (e.g., enriched relations)',
|
|
71
|
+
required: false,
|
|
72
|
+
nullable: true,
|
|
73
|
+
example: {
|
|
74
|
+
includes: ['sender', 'recipient']
|
|
75
|
+
}
|
|
76
|
+
}),
|
|
77
|
+
__metadata("design:type", Object)
|
|
78
|
+
], PaginatedResponseDTO.prototype, "metadata", void 0);
|
|
66
79
|
//# sourceMappingURL=pagination.response.dto.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pagination.response.dto.js","sourceRoot":"","sources":["../../../../../src/shared-lib/dto/pagination/pagination.response.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAA8C;AAI9C;;GAEG;AACH,MAAa,oBAAoB;IAKtB,IAAI,CAAmB;IAavB,UAAU,CAAqB;
|
|
1
|
+
{"version":3,"file":"pagination.response.dto.js","sourceRoot":"","sources":["../../../../../src/shared-lib/dto/pagination/pagination.response.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAA8C;AAI9C;;GAEG;AACH,MAAa,oBAAoB;IAKtB,IAAI,CAAmB;IAavB,UAAU,CAAqB;IAU/B,QAAQ,CAGf;IAEF,YACE,IAAS,EACT,IAAmB,EACnB,KAAoB,EACpB,KAAa,EACb,QAAsD;QAEtD,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC;QACrC,IAAI,CAAC,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC;YAC9B,IAAI;YACJ,KAAK;YACL,KAAK;YACL,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC;YACtC,OAAO,EAAE,CAAC,IAAI,IAAI,CAAC,CAAC,GAAG,CAAC,KAAK,IAAI,CAAC,CAAC,GAAG,KAAK;YAC3C,OAAO,EAAE,CAAC,IAAI,IAAI,CAAC,CAAC,GAAG,CAAC;SACzB,CAAC,CAAC;QACH,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IACjE,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,MAAM,CACX,IAAS,EACT,IAAY,EACZ,KAAa,EACb,KAAa,EACb,QAAsD;QAEtD,OAAO,IAAI,oBAAoB,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;IACtE,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,KAAK,CAAI,OAAe,CAAC,EAAE,QAAgB,EAAE;QAClD,OAAO,IAAI,oBAAoB,CAAC,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC;IACtD,CAAC;CACF;AAvED,oDAuEC;AAlEU;IAJR,IAAA,qBAAW,EAAC;QACX,WAAW,EAAE,qBAAqB;QAClC,IAAI,EAAE,OAAO;KACd,CAAC;;kDAC8B;AAavB;IAXR,IAAA,qBAAW,EAAC;QACX,WAAW,EAAE,qBAAqB;QAClC,OAAO,EAAE;YACP,IAAI,EAAE,CAAC;YACP,KAAK,EAAE,EAAE;YACT,KAAK,EAAE,GAAG;YACV,KAAK,EAAE,CAAC;YACR,OAAO,EAAE,IAAI;YACb,OAAO,EAAE,KAAK;SACf;KACF,CAAC;;wDACsC;AAU/B;IARR,IAAA,qBAAW,EAAC;QACX,WAAW,EAAE,gDAAgD;QAC7D,QAAQ,EAAE,KAAK;QACf,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE;YACP,QAAQ,EAAE,CAAC,QAAQ,EAAE,WAAW,CAAC;SAClC;KACF,CAAC;;sDAIA"}
|
|
@@ -4,6 +4,8 @@ import { TransactionTriggerProcessType } from "../../enum/transaction-trigger-pr
|
|
|
4
4
|
import type { NativeTokenType } from "../../types/native-token.type";
|
|
5
5
|
import { AccountOwnerType } from "../../enum";
|
|
6
6
|
import { TransactionCompleteFields } from "../../interfaces/transaction.interface";
|
|
7
|
+
import { UserDTO } from "../user.dto";
|
|
8
|
+
import { BusinessDTO } from "../business/business.dto";
|
|
7
9
|
export declare class TransactionDTO implements TransactionCompleteFields {
|
|
8
10
|
amount: number | null;
|
|
9
11
|
id: string;
|
|
@@ -29,5 +31,8 @@ export declare class TransactionDTO implements TransactionCompleteFields {
|
|
|
29
31
|
engagedBusinessId: string | null;
|
|
30
32
|
authorizedSubmitterId: string | null;
|
|
31
33
|
authorizedSubmitterType: AccountOwnerType | null;
|
|
34
|
+
sender?: UserDTO | BusinessDTO;
|
|
35
|
+
recipient?: UserDTO | BusinessDTO;
|
|
36
|
+
engagedBusiness?: BusinessDTO;
|
|
32
37
|
}
|
|
33
38
|
//# sourceMappingURL=transaction.dto.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transaction.dto.d.ts","sourceRoot":"","sources":["../../../../../src/shared-lib/dto/transaction/transaction.dto.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AACvE,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AACvE,OAAO,EAAE,6BAA6B,EAAE,MAAM,kDAAkD,CAAC;AACjG,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"transaction.dto.d.ts","sourceRoot":"","sources":["../../../../../src/shared-lib/dto/transaction/transaction.dto.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AACvE,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AACvE,OAAO,EAAE,6BAA6B,EAAE,MAAM,kDAAkD,CAAC;AACjG,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,EAAE,yBAAyB,EAAE,MAAM,wCAAwC,CAAC;AACnF,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEvD,qBAAa,cAAe,YAAW,yBAAyB;IAG5D,MAAM,EAAE,MAAM,GAAG,IAAI,CAAO;IAG5B,EAA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
|
16
16
|
const transaction_trigger_process_type_enum_1 = require("../../enum/transaction-trigger-process-type.enum");
|
|
17
17
|
const enum_1 = require("../../enum");
|
|
18
|
+
const user_dto_1 = require("../user.dto");
|
|
19
|
+
const business_dto_1 = require("../business/business.dto");
|
|
18
20
|
class TransactionDTO {
|
|
19
21
|
amount = null;
|
|
20
22
|
id = '';
|
|
@@ -40,6 +42,14 @@ class TransactionDTO {
|
|
|
40
42
|
engagedBusinessId = null;
|
|
41
43
|
authorizedSubmitterId = null;
|
|
42
44
|
authorizedSubmitterType = null;
|
|
45
|
+
// =====================================
|
|
46
|
+
// OPTIONAL ENRICHMENT FIELDS
|
|
47
|
+
// =====================================
|
|
48
|
+
// Only populated when include query param is specified
|
|
49
|
+
// e.g., GET /transactions?include=sender,recipient,business
|
|
50
|
+
sender;
|
|
51
|
+
recipient;
|
|
52
|
+
engagedBusiness;
|
|
43
53
|
}
|
|
44
54
|
exports.TransactionDTO = TransactionDTO;
|
|
45
55
|
__decorate([
|
|
@@ -181,4 +191,37 @@ __decorate([
|
|
|
181
191
|
}),
|
|
182
192
|
__metadata("design:type", Object)
|
|
183
193
|
], TransactionDTO.prototype, "authorizedSubmitterType", void 0);
|
|
194
|
+
__decorate([
|
|
195
|
+
(0, swagger_1.ApiProperty)({
|
|
196
|
+
description: 'Enriched sender entity (User or Business). Only populated when include=sender is specified. Type is determined by senderOwnerType field.',
|
|
197
|
+
required: false,
|
|
198
|
+
nullable: true,
|
|
199
|
+
oneOf: [
|
|
200
|
+
{ $ref: (0, swagger_1.getSchemaPath)(user_dto_1.UserDTO) },
|
|
201
|
+
{ $ref: (0, swagger_1.getSchemaPath)(business_dto_1.BusinessDTO) }
|
|
202
|
+
]
|
|
203
|
+
}),
|
|
204
|
+
__metadata("design:type", Object)
|
|
205
|
+
], TransactionDTO.prototype, "sender", void 0);
|
|
206
|
+
__decorate([
|
|
207
|
+
(0, swagger_1.ApiProperty)({
|
|
208
|
+
description: 'Enriched recipient entity (User or Business). Only populated when include=recipient is specified. Type is determined by recipientOwnerType field.',
|
|
209
|
+
required: false,
|
|
210
|
+
nullable: true,
|
|
211
|
+
oneOf: [
|
|
212
|
+
{ $ref: (0, swagger_1.getSchemaPath)(user_dto_1.UserDTO) },
|
|
213
|
+
{ $ref: (0, swagger_1.getSchemaPath)(business_dto_1.BusinessDTO) }
|
|
214
|
+
]
|
|
215
|
+
}),
|
|
216
|
+
__metadata("design:type", Object)
|
|
217
|
+
], TransactionDTO.prototype, "recipient", void 0);
|
|
218
|
+
__decorate([
|
|
219
|
+
(0, swagger_1.ApiProperty)({
|
|
220
|
+
description: 'Enriched engaged business entity. Only populated when include=business is specified.',
|
|
221
|
+
required: false,
|
|
222
|
+
nullable: true,
|
|
223
|
+
type: () => business_dto_1.BusinessDTO
|
|
224
|
+
}),
|
|
225
|
+
__metadata("design:type", business_dto_1.BusinessDTO)
|
|
226
|
+
], TransactionDTO.prototype, "engagedBusiness", void 0);
|
|
184
227
|
//# sourceMappingURL=transaction.dto.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transaction.dto.js","sourceRoot":"","sources":["../../../../../src/shared-lib/dto/transaction/transaction.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"transaction.dto.js","sourceRoot":"","sources":["../../../../../src/shared-lib/dto/transaction/transaction.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAA4D;AAC5D,4EAAuE;AACvE,gFAAuE;AACvE,4GAAiG;AAEjG,qCAA8C;AAE9C,0CAAsC;AACtC,2DAAuD;AAEvD,MAAa,cAAc;IAGvB,MAAM,GAAkB,IAAI,CAAA;IAG5B,EAAE,GAAW,EAAE,CAAA;IAGf,YAAY,GAAW,EAAE,CAAA;IAMzB,eAAe,GAAkB,IAAI,CAAA;IAKrC,SAAS,GAA2B,IAAI,CAAA;IAGxC,aAAa,GAAW,EAAE,CAAA;IAG1B,gBAAgB,GAAkB,IAAI,CAAA;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AW;KAC1B,CAAC;8BACgB,0BAAW;uDAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/shared-lib/types/index.ts"],"names":[],"mappings":"AACA,cAAc,kBAAkB,CAAC;AACjC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,yBAAyB,CAAC;AACxC,cAAc,WAAW,CAAC;AAC1B,cAAc,6BAA6B,CAAC;AAC5C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/shared-lib/types/index.ts"],"names":[],"mappings":"AACA,cAAc,kBAAkB,CAAC;AACjC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,yBAAyB,CAAC;AACxC,cAAc,WAAW,CAAC;AAC1B,cAAc,6BAA6B,CAAC;AAC5C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,qCAAqC,CAAC"}
|
|
@@ -24,4 +24,5 @@ __exportStar(require("./domains"), exports);
|
|
|
24
24
|
__exportStar(require("./query-specification.types"), exports);
|
|
25
25
|
__exportStar(require("./transaction-filters.type"), exports);
|
|
26
26
|
__exportStar(require("./includable-relation.type"), exports);
|
|
27
|
+
__exportStar(require("./transaction-include-relation.type"), exports);
|
|
27
28
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/shared-lib/types/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mDAAmD;AACnD,mDAAiC;AACjC,gEAA8C;AAC9C,sDAAoC;AACpC,mDAAiC;AACjC,0DAAwC;AACxC,4CAA0B;AAC1B,8DAA4C;AAC5C,6DAA2C;AAC3C,6DAA2C"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/shared-lib/types/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mDAAmD;AACnD,mDAAiC;AACjC,gEAA8C;AAC9C,sDAAoC;AACpC,mDAAiC;AACjC,0DAAwC;AACxC,4CAA0B;AAC1B,8DAA4C;AAC5C,6DAA2C;AAC3C,6DAA2C;AAC3C,sEAAoD"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TRANSACTION INCLUDE RELATION TYPE
|
|
3
|
+
*
|
|
4
|
+
* Type-safe relations for optional enrichment in transaction queries.
|
|
5
|
+
* Prevents typos and provides IDE autocomplete.
|
|
6
|
+
*
|
|
7
|
+
* Usage:
|
|
8
|
+
* ```
|
|
9
|
+
* GET /transactions?include=sender,recipient,business
|
|
10
|
+
*
|
|
11
|
+
* include: ['sender', 'recipient'] // ✅ Type-safe
|
|
12
|
+
* include: ['snder'] // ❌ Compile error
|
|
13
|
+
* ```
|
|
14
|
+
*
|
|
15
|
+
* Relations:
|
|
16
|
+
* - sender: Enriches transaction sender (polymorphic: UserDTO | BusinessDTO)
|
|
17
|
+
* - recipient: Enriches transaction recipient (polymorphic: UserDTO | BusinessDTO)
|
|
18
|
+
* - business: Enriches engaged business (BusinessDTO)
|
|
19
|
+
*/
|
|
20
|
+
export type TransactionIncludeRelation = 'sender' | 'recipient' | 'business';
|
|
21
|
+
/**
|
|
22
|
+
* Valid transaction relations for runtime validation
|
|
23
|
+
*/
|
|
24
|
+
export declare const VALID_TRANSACTION_RELATIONS: readonly TransactionIncludeRelation[];
|
|
25
|
+
/**
|
|
26
|
+
* Type guard to validate relation strings at runtime
|
|
27
|
+
*/
|
|
28
|
+
export declare function isValidTransactionRelation(value: string): value is TransactionIncludeRelation;
|
|
29
|
+
//# sourceMappingURL=transaction-include-relation.type.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transaction-include-relation.type.d.ts","sourceRoot":"","sources":["../../../../src/shared-lib/types/transaction-include-relation.type.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,MAAM,0BAA0B,GAAG,QAAQ,GAAG,WAAW,GAAG,UAAU,CAAC;AAE7E;;GAEG;AACH,eAAO,MAAM,2BAA2B,EAAE,SAAS,0BAA0B,EAInE,CAAC;AAEX;;GAEG;AACH,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,0BAA0B,CAE7F"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.VALID_TRANSACTION_RELATIONS = void 0;
|
|
4
|
+
exports.isValidTransactionRelation = isValidTransactionRelation;
|
|
5
|
+
/**
|
|
6
|
+
* Valid transaction relations for runtime validation
|
|
7
|
+
*/
|
|
8
|
+
exports.VALID_TRANSACTION_RELATIONS = [
|
|
9
|
+
'sender',
|
|
10
|
+
'recipient',
|
|
11
|
+
'business'
|
|
12
|
+
];
|
|
13
|
+
/**
|
|
14
|
+
* Type guard to validate relation strings at runtime
|
|
15
|
+
*/
|
|
16
|
+
function isValidTransactionRelation(value) {
|
|
17
|
+
return exports.VALID_TRANSACTION_RELATIONS.includes(value);
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=transaction-include-relation.type.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transaction-include-relation.type.js","sourceRoot":"","sources":["../../../../src/shared-lib/types/transaction-include-relation.type.ts"],"names":[],"mappings":";;;AAiCA,gEAEC;AAdD;;GAEG;AACU,QAAA,2BAA2B,GAA0C;IAChF,QAAQ;IACR,WAAW;IACX,UAAU;CACF,CAAC;AAEX;;GAEG;AACH,SAAgB,0BAA0B,CAAC,KAAa;IACtD,OAAO,mCAA2B,CAAC,QAAQ,CAAC,KAAmC,CAAC,CAAC;AACnF,CAAC"}
|
|
@@ -25,15 +25,26 @@ export declare class RetentionAnalyticsRequestDTO {
|
|
|
25
25
|
monthsBack?: number;
|
|
26
26
|
filters?: RetentionAnalyticsFiltersDTO;
|
|
27
27
|
}
|
|
28
|
+
/**
|
|
29
|
+
* Retention data for a month offset within a cohort
|
|
30
|
+
* Tracks how many users from the original cohort are still active
|
|
31
|
+
*/
|
|
32
|
+
export declare class CohortRetentionMonthDTO {
|
|
33
|
+
retainedUsers: number;
|
|
34
|
+
retentionRate: number;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Cohort retention result for a single month
|
|
38
|
+
* Contains the cohort (new users in month) and their retention over subsequent months
|
|
39
|
+
*/
|
|
28
40
|
export declare class RetentionMonthResultDTO {
|
|
29
41
|
monthKey: string;
|
|
30
42
|
startDate: Date;
|
|
31
43
|
endDate: Date;
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
transactionCount: number;
|
|
44
|
+
cohortSize: number;
|
|
45
|
+
monthlyRetention: {
|
|
46
|
+
[monthOffset: string]: CohortRetentionMonthDTO;
|
|
47
|
+
};
|
|
37
48
|
byTriggerType?: {
|
|
38
49
|
[key: string]: {
|
|
39
50
|
count: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"retention-analytics.dto.d.ts","sourceRoot":"","sources":["../../../../../src/shared-lib/dto/analytics/retention-analytics.dto.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAErE,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAE7D;;;;;;;;;;;;;;;GAeG;AAIH,qBAAa,4BAA4B;IAQvC,SAAS,CAAC,EAAE,eAAe,CAAC;IAQ5B,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAID,qBAAa,4BAA4B;IAOvC,UAAU,CAAC,EAAE,IAAI,CAAC;IAalB,UAAU,CAAC,EAAE,MAAM,CAAC;IASpB,OAAO,CAAC,EAAE,4BAA4B,CAAC;CACxC;AAID,qBAAa,uBAAuB;IAKlC,
|
|
1
|
+
{"version":3,"file":"retention-analytics.dto.d.ts","sourceRoot":"","sources":["../../../../../src/shared-lib/dto/analytics/retention-analytics.dto.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAErE,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAE7D;;;;;;;;;;;;;;;GAeG;AAIH,qBAAa,4BAA4B;IAQvC,SAAS,CAAC,EAAE,eAAe,CAAC;IAQ5B,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAID,qBAAa,4BAA4B;IAOvC,UAAU,CAAC,EAAE,IAAI,CAAC;IAalB,UAAU,CAAC,EAAE,MAAM,CAAC;IASpB,OAAO,CAAC,EAAE,4BAA4B,CAAC;CACxC;AAID;;;GAGG;AACH,qBAAa,uBAAuB;IAKlC,aAAa,EAAG,MAAM,CAAC;IAMvB,aAAa,EAAG,MAAM,CAAC;CACxB;AAED;;;GAGG;AACH,qBAAa,uBAAuB;IAKlC,QAAQ,EAAG,MAAM,CAAC;IAMlB,SAAS,EAAG,IAAI,CAAC;IAMjB,OAAO,EAAG,IAAI,CAAC;IAMf,UAAU,EAAG,MAAM,CAAC;IAWpB,gBAAgB,EAAG;QACjB,CAAC,WAAW,EAAE,MAAM,GAAG,uBAAuB,CAAC;KAChD,CAAC;IASF,aAAa,CAAC,EAAE;QACd,CAAC,GAAG,EAAE,MAAM,GAAG;YACb,KAAK,EAAE,MAAM,CAAC;YACd,WAAW,EAAE,MAAM,CAAC;SACrB,CAAC;KACH,CAAC;CACH;AAID,qBAAa,6BAA6B;IAKxC,OAAO,EAAG,uBAAuB,EAAE,CAAC;IAMpC,WAAW,EAAG,MAAM,CAAC;IAMrB,QAAQ,EAAG,qBAAqB,GAAG;QACjC;;WAEG;QACH,iBAAiB,EAAE,gBAAgB,CAAC;KACrC,CAAC;CACH"}
|
|
@@ -83,15 +83,36 @@ __decorate([
|
|
|
83
83
|
Type(() => RetentionAnalyticsFiltersDTO)
|
|
84
84
|
], RetentionAnalyticsRequestDTO.prototype, "filters", void 0);
|
|
85
85
|
// ========== MONTH RESULT ==========
|
|
86
|
+
/**
|
|
87
|
+
* Retention data for a month offset within a cohort
|
|
88
|
+
* Tracks how many users from the original cohort are still active
|
|
89
|
+
*/
|
|
90
|
+
export class CohortRetentionMonthDTO {
|
|
91
|
+
retainedUsers;
|
|
92
|
+
retentionRate;
|
|
93
|
+
}
|
|
94
|
+
__decorate([
|
|
95
|
+
ApiProperty({
|
|
96
|
+
description: 'Number of users from original cohort still active in this month offset',
|
|
97
|
+
example: 85
|
|
98
|
+
})
|
|
99
|
+
], CohortRetentionMonthDTO.prototype, "retainedUsers", void 0);
|
|
100
|
+
__decorate([
|
|
101
|
+
ApiProperty({
|
|
102
|
+
description: 'Retention rate: (retainedUsers / cohortSize) * 100',
|
|
103
|
+
example: 70.8
|
|
104
|
+
})
|
|
105
|
+
], CohortRetentionMonthDTO.prototype, "retentionRate", void 0);
|
|
106
|
+
/**
|
|
107
|
+
* Cohort retention result for a single month
|
|
108
|
+
* Contains the cohort (new users in month) and their retention over subsequent months
|
|
109
|
+
*/
|
|
86
110
|
export class RetentionMonthResultDTO {
|
|
87
111
|
monthKey;
|
|
88
112
|
startDate;
|
|
89
113
|
endDate;
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
returningUsers;
|
|
93
|
-
retentionRate;
|
|
94
|
-
transactionCount;
|
|
114
|
+
cohortSize;
|
|
115
|
+
monthlyRetention;
|
|
95
116
|
byTriggerType;
|
|
96
117
|
}
|
|
97
118
|
__decorate([
|
|
@@ -114,34 +135,21 @@ __decorate([
|
|
|
114
135
|
], RetentionMonthResultDTO.prototype, "endDate", void 0);
|
|
115
136
|
__decorate([
|
|
116
137
|
ApiProperty({
|
|
117
|
-
description: '
|
|
118
|
-
example: 450
|
|
119
|
-
})
|
|
120
|
-
], RetentionMonthResultDTO.prototype, "activeUsers", void 0);
|
|
121
|
-
__decorate([
|
|
122
|
-
ApiProperty({
|
|
123
|
-
description: 'Number of users making their first transaction ever',
|
|
138
|
+
description: 'Number of users who made their first transaction in this month (cohort size)',
|
|
124
139
|
example: 120
|
|
125
140
|
})
|
|
126
|
-
], RetentionMonthResultDTO.prototype, "
|
|
127
|
-
__decorate([
|
|
128
|
-
ApiProperty({
|
|
129
|
-
description: 'Number of users who were active in previous month and returned',
|
|
130
|
-
example: 330
|
|
131
|
-
})
|
|
132
|
-
], RetentionMonthResultDTO.prototype, "returningUsers", void 0);
|
|
133
|
-
__decorate([
|
|
134
|
-
ApiProperty({
|
|
135
|
-
description: 'Retention rate: (returningUsers / previousMonth.activeUsers) * 100',
|
|
136
|
-
example: 73.3
|
|
137
|
-
})
|
|
138
|
-
], RetentionMonthResultDTO.prototype, "retentionRate", void 0);
|
|
141
|
+
], RetentionMonthResultDTO.prototype, "cohortSize", void 0);
|
|
139
142
|
__decorate([
|
|
140
143
|
ApiProperty({
|
|
141
|
-
description: '
|
|
142
|
-
|
|
144
|
+
description: 'Retention data for this cohort over subsequent months. Key is month offset (0=same month, 1=next month, 2=2 months later, etc.)',
|
|
145
|
+
type: 'object',
|
|
146
|
+
example: {
|
|
147
|
+
'0': { retainedUsers: 120, retentionRate: 100 },
|
|
148
|
+
'1': { retainedUsers: 85, retentionRate: 70.8 },
|
|
149
|
+
'2': { retainedUsers: 65, retentionRate: 54.2 }
|
|
150
|
+
}
|
|
143
151
|
})
|
|
144
|
-
], RetentionMonthResultDTO.prototype, "
|
|
152
|
+
], RetentionMonthResultDTO.prototype, "monthlyRetention", void 0);
|
|
145
153
|
__decorate([
|
|
146
154
|
ApiPropertyOptional({
|
|
147
155
|
description: 'Breakdown of transactions by trigger type',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"retention-analytics.dto.js","sourceRoot":"","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,KAAK,EAAE;IACP,GAAG,CAAC,CAAC,CAAC;IACN,GAAG,CAAC,EAAE,CAAC;gEACY;AASpB;IAPC,mBAAmB,CAAC;QACnB,WAAW,EAAE,sCAAsC;QACnD,IAAI,EAAE,4BAA4B;KACnC,CAAC;IACD,UAAU,EAAE;IACZ,cAAc,EAAE;IAChB,IAAI,CAAC,GAAG,EAAE,CAAC,4BAA4B,CAAC;6DACF;AAGzC,qCAAqC;AAErC,MAAM,OAAO,uBAAuB;IAKlC,
|
|
1
|
+
{"version":3,"file":"retention-analytics.dto.js","sourceRoot":"","sources":["../../../../../src/shared-lib/dto/analytics/retention-analytics.dto.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,YAAY,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC9G,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAEnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAGjE;;;;;;;;;;;;;;;GAeG;AAEH,wCAAwC;AAExC,MAAM,OAAO,4BAA4B;IAQvC,SAAS,CAAmB;IAQ5B,kBAAkB,CAAU;CAC7B;AATC;IAPC,mBAAmB,CAAC;QACnB,WAAW,EAAE,+BAA+B;QAC5C,IAAI,EAAE,gBAAgB;QACtB,OAAO,EAAE,gBAAgB,CAAC,MAAM;KACjC,CAAC;IACD,UAAU,EAAE;IACZ,MAAM,CAAC,gBAAgB,CAAC;+DACG;AAQ5B;IANC,mBAAmB,CAAC;QACnB,WAAW,EAAE,gCAAgC;QAC7C,OAAO,EAAE,UAAU;KACpB,CAAC;IACD,UAAU,EAAE;IACZ,QAAQ,EAAE;wEACiB;AAG9B,gCAAgC;AAEhC,MAAM,OAAO,4BAA4B;IAOvC,UAAU,C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edResponse, type PaginationMetadata } from "../../interface
|
|
|
5
5
|
export declare class PaginatedResponseDTO<T> implements PaginatedResponse<T> {
|
|
6
6
|
readonly data: ReadonlyArray<T>;
|
|
7
7
|
readonly pagination: PaginationMetadata;
|
|
8
|
-
|
|
8
|
+
readonly metadata?: {
|
|
9
|
+
includes?: string[];
|
|
10
|
+
[key: string]: any;
|
|
11
|
+
};
|
|
12
|
+
constructor(data: T[], page: number | null, limit: number | null, total: number, metadata?: {
|
|
13
|
+
includes?: string[];
|
|
14
|
+
[key: string]: any;
|
|
15
|
+
});
|
|
9
16
|
/**
|
|
10
17
|
* ✅ FACTORY: Create paginated response from service layer
|
|
11
18
|
*/
|
|
12
|
-
static create<T>(data: T[], page: number, limit: number, total: number
|
|
19
|
+
static create<T>(data: T[], page: number, limit: number, total: number, metadata?: {
|
|
20
|
+
includes?: string[];
|
|
21
|
+
[key: string]: any;
|
|
22
|
+
}): PaginatedResponseDTO<T>;
|
|
13
23
|
/**
|
|
14
24
|
* ✅ FACTORY: Create empty paginated response
|
|
15
25
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pagination.response.dto.d.ts","sourceRoot":"","sources":["../../../../../src/shared-lib/dto/pagination/pagination.response.dto.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,iBAAiB,EAAE,KAAK,kBAAkB,EAAE,MAAM,4CAA4C,CAAC;AAG7G;;GAEG;AACH,qBAAa,oBAAoB,CAAC,CAAC,CAAE,YAAW,iBAAiB,CAAC,CAAC,CAAC;IAKlE,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;IAahC,QAAQ,CAAC,UAAU,EAAE,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"pagination.response.dto.d.ts","sourceRoot":"","sources":["../../../../../src/shared-lib/dto/pagination/pagination.response.dto.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,iBAAiB,EAAE,KAAK,kBAAkB,EAAE,MAAM,4CAA4C,CAAC;AAG7G;;GAEG;AACH,qBAAa,oBAAoB,CAAC,CAAC,CAAE,YAAW,iBAAiB,CAAC,CAAC,CAAC;IAKlE,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;IAahC,QAAQ,CAAC,UAAU,EAAE,kBAAkB,CAAC;IAUxC,QAAQ,CAAC,QAAQ,CAAC,EAAE;QAClB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;QACpB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;KACpB,CAAC;gBAGA,IAAI,EAAE,CAAC,EAAE,EACT,IAAI,EAAE,MAAM,GAAG,IAAI,EACnB,KAAK,EAAE,MAAM,GAAG,IAAI,EACpB,KAAK,EAAE,MAAM,EACb,QAAQ,CAAC,EAAE;QAAE,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;QAAC,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE;IAcxD;;OAEG;IACH,MAAM,CAAC,MAAM,CAAC,CAAC,EACb,IAAI,EAAE,CAAC,EAAE,EACT,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,EACb,QAAQ,CAAC,EAAE;QAAE,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;QAAC,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,GACrD,oBAAoB,CAAC,CAAC,CAAC;IAI1B;;OAEG;IACH,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,GAAE,MAAU,EAAE,KAAK,GAAE,MAAW,GAAG,oBAAoB,CAAC,CAAC,CAAC;CAG/E"}
|
|
@@ -11,7 +11,8 @@ import { ApiProperty } from "@nestjs/swagger";
|
|
|
11
11
|
export class PaginatedResponseDTO {
|
|
12
12
|
data;
|
|
13
13
|
pagination;
|
|
14
|
-
|
|
14
|
+
metadata;
|
|
15
|
+
constructor(data, page, limit, total, metadata) {
|
|
15
16
|
this.data = Object.freeze([...data]);
|
|
16
17
|
this.pagination = Object.freeze({
|
|
17
18
|
page,
|
|
@@ -21,12 +22,13 @@ export class PaginatedResponseDTO {
|
|
|
21
22
|
hasNext: (page || 1) * (limit || 1) < total,
|
|
22
23
|
hasPrev: (page || 1) > 1
|
|
23
24
|
});
|
|
25
|
+
this.metadata = metadata ? Object.freeze(metadata) : undefined;
|
|
24
26
|
}
|
|
25
27
|
/**
|
|
26
28
|
* ✅ FACTORY: Create paginated response from service layer
|
|
27
29
|
*/
|
|
28
|
-
static create(data, page, limit, total) {
|
|
29
|
-
return new PaginatedResponseDTO(data, page, limit, total);
|
|
30
|
+
static create(data, page, limit, total, metadata) {
|
|
31
|
+
return new PaginatedResponseDTO(data, page, limit, total, metadata);
|
|
30
32
|
}
|
|
31
33
|
/**
|
|
32
34
|
* ✅ FACTORY: Create empty paginated response
|
|
@@ -54,4 +56,14 @@ __decorate([
|
|
|
54
56
|
}
|
|
55
57
|
})
|
|
56
58
|
], PaginatedResponseDTO.prototype, "pagination", void 0);
|
|
59
|
+
__decorate([
|
|
60
|
+
ApiProperty({
|
|
61
|
+
description: 'Additional metadata (e.g., enriched relations)',
|
|
62
|
+
required: false,
|
|
63
|
+
nullable: true,
|
|
64
|
+
example: {
|
|
65
|
+
includes: ['sender', 'recipient']
|
|
66
|
+
}
|
|
67
|
+
})
|
|
68
|
+
], PaginatedResponseDTO.prototype, "metadata", void 0);
|
|
57
69
|
//# sourceMappingURL=pagination.response.dto.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pagination.response.dto.js","sourceRoot":"","sources":["../../../../../src/shared-lib/dto/pagination/pagination.response.dto.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAI9C;;GAEG;AACH,MAAM,OAAO,oBAAoB;IAKtB,IAAI,CAAmB;IAavB,UAAU,CAAqB;
|
|
1
|
+
{"version":3,"file":"pagination.response.dto.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CAAC;IACtD,CAAC;CACF;AAlEU;IAJR,WAAW,CAAC;QACX,WAAW,EAAE,qBAAqB;QAClC,IAAI,EAAE,OAAO;KACd,CAAC;kDAC8B;AAavB;IAXR,WAAW,CAAC;QACX,WAAW,EAAE,qBAAqB;QAClC,OAAO,EAAE;YACP,IAAI,EAAE,CAAC;YACP,KAAK,EAAE,EAAE;YACT,KAAK,EAAE,GAAG;YACV,KAAK,EAAE,CAAC;YACR,OAAO,EAAE,IAAI;YACb,OAAO,EAAE,KAAK;SACf;KACF,CAAC;wDACsC;AAU/B;IARR,WAAW,CAAC;QACX,WAAW,EAAE,gDAAgD;QAC7D,QAAQ,EAAE,KAAK;QACf,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE;YACP,QAAQ,EAAE,CAAC,QAAQ,EAAE,WAAW,CAAC;SAClC;KACF,CAAC;sDAIA"}
|
|
@@ -4,6 +4,8 @@ import { TransactionTriggerProcessType } from "../../enum/transaction-trigger-pr
|
|
|
4
4
|
import type { NativeTokenType } from "../../types/native-token.type";
|
|
5
5
|
import { AccountOwnerType } from "../../enum";
|
|
6
6
|
import { TransactionCompleteFields } from "../../interfaces/transaction.interface";
|
|
7
|
+
import { UserDTO } from "../user.dto";
|
|
8
|
+
import { BusinessDTO } from "../business/business.dto";
|
|
7
9
|
export declare class TransactionDTO implements TransactionCompleteFields {
|
|
8
10
|
amount: number | null;
|
|
9
11
|
id: string;
|
|
@@ -29,5 +31,8 @@ export declare class TransactionDTO implements TransactionCompleteFields {
|
|
|
29
31
|
engagedBusinessId: string | null;
|
|
30
32
|
authorizedSubmitterId: string | null;
|
|
31
33
|
authorizedSubmitterType: AccountOwnerType | null;
|
|
34
|
+
sender?: UserDTO | BusinessDTO;
|
|
35
|
+
recipient?: UserDTO | BusinessDTO;
|
|
36
|
+
engagedBusiness?: BusinessDTO;
|
|
32
37
|
}
|
|
33
38
|
//# sourceMappingURL=transaction.dto.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transaction.dto.d.ts","sourceRoot":"","sources":["../../../../../src/shared-lib/dto/transaction/transaction.dto.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AACvE,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AACvE,OAAO,EAAE,6BAA6B,EAAE,MAAM,kDAAkD,CAAC;AACjG,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"transaction.dto.d.ts","sourceRoot":"","sources":["../../../../../src/shared-lib/dto/transaction/transaction.dto.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AACvE,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AACvE,OAAO,EAAE,6BAA6B,EAAE,MAAM,kDAAkD,CAAC;AACjG,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,EAAE,yBAAyB,EAAE,MAAM,wCAAwC,CAAC;AACnF,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEvD,qBAAa,cAAe,YAAW,yBAAyB;IAG5D,MAAM,EAAE,MAAM,GAAG,IAAI,CAAO;IAG5B,EAAE,EAAE,MAAM,CAAK;IAGf,YAAY,EAAE,MAAM,CAAK;IAMzB,eAAe,EAAE,MAAM,GAAG,IAAI,CAAO;IAKrC,SAAS,EAAE,eAAe,GAAG,IAAI,CAAO;IAGxC,aAAa,EAAE,MAAM,CAAK;IAG1B,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAO;IAGtC,eAAe,EAAE,MAAM,GAAG,IAAI,CAAO;IAMrC,IAAI,EAAE,mBAAmB,GAAG,IAAI,CAAO;IAMvC,kBAAkB,EAAE,6BAA6B,GAAG,IAAI,CAAO;IAK/D,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAO;IAMtC,MAAM,EAAE,iBAAiB,CAA+B;IAGxD,SAAS,EAAE,IAAI,GAAG,IAAI,CAAO;IAG7B,SAAS,CAAC,EAAE,IAAI,GAAG,IAAI,CAAO;IAG9B,QAAQ,EAAE,MAAM,CAAK;IAGrB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAO;IAM7B,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAQ;IAO/B,eAAe,EAAE,gBAAgB,GAAG,IAAI,CAAQ;IAMhD,WAAW,EAAE,MAAM,GAAG,IAAI,CAAQ;IAOlC,kBAAkB,EAAE,gBAAgB,GAAG,IAAI,CAAQ;IAMnD,OAAO,EAAE,MAAM,GAAG,IAAI,CAAQ;IAM9B,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAQ;IAMxC,qBAAqB,EAAE,MAAM,GAAG,IAAI,CAAQ;IAO5C,uBAAuB,EAAE,gBAAgB,GAAG,IAAI,CAAQ;IAiBxD,MAAM,CAAC,EAAE,OAAO,GAAG,WAAW,CAAC;IAW/B,SAAS,CAAC,EAAE,OAAO,GAAG,WAAW,CAAC;IAQlC,eAAe,CAAC,EAAE,WAAW,CAAC;CACjC"}
|
|
@@ -4,11 +4,13 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
4
|
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;
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
-
import { ApiProperty } from "@nestjs/swagger";
|
|
7
|
+
import { ApiProperty, getSchemaPath } from "@nestjs/swagger";
|
|
8
8
|
import { Web3TransactionType } from "../../enum/transaction-type.enum.js";
|
|
9
9
|
import { TransactionStatus } from "../../enum/transaction-status.enum.js";
|
|
10
10
|
import { TransactionTriggerProcessType } from "../../enum/transaction-trigger-process-type.enum.js";
|
|
11
11
|
import { AccountOwnerType } from "../../enum/index.js";
|
|
12
|
+
import { UserDTO } from "../user.dto.js";
|
|
13
|
+
import { BusinessDTO } from "../business/business.dto.js";
|
|
12
14
|
export class TransactionDTO {
|
|
13
15
|
amount = null;
|
|
14
16
|
id = '';
|
|
@@ -34,6 +36,14 @@ export class TransactionDTO {
|
|
|
34
36
|
engagedBusinessId = null;
|
|
35
37
|
authorizedSubmitterId = null;
|
|
36
38
|
authorizedSubmitterType = null;
|
|
39
|
+
// =====================================
|
|
40
|
+
// OPTIONAL ENRICHMENT FIELDS
|
|
41
|
+
// =====================================
|
|
42
|
+
// Only populated when include query param is specified
|
|
43
|
+
// e.g., GET /transactions?include=sender,recipient,business
|
|
44
|
+
sender;
|
|
45
|
+
recipient;
|
|
46
|
+
engagedBusiness;
|
|
37
47
|
}
|
|
38
48
|
__decorate([
|
|
39
49
|
ApiProperty({ description: 'Transaction amount' })
|
|
@@ -150,4 +160,34 @@ __decorate([
|
|
|
150
160
|
enum: AccountOwnerType
|
|
151
161
|
})
|
|
152
162
|
], TransactionDTO.prototype, "authorizedSubmitterType", void 0);
|
|
163
|
+
__decorate([
|
|
164
|
+
ApiProperty({
|
|
165
|
+
description: 'Enriched sender entity (User or Business). Only populated when include=sender is specified. Type is determined by senderOwnerType field.',
|
|
166
|
+
required: false,
|
|
167
|
+
nullable: true,
|
|
168
|
+
oneOf: [
|
|
169
|
+
{ $ref: getSchemaPath(UserDTO) },
|
|
170
|
+
{ $ref: getSchemaPath(BusinessDTO) }
|
|
171
|
+
]
|
|
172
|
+
})
|
|
173
|
+
], TransactionDTO.prototype, "sender", void 0);
|
|
174
|
+
__decorate([
|
|
175
|
+
ApiProperty({
|
|
176
|
+
description: 'Enriched recipient entity (User or Business). Only populated when include=recipient is specified. Type is determined by recipientOwnerType field.',
|
|
177
|
+
required: false,
|
|
178
|
+
nullable: true,
|
|
179
|
+
oneOf: [
|
|
180
|
+
{ $ref: getSchemaPath(UserDTO) },
|
|
181
|
+
{ $ref: getSchemaPath(BusinessDTO) }
|
|
182
|
+
]
|
|
183
|
+
})
|
|
184
|
+
], TransactionDTO.prototype, "recipient", void 0);
|
|
185
|
+
__decorate([
|
|
186
|
+
ApiProperty({
|
|
187
|
+
description: 'Enriched engaged business entity. Only populated when include=business is specified.',
|
|
188
|
+
required: false,
|
|
189
|
+
nullable: true,
|
|
190
|
+
type: () => BusinessDTO
|
|
191
|
+
})
|
|
192
|
+
], TransactionDTO.prototype, "engagedBusiness", void 0);
|
|
153
193
|
//# sourceMappingURL=transaction.dto.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transaction.dto.js","sourceRoot":"","sources":["../../../../../src/shared-lib/dto/transaction/transaction.dto.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;
|
|
1
|
+
{"version":3,"file":"transaction.dto.js","sourceRoot":"","sources":["../../../../../src/shared-lib/dto/transaction/transaction.dto.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AACvE,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AACvE,OAAO,EAAE,6BAA6B,EAAE,MAAM,kDAAkD,CAAC;AAEjG,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAE9C,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEvD,MAAM,OAAO,cAAc;IAGvB,MAAM,GAAkB,IAAI,CAAA;IAG5B,EAAE,GAAW,EAAE,CAAA;IAGf,YAAY,GAAW,EAAE,CAAA;IAMzB,eAAe,GAAkB,IAAI,CAAA;IAKrC,SAAS,GAA2B,IAAI,C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B,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,yBAAyB,CAAC;AACxC,cAAc,WAAW,CAAC;AAC1B,cAAc,6BAA6B,CAAC;AAC5C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/shared-lib/types/index.ts"],"names":[],"mappings":"AACA,cAAc,kBAAkB,CAAC;AACjC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,yBAAyB,CAAC;AACxC,cAAc,WAAW,CAAC;AAC1B,cAAc,6BAA6B,CAAC;AAC5C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,qCAAqC,CAAC"}
|
|
@@ -8,4 +8,5 @@ export * from './domains.js';
|
|
|
8
8
|
export * from './query-specification.types.js';
|
|
9
9
|
export * from './transaction-filters.type.js';
|
|
10
10
|
export * from './includable-relation.type.js';
|
|
11
|
+
export * from './transaction-include-relation.type.js';
|
|
11
12
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/shared-lib/types/index.ts"],"names":[],"mappings":"AAAA,mDAAmD;AACnD,cAAc,kBAAkB,CAAC;AACjC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,yBAAyB,CAAC;AACxC,cAAc,WAAW,CAAC;AAC1B,cAAc,6BAA6B,CAAC;AAC5C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/shared-lib/types/index.ts"],"names":[],"mappings":"AAAA,mDAAmD;AACnD,cAAc,kBAAkB,CAAC;AACjC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,yBAAyB,CAAC;AACxC,cAAc,WAAW,CAAC;AAC1B,cAAc,6BAA6B,CAAC;AAC5C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,qCAAqC,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TRANSACTION INCLUDE RELATION TYPE
|
|
3
|
+
*
|
|
4
|
+
* Type-safe relations for optional enrichment in transaction queries.
|
|
5
|
+
* Prevents typos and provides IDE autocomplete.
|
|
6
|
+
*
|
|
7
|
+
* Usage:
|
|
8
|
+
* ```
|
|
9
|
+
* GET /transactions?include=sender,recipient,business
|
|
10
|
+
*
|
|
11
|
+
* include: ['sender', 'recipient'] // ✅ Type-safe
|
|
12
|
+
* include: ['snder'] // ❌ Compile error
|
|
13
|
+
* ```
|
|
14
|
+
*
|
|
15
|
+
* Relations:
|
|
16
|
+
* - sender: Enriches transaction sender (polymorphic: UserDTO | BusinessDTO)
|
|
17
|
+
* - recipient: Enriches transaction recipient (polymorphic: UserDTO | BusinessDTO)
|
|
18
|
+
* - business: Enriches engaged business (BusinessDTO)
|
|
19
|
+
*/
|
|
20
|
+
export type TransactionIncludeRelation = 'sender' | 'recipient' | 'business';
|
|
21
|
+
/**
|
|
22
|
+
* Valid transaction relations for runtime validation
|
|
23
|
+
*/
|
|
24
|
+
export declare const VALID_TRANSACTION_RELATIONS: readonly TransactionIncludeRelation[];
|
|
25
|
+
/**
|
|
26
|
+
* Type guard to validate relation strings at runtime
|
|
27
|
+
*/
|
|
28
|
+
export declare function isValidTransactionRelation(value: string): value is TransactionIncludeRelation;
|
|
29
|
+
//# sourceMappingURL=transaction-include-relation.type.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transaction-include-relation.type.d.ts","sourceRoot":"","sources":["../../../../src/shared-lib/types/transaction-include-relation.type.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,MAAM,0BAA0B,GAAG,QAAQ,GAAG,WAAW,GAAG,UAAU,CAAC;AAE7E;;GAEG;AACH,eAAO,MAAM,2BAA2B,EAAE,SAAS,0BAA0B,EAInE,CAAC;AAEX;;GAEG;AACH,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,0BAA0B,CAE7F"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Valid transaction relations for runtime validation
|
|
3
|
+
*/
|
|
4
|
+
export const VALID_TRANSACTION_RELATIONS = [
|
|
5
|
+
'sender',
|
|
6
|
+
'recipient',
|
|
7
|
+
'business'
|
|
8
|
+
];
|
|
9
|
+
/**
|
|
10
|
+
* Type guard to validate relation strings at runtime
|
|
11
|
+
*/
|
|
12
|
+
export function isValidTransactionRelation(value) {
|
|
13
|
+
return VALID_TRANSACTION_RELATIONS.includes(value);
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=transaction-include-relation.type.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transaction-include-relation.type.js","sourceRoot":"","sources":["../../../../src/shared-lib/types/transaction-include-relation.type.ts"],"names":[],"mappings":"AAqBA;;GAEG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAA0C;IAChF,QAAQ;IACR,WAAW;IACX,UAAU;CACF,CAAC;AAEX;;GAEG;AACH,MAAM,UAAU,0BAA0B,CAAC,KAAa;IACtD,OAAO,2BAA2B,CAAC,QAAQ,CAAC,KAAmC,CAAC,CAAC;AACnF,CAAC"}
|