import { Column, Entity, PrimaryGeneratedColumn } from 'typeorm';

@Entity('phone_calls')
export class PhoneCallEntity {
    @PrimaryGeneratedColumn() id: number;
    @Column({ type: 'int', nullable: false }) from_phone_id: number;
    @Column({ type: 'int', nullable: true }) to_phone_id: number | null;
    @Column({ type: 'varchar', length: 32 }) from_number: string;
    @Column({ type: 'varchar', length: 32 }) to_number: string;
    @Column({ type: 'datetime', default: () => 'CURRENT_TIMESTAMP' }) created: Date;
    @Column({ type: 'int', nullable: true }) duration: number | null;
    @Column({ type: 'varchar', length: 32, nullable: true }) missed_by: string | null; 
}
