Skip to main content

CustomerAccount

Class representing a customer account. Manages and integrates different aspects of customer data and interactions with the business.

Constructors

new CustomerAccount()

new CustomerAccount(
customer,
contactInfo,
billingInfo): CustomerAccount

Constructs a new CustomerAccount instance.

Parameters

ParameterTypeDescription
customerCustomerBasic customer profile information.
contactInfoCustomerContactContact details for the customer.
billingInfoCustomerBillingCustomer's billing information.

Returns

CustomerAccount

Methods

addOrderToHistory()

addOrderToHistory(order): void

Adds a new order to the customer's historical record.

Parameters

ParameterTypeDescription
orderCustomerOrderHistoryThe order to be added to the history.

Returns

void


getBillingInfo()

getBillingInfo(): CustomerBilling

Retrieves the billing information of the customer.

Returns

CustomerBilling

The billing details.


getContactInfo()

getContactInfo(): CustomerContact

Retrieves the contact information of the customer.

Returns

CustomerContact

The contact details.


getCustomer()

getCustomer(): Customer

Retrieves the stored customer profile information.

Returns

Customer

The customer's profile data.


getOrderHistory()

getOrderHistory(): CustomerOrderHistory[]

Retrieves the full history of orders made by the customer.

Returns

CustomerOrderHistory[]

An array of order history records.