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

@Entity('phone_messages')
export class PhoneMessageEntity {
    @PrimaryGeneratedColumn() id: number;
    @Column() from_phone_id: number;
    @Column({ type: 'varchar', length: 16 }) from_phone_number: string;
    @Column() conversation_id: number;
    @Column({ type: 'varchar', length: 512 }) content: string;
    @Column({ type: 'varchar', length: 16, nullable: true }) type: string | null;
    @Column({ type: 'datetime', default: () => 'CURRENT_TIMESTAMP' }) sent: Date;
    @Column({ type: 'datetime', nullable: true }) delivered: Date;
    @Column({ type: 'datetime', nullable: true }) read: Date;
    @Column() character_id: number;
}
