Customer
Customer
This entity represents a customer of the store, typically an individual person. A Customer can be a guest, in which case it has no associated User. Customers with registered account will have an associated User entity.
Signature
class Customer extends VendureEntity implements ChannelAware, HasCustomFields, SoftDeletable {
constructor(input?: DeepPartial<Customer>)
@Column({ type: Date, nullable: true }) @Column({ type: Date, nullable: true })
deletedAt: Date | null;
@Column({ nullable: true }) @Column({ nullable: true })
title: string;
@Column() @Column() firstName: string;
@Column() @Column() lastName: string;
@Column({ nullable: true }) @Column({ nullable: true })
phoneNumber: string;
@Column() @Column()
emailAddress: string;
@ManyToMany(type => CustomerGroup, group => group.customers) @JoinTable() @ManyToMany(type => CustomerGroup, group => group.customers)
@JoinTable()
groups: CustomerGroup[];
@OneToMany(type => Address, address => address.customer) @OneToMany(type => Address, address => address.customer)
addresses: Address[];
@OneToMany(type => Order, order => order.customer) @OneToMany(type => Order, order => order.customer)
orders: Order[];
@OneToOne(type => User, { eager: true }) @JoinColumn() @OneToOne(type => User, { eager: true })
@JoinColumn()
user?: User;
@Column(type => CustomCustomerFields) @Column(type => CustomCustomerFields)
customFields: CustomCustomerFields;
@ManyToMany(type => Channel) @JoinTable() @ManyToMany(type => Channel)
@JoinTable()
channels: Channel[];
}
Extends
Implements
- ChannelAware
- HasCustomFields
- SoftDeletable
Members
constructor
method
type:
(input?: DeepPartial<Customer>) => Customer
deletedAt
property
type:
Date | null
title
property
type:
string
firstName
property
type:
string
lastName
property
type:
string
phoneNumber
property
type:
string
emailAddress
property
type:
string
groups
property
type:
CustomerGroup[]
addresses
property
type:
Address[]
orders
property
type:
Order[]
user
property
type:
User
customFields
property
type:
CustomCustomerFields
channels
property
type:
Channel[]