Skip to content

@sourceloop/ctrl-plane-subscription-service / Exports / BillingCustomerService

Class: BillingCustomerService

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new BillingCustomerService(billingCustomerRepo, invoiceRepo, billingProvider)

Parameters

Name Type
billingCustomerRepo BillingCustomerRepository<BillingCustomer>
invoiceRepo InvoiceRepository<Invoice>
billingProvider IService

Defined in

services/subscription-service/src/services/billing-customer.service.ts:9

Properties

billingCustomerRepo

Private Readonly billingCustomerRepo: BillingCustomerRepository<BillingCustomer>

Defined in

services/subscription-service/src/services/billing-customer.service.ts:11


billingProvider

Private Readonly billingProvider: IService

Defined in

services/subscription-service/src/services/billing-customer.service.ts:15


invoiceRepo

Private Readonly invoiceRepo: InvoiceRepository<Invoice>

Defined in

services/subscription-service/src/services/billing-customer.service.ts:13

Methods

createCustomer

createCustomer(customerDto, tenantId): Promise<CustomerDto>

Parameters

Name Type
customerDto Omit<CustomerDto, "id">
tenantId string

Returns

Promise<CustomerDto>

Defined in

services/subscription-service/src/services/billing-customer.service.ts:17


deleteCustomerByTenantId

deleteCustomerByTenantId(tenantId): Promise<void>

Parameters

Name Type
tenantId string

Returns

Promise<void>

Defined in

services/subscription-service/src/services/billing-customer.service.ts:87


getCustomer

getCustomer(filter?): Promise<{ customerDetails: CustomerDto ; info: BillingCustomer }>

Parameters

Name Type
filter? Filter<BillingCustomer>

Returns

Promise<{ customerDetails: CustomerDto ; info: BillingCustomer }>

Defined in

services/subscription-service/src/services/billing-customer.service.ts:52


mapToCustomerDto

Private mapToCustomerDto(customer): CustomerDto

Parameters

Name Type
customer TCustomer

Returns

CustomerDto

Defined in

services/subscription-service/src/services/billing-customer.service.ts:30


updateCustomerByTenantId

updateCustomerByTenantId(tenantId, customerDto): Promise<void>

Parameters

Name Type
tenantId string
customerDto Partial<CustomerDto>

Returns

Promise<void>

Defined in

services/subscription-service/src/services/billing-customer.service.ts:69