@passly-nl/data 1.2.1 → 1.3.0
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/index.d.mts +667 -72
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +1982 -343
- package/dist/index.mjs.map +1 -1
- package/package.json +6 -8
- package/src/adapter/StatisticsBuyersAdapter.ts +50 -1
- package/src/adapter/StatisticsChartAdapter.ts +56 -0
- package/src/adapter/StatisticsEventsAdapter.ts +41 -2
- package/src/adapter/StatisticsGrowthAdapter.ts +9 -1
- package/src/adapter/StatisticsMarketingAdapter.ts +78 -0
- package/src/adapter/StatisticsOperationsAdapter.ts +45 -12
- package/src/adapter/StatisticsOverviewAdapter.ts +33 -2
- package/src/adapter/StatisticsRefundsAdapter.ts +43 -0
- package/src/adapter/StatisticsSalesAdapter.ts +36 -1
- package/src/adapter/index.ts +3 -1
- package/src/dto/eventStatistics/index.ts +0 -1
- package/src/dto/order/OrderProductDto.ts +5 -4
- package/src/dto/statistics/StatisticsBuyersAcquisitionSourceDto.ts +28 -0
- package/src/dto/statistics/StatisticsBuyersAgeGenderMatrixDto.ts +38 -0
- package/src/dto/statistics/StatisticsBuyersCohortRetentionDto.ts +48 -0
- package/src/dto/statistics/StatisticsBuyersDeviceConversionDto.ts +48 -0
- package/src/dto/statistics/StatisticsBuyersGeographicDistributionDto.ts +49 -0
- package/src/dto/statistics/StatisticsBuyersSpendBucketsDto.ts +36 -0
- package/src/dto/statistics/StatisticsChartDto.ts +43 -0
- package/src/dto/statistics/StatisticsEventsSalesCurveDto.ts +19 -0
- package/src/dto/statistics/StatisticsEventsSalesCurveEventDto.ts +59 -0
- package/src/dto/statistics/StatisticsEventsSellOutTimingDto.ts +39 -0
- package/src/dto/statistics/StatisticsEventsSellOutTimingEventDto.ts +38 -0
- package/src/dto/statistics/StatisticsEventsTimeToEventDto.ts +36 -0
- package/src/dto/statistics/StatisticsGrowthCmgrDto.ts +38 -0
- package/src/dto/statistics/StatisticsMarketingCampaignDto.ts +69 -0
- package/src/dto/statistics/StatisticsMarketingOverviewDto.ts +79 -0
- package/src/dto/statistics/StatisticsMarketingReferrerDto.ts +39 -0
- package/src/dto/statistics/StatisticsMarketingShortlinkRoiDto.ts +109 -0
- package/src/dto/statistics/StatisticsMarketingSourceBreakdownDto.ts +49 -0
- package/src/dto/statistics/StatisticsMarketingSourceFunnelDto.ts +48 -0
- package/src/dto/statistics/StatisticsMarketingSourceMediumMatrixDto.ts +39 -0
- package/src/dto/statistics/StatisticsOperationsNoShowRateDto.ts +59 -0
- package/src/dto/statistics/StatisticsOperationsNoShowRateEventDto.ts +58 -0
- package/src/dto/statistics/StatisticsOperationsScanTimeDistributionDto.ts +36 -0
- package/src/dto/statistics/{StatisticsOperationsTaskAssigneeDto.ts → StatisticsOperationsStewardDto.ts} +28 -8
- package/src/dto/statistics/StatisticsOperationsStockUtilizationDto.ts +100 -0
- package/src/dto/statistics/StatisticsOverviewCancellationFunnelDto.ts +58 -0
- package/src/dto/statistics/StatisticsOverviewReservationConversionRateDto.ts +78 -0
- package/src/dto/statistics/StatisticsOverviewTopShopDto.ts +49 -0
- package/src/dto/statistics/StatisticsPieChartDto.ts +29 -0
- package/src/dto/statistics/StatisticsRefundsAmountDistributionDto.ts +38 -0
- package/src/dto/statistics/StatisticsRefundsOverviewDto.ts +59 -0
- package/src/dto/statistics/StatisticsRefundsTopEventDto.ts +70 -0
- package/src/dto/statistics/StatisticsRefundsVelocityDto.ts +45 -0
- package/src/dto/statistics/StatisticsSalesDiscountEfficacyDto.ts +99 -0
- package/src/dto/statistics/StatisticsSalesFailedTransactionReasonDto.ts +29 -0
- package/src/dto/statistics/StatisticsSalesOrderValueDistributionDto.ts +38 -0
- package/src/dto/statistics/StatisticsSalesRepeatPurchaseVelocityDto.ts +35 -0
- package/src/dto/statistics/index.ts +37 -2
- package/src/service/MerchantEventStatisticsBuyersService.ts +4 -5
- package/src/service/MerchantEventStatisticsOperationsService.ts +4 -5
- package/src/service/MerchantEventStatisticsSalesService.ts +10 -11
- package/src/service/MerchantStatisticsBuyersService.ts +64 -5
- package/src/service/MerchantStatisticsEventsService.ts +48 -9
- package/src/service/MerchantStatisticsGrowthService.ts +25 -5
- package/src/service/MerchantStatisticsMarketingService.ts +96 -0
- package/src/service/MerchantStatisticsOperationsService.ts +39 -10
- package/src/service/MerchantStatisticsOverviewService.ts +34 -5
- package/src/service/MerchantStatisticsRefundsService.ts +76 -0
- package/src/service/MerchantStatisticsSalesService.ts +78 -9
- package/src/service/MerchantStatisticsService.ts +0 -11
- package/src/service/index.ts +2 -0
- package/src/types/index.ts +1 -0
- package/src/types/statistics.ts +32 -0
- package/src/adapter/EventStatisticsSalesAdapter.ts +0 -21
- package/src/dto/eventStatistics/EventStatisticsSalesFlowChartDto.ts +0 -66
- package/src/dto/statistics/StatisticsOperationsTasksOverviewDto.ts +0 -69
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { dto } from '@basmilius/http-client';
|
|
2
|
+
import type { CostDto, ShopDto } from '#data/dto';
|
|
3
|
+
|
|
4
|
+
@dto
|
|
5
|
+
export class StatisticsOverviewTopShopDto {
|
|
6
|
+
get shop(): ShopDto {
|
|
7
|
+
return this.#shop;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
set shop(value: ShopDto) {
|
|
11
|
+
this.#shop = value;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
get revenue(): CostDto {
|
|
15
|
+
return this.#revenue;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
set revenue(value: CostDto) {
|
|
19
|
+
this.#revenue = value;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
get orders(): number {
|
|
23
|
+
return this.#orders;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
set orders(value: number) {
|
|
27
|
+
this.#orders = value;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
get tickets(): number {
|
|
31
|
+
return this.#tickets;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
set tickets(value: number) {
|
|
35
|
+
this.#tickets = value;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
#shop: ShopDto;
|
|
39
|
+
#revenue: CostDto;
|
|
40
|
+
#orders: number;
|
|
41
|
+
#tickets: number;
|
|
42
|
+
|
|
43
|
+
constructor(shop: ShopDto, revenue: CostDto, orders: number, tickets: number) {
|
|
44
|
+
this.#shop = shop;
|
|
45
|
+
this.#revenue = revenue;
|
|
46
|
+
this.#orders = orders;
|
|
47
|
+
this.#tickets = tickets;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { dto } from '@basmilius/http-client';
|
|
2
|
+
import type { StatisticsChartValueType, StatisticsPieSlice } from '#data/types';
|
|
3
|
+
|
|
4
|
+
@dto
|
|
5
|
+
export class StatisticsPieChartDto {
|
|
6
|
+
get slices(): readonly StatisticsPieSlice[] {
|
|
7
|
+
return this.#slices;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
set slices(value: readonly StatisticsPieSlice[]) {
|
|
11
|
+
this.#slices = value;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
get valueType(): StatisticsChartValueType {
|
|
15
|
+
return this.#valueType;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
set valueType(value: StatisticsChartValueType) {
|
|
19
|
+
this.#valueType = value;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
#slices: readonly StatisticsPieSlice[];
|
|
23
|
+
#valueType: StatisticsChartValueType;
|
|
24
|
+
|
|
25
|
+
constructor(slices: readonly StatisticsPieSlice[], valueType: StatisticsChartValueType) {
|
|
26
|
+
this.#slices = slices;
|
|
27
|
+
this.#valueType = valueType;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { dto } from '@basmilius/http-client';
|
|
2
|
+
|
|
3
|
+
@dto
|
|
4
|
+
export class StatisticsRefundsAmountDistributionDto {
|
|
5
|
+
get full(): number {
|
|
6
|
+
return this.#full;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
set full(value: number) {
|
|
10
|
+
this.#full = value;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
get partial(): number {
|
|
14
|
+
return this.#partial;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
set partial(value: number) {
|
|
18
|
+
this.#partial = value;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
get averagePartialRatio(): number {
|
|
22
|
+
return this.#averagePartialRatio;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
set averagePartialRatio(value: number) {
|
|
26
|
+
this.#averagePartialRatio = value;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
#full: number;
|
|
30
|
+
#partial: number;
|
|
31
|
+
#averagePartialRatio: number;
|
|
32
|
+
|
|
33
|
+
constructor(full: number, partial: number, averagePartialRatio: number) {
|
|
34
|
+
this.#full = full;
|
|
35
|
+
this.#partial = partial;
|
|
36
|
+
this.#averagePartialRatio = averagePartialRatio;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { dto } from '@basmilius/http-client';
|
|
2
|
+
import type { CostDto, StatisticsTrendDto } from '#data/dto';
|
|
3
|
+
|
|
4
|
+
@dto
|
|
5
|
+
export class StatisticsRefundsOverviewDto {
|
|
6
|
+
get refundRate(): StatisticsTrendDto<number> {
|
|
7
|
+
return this.#refundRate;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
set refundRate(value: StatisticsTrendDto<number>) {
|
|
11
|
+
this.#refundRate = value;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
get refundCount(): StatisticsTrendDto<number> {
|
|
15
|
+
return this.#refundCount;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
set refundCount(value: StatisticsTrendDto<number>) {
|
|
19
|
+
this.#refundCount = value;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
get refundAmount(): StatisticsTrendDto<CostDto> {
|
|
23
|
+
return this.#refundAmount;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
set refundAmount(value: StatisticsTrendDto<CostDto>) {
|
|
27
|
+
this.#refundAmount = value;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
get averageRefundAmount(): CostDto {
|
|
31
|
+
return this.#averageRefundAmount;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
set averageRefundAmount(value: CostDto) {
|
|
35
|
+
this.#averageRefundAmount = value;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
get averageCompletionTimeSeconds(): number {
|
|
39
|
+
return this.#averageCompletionTimeSeconds;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
set averageCompletionTimeSeconds(value: number) {
|
|
43
|
+
this.#averageCompletionTimeSeconds = value;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
#refundRate: StatisticsTrendDto<number>;
|
|
47
|
+
#refundCount: StatisticsTrendDto<number>;
|
|
48
|
+
#refundAmount: StatisticsTrendDto<CostDto>;
|
|
49
|
+
#averageRefundAmount: CostDto;
|
|
50
|
+
#averageCompletionTimeSeconds: number;
|
|
51
|
+
|
|
52
|
+
constructor(refundRate: StatisticsTrendDto<number>, refundCount: StatisticsTrendDto<number>, refundAmount: StatisticsTrendDto<CostDto>, averageRefundAmount: CostDto, averageCompletionTimeSeconds: number) {
|
|
53
|
+
this.#refundRate = refundRate;
|
|
54
|
+
this.#refundCount = refundCount;
|
|
55
|
+
this.#refundAmount = refundAmount;
|
|
56
|
+
this.#averageRefundAmount = averageRefundAmount;
|
|
57
|
+
this.#averageCompletionTimeSeconds = averageCompletionTimeSeconds;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { dto } from '@basmilius/http-client';
|
|
2
|
+
import type { DateTime } from 'luxon';
|
|
3
|
+
import type { CostDto } from '#data/dto';
|
|
4
|
+
|
|
5
|
+
@dto
|
|
6
|
+
export class StatisticsRefundsTopEventDto {
|
|
7
|
+
get eventId(): string {
|
|
8
|
+
return this.#eventId;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
set eventId(value: string) {
|
|
12
|
+
this.#eventId = value;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
get eventName(): string {
|
|
16
|
+
return this.#eventName;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
set eventName(value: string) {
|
|
20
|
+
this.#eventName = value;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
get eventStartsOn(): DateTime {
|
|
24
|
+
return this.#eventStartsOn;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
set eventStartsOn(value: DateTime) {
|
|
28
|
+
this.#eventStartsOn = value;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
get refundCount(): number {
|
|
32
|
+
return this.#refundCount;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
set refundCount(value: number) {
|
|
36
|
+
this.#refundCount = value;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
get refundAmount(): CostDto {
|
|
40
|
+
return this.#refundAmount;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
set refundAmount(value: CostDto) {
|
|
44
|
+
this.#refundAmount = value;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
get refundRate(): number {
|
|
48
|
+
return this.#refundRate;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
set refundRate(value: number) {
|
|
52
|
+
this.#refundRate = value;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
#eventId: string;
|
|
56
|
+
#eventName: string;
|
|
57
|
+
#eventStartsOn: DateTime;
|
|
58
|
+
#refundCount: number;
|
|
59
|
+
#refundAmount: CostDto;
|
|
60
|
+
#refundRate: number;
|
|
61
|
+
|
|
62
|
+
constructor(eventId: string, eventName: string, eventStartsOn: DateTime, refundCount: number, refundAmount: CostDto, refundRate: number) {
|
|
63
|
+
this.#eventId = eventId;
|
|
64
|
+
this.#eventName = eventName;
|
|
65
|
+
this.#eventStartsOn = eventStartsOn;
|
|
66
|
+
this.#refundCount = refundCount;
|
|
67
|
+
this.#refundAmount = refundAmount;
|
|
68
|
+
this.#refundRate = refundRate;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { dto } from '@basmilius/http-client';
|
|
2
|
+
|
|
3
|
+
export type StatisticsRefundsVelocityBucket =
|
|
4
|
+
| 'within_1_day'
|
|
5
|
+
| 'within_7_days'
|
|
6
|
+
| 'within_30_days'
|
|
7
|
+
| 'within_90_days'
|
|
8
|
+
| 'over_90_days';
|
|
9
|
+
|
|
10
|
+
@dto
|
|
11
|
+
export class StatisticsRefundsVelocityDto {
|
|
12
|
+
get averageDaysOrderToRefund(): number {
|
|
13
|
+
return this.#averageDaysOrderToRefund;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
set averageDaysOrderToRefund(value: number) {
|
|
17
|
+
this.#averageDaysOrderToRefund = value;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
get averageSecondsRequestToCompletion(): number {
|
|
21
|
+
return this.#averageSecondsRequestToCompletion;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
set averageSecondsRequestToCompletion(value: number) {
|
|
25
|
+
this.#averageSecondsRequestToCompletion = value;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
get buckets(): Record<StatisticsRefundsVelocityBucket, number> {
|
|
29
|
+
return this.#buckets;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
set buckets(value: Record<StatisticsRefundsVelocityBucket, number>) {
|
|
33
|
+
this.#buckets = value;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
#averageDaysOrderToRefund: number;
|
|
37
|
+
#averageSecondsRequestToCompletion: number;
|
|
38
|
+
#buckets: Record<StatisticsRefundsVelocityBucket, number>;
|
|
39
|
+
|
|
40
|
+
constructor(averageDaysOrderToRefund: number, averageSecondsRequestToCompletion: number, buckets: Record<StatisticsRefundsVelocityBucket, number>) {
|
|
41
|
+
this.#averageDaysOrderToRefund = averageDaysOrderToRefund;
|
|
42
|
+
this.#averageSecondsRequestToCompletion = averageSecondsRequestToCompletion;
|
|
43
|
+
this.#buckets = buckets;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { dto } from '@basmilius/http-client';
|
|
2
|
+
import type { CostDto } from '#data/dto';
|
|
3
|
+
|
|
4
|
+
@dto
|
|
5
|
+
export class StatisticsSalesDiscountEfficacyDto {
|
|
6
|
+
get ordersWithDiscount(): number {
|
|
7
|
+
return this.#ordersWithDiscount;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
set ordersWithDiscount(value: number) {
|
|
11
|
+
this.#ordersWithDiscount = value;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
get ordersWithoutDiscount(): number {
|
|
15
|
+
return this.#ordersWithoutDiscount;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
set ordersWithoutDiscount(value: number) {
|
|
19
|
+
this.#ordersWithoutDiscount = value;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
get discountUsageRate(): number {
|
|
23
|
+
return this.#discountUsageRate;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
set discountUsageRate(value: number) {
|
|
27
|
+
this.#discountUsageRate = value;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
get revenueWithDiscount(): CostDto {
|
|
31
|
+
return this.#revenueWithDiscount;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
set revenueWithDiscount(value: CostDto) {
|
|
35
|
+
this.#revenueWithDiscount = value;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
get revenueWithoutDiscount(): CostDto {
|
|
39
|
+
return this.#revenueWithoutDiscount;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
set revenueWithoutDiscount(value: CostDto) {
|
|
43
|
+
this.#revenueWithoutDiscount = value;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
get totalDiscountAmount(): CostDto {
|
|
47
|
+
return this.#totalDiscountAmount;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
set totalDiscountAmount(value: CostDto) {
|
|
51
|
+
this.#totalDiscountAmount = value;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
get averageDiscountPerOrder(): CostDto {
|
|
55
|
+
return this.#averageDiscountPerOrder;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
set averageDiscountPerOrder(value: CostDto) {
|
|
59
|
+
this.#averageDiscountPerOrder = value;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
get averageOrderValueWithDiscount(): CostDto {
|
|
63
|
+
return this.#averageOrderValueWithDiscount;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
set averageOrderValueWithDiscount(value: CostDto) {
|
|
67
|
+
this.#averageOrderValueWithDiscount = value;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
get averageOrderValueWithoutDiscount(): CostDto {
|
|
71
|
+
return this.#averageOrderValueWithoutDiscount;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
set averageOrderValueWithoutDiscount(value: CostDto) {
|
|
75
|
+
this.#averageOrderValueWithoutDiscount = value;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
#ordersWithDiscount: number;
|
|
79
|
+
#ordersWithoutDiscount: number;
|
|
80
|
+
#discountUsageRate: number;
|
|
81
|
+
#revenueWithDiscount: CostDto;
|
|
82
|
+
#revenueWithoutDiscount: CostDto;
|
|
83
|
+
#totalDiscountAmount: CostDto;
|
|
84
|
+
#averageDiscountPerOrder: CostDto;
|
|
85
|
+
#averageOrderValueWithDiscount: CostDto;
|
|
86
|
+
#averageOrderValueWithoutDiscount: CostDto;
|
|
87
|
+
|
|
88
|
+
constructor(ordersWithDiscount: number, ordersWithoutDiscount: number, discountUsageRate: number, revenueWithDiscount: CostDto, revenueWithoutDiscount: CostDto, totalDiscountAmount: CostDto, averageDiscountPerOrder: CostDto, averageOrderValueWithDiscount: CostDto, averageOrderValueWithoutDiscount: CostDto) {
|
|
89
|
+
this.#ordersWithDiscount = ordersWithDiscount;
|
|
90
|
+
this.#ordersWithoutDiscount = ordersWithoutDiscount;
|
|
91
|
+
this.#discountUsageRate = discountUsageRate;
|
|
92
|
+
this.#revenueWithDiscount = revenueWithDiscount;
|
|
93
|
+
this.#revenueWithoutDiscount = revenueWithoutDiscount;
|
|
94
|
+
this.#totalDiscountAmount = totalDiscountAmount;
|
|
95
|
+
this.#averageDiscountPerOrder = averageDiscountPerOrder;
|
|
96
|
+
this.#averageOrderValueWithDiscount = averageOrderValueWithDiscount;
|
|
97
|
+
this.#averageOrderValueWithoutDiscount = averageOrderValueWithoutDiscount;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { dto } from '@basmilius/http-client';
|
|
2
|
+
import type { TransactionStatus } from '#data/types';
|
|
3
|
+
|
|
4
|
+
@dto
|
|
5
|
+
export class StatisticsSalesFailedTransactionReasonDto {
|
|
6
|
+
get status(): TransactionStatus {
|
|
7
|
+
return this.#status;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
set status(value: TransactionStatus) {
|
|
11
|
+
this.#status = value;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
get count(): number {
|
|
15
|
+
return this.#count;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
set count(value: number) {
|
|
19
|
+
this.#count = value;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
#status: TransactionStatus;
|
|
23
|
+
#count: number;
|
|
24
|
+
|
|
25
|
+
constructor(status: TransactionStatus, count: number) {
|
|
26
|
+
this.#status = status;
|
|
27
|
+
this.#count = count;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { dto } from '@basmilius/http-client';
|
|
2
|
+
import type { CostDto } from '#data/dto';
|
|
3
|
+
|
|
4
|
+
export type StatisticsSalesOrderValueBucket =
|
|
5
|
+
| 'under_25'
|
|
6
|
+
| '25_50'
|
|
7
|
+
| '50_100'
|
|
8
|
+
| '100_250'
|
|
9
|
+
| '250_500'
|
|
10
|
+
| '500_1000'
|
|
11
|
+
| 'over_1000';
|
|
12
|
+
|
|
13
|
+
@dto
|
|
14
|
+
export class StatisticsSalesOrderValueDistributionDto {
|
|
15
|
+
get buckets(): Record<StatisticsSalesOrderValueBucket, number> {
|
|
16
|
+
return this.#buckets;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
set buckets(value: Record<StatisticsSalesOrderValueBucket, number>) {
|
|
20
|
+
this.#buckets = value;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
get median(): CostDto {
|
|
24
|
+
return this.#median;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
set median(value: CostDto) {
|
|
28
|
+
this.#median = value;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
#buckets: Record<StatisticsSalesOrderValueBucket, number>;
|
|
32
|
+
#median: CostDto;
|
|
33
|
+
|
|
34
|
+
constructor(buckets: Record<StatisticsSalesOrderValueBucket, number>, median: CostDto) {
|
|
35
|
+
this.#buckets = buckets;
|
|
36
|
+
this.#median = median;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { dto } from '@basmilius/http-client';
|
|
2
|
+
|
|
3
|
+
export type StatisticsSalesRepeatPurchaseVelocityBucket =
|
|
4
|
+
| 'within_7_days'
|
|
5
|
+
| 'within_30_days'
|
|
6
|
+
| 'within_90_days'
|
|
7
|
+
| 'within_365_days'
|
|
8
|
+
| 'over_365_days';
|
|
9
|
+
|
|
10
|
+
@dto
|
|
11
|
+
export class StatisticsSalesRepeatPurchaseVelocityDto {
|
|
12
|
+
get averageDaysBetweenOrders(): number {
|
|
13
|
+
return this.#averageDaysBetweenOrders;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
set averageDaysBetweenOrders(value: number) {
|
|
17
|
+
this.#averageDaysBetweenOrders = value;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
get buckets(): Record<StatisticsSalesRepeatPurchaseVelocityBucket, number> {
|
|
21
|
+
return this.#buckets;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
set buckets(value: Record<StatisticsSalesRepeatPurchaseVelocityBucket, number>) {
|
|
25
|
+
this.#buckets = value;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
#averageDaysBetweenOrders: number;
|
|
29
|
+
#buckets: Record<StatisticsSalesRepeatPurchaseVelocityBucket, number>;
|
|
30
|
+
|
|
31
|
+
constructor(averageDaysBetweenOrders: number, buckets: Record<StatisticsSalesRepeatPurchaseVelocityBucket, number>) {
|
|
32
|
+
this.#averageDaysBetweenOrders = averageDaysBetweenOrders;
|
|
33
|
+
this.#buckets = buckets;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -2,15 +2,39 @@ export * from './InsightDto';
|
|
|
2
2
|
export * from './InsightSignalDto';
|
|
3
3
|
export * from './InsightsResponseDto';
|
|
4
4
|
export * from './MilestoneDto';
|
|
5
|
+
export * from './StatisticsBuyersAcquisitionSourceDto';
|
|
6
|
+
export * from './StatisticsBuyersAgeGenderMatrixDto';
|
|
7
|
+
export * from './StatisticsBuyersCohortRetentionDto';
|
|
8
|
+
export * from './StatisticsBuyersDeviceConversionDto';
|
|
9
|
+
export * from './StatisticsBuyersGeographicDistributionDto';
|
|
5
10
|
export * from './StatisticsBuyersOverviewDto';
|
|
6
11
|
export * from './StatisticsBuyersRankedDto';
|
|
12
|
+
export * from './StatisticsBuyersSpendBucketsDto';
|
|
13
|
+
export * from './StatisticsChartDto';
|
|
7
14
|
export * from './StatisticsEventsOverviewDto';
|
|
15
|
+
export * from './StatisticsEventsSalesCurveDto';
|
|
16
|
+
export * from './StatisticsEventsSalesCurveEventDto';
|
|
17
|
+
export * from './StatisticsEventsSellOutTimingDto';
|
|
18
|
+
export * from './StatisticsEventsSellOutTimingEventDto';
|
|
19
|
+
export * from './StatisticsEventsTimeToEventDto';
|
|
20
|
+
export * from './StatisticsGrowthCmgrDto';
|
|
8
21
|
export * from './StatisticsGrowthOverviewDto';
|
|
22
|
+
export * from './StatisticsMarketingCampaignDto';
|
|
23
|
+
export * from './StatisticsMarketingOverviewDto';
|
|
24
|
+
export * from './StatisticsMarketingReferrerDto';
|
|
25
|
+
export * from './StatisticsMarketingShortlinkRoiDto';
|
|
26
|
+
export * from './StatisticsMarketingSourceBreakdownDto';
|
|
27
|
+
export * from './StatisticsMarketingSourceFunnelDto';
|
|
28
|
+
export * from './StatisticsMarketingSourceMediumMatrixDto';
|
|
9
29
|
export * from './StatisticsOperationsAppTeamDto';
|
|
30
|
+
export * from './StatisticsOperationsNoShowRateDto';
|
|
31
|
+
export * from './StatisticsOperationsNoShowRateEventDto';
|
|
10
32
|
export * from './StatisticsOperationsOverviewDto';
|
|
11
|
-
export * from './
|
|
12
|
-
export * from './
|
|
33
|
+
export * from './StatisticsOperationsScanTimeDistributionDto';
|
|
34
|
+
export * from './StatisticsOperationsStewardDto';
|
|
35
|
+
export * from './StatisticsOperationsStockUtilizationDto';
|
|
13
36
|
export * from './StatisticsOverviewBestRevenueMonthDto';
|
|
37
|
+
export * from './StatisticsOverviewCancellationFunnelDto';
|
|
14
38
|
export * from './StatisticsOverviewEventPerformanceDto';
|
|
15
39
|
export * from './StatisticsOverviewEventPerformanceEventDto';
|
|
16
40
|
export * from './StatisticsOverviewEventPerformanceSummaryDto';
|
|
@@ -18,7 +42,18 @@ export * from './StatisticsOverviewKPIsDto';
|
|
|
18
42
|
export * from './StatisticsOverviewKPIsTotalEventsHostedDto';
|
|
19
43
|
export * from './StatisticsOverviewKPIsTotalRevenueDto';
|
|
20
44
|
export * from './StatisticsOverviewKPIsTotalTicketsSoldDto';
|
|
45
|
+
export * from './StatisticsOverviewReservationConversionRateDto';
|
|
46
|
+
export * from './StatisticsOverviewTopShopDto';
|
|
47
|
+
export * from './StatisticsPieChartDto';
|
|
48
|
+
export * from './StatisticsRefundsAmountDistributionDto';
|
|
49
|
+
export * from './StatisticsRefundsOverviewDto';
|
|
50
|
+
export * from './StatisticsRefundsTopEventDto';
|
|
51
|
+
export * from './StatisticsRefundsVelocityDto';
|
|
52
|
+
export * from './StatisticsSalesDiscountEfficacyDto';
|
|
53
|
+
export * from './StatisticsSalesFailedTransactionReasonDto';
|
|
21
54
|
export * from './StatisticsSalesLifetimeTotalsDto';
|
|
55
|
+
export * from './StatisticsSalesOrderValueDistributionDto';
|
|
22
56
|
export * from './StatisticsSalesPurchaseBehaviorDto';
|
|
57
|
+
export * from './StatisticsSalesRepeatPurchaseVelocityDto';
|
|
23
58
|
export * from './StatisticsSalesTransactionSuccessRateDto';
|
|
24
59
|
export * from './StatisticsTrendDto';
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { BaseResponse, BaseService, QueryString } from '@basmilius/http-client';
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import type { EventStatisticsBuyersOverviewDto, StatisticsBuyersRankedDto } from '#data/dto';
|
|
2
|
+
import { EventStatisticsBuyersAdapter, StatisticsChartAdapter } from '#data/adapter';
|
|
3
|
+
import type { EventStatisticsBuyersOverviewDto, StatisticsBuyersRankedDto, StatisticsChartDto } from '#data/dto';
|
|
5
4
|
|
|
6
5
|
export class MerchantEventStatisticsBuyersService extends BaseService {
|
|
7
6
|
async getOverview(merchantId: string, eventId: string): Promise<BaseResponse<EventStatisticsBuyersOverviewDto>> {
|
|
@@ -14,14 +13,14 @@ export class MerchantEventStatisticsBuyersService extends BaseService {
|
|
|
14
13
|
.runAdapter(EventStatisticsBuyersAdapter.parseOverview);
|
|
15
14
|
}
|
|
16
15
|
|
|
17
|
-
async getAcquisitionChart(merchantId: string, eventId: string): Promise<BaseResponse<
|
|
16
|
+
async getAcquisitionChart(merchantId: string, eventId: string): Promise<BaseResponse<StatisticsChartDto>> {
|
|
18
17
|
return await this
|
|
19
18
|
.request(`/merchants/${merchantId}/events/${eventId}/statistics/buyers/acquisition-chart`)
|
|
20
19
|
.method('get')
|
|
21
20
|
.queryString(QueryString.builder()
|
|
22
21
|
.append('language', 'nl'))
|
|
23
22
|
.bearerToken()
|
|
24
|
-
.
|
|
23
|
+
.runAdapter(StatisticsChartAdapter.parseChart);
|
|
25
24
|
}
|
|
26
25
|
|
|
27
26
|
async getAgeDistribution(merchantId: string, eventId: string): Promise<BaseResponse<Record<string, number>>> {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { BaseResponse, BaseService, QueryString } from '@basmilius/http-client';
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import type { EventStatisticsAppTeamDto, EventStatisticsAttendanceDto, EventStatisticsOperationsOverviewDto, EventStatisticsSwapsDto } from '#data/dto';
|
|
2
|
+
import { EventStatisticsOperationsAdapter, StatisticsChartAdapter } from '#data/adapter';
|
|
3
|
+
import type { EventStatisticsAppTeamDto, EventStatisticsAttendanceDto, EventStatisticsOperationsOverviewDto, EventStatisticsSwapsDto, StatisticsChartDto } from '#data/dto';
|
|
5
4
|
|
|
6
5
|
export class MerchantEventStatisticsOperationsService extends BaseService {
|
|
7
6
|
async getOverview(merchantId: string, eventId: string): Promise<BaseResponse<EventStatisticsOperationsOverviewDto>> {
|
|
@@ -34,14 +33,14 @@ export class MerchantEventStatisticsOperationsService extends BaseService {
|
|
|
34
33
|
.runAdapter(EventStatisticsOperationsAdapter.parseAttendance);
|
|
35
34
|
}
|
|
36
35
|
|
|
37
|
-
async getScansTrend(merchantId: string, eventId: string): Promise<BaseResponse<
|
|
36
|
+
async getScansTrend(merchantId: string, eventId: string): Promise<BaseResponse<StatisticsChartDto>> {
|
|
38
37
|
return await this
|
|
39
38
|
.request(`/merchants/${merchantId}/events/${eventId}/statistics/operations/scans-trend`)
|
|
40
39
|
.method('get')
|
|
41
40
|
.queryString(QueryString.builder()
|
|
42
41
|
.append('language', 'nl'))
|
|
43
42
|
.bearerToken()
|
|
44
|
-
.
|
|
43
|
+
.runAdapter(StatisticsChartAdapter.parseChart);
|
|
45
44
|
}
|
|
46
45
|
|
|
47
46
|
async getSwaps(merchantId: string, eventId: string): Promise<BaseResponse<EventStatisticsSwapsDto>> {
|