import { Entity, ManyToOne, PrimaryColumn } from 'typeorm';
import { Address } from './Address';

/**
 * The interface(tm) all entities using addresses have to implement.
 * This is a abstract class, because apparently typeorm can't really work with interfaces :/
 */
@Entity()
export abstract class IAddressUser {
    @PrimaryColumn()
    id: number;

    @ManyToOne(() => Address, address => address.addressUsers, { nullable: true })
    address?: Address
}
