@passly-nl/data 1.2.2 → 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 +664 -69
- 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/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
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@passly-nl/data",
|
|
3
3
|
"description": "API implementation for Passly.",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.3.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"funding": "https://github.com/sponsors/basmilius",
|
|
@@ -50,20 +50,18 @@
|
|
|
50
50
|
"./*": "./*"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
|
-
"@basmilius/http-client": "^3.
|
|
54
|
-
"@flux-ui/types": "^3.0.0-next.
|
|
53
|
+
"@basmilius/http-client": "^3.34.0",
|
|
54
|
+
"@flux-ui/types": "^3.0.0-next.69",
|
|
55
55
|
"@fortawesome/fontawesome-common-types": "^7.2.0",
|
|
56
56
|
"@types/luxon": "^3.7.1",
|
|
57
|
-
"@typescript/native-preview": "^7.0.0-dev.
|
|
58
|
-
"apexcharts": "^5.11.0",
|
|
57
|
+
"@typescript/native-preview": "^7.0.0-dev.20260524.1",
|
|
59
58
|
"luxon": "^3.7.2",
|
|
60
59
|
"tsdown": "^0.22.0"
|
|
61
60
|
},
|
|
62
61
|
"peerDependencies": {
|
|
63
|
-
"@basmilius/http-client": "^3.
|
|
64
|
-
"@flux-ui/types": "^3.0.0-next.
|
|
62
|
+
"@basmilius/http-client": "^3.34.0",
|
|
63
|
+
"@flux-ui/types": "^3.0.0-next.69",
|
|
65
64
|
"@fortawesome/fontawesome-common-types": "^7.2.0",
|
|
66
|
-
"apexcharts": "^5.11.0",
|
|
67
65
|
"luxon": "^3.7.2"
|
|
68
66
|
},
|
|
69
67
|
"overrides": {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { adapter, ForeignData } from '@basmilius/http-client';
|
|
2
2
|
import { BuyerAdapter, PaymentAdapter, StatisticsAdapter } from '#data/adapter';
|
|
3
|
-
import { StatisticsBuyersOverviewDto, StatisticsBuyersRankedDto } from '#data/dto';
|
|
3
|
+
import { StatisticsBuyersAcquisitionSourceDto, StatisticsBuyersAgeGenderMatrixDto, StatisticsBuyersCohortRetentionDto, StatisticsBuyersDeviceConversionDto, StatisticsBuyersGeographicDistributionDto, StatisticsBuyersOverviewDto, StatisticsBuyersRankedDto, StatisticsBuyersSpendBucketsDto } from '#data/dto';
|
|
4
4
|
|
|
5
5
|
@adapter
|
|
6
6
|
export class StatisticsBuyersAdapter {
|
|
@@ -25,4 +25,53 @@ export class StatisticsBuyersAdapter {
|
|
|
25
25
|
PaymentAdapter.parseCost(data.average_order_value)
|
|
26
26
|
);
|
|
27
27
|
}
|
|
28
|
+
|
|
29
|
+
static parseGeographicDistribution(data: ForeignData): StatisticsBuyersGeographicDistributionDto {
|
|
30
|
+
return new StatisticsBuyersGeographicDistributionDto(
|
|
31
|
+
data.country,
|
|
32
|
+
data.buyers,
|
|
33
|
+
data.orders,
|
|
34
|
+
PaymentAdapter.parseCost(data.revenue)
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
static parseCohortRetention(data: ForeignData): StatisticsBuyersCohortRetentionDto {
|
|
39
|
+
return new StatisticsBuyersCohortRetentionDto(
|
|
40
|
+
data.cohorts,
|
|
41
|
+
data.buckets,
|
|
42
|
+
data.cohort_sizes,
|
|
43
|
+
data.cells
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
static parseSpendBuckets(data: ForeignData): StatisticsBuyersSpendBucketsDto {
|
|
48
|
+
return new StatisticsBuyersSpendBucketsDto(
|
|
49
|
+
data.buckets,
|
|
50
|
+
data.total_buyers
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
static parseAcquisitionSource(data: ForeignData): StatisticsBuyersAcquisitionSourceDto {
|
|
55
|
+
return new StatisticsBuyersAcquisitionSourceDto(
|
|
56
|
+
data.source,
|
|
57
|
+
data.buyers
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
static parseAgeGenderMatrix(data: ForeignData): StatisticsBuyersAgeGenderMatrixDto {
|
|
62
|
+
return new StatisticsBuyersAgeGenderMatrixDto(
|
|
63
|
+
data.age_groups,
|
|
64
|
+
data.genders,
|
|
65
|
+
data.cells
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
static parseDeviceConversion(data: ForeignData): StatisticsBuyersDeviceConversionDto {
|
|
70
|
+
return new StatisticsBuyersDeviceConversionDto(
|
|
71
|
+
data.operating_system,
|
|
72
|
+
data.visits,
|
|
73
|
+
data.orders,
|
|
74
|
+
data.conversion_rate
|
|
75
|
+
);
|
|
76
|
+
}
|
|
28
77
|
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { adapter, ForeignData } from '@basmilius/http-client';
|
|
2
|
+
import { StatisticsChartDto, StatisticsPieChartDto } from '#data/dto';
|
|
3
|
+
import type { StatisticsChartDataPoint, StatisticsChartSeries, StatisticsChartSeriesKind, StatisticsChartValueType, StatisticsPieSlice } from '#data/types';
|
|
4
|
+
|
|
5
|
+
@adapter
|
|
6
|
+
export class StatisticsChartAdapter {
|
|
7
|
+
static parseChart(data: ForeignData): StatisticsChartDto {
|
|
8
|
+
return new StatisticsChartDto(
|
|
9
|
+
data.series.map(StatisticsChartAdapter.parseSeries),
|
|
10
|
+
data.labels,
|
|
11
|
+
data.granularity ?? null
|
|
12
|
+
);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
static parseSeries(data: ForeignData): StatisticsChartSeries {
|
|
16
|
+
return {
|
|
17
|
+
name: data.name ?? null,
|
|
18
|
+
valueType: data.value_type as StatisticsChartValueType,
|
|
19
|
+
data: data.data.map(StatisticsChartAdapter.parseDataPoint),
|
|
20
|
+
type: (data.type ?? null) as StatisticsChartSeriesKind | null,
|
|
21
|
+
axisIndex: data.axis_index ?? null,
|
|
22
|
+
zIndex: data.z_index ?? null,
|
|
23
|
+
currency: data.currency ?? null
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
static parseDataPoint(data: number | null | ForeignData): number | null | StatisticsChartDataPoint {
|
|
28
|
+
if (data === null) {
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
if (typeof data === 'number') {
|
|
33
|
+
return data;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
return {
|
|
37
|
+
value: data.value,
|
|
38
|
+
formatted: data.formatted
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
static parsePie(data: ForeignData): StatisticsPieChartDto {
|
|
43
|
+
return new StatisticsPieChartDto(
|
|
44
|
+
data.slices.map(StatisticsChartAdapter.parsePieSlice),
|
|
45
|
+
data.value_type as StatisticsChartValueType
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
static parsePieSlice(data: ForeignData): StatisticsPieSlice {
|
|
50
|
+
return {
|
|
51
|
+
label: data.label,
|
|
52
|
+
value: data.value,
|
|
53
|
+
formatted: data.formatted ?? null
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { adapter, type ForeignData } from '@basmilius/http-client';
|
|
2
|
-
import { PaymentAdapter, StatisticsOverviewAdapter } from '#data/adapter';
|
|
3
|
-
import { StatisticsEventsOverviewDto, type StatisticsOverviewEventPerformanceDto } from '#data/dto';
|
|
2
|
+
import { DateTimeAdapter, PaymentAdapter, StatisticsOverviewAdapter } from '#data/adapter';
|
|
3
|
+
import { StatisticsEventsOverviewDto, StatisticsEventsSalesCurveDto, StatisticsEventsSalesCurveEventDto, StatisticsEventsSellOutTimingDto, StatisticsEventsSellOutTimingEventDto, StatisticsEventsTimeToEventDto, type StatisticsOverviewEventPerformanceDto } from '#data/dto';
|
|
4
4
|
|
|
5
5
|
@adapter
|
|
6
6
|
export class StatisticsEventsAdapter {
|
|
@@ -17,4 +17,43 @@ export class StatisticsEventsAdapter {
|
|
|
17
17
|
static parsePerformance(data: ForeignData): StatisticsOverviewEventPerformanceDto {
|
|
18
18
|
return StatisticsOverviewAdapter.parseEventPerformance(data);
|
|
19
19
|
}
|
|
20
|
+
|
|
21
|
+
static parseTimeToEvent(data: ForeignData): StatisticsEventsTimeToEventDto {
|
|
22
|
+
return new StatisticsEventsTimeToEventDto(
|
|
23
|
+
data.buckets,
|
|
24
|
+
data.average_days
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
static parseSalesCurve(data: ForeignData): StatisticsEventsSalesCurveDto {
|
|
29
|
+
return new StatisticsEventsSalesCurveDto(
|
|
30
|
+
data.events.map(StatisticsEventsAdapter.parseSalesCurveEvent)
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
static parseSalesCurveEvent(data: ForeignData): StatisticsEventsSalesCurveEventDto {
|
|
35
|
+
return new StatisticsEventsSalesCurveEventDto(
|
|
36
|
+
data.id,
|
|
37
|
+
data.name,
|
|
38
|
+
DateTimeAdapter.parseDateTime(data.starts_on),
|
|
39
|
+
data.days_before_start,
|
|
40
|
+
data.cumulative_tickets
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
static parseSellOutTiming(data: ForeignData): StatisticsEventsSellOutTimingDto {
|
|
45
|
+
return new StatisticsEventsSellOutTimingDto(
|
|
46
|
+
data.events_sold_out,
|
|
47
|
+
data.average_days_to_sell_out,
|
|
48
|
+
data.events.map(StatisticsEventsAdapter.parseSellOutTimingEvent)
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
static parseSellOutTimingEvent(data: ForeignData): StatisticsEventsSellOutTimingEventDto {
|
|
53
|
+
return new StatisticsEventsSellOutTimingEventDto(
|
|
54
|
+
data.id,
|
|
55
|
+
data.name,
|
|
56
|
+
data.days_to_sell_out
|
|
57
|
+
);
|
|
58
|
+
}
|
|
20
59
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { adapter, type ForeignData } from '@basmilius/http-client';
|
|
2
2
|
import { DateTimeAdapter, PaymentAdapter, StatisticsAdapter } from '#data/adapter';
|
|
3
|
-
import { MilestoneDto, StatisticsGrowthOverviewDto } from '#data/dto';
|
|
3
|
+
import { MilestoneDto, StatisticsGrowthCmgrDto, StatisticsGrowthOverviewDto } from '#data/dto';
|
|
4
4
|
|
|
5
5
|
@adapter
|
|
6
6
|
export class StatisticsGrowthAdapter {
|
|
@@ -26,6 +26,14 @@ export class StatisticsGrowthAdapter {
|
|
|
26
26
|
);
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
+
static parseCmgr(data: ForeignData): StatisticsGrowthCmgrDto {
|
|
30
|
+
return new StatisticsGrowthCmgrDto(
|
|
31
|
+
data.revenue_cmgr,
|
|
32
|
+
data.tickets_cmgr,
|
|
33
|
+
data.months_observed
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
|
|
29
37
|
private static parseFiniteNumber(value: unknown): number | null {
|
|
30
38
|
if (value === null || value === undefined) {
|
|
31
39
|
return null;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { adapter, ForeignData } from '@basmilius/http-client';
|
|
2
|
+
import { PaymentAdapter } from '#data/adapter';
|
|
3
|
+
import { StatisticsMarketingCampaignDto, StatisticsMarketingOverviewDto, StatisticsMarketingReferrerDto, StatisticsMarketingShortlinkRoiDto, StatisticsMarketingSourceBreakdownDto, StatisticsMarketingSourceFunnelDto, StatisticsMarketingSourceMediumMatrixDto } from '#data/dto';
|
|
4
|
+
|
|
5
|
+
@adapter
|
|
6
|
+
export class StatisticsMarketingAdapter {
|
|
7
|
+
static parseOverview(data: ForeignData): StatisticsMarketingOverviewDto {
|
|
8
|
+
return new StatisticsMarketingOverviewDto(
|
|
9
|
+
data.attributed_orders,
|
|
10
|
+
data.direct_orders,
|
|
11
|
+
data.attribution_rate,
|
|
12
|
+
PaymentAdapter.parseCost(data.attributed_revenue),
|
|
13
|
+
PaymentAdapter.parseCost(data.direct_revenue),
|
|
14
|
+
data.paid_ad_orders,
|
|
15
|
+
PaymentAdapter.parseCost(data.paid_ad_revenue)
|
|
16
|
+
);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
static parseSourceBreakdown(data: ForeignData): StatisticsMarketingSourceBreakdownDto {
|
|
20
|
+
return new StatisticsMarketingSourceBreakdownDto(
|
|
21
|
+
data.source,
|
|
22
|
+
data.orders,
|
|
23
|
+
data.tickets,
|
|
24
|
+
PaymentAdapter.parseCost(data.revenue)
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
static parseTopCampaigns(data: ForeignData): StatisticsMarketingCampaignDto {
|
|
29
|
+
return new StatisticsMarketingCampaignDto(
|
|
30
|
+
data.campaign,
|
|
31
|
+
data.source,
|
|
32
|
+
data.medium,
|
|
33
|
+
data.orders,
|
|
34
|
+
data.tickets,
|
|
35
|
+
PaymentAdapter.parseCost(data.revenue)
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
static parseSourceMediumMatrix(data: ForeignData): StatisticsMarketingSourceMediumMatrixDto {
|
|
40
|
+
return new StatisticsMarketingSourceMediumMatrixDto(
|
|
41
|
+
data.sources,
|
|
42
|
+
data.mediums,
|
|
43
|
+
data.cells.map((row: ForeignData[]) => row.map(PaymentAdapter.parseCost))
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
static parseTopReferrers(data: ForeignData): StatisticsMarketingReferrerDto {
|
|
48
|
+
return new StatisticsMarketingReferrerDto(
|
|
49
|
+
data.host,
|
|
50
|
+
data.orders,
|
|
51
|
+
PaymentAdapter.parseCost(data.revenue)
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
static parseSourceFunnel(data: ForeignData): StatisticsMarketingSourceFunnelDto {
|
|
56
|
+
return new StatisticsMarketingSourceFunnelDto(
|
|
57
|
+
data.source,
|
|
58
|
+
data.reservations,
|
|
59
|
+
data.orders,
|
|
60
|
+
data.conversion_rate
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
static parseShortlinkRoi(data: ForeignData): StatisticsMarketingShortlinkRoiDto {
|
|
65
|
+
return new StatisticsMarketingShortlinkRoiDto(
|
|
66
|
+
data.identifier,
|
|
67
|
+
data.hits,
|
|
68
|
+
data.orders,
|
|
69
|
+
PaymentAdapter.parseCost(data.revenue),
|
|
70
|
+
data.conversion_rate,
|
|
71
|
+
data.shop_id ?? null,
|
|
72
|
+
data.shop_name ?? null,
|
|
73
|
+
data.event_id ?? null,
|
|
74
|
+
data.event_name ?? null,
|
|
75
|
+
data.target_url ?? null
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { adapter, type ForeignData } from '@basmilius/http-client';
|
|
2
|
-
import {
|
|
2
|
+
import { DateTimeAdapter, PaymentAdapter } from '#data/adapter';
|
|
3
|
+
import { StatisticsOperationsAppTeamDto, StatisticsOperationsNoShowRateDto, StatisticsOperationsNoShowRateEventDto, StatisticsOperationsOverviewDto, StatisticsOperationsScanTimeDistributionDto, StatisticsOperationsStewardDto, StatisticsOperationsStockUtilizationDto } from '#data/dto';
|
|
3
4
|
|
|
4
5
|
@adapter
|
|
5
6
|
export class StatisticsOperationsAdapter {
|
|
@@ -25,23 +26,55 @@ export class StatisticsOperationsAdapter {
|
|
|
25
26
|
);
|
|
26
27
|
}
|
|
27
28
|
|
|
28
|
-
static
|
|
29
|
-
return new
|
|
30
|
-
data.
|
|
31
|
-
data.
|
|
32
|
-
data.
|
|
33
|
-
data.
|
|
34
|
-
data.
|
|
35
|
-
data.top_assignees.map(StatisticsOperationsAdapter.parseTaskAssignee)
|
|
29
|
+
static parseNoShowRate(data: ForeignData): StatisticsOperationsNoShowRateDto {
|
|
30
|
+
return new StatisticsOperationsNoShowRateDto(
|
|
31
|
+
data.valid_tickets,
|
|
32
|
+
data.checked_in,
|
|
33
|
+
data.no_shows,
|
|
34
|
+
data.no_show_rate,
|
|
35
|
+
data.events.map(StatisticsOperationsAdapter.parseNoShowRateEvent)
|
|
36
36
|
);
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
static
|
|
40
|
-
return new
|
|
39
|
+
static parseNoShowRateEvent(data: ForeignData): StatisticsOperationsNoShowRateEventDto {
|
|
40
|
+
return new StatisticsOperationsNoShowRateEventDto(
|
|
41
|
+
data.id,
|
|
42
|
+
data.name,
|
|
43
|
+
data.no_show_rate,
|
|
44
|
+
data.no_shows,
|
|
45
|
+
data.tickets_sold
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
static parseScanTimeDistribution(data: ForeignData): StatisticsOperationsScanTimeDistributionDto {
|
|
50
|
+
return new StatisticsOperationsScanTimeDistributionDto(
|
|
51
|
+
data.buckets,
|
|
52
|
+
data.median_minutes_relative
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
static parseSteward(data: ForeignData): StatisticsOperationsStewardDto {
|
|
57
|
+
return new StatisticsOperationsStewardDto(
|
|
41
58
|
data.user.id,
|
|
42
59
|
data.user.full_name,
|
|
43
60
|
data.user.initials,
|
|
44
|
-
data.
|
|
61
|
+
data.scans,
|
|
62
|
+
data.checkins,
|
|
63
|
+
data.checkouts
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
static parseStockUtilization(data: ForeignData): StatisticsOperationsStockUtilizationDto {
|
|
68
|
+
return new StatisticsOperationsStockUtilizationDto(
|
|
69
|
+
data.product_id,
|
|
70
|
+
data.product_name,
|
|
71
|
+
PaymentAdapter.parseCost(data.product_price),
|
|
72
|
+
data.event_id,
|
|
73
|
+
data.event_name,
|
|
74
|
+
DateTimeAdapter.parseDateTime(data.event_starts_on),
|
|
75
|
+
data.stock,
|
|
76
|
+
data.sold,
|
|
77
|
+
data.utilization_rate
|
|
45
78
|
);
|
|
46
79
|
}
|
|
47
80
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { adapter, ForeignData } from '@basmilius/http-client';
|
|
2
|
-
import { DateTimeAdapter, FileSystemAdapter, PaymentAdapter, StatisticsAdapter } from '#data/adapter';
|
|
3
|
-
import { StatisticsOverviewBestRevenueMonthDto, StatisticsOverviewEventPerformanceDto, StatisticsOverviewEventPerformanceEventDto, StatisticsOverviewEventPerformanceSummaryDto, StatisticsOverviewKPIsDto, StatisticsOverviewKPIsTotalEventsHostedDto, StatisticsOverviewKPIsTotalRevenueDto, StatisticsOverviewKPIsTotalTicketsSoldDto } from '#data/dto';
|
|
2
|
+
import { DateTimeAdapter, EventAdapter, FileSystemAdapter, PaymentAdapter, StatisticsAdapter } from '#data/adapter';
|
|
3
|
+
import { StatisticsOverviewBestRevenueMonthDto, StatisticsOverviewCancellationFunnelDto, StatisticsOverviewEventPerformanceDto, StatisticsOverviewEventPerformanceEventDto, StatisticsOverviewEventPerformanceSummaryDto, StatisticsOverviewKPIsDto, StatisticsOverviewKPIsTotalEventsHostedDto, StatisticsOverviewKPIsTotalRevenueDto, StatisticsOverviewKPIsTotalTicketsSoldDto, StatisticsOverviewReservationConversionRateDto, StatisticsOverviewTopShopDto } from '#data/dto';
|
|
4
4
|
import { optional } from '#data/util';
|
|
5
5
|
|
|
6
6
|
@adapter
|
|
@@ -82,4 +82,35 @@ export class StatisticsOverviewAdapter {
|
|
|
82
82
|
StatisticsAdapter.parseTrend(data.trend, Number)
|
|
83
83
|
);
|
|
84
84
|
}
|
|
85
|
+
|
|
86
|
+
static parseTopShop(data: ForeignData): StatisticsOverviewTopShopDto {
|
|
87
|
+
return new StatisticsOverviewTopShopDto(
|
|
88
|
+
EventAdapter.parseShop(data.shop),
|
|
89
|
+
PaymentAdapter.parseCost(data.revenue),
|
|
90
|
+
data.orders,
|
|
91
|
+
data.tickets
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
static parseCancellationFunnel(data: ForeignData): StatisticsOverviewCancellationFunnelDto {
|
|
96
|
+
return new StatisticsOverviewCancellationFunnelDto(
|
|
97
|
+
data.paid_orders,
|
|
98
|
+
data.orders_with_refund,
|
|
99
|
+
data.orders_fully_refunded,
|
|
100
|
+
data.partial_refund_rate,
|
|
101
|
+
data.full_refund_rate
|
|
102
|
+
);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
static parseReservationConversionRate(data: ForeignData): StatisticsOverviewReservationConversionRateDto {
|
|
106
|
+
return new StatisticsOverviewReservationConversionRateDto(
|
|
107
|
+
data.current,
|
|
108
|
+
data.previous,
|
|
109
|
+
data.growth_rate,
|
|
110
|
+
data.reservations_current,
|
|
111
|
+
data.reservations_previous,
|
|
112
|
+
data.orders_current,
|
|
113
|
+
data.orders_previous
|
|
114
|
+
);
|
|
115
|
+
}
|
|
85
116
|
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { adapter, ForeignData } from '@basmilius/http-client';
|
|
2
|
+
import { DateTimeAdapter, PaymentAdapter, StatisticsAdapter } from '#data/adapter';
|
|
3
|
+
import { StatisticsRefundsAmountDistributionDto, StatisticsRefundsOverviewDto, StatisticsRefundsTopEventDto, StatisticsRefundsVelocityDto } from '#data/dto';
|
|
4
|
+
|
|
5
|
+
@adapter
|
|
6
|
+
export class StatisticsRefundsAdapter {
|
|
7
|
+
static parseOverview(data: ForeignData): StatisticsRefundsOverviewDto {
|
|
8
|
+
return new StatisticsRefundsOverviewDto(
|
|
9
|
+
StatisticsAdapter.parseTrend(data.refund_rate, Number),
|
|
10
|
+
StatisticsAdapter.parseTrend(data.refund_count, Number),
|
|
11
|
+
StatisticsAdapter.parseTrend(data.refund_amount, PaymentAdapter.parseCost),
|
|
12
|
+
PaymentAdapter.parseCost(data.average_refund_amount),
|
|
13
|
+
data.average_completion_time_seconds
|
|
14
|
+
);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
static parseTopEvents(data: ForeignData): StatisticsRefundsTopEventDto {
|
|
18
|
+
return new StatisticsRefundsTopEventDto(
|
|
19
|
+
data.event_id,
|
|
20
|
+
data.event_name,
|
|
21
|
+
DateTimeAdapter.parseDateTime(data.event_starts_on),
|
|
22
|
+
data.refund_count,
|
|
23
|
+
PaymentAdapter.parseCost(data.refund_amount),
|
|
24
|
+
data.refund_rate
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
static parseVelocity(data: ForeignData): StatisticsRefundsVelocityDto {
|
|
29
|
+
return new StatisticsRefundsVelocityDto(
|
|
30
|
+
data.average_days_order_to_refund,
|
|
31
|
+
data.average_seconds_request_to_completion,
|
|
32
|
+
data.buckets
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
static parseAmountDistribution(data: ForeignData): StatisticsRefundsAmountDistributionDto {
|
|
37
|
+
return new StatisticsRefundsAmountDistributionDto(
|
|
38
|
+
data.full,
|
|
39
|
+
data.partial,
|
|
40
|
+
data.average_partial_ratio
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { adapter, ForeignData } from '@basmilius/http-client';
|
|
2
2
|
import { DateTimeAdapter, PaymentAdapter } from '#data/adapter';
|
|
3
|
-
import { StatisticsSalesLifetimeTotalsDto, StatisticsSalesPurchaseBehaviorDto, StatisticsSalesTransactionSuccessRateDto } from '#data/dto';
|
|
3
|
+
import { StatisticsSalesDiscountEfficacyDto, StatisticsSalesFailedTransactionReasonDto, StatisticsSalesLifetimeTotalsDto, StatisticsSalesOrderValueDistributionDto, StatisticsSalesPurchaseBehaviorDto, StatisticsSalesRepeatPurchaseVelocityDto, StatisticsSalesTransactionSuccessRateDto } from '#data/dto';
|
|
4
4
|
|
|
5
5
|
@adapter
|
|
6
6
|
export class StatisticsSalesAdapter {
|
|
@@ -30,4 +30,39 @@ export class StatisticsSalesAdapter {
|
|
|
30
30
|
data.reasons
|
|
31
31
|
);
|
|
32
32
|
}
|
|
33
|
+
|
|
34
|
+
static parseDiscountEfficacy(data: ForeignData): StatisticsSalesDiscountEfficacyDto {
|
|
35
|
+
return new StatisticsSalesDiscountEfficacyDto(
|
|
36
|
+
data.orders_with_discount,
|
|
37
|
+
data.orders_without_discount,
|
|
38
|
+
data.discount_usage_rate,
|
|
39
|
+
PaymentAdapter.parseCost(data.revenue_with_discount),
|
|
40
|
+
PaymentAdapter.parseCost(data.revenue_without_discount),
|
|
41
|
+
PaymentAdapter.parseCost(data.total_discount_amount),
|
|
42
|
+
PaymentAdapter.parseCost(data.average_discount_per_order),
|
|
43
|
+
PaymentAdapter.parseCost(data.average_order_value_with_discount),
|
|
44
|
+
PaymentAdapter.parseCost(data.average_order_value_without_discount)
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
static parseOrderValueDistribution(data: ForeignData): StatisticsSalesOrderValueDistributionDto {
|
|
49
|
+
return new StatisticsSalesOrderValueDistributionDto(
|
|
50
|
+
data.buckets,
|
|
51
|
+
PaymentAdapter.parseCost(data.median)
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
static parseFailedTransactionReason(data: ForeignData): StatisticsSalesFailedTransactionReasonDto {
|
|
56
|
+
return new StatisticsSalesFailedTransactionReasonDto(
|
|
57
|
+
data.status,
|
|
58
|
+
data.count
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
static parseRepeatPurchaseVelocity(data: ForeignData): StatisticsSalesRepeatPurchaseVelocityDto {
|
|
63
|
+
return new StatisticsSalesRepeatPurchaseVelocityDto(
|
|
64
|
+
data.average_days_between_orders,
|
|
65
|
+
data.buckets
|
|
66
|
+
);
|
|
67
|
+
}
|
|
33
68
|
}
|
package/src/adapter/index.ts
CHANGED
|
@@ -13,7 +13,6 @@ export * from './EventAdapter';
|
|
|
13
13
|
export * from './EventStatisticsBuyersAdapter';
|
|
14
14
|
export * from './EventStatisticsOperationsAdapter';
|
|
15
15
|
export * from './EventStatisticsOverviewAdapter';
|
|
16
|
-
export * from './EventStatisticsSalesAdapter';
|
|
17
16
|
export * from './FileSystemAdapter';
|
|
18
17
|
export * from './FinanceAdapter';
|
|
19
18
|
export * from './FluxAdapter';
|
|
@@ -31,11 +30,14 @@ export * from './ServiceAdapter';
|
|
|
31
30
|
export * from './ShortlinkAdapter';
|
|
32
31
|
export * from './StatisticsAdapter';
|
|
33
32
|
export * from './StatisticsBuyersAdapter';
|
|
33
|
+
export * from './StatisticsChartAdapter';
|
|
34
34
|
export * from './StatisticsEventsAdapter';
|
|
35
35
|
export * from './StatisticsGrowthAdapter';
|
|
36
36
|
export * from './StatisticsInsightsAdapter';
|
|
37
|
+
export * from './StatisticsMarketingAdapter';
|
|
37
38
|
export * from './StatisticsOperationsAdapter';
|
|
38
39
|
export * from './StatisticsOverviewAdapter';
|
|
40
|
+
export * from './StatisticsRefundsAdapter';
|
|
39
41
|
export * from './StatisticsSalesAdapter';
|
|
40
42
|
export * from './SubscriptionAdapter';
|
|
41
43
|
export * from './TicketAdapter';
|
|
@@ -4,6 +4,5 @@ export * from './EventStatisticsBuyersOverviewDto';
|
|
|
4
4
|
export * from './EventStatisticsFinancialDto';
|
|
5
5
|
export * from './EventStatisticsKpisDto';
|
|
6
6
|
export * from './EventStatisticsOperationsOverviewDto';
|
|
7
|
-
export * from './EventStatisticsSalesFlowChartDto';
|
|
8
7
|
export * from './EventStatisticsStatusDto';
|
|
9
8
|
export * from './EventStatisticsSwapsDto';
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { dto } from '@basmilius/http-client';
|
|
2
|
+
|
|
3
|
+
@dto
|
|
4
|
+
export class StatisticsBuyersAcquisitionSourceDto {
|
|
5
|
+
get source(): string {
|
|
6
|
+
return this.#source;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
set source(value: string) {
|
|
10
|
+
this.#source = value;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
get buyers(): number {
|
|
14
|
+
return this.#buyers;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
set buyers(value: number) {
|
|
18
|
+
this.#buyers = value;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
#source: string;
|
|
22
|
+
#buyers: number;
|
|
23
|
+
|
|
24
|
+
constructor(source: string, buyers: number) {
|
|
25
|
+
this.#source = source;
|
|
26
|
+
this.#buyers = buyers;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { dto } from '@basmilius/http-client';
|
|
2
|
+
|
|
3
|
+
@dto
|
|
4
|
+
export class StatisticsBuyersAgeGenderMatrixDto {
|
|
5
|
+
get ageGroups(): readonly string[] {
|
|
6
|
+
return this.#ageGroups;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
set ageGroups(value: readonly string[]) {
|
|
10
|
+
this.#ageGroups = value;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
get genders(): readonly string[] {
|
|
14
|
+
return this.#genders;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
set genders(value: readonly string[]) {
|
|
18
|
+
this.#genders = value;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
get cells(): readonly (readonly number[])[] {
|
|
22
|
+
return this.#cells;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
set cells(value: readonly (readonly number[])[]) {
|
|
26
|
+
this.#cells = value;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
#ageGroups: readonly string[];
|
|
30
|
+
#genders: readonly string[];
|
|
31
|
+
#cells: readonly (readonly number[])[];
|
|
32
|
+
|
|
33
|
+
constructor(ageGroups: readonly string[], genders: readonly string[], cells: readonly (readonly number[])[]) {
|
|
34
|
+
this.#ageGroups = ageGroups;
|
|
35
|
+
this.#genders = genders;
|
|
36
|
+
this.#cells = cells;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { dto } from '@basmilius/http-client';
|
|
2
|
+
|
|
3
|
+
@dto
|
|
4
|
+
export class StatisticsBuyersCohortRetentionDto {
|
|
5
|
+
get cohorts(): readonly string[] {
|
|
6
|
+
return this.#cohorts;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
set cohorts(value: readonly string[]) {
|
|
10
|
+
this.#cohorts = value;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
get buckets(): readonly string[] {
|
|
14
|
+
return this.#buckets;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
set buckets(value: readonly string[]) {
|
|
18
|
+
this.#buckets = value;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
get cohortSizes(): readonly number[] {
|
|
22
|
+
return this.#cohortSizes;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
set cohortSizes(value: readonly number[]) {
|
|
26
|
+
this.#cohortSizes = value;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
get cells(): readonly (readonly (number | null)[])[] {
|
|
30
|
+
return this.#cells;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
set cells(value: readonly (readonly (number | null)[])[]) {
|
|
34
|
+
this.#cells = value;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
#cohorts: readonly string[];
|
|
38
|
+
#buckets: readonly string[];
|
|
39
|
+
#cohortSizes: readonly number[];
|
|
40
|
+
#cells: readonly (readonly (number | null)[])[];
|
|
41
|
+
|
|
42
|
+
constructor(cohorts: readonly string[], buckets: readonly string[], cohortSizes: readonly number[], cells: readonly (readonly (number | null)[])[]) {
|
|
43
|
+
this.#cohorts = cohorts;
|
|
44
|
+
this.#buckets = buckets;
|
|
45
|
+
this.#cohortSizes = cohortSizes;
|
|
46
|
+
this.#cells = cells;
|
|
47
|
+
}
|
|
48
|
+
}
|