Customer
Hierarchy (View Summary)
- Customer
Index
Constructors
Properties
Accessors
Methods
Constructors
constructor
new Customer(
id: number,
name: string,
nextOrderNumber: string | number,
): Customer
The constructor of the Customer
class.
Parameters
id: number
the customer's database ID
name: string
the customer's name
nextOrderNumber: string | number
the next number to use when this customer places an order
Returns Customer
Properties
Readonly
id
id: number
A public readonly property.
name
name: string
A public property that can be reassigned.
Protected
Optional
contact Name
contactName?: string
An optional protected property.
Accessors
next Order Number
- get nextOrderNumber(): string
A getter that prepends a number sign to the private
_nextOrderNumber
property.Returns string
- set nextOrderNumber(value: string | number): void
A setter that takes in either a string or a number and sets the private
_nextOrderNumber
property.Parameters
value: string | number
Returns void
Methods
on Order Placed
onOrderPlaced(): void
A public method. To be called when an order is placed for this customer.
Returns void
on Order Placed Arrow Function
onOrderPlacedArrowFunction(): void
A public method that's defined using an arrow function.
TypeDoc knows to document this as a method rather than a property.
Returns void
Protected
is Valid
isValid(): boolean
A protected method.
An abstract base class for the customer entity in our application.
Notice how TypeDoc shows the inheritance hierarchy for our class.