import { Column, Entity } from 'typeorm';
import { BaseCoreModel } from './base-core.model';
import { BaseEntity } from '../../domain/entities/base.entity';

@Entity()
export abstract class BaseModel<Entity>
  extends BaseCoreModel<Entity>
  implements BaseEntity
{
  @Column('varchar', { name: 'creator_id', length: 36, nullable: true })
  creator_id: string;

  @Column('varchar', { name: 'creator_name', length: 125, nullable: true })
  creator_name: string;

  @Column('varchar', { name: 'editor_id', length: 36, nullable: true })
  editor_id: string;

  @Column('varchar', { name: 'editor_name', length: 125, nullable: true })
  editor_name: string;

  @Column({ type: 'bigint', nullable: false })
  created_at: number;

  @Column({ type: 'bigint', nullable: false })
  updated_at: number;
}
