mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-26 18:42:49 +00:00
55 lines
1.5 KiB
TypeScript
55 lines
1.5 KiB
TypeScript
import { BaseEntity } from "@edr/api-common";
|
|
import { Column, Entity } from "typeorm";
|
|
|
|
export type CustomerStatus = "Active" | "Pending" | "Inactive";
|
|
export type CustomerType = "Importer" | "Exporter" | "Supplier";
|
|
|
|
@Entity({schema:"freight", name: "customers" })
|
|
export class Customer extends BaseEntity {
|
|
@Column({ name: "name", type: "varchar", length: 256 })
|
|
name!: string;
|
|
|
|
@Column({ name: "email", type: "varchar", length: 256, unique: true })
|
|
email!: string;
|
|
|
|
@Column({ name: "phone", type: "varchar", length: 32 })
|
|
phone!: string;
|
|
|
|
@Column({ name: "company", type: "varchar", length: 256, nullable: true })
|
|
company?: string | null;
|
|
|
|
@Column({
|
|
name: "customer_type",
|
|
type: "varchar",
|
|
length: 32,
|
|
default: "Importer",
|
|
})
|
|
customerType!: CustomerType;
|
|
|
|
@Column({
|
|
name: "status",
|
|
type: "varchar",
|
|
length: 32,
|
|
default: "Active",
|
|
})
|
|
status!: CustomerStatus;
|
|
|
|
@Column({ name: "tin_number", type: "varchar", length: 64, nullable: true })
|
|
tinNumber?: string | null;
|
|
|
|
@Column({ name: "city", type: "varchar", length: 128, nullable: true })
|
|
city?: string | null;
|
|
|
|
@Column({ name: "country", type: "varchar", length: 128, nullable: true })
|
|
country?: string | null;
|
|
|
|
@Column({ name: "address", type: "text", nullable: true })
|
|
address?: string | null;
|
|
|
|
@Column({ name: "tax_id", type: "varchar", length: 64, nullable: true })
|
|
taxId?: string | null;
|
|
|
|
@Column({ name: "notes", type: "text", nullable: true })
|
|
notes?: string | null;
|
|
}
|