reach-api-sdk 1.0.30 → 1.0.31
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/reach-sdk.d.ts +35 -1
- package/dist/reach-sdk.js +21 -0
- package/package.json +1 -1
- package/src/definition/swagger.yaml +93 -0
- package/src/index.ts +1 -0
- package/src/models/Customer.ts +2 -0
- package/src/models/CustomerStats.ts +26 -0
- package/src/services/CustomersService.ts +27 -0
package/dist/reach-sdk.d.ts
CHANGED
|
@@ -1149,6 +1149,28 @@ type Country = {
|
|
|
1149
1149
|
taxes?: Array<Tax> | null;
|
|
1150
1150
|
};
|
|
1151
1151
|
|
|
1152
|
+
/**
|
|
1153
|
+
* Model for customer stats.
|
|
1154
|
+
*/
|
|
1155
|
+
type CustomerStats = {
|
|
1156
|
+
/**
|
|
1157
|
+
* Gets or sets the total revenue recieved from the customer.
|
|
1158
|
+
*/
|
|
1159
|
+
totalRevenue: number;
|
|
1160
|
+
/**
|
|
1161
|
+
* Gets or sets the total number of orders placed by the customer.
|
|
1162
|
+
*/
|
|
1163
|
+
totalOrders: number;
|
|
1164
|
+
/**
|
|
1165
|
+
* Gets or sets the total number of cancellations.
|
|
1166
|
+
*/
|
|
1167
|
+
totalCancellations: number;
|
|
1168
|
+
/**
|
|
1169
|
+
* Gets or sets the total amount refunded to the customer.
|
|
1170
|
+
*/
|
|
1171
|
+
totalRefunded: number;
|
|
1172
|
+
};
|
|
1173
|
+
|
|
1152
1174
|
/**
|
|
1153
1175
|
* The customer type.
|
|
1154
1176
|
*/
|
|
@@ -1242,6 +1264,7 @@ type Customer = {
|
|
|
1242
1264
|
* Gets or sets how many times the customer has booked with the organisation.
|
|
1243
1265
|
*/
|
|
1244
1266
|
bookingCount?: number | null;
|
|
1267
|
+
stats?: CustomerStats;
|
|
1245
1268
|
};
|
|
1246
1269
|
|
|
1247
1270
|
/**
|
|
@@ -6420,6 +6443,17 @@ type CustomerPost = {
|
|
|
6420
6443
|
declare class CustomersService {
|
|
6421
6444
|
readonly httpRequest: BaseHttpRequest;
|
|
6422
6445
|
constructor(httpRequest: BaseHttpRequest);
|
|
6446
|
+
/**
|
|
6447
|
+
* Gets the customer with added stats.
|
|
6448
|
+
* @returns Customer Success
|
|
6449
|
+
* @throws ApiError
|
|
6450
|
+
*/
|
|
6451
|
+
getObjectWithStats({ id, }: {
|
|
6452
|
+
/**
|
|
6453
|
+
* The customer Id.
|
|
6454
|
+
*/
|
|
6455
|
+
id: string;
|
|
6456
|
+
}): CancelablePromise<Customer>;
|
|
6423
6457
|
/**
|
|
6424
6458
|
* Exports the customers list to a csv format.
|
|
6425
6459
|
* Endpoint has AllowAnonymous attr, however the jwt is validated in the method body (in support of authenticated file downloads.
|
|
@@ -28860,4 +28894,4 @@ type ValidationResultModel = {
|
|
|
28860
28894
|
readonly errors?: Array<ValidationError> | null;
|
|
28861
28895
|
};
|
|
28862
28896
|
|
|
28863
|
-
export { Activity, ActivityService, ActivityType, AdvanceBooking, Amenity, AmenityService, ApiClient, ApiError, AppUserRole, ApplicationRole, Attendee, AttendeePage, AttendeePatch, AttendeePost, AttendeesService, AutoCompleteResponseModel, BadEnglandReportService, BaseHttpRequest, BookingService, BookingStatus, CancelError, CancelablePromise, ContactOnConfirmation, Country, CountryService, Course, CourseBookingCutoff, CoursePage, CoursePatch, CoursePost, CourseSearchSortBy, CourseSession, CourseSessionPage, CourseSessionPatch, CourseSessionPost, CourseSessionSchedule, CourseSessionSchedulePage, CourseSessionSchedulePatch, CourseSessionSchedulePost, CourseSessionSchedulesService, CourseSessionsService, CoursesService, CreateOffer, CreateQuestion, CreateQuestionOption, CreateVenue, Customer, CustomerCancellationOption, CustomerPage, CustomerPatch, CustomerPost, CustomerType, CustomersService, DayOfWeek, EmailReminderSchedule, EmailReminderSchedulePage, EmailReminderSchedulePatch, EmailReminderSchedulePost, EmailReminderSchedulesService, EmailSetting, EmailSettingPage, EmailSettingPatch, EmailSettingPost, EmailSettingsService, FacilitiesService, Facility, FacilityIndividual, FacilityIndividualPage, FacilityIndividualPatch, FacilityIndividualPost, FacilityIndividualsService, FacilityIndividualsType, FacilityPage, FacilityPatch, FacilityPost, FilestackImageMetaResponseModel, FilestackService, GenericActivity, GenericActivityPage, GenericActivityPatch, GenericActivityPost, GenericActivityService, GeocodeResponseModel, GeocodeService, GooglePrediction, HereAddressDetails, HereAutoComplete, HereAutocompleteLookupService, HereLookupResults, HereMapDetails, HerePositionDetails, HttpStatusCode, IOpportunity, Image, ImagePage, ImagePatch, ImagePost, ImagesService, InviteStatus, LeasingService, LoqateGeocode, LoqatePlaceResult, LoqatePlacesService, LoqatePrediction, Northeast, NotificationQueue, NotificationQueuePage, NotificationQueuePatch, NotificationQueuePost, NotificationQueueService, NotificationSetting, NotificationSettingPage, NotificationSettingPatch, NotificationSettingPost, NotificationSettingsService, NotificationType, Offer, OfferPage, OfferPatch, OfferPost, OffersService, OpenAPI, OpenAPIConfig, OpenactiveFeedIntermediate, OpenactiveFeedIntermediatePage, OpenactiveFeedIntermediatePatch, OpenactiveFeedIntermediatePost, OpenactiveFeedIntermediateService, OpenactiveFeedItem, OpenactiveFeedItemPage, OpenactiveFeedItemPatch, OpenactiveFeedItemPost, OpenactiveFeedItemService, OpportunityRegister, OpportunityRegisterPage, OpportunityRegisterPatch, OpportunityRegisterPost, OpportunityRegisterService, OpportunityType, Order, OrderItem, OrderItemPage, OrderItemPatch, OrderItemPost, OrderItemStatus, OrderItemsService, OrderPage, OrderPatch, OrderPost, OrderPostItem, OrderRefresh, OrderSource, OrderStage, OrderToken, OrderTokenPage, OrderTokenPatch, OrderTokenPost, OrderUpdateContact, OrdersService, OrgCourseUtilisation, OrgCourseUtilisationPage, OrgCourseUtilisationPatch, OrgCourseUtilisationPost, OrgCourseUtilisationService, OrganisationApplicationFeeHandling, OrganisationAvailableChannel, OrganisationRefundPolicy, OrganisationTaxMode, OrganisationType, Pagination, PatchSurveyQuestionOption, Payment, PaymentMethod, PaymentPage, PaymentPatch, PaymentPost, PaymentsService, Permission, PermissionPage, PermissionPatch, PermissionPost, PermissionsService, PlaceDetailsResponseModel, PlaceGeometry, PlaceLocation, PlaceResult, PlaceViewport, PlacesService, PlusCode, Prepayment, Programme, ProgrammePage, ProgrammePatch, ProgrammePost, ProgrammesService, PublicBookingService, PublicCoursesService, PublicFacilitiesService, PublicHealthCheckService, PublicLeasingService, PublicOrderTokensService, PublicOrdersService, PublicProgrammesService, PublicScheduledSessionsService, PublicSessionsService, PublicSlotsService, PublicStripeWebhookService, PublicSurveyQuestionsService, PublicSurveysService, PublicTenantsService, PublicVenuesService, PublicWaitlistActivityService, PublicWaitlistOpportunityService, ReachEntity, ReachError, ReachOperation, RecentOrderActivityReport, RecentOrderActivityReportPage, RecentOrderActivityReportPatch, RecentOrderActivityReportPost, RecentOrderActivityReportService, ScheduleStatus, ScheduledSession, ScheduledSessionPage, ScheduledSessionPatch, ScheduledSessionPost, ScheduledSessionSchedule, ScheduledSessionSchedulePage, ScheduledSessionSchedulePatch, ScheduledSessionSchedulePost, ScheduledSessionSearchSortBy, ScheduledSessionsSchedulesService, ScheduledSessionsService, SearchSortOrderDirection, Session, SessionCreate, SessionGender, SessionPage, SessionPatch, SessionPost, SessionType, SessionsService, Slot, SlotAvailabilityStatus, SlotOffer, SlotOfferPage, SlotOfferPatch, SlotOfferPost, SlotOffersService, SlotPage, SlotPatch, SlotPost, SlotSchedule, SlotScheduleOffer, SlotScheduleOfferPage, SlotScheduleOfferPatch, SlotScheduleOfferPost, SlotScheduleOffersService, SlotSchedulePage, SlotSchedulePatch, SlotSchedulePost, SlotSchedulesService, SlotStatus, SlotsService, Southwest, StripeAccount, StripeAccountPage, StripeAccountPatch, StripeAccountPost, StripeAccountService, StructuredFormatting, Surface, SurfacesService, Survey, SurveyAnswer, SurveyAnswerPage, SurveyAnswerPatch, SurveyAnswerPost, SurveyAnswersService, SurveyCreate, SurveyPage, SurveyPatch, SurveyPost, SurveyQuestion, SurveyQuestionOption, SurveyQuestionPage, SurveyQuestionPatch, SurveyQuestionPost, SurveyQuestionType, SurveyQuestionsService, SurveyQuestionsTarget, SurveyReportExtended, SurveyReportExtendedPage, SurveyReportExtendedPatch, SurveyReportExtendedPost, SurveyReportExtendedService, SurveyResponseMode, SurveySubmissionModel, SurveySubmissionResponse, SurveySubmit, SurveyType, SurveysService, Tax, Tenant, TenantPage, TenantPatch, TenantPost, TenantWebsiteSetting, TenantWebsiteSettingPage, TenantWebsiteSettingPatch, TenantWebsiteSettingPost, TenantWebsiteSettingsService, TenantsService, Timezone, TimezoneService, TotalRevenueReport, TotalRevenueReportPage, TotalRevenueReportPatch, TotalRevenueReportPost, TotalRevenueReportService, UpdateEmailSettings, UpdateOffer, User, UserPage, UserPatch, UserPost, UserRole, UsersService, ValidationError, ValidationResultModel, Venue, VenueBadmintonEnglandReport, VenueBadmintonEnglandReportPage, VenueBadmintonEnglandReportPatch, VenueBadmintonEnglandReportPost, VenueCreate, VenueOpeningHours, VenuePage, VenuePatch, VenuePost, VenuesReport, VenuesReportPage, VenuesReportPatch, VenuesReportPost, VenuesReportService, VenuesService, WaitlistActivity, WaitlistActivityPage, WaitlistActivityPatch, WaitlistActivityPost, WaitlistActivityService, WaitlistOpportunity, WaitlistOpportunityPage, WaitlistOpportunityPatch, WaitlistOpportunityPost, WaitlistOpportunityService };
|
|
28897
|
+
export { Activity, ActivityService, ActivityType, AdvanceBooking, Amenity, AmenityService, ApiClient, ApiError, AppUserRole, ApplicationRole, Attendee, AttendeePage, AttendeePatch, AttendeePost, AttendeesService, AutoCompleteResponseModel, BadEnglandReportService, BaseHttpRequest, BookingService, BookingStatus, CancelError, CancelablePromise, ContactOnConfirmation, Country, CountryService, Course, CourseBookingCutoff, CoursePage, CoursePatch, CoursePost, CourseSearchSortBy, CourseSession, CourseSessionPage, CourseSessionPatch, CourseSessionPost, CourseSessionSchedule, CourseSessionSchedulePage, CourseSessionSchedulePatch, CourseSessionSchedulePost, CourseSessionSchedulesService, CourseSessionsService, CoursesService, CreateOffer, CreateQuestion, CreateQuestionOption, CreateVenue, Customer, CustomerCancellationOption, CustomerPage, CustomerPatch, CustomerPost, CustomerStats, CustomerType, CustomersService, DayOfWeek, EmailReminderSchedule, EmailReminderSchedulePage, EmailReminderSchedulePatch, EmailReminderSchedulePost, EmailReminderSchedulesService, EmailSetting, EmailSettingPage, EmailSettingPatch, EmailSettingPost, EmailSettingsService, FacilitiesService, Facility, FacilityIndividual, FacilityIndividualPage, FacilityIndividualPatch, FacilityIndividualPost, FacilityIndividualsService, FacilityIndividualsType, FacilityPage, FacilityPatch, FacilityPost, FilestackImageMetaResponseModel, FilestackService, GenericActivity, GenericActivityPage, GenericActivityPatch, GenericActivityPost, GenericActivityService, GeocodeResponseModel, GeocodeService, GooglePrediction, HereAddressDetails, HereAutoComplete, HereAutocompleteLookupService, HereLookupResults, HereMapDetails, HerePositionDetails, HttpStatusCode, IOpportunity, Image, ImagePage, ImagePatch, ImagePost, ImagesService, InviteStatus, LeasingService, LoqateGeocode, LoqatePlaceResult, LoqatePlacesService, LoqatePrediction, Northeast, NotificationQueue, NotificationQueuePage, NotificationQueuePatch, NotificationQueuePost, NotificationQueueService, NotificationSetting, NotificationSettingPage, NotificationSettingPatch, NotificationSettingPost, NotificationSettingsService, NotificationType, Offer, OfferPage, OfferPatch, OfferPost, OffersService, OpenAPI, OpenAPIConfig, OpenactiveFeedIntermediate, OpenactiveFeedIntermediatePage, OpenactiveFeedIntermediatePatch, OpenactiveFeedIntermediatePost, OpenactiveFeedIntermediateService, OpenactiveFeedItem, OpenactiveFeedItemPage, OpenactiveFeedItemPatch, OpenactiveFeedItemPost, OpenactiveFeedItemService, OpportunityRegister, OpportunityRegisterPage, OpportunityRegisterPatch, OpportunityRegisterPost, OpportunityRegisterService, OpportunityType, Order, OrderItem, OrderItemPage, OrderItemPatch, OrderItemPost, OrderItemStatus, OrderItemsService, OrderPage, OrderPatch, OrderPost, OrderPostItem, OrderRefresh, OrderSource, OrderStage, OrderToken, OrderTokenPage, OrderTokenPatch, OrderTokenPost, OrderUpdateContact, OrdersService, OrgCourseUtilisation, OrgCourseUtilisationPage, OrgCourseUtilisationPatch, OrgCourseUtilisationPost, OrgCourseUtilisationService, OrganisationApplicationFeeHandling, OrganisationAvailableChannel, OrganisationRefundPolicy, OrganisationTaxMode, OrganisationType, Pagination, PatchSurveyQuestionOption, Payment, PaymentMethod, PaymentPage, PaymentPatch, PaymentPost, PaymentsService, Permission, PermissionPage, PermissionPatch, PermissionPost, PermissionsService, PlaceDetailsResponseModel, PlaceGeometry, PlaceLocation, PlaceResult, PlaceViewport, PlacesService, PlusCode, Prepayment, Programme, ProgrammePage, ProgrammePatch, ProgrammePost, ProgrammesService, PublicBookingService, PublicCoursesService, PublicFacilitiesService, PublicHealthCheckService, PublicLeasingService, PublicOrderTokensService, PublicOrdersService, PublicProgrammesService, PublicScheduledSessionsService, PublicSessionsService, PublicSlotsService, PublicStripeWebhookService, PublicSurveyQuestionsService, PublicSurveysService, PublicTenantsService, PublicVenuesService, PublicWaitlistActivityService, PublicWaitlistOpportunityService, ReachEntity, ReachError, ReachOperation, RecentOrderActivityReport, RecentOrderActivityReportPage, RecentOrderActivityReportPatch, RecentOrderActivityReportPost, RecentOrderActivityReportService, ScheduleStatus, ScheduledSession, ScheduledSessionPage, ScheduledSessionPatch, ScheduledSessionPost, ScheduledSessionSchedule, ScheduledSessionSchedulePage, ScheduledSessionSchedulePatch, ScheduledSessionSchedulePost, ScheduledSessionSearchSortBy, ScheduledSessionsSchedulesService, ScheduledSessionsService, SearchSortOrderDirection, Session, SessionCreate, SessionGender, SessionPage, SessionPatch, SessionPost, SessionType, SessionsService, Slot, SlotAvailabilityStatus, SlotOffer, SlotOfferPage, SlotOfferPatch, SlotOfferPost, SlotOffersService, SlotPage, SlotPatch, SlotPost, SlotSchedule, SlotScheduleOffer, SlotScheduleOfferPage, SlotScheduleOfferPatch, SlotScheduleOfferPost, SlotScheduleOffersService, SlotSchedulePage, SlotSchedulePatch, SlotSchedulePost, SlotSchedulesService, SlotStatus, SlotsService, Southwest, StripeAccount, StripeAccountPage, StripeAccountPatch, StripeAccountPost, StripeAccountService, StructuredFormatting, Surface, SurfacesService, Survey, SurveyAnswer, SurveyAnswerPage, SurveyAnswerPatch, SurveyAnswerPost, SurveyAnswersService, SurveyCreate, SurveyPage, SurveyPatch, SurveyPost, SurveyQuestion, SurveyQuestionOption, SurveyQuestionPage, SurveyQuestionPatch, SurveyQuestionPost, SurveyQuestionType, SurveyQuestionsService, SurveyQuestionsTarget, SurveyReportExtended, SurveyReportExtendedPage, SurveyReportExtendedPatch, SurveyReportExtendedPost, SurveyReportExtendedService, SurveyResponseMode, SurveySubmissionModel, SurveySubmissionResponse, SurveySubmit, SurveyType, SurveysService, Tax, Tenant, TenantPage, TenantPatch, TenantPost, TenantWebsiteSetting, TenantWebsiteSettingPage, TenantWebsiteSettingPatch, TenantWebsiteSettingPost, TenantWebsiteSettingsService, TenantsService, Timezone, TimezoneService, TotalRevenueReport, TotalRevenueReportPage, TotalRevenueReportPatch, TotalRevenueReportPost, TotalRevenueReportService, UpdateEmailSettings, UpdateOffer, User, UserPage, UserPatch, UserPost, UserRole, UsersService, ValidationError, ValidationResultModel, Venue, VenueBadmintonEnglandReport, VenueBadmintonEnglandReportPage, VenueBadmintonEnglandReportPatch, VenueBadmintonEnglandReportPost, VenueCreate, VenueOpeningHours, VenuePage, VenuePatch, VenuePost, VenuesReport, VenuesReportPage, VenuesReportPatch, VenuesReportPost, VenuesReportService, VenuesService, WaitlistActivity, WaitlistActivityPage, WaitlistActivityPatch, WaitlistActivityPost, WaitlistActivityService, WaitlistOpportunity, WaitlistOpportunityPage, WaitlistOpportunityPatch, WaitlistOpportunityPost, WaitlistOpportunityService };
|
package/dist/reach-sdk.js
CHANGED
|
@@ -3011,6 +3011,27 @@ const request = (config, options, axiosClient = axios) => {
|
|
|
3011
3011
|
constructor(httpRequest) {
|
|
3012
3012
|
this.httpRequest = httpRequest;
|
|
3013
3013
|
}
|
|
3014
|
+
/**
|
|
3015
|
+
* Gets the customer with added stats.
|
|
3016
|
+
* @returns Customer Success
|
|
3017
|
+
* @throws ApiError
|
|
3018
|
+
*/
|
|
3019
|
+
getObjectWithStats({
|
|
3020
|
+
id
|
|
3021
|
+
}) {
|
|
3022
|
+
return this.httpRequest.request({
|
|
3023
|
+
method: "GET",
|
|
3024
|
+
url: "/api/customers/{id}/with-stats",
|
|
3025
|
+
path: {
|
|
3026
|
+
id
|
|
3027
|
+
},
|
|
3028
|
+
errors: {
|
|
3029
|
+
400: `Bad Request`,
|
|
3030
|
+
422: `Client Error`,
|
|
3031
|
+
500: `Server Error`
|
|
3032
|
+
}
|
|
3033
|
+
});
|
|
3034
|
+
}
|
|
3014
3035
|
/**
|
|
3015
3036
|
* Exports the customers list to a csv format.
|
|
3016
3037
|
* Endpoint has AllowAnonymous attr, however the jwt is validated in the method body (in support of authenticated file downloads.
|
package/package.json
CHANGED
|
@@ -7939,6 +7939,69 @@ paths:
|
|
|
7939
7939
|
text/json:
|
|
7940
7940
|
schema:
|
|
7941
7941
|
$ref: '#/components/schemas/ValidationResultModel'
|
|
7942
|
+
'/api/customers/{id}/with-stats':
|
|
7943
|
+
get:
|
|
7944
|
+
tags:
|
|
7945
|
+
- Customers
|
|
7946
|
+
summary: Gets the customer with added stats.
|
|
7947
|
+
operationId: GetObjectWithStats
|
|
7948
|
+
parameters:
|
|
7949
|
+
- name: id
|
|
7950
|
+
in: path
|
|
7951
|
+
description: The customer Id.
|
|
7952
|
+
required: true
|
|
7953
|
+
schema:
|
|
7954
|
+
type: string
|
|
7955
|
+
format: uuid
|
|
7956
|
+
responses:
|
|
7957
|
+
'200':
|
|
7958
|
+
description: Success
|
|
7959
|
+
content:
|
|
7960
|
+
text/plain:
|
|
7961
|
+
schema:
|
|
7962
|
+
$ref: '#/components/schemas/Customer'
|
|
7963
|
+
application/json:
|
|
7964
|
+
schema:
|
|
7965
|
+
$ref: '#/components/schemas/Customer'
|
|
7966
|
+
text/json:
|
|
7967
|
+
schema:
|
|
7968
|
+
$ref: '#/components/schemas/Customer'
|
|
7969
|
+
'400':
|
|
7970
|
+
description: Bad Request
|
|
7971
|
+
content:
|
|
7972
|
+
text/plain:
|
|
7973
|
+
schema:
|
|
7974
|
+
$ref: '#/components/schemas/ReachError'
|
|
7975
|
+
application/json:
|
|
7976
|
+
schema:
|
|
7977
|
+
$ref: '#/components/schemas/ReachError'
|
|
7978
|
+
text/json:
|
|
7979
|
+
schema:
|
|
7980
|
+
$ref: '#/components/schemas/ReachError'
|
|
7981
|
+
'500':
|
|
7982
|
+
description: Server Error
|
|
7983
|
+
content:
|
|
7984
|
+
text/plain:
|
|
7985
|
+
schema:
|
|
7986
|
+
$ref: '#/components/schemas/ReachError'
|
|
7987
|
+
application/json:
|
|
7988
|
+
schema:
|
|
7989
|
+
$ref: '#/components/schemas/ReachError'
|
|
7990
|
+
text/json:
|
|
7991
|
+
schema:
|
|
7992
|
+
$ref: '#/components/schemas/ReachError'
|
|
7993
|
+
'422':
|
|
7994
|
+
description: Client Error
|
|
7995
|
+
content:
|
|
7996
|
+
text/plain:
|
|
7997
|
+
schema:
|
|
7998
|
+
$ref: '#/components/schemas/ValidationResultModel'
|
|
7999
|
+
application/json:
|
|
8000
|
+
schema:
|
|
8001
|
+
$ref: '#/components/schemas/ValidationResultModel'
|
|
8002
|
+
text/json:
|
|
8003
|
+
schema:
|
|
8004
|
+
$ref: '#/components/schemas/ValidationResultModel'
|
|
7942
8005
|
/api/customers/export/csv:
|
|
7943
8006
|
post:
|
|
7944
8007
|
tags:
|
|
@@ -67332,6 +67395,8 @@ components:
|
|
|
67332
67395
|
description: Gets or sets how many times the customer has booked with the organisation.
|
|
67333
67396
|
format: int32
|
|
67334
67397
|
nullable: true
|
|
67398
|
+
stats:
|
|
67399
|
+
$ref: '#/components/schemas/CustomerStats'
|
|
67335
67400
|
additionalProperties: false
|
|
67336
67401
|
description: Represents an organisation within the Reach application.
|
|
67337
67402
|
CustomerCancellationOption:
|
|
@@ -67477,6 +67542,34 @@ components:
|
|
|
67477
67542
|
default: false
|
|
67478
67543
|
additionalProperties: false
|
|
67479
67544
|
description: Post model for customer inserts.
|
|
67545
|
+
CustomerStats:
|
|
67546
|
+
required:
|
|
67547
|
+
- totalCancellations
|
|
67548
|
+
- totalOrders
|
|
67549
|
+
- totalRefunded
|
|
67550
|
+
- totalRevenue
|
|
67551
|
+
type: object
|
|
67552
|
+
properties:
|
|
67553
|
+
totalRevenue:
|
|
67554
|
+
type: number
|
|
67555
|
+
description: Gets or sets the total revenue recieved from the customer.
|
|
67556
|
+
format: double
|
|
67557
|
+
totalOrders:
|
|
67558
|
+
type: integer
|
|
67559
|
+
description: Gets or sets the total number of orders placed by the customer.
|
|
67560
|
+
format: int32
|
|
67561
|
+
default: 0
|
|
67562
|
+
totalCancellations:
|
|
67563
|
+
type: integer
|
|
67564
|
+
description: Gets or sets the total number of cancellations.
|
|
67565
|
+
format: int32
|
|
67566
|
+
default: 0
|
|
67567
|
+
totalRefunded:
|
|
67568
|
+
type: number
|
|
67569
|
+
description: Gets or sets the total amount refunded to the customer.
|
|
67570
|
+
format: double
|
|
67571
|
+
additionalProperties: false
|
|
67572
|
+
description: Model for customer stats.
|
|
67480
67573
|
CustomerType:
|
|
67481
67574
|
enum:
|
|
67482
67575
|
- Person
|
package/src/index.ts
CHANGED
|
@@ -47,6 +47,7 @@ export { CustomerCancellationOption } from './models/CustomerCancellationOption'
|
|
|
47
47
|
export type { CustomerPage } from './models/CustomerPage';
|
|
48
48
|
export type { CustomerPatch } from './models/CustomerPatch';
|
|
49
49
|
export type { CustomerPost } from './models/CustomerPost';
|
|
50
|
+
export type { CustomerStats } from './models/CustomerStats';
|
|
50
51
|
export { CustomerType } from './models/CustomerType';
|
|
51
52
|
export { DayOfWeek } from './models/DayOfWeek';
|
|
52
53
|
export type { EmailReminderSchedule } from './models/EmailReminderSchedule';
|
package/src/models/Customer.ts
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
/* tslint:disable */
|
|
4
4
|
/* eslint-disable */
|
|
5
5
|
|
|
6
|
+
import type { CustomerStats } from './CustomerStats';
|
|
6
7
|
import type { CustomerType } from './CustomerType';
|
|
7
8
|
|
|
8
9
|
/**
|
|
@@ -90,4 +91,5 @@ export type Customer = {
|
|
|
90
91
|
* Gets or sets how many times the customer has booked with the organisation.
|
|
91
92
|
*/
|
|
92
93
|
bookingCount?: number | null;
|
|
94
|
+
stats?: CustomerStats;
|
|
93
95
|
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/* generated using openapi-typescript-codegen -- do no edit */
|
|
2
|
+
/* istanbul ignore file */
|
|
3
|
+
/* tslint:disable */
|
|
4
|
+
/* eslint-disable */
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Model for customer stats.
|
|
8
|
+
*/
|
|
9
|
+
export type CustomerStats = {
|
|
10
|
+
/**
|
|
11
|
+
* Gets or sets the total revenue recieved from the customer.
|
|
12
|
+
*/
|
|
13
|
+
totalRevenue: number;
|
|
14
|
+
/**
|
|
15
|
+
* Gets or sets the total number of orders placed by the customer.
|
|
16
|
+
*/
|
|
17
|
+
totalOrders: number;
|
|
18
|
+
/**
|
|
19
|
+
* Gets or sets the total number of cancellations.
|
|
20
|
+
*/
|
|
21
|
+
totalCancellations: number;
|
|
22
|
+
/**
|
|
23
|
+
* Gets or sets the total amount refunded to the customer.
|
|
24
|
+
*/
|
|
25
|
+
totalRefunded: number;
|
|
26
|
+
};
|
|
@@ -14,6 +14,33 @@ import type { BaseHttpRequest } from '../core/BaseHttpRequest';
|
|
|
14
14
|
export class CustomersService {
|
|
15
15
|
constructor(public readonly httpRequest: BaseHttpRequest) {}
|
|
16
16
|
|
|
17
|
+
/**
|
|
18
|
+
* Gets the customer with added stats.
|
|
19
|
+
* @returns Customer Success
|
|
20
|
+
* @throws ApiError
|
|
21
|
+
*/
|
|
22
|
+
public getObjectWithStats({
|
|
23
|
+
id,
|
|
24
|
+
}: {
|
|
25
|
+
/**
|
|
26
|
+
* The customer Id.
|
|
27
|
+
*/
|
|
28
|
+
id: string;
|
|
29
|
+
}): CancelablePromise<Customer> {
|
|
30
|
+
return this.httpRequest.request({
|
|
31
|
+
method: 'GET',
|
|
32
|
+
url: '/api/customers/{id}/with-stats',
|
|
33
|
+
path: {
|
|
34
|
+
id: id,
|
|
35
|
+
},
|
|
36
|
+
errors: {
|
|
37
|
+
400: `Bad Request`,
|
|
38
|
+
422: `Client Error`,
|
|
39
|
+
500: `Server Error`,
|
|
40
|
+
},
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
|
|
17
44
|
/**
|
|
18
45
|
* Exports the customers list to a csv format.
|
|
19
46
|
* Endpoint has AllowAnonymous attr, however the jwt is validated in the method body (in support of authenticated file downloads.
|