import type { AxiosInstance } from 'axios'; import type { z } from 'zod'; import { InvoiceHalListSchema, ReservationHalListSchema, SubscriptionHalListSchema, VisitHalListSchema, } from '../../types'; import { BaseCustomersResourceRepository } from './BaseCustomersResourceRepository'; import { CardsResourceRepository } from './CardsResourceRepository'; import { CustomersResourceRepository } from './CustomersResourceRepository'; export class Customers { public readonly customers: CustomersResourceRepository; public readonly cards: CardsResourceRepository; public readonly reservations: BaseCustomersResourceRepository< z.infer >; /** * @deprecated use `users.visitHistory` instead */ public readonly visits: BaseCustomersResourceRepository< z.infer >; public readonly invoices: BaseCustomersResourceRepository< z.infer >; public readonly subscriptions: BaseCustomersResourceRepository< z.infer >; constructor(axios: AxiosInstance) { this.customers = new CustomersResourceRepository(axios); this.cards = new CardsResourceRepository(axios, '/cards'); this.reservations = new BaseCustomersResourceRepository( axios, '/reservations', { listForCustomer: ReservationHalListSchema, } ); this.visits = new BaseCustomersResourceRepository(axios, '/visits', { listForCustomer: VisitHalListSchema, }); this.invoices = new BaseCustomersResourceRepository(axios, '/invoices', { listForCustomer: InvoiceHalListSchema, }); this.subscriptions = new BaseCustomersResourceRepository( axios, '/subscriptions', { listForCustomer: SubscriptionHalListSchema, } ); } }