import { Column } from 'typeorm';
import { BaseEntity } from '../../database/base.entity';
import type { MediaType } from './media.constants';

/**
 * Shared columns for every `{module}_media` table. Concrete entities
 * add the parent FK (`hotel_id`, `activity_id`, …) and the relation.
 */
export abstract class BaseMediaEntity extends BaseEntity {
  @Column({ type: 'varchar', length: 500 })
  url: string;

  @Column({ type: 'varchar', length: 10 })
  media_type: MediaType;

  @Column({ type: 'varchar', length: 255 })
  filename: string;

  @Column({ type: 'boolean', default: false })
  is_cover: boolean;

  @Column({ type: 'int', default: 0 })
  sort_order: number;
}
