import {Entity, PrimaryGeneratedColumn, Column, OneToMany, ManyToMany, ManyToOne} from "typeorm";
import { Client } from "./Client";

@Entity()
export class Address {

    @PrimaryGeneratedColumn()
    id!: number;
    
    @Column()
    address1!: string;

    @Column({ default: null, nullable: true })
    address2!: string;

    @Column()
    city!: string;

    @Column()
    zip!: string;

    @Column()
    state!: string;

    @Column({ default: true })
    enable!: boolean;

    @Column({ default: false })
    isMain!: boolean;

    @ManyToOne(type => Client, Client => Client.Addresses) // note: we will create author property in the Photo class below
    Client!: Client;

   

}


