Archived
Added simple customer and address models
To be expanded
This commit is contained in:
1 parent
2803e52cfd
commit
4b26e5cb62
2 files changed
+46
No files matched your search
@@ -0,0 +1,26 @@
|
||||
import {Entity, PrimaryGeneratedColumn, Column} from "typeorm";
|
||||
|
||||
@Entity()
|
||||
export class Address {
|
||||
|
||||
@PrimaryGeneratedColumn()
|
||||
id: number;
|
||||
|
||||
@Column()
|
||||
street: string;
|
||||
|
||||
@Column()
|
||||
housenumber: string;
|
||||
|
||||
@Column()
|
||||
city: string;
|
||||
|
||||
@Column()
|
||||
plz: string;
|
||||
|
||||
@Column()
|
||||
state: string;
|
||||
|
||||
@Column()
|
||||
country: string;
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
import {Entity, PrimaryGeneratedColumn, Column, JoinColumn} from "typeorm";
|
||||
import {Address} from "./Address";
|
||||
|
||||
@Entity()
|
||||
export class Customer {
|
||||
|
||||
@PrimaryGeneratedColumn()
|
||||
id: number;
|
||||
|
||||
@Column()
|
||||
name: string;
|
||||
|
||||
@Column()
|
||||
lastName: string;
|
||||
|
||||
@OneToOne(() => Address)
|
||||
@JoinColumn
|
||||
@Column()
|
||||
invoiceAddress: Address;
|
||||
}
|
||||
Reference in new issue
Block a user