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

import type { FeedItemType } from '@core/social/domain/types/FeedItemType';

@Entity({ name: 'social_feed_items' })
export class FeedItemOrmEntity {
  @PrimaryColumn({ type: 'uuid' })
  id!: string;

  @Column({ type: 'timestamptz' })
  timestamp!: Date;

  @Column({ type: 'text' })
  type!: FeedItemType;

  @Column({ type: 'uuid', nullable: true })
  actorFriendId!: string | null;

  @Column({ type: 'uuid', nullable: true })
  actorDriverId!: string | null;

  @Column({ type: 'uuid', nullable: true })
  leagueId!: string | null;

  @Column({ type: 'uuid', nullable: true })
  raceId!: string | null;

  @Column({ type: 'uuid', nullable: true })
  teamId!: string | null;

  @Column({ type: 'int', nullable: true })
  position!: number | null;

  @Column({ type: 'text' })
  headline!: string;

  @Column({ type: 'text', nullable: true })
  body!: string | null;

  @Column({ type: 'text', nullable: true })
  ctaLabel!: string | null;

  @Column({ type: 'text', nullable: true })
  ctaHref!: string | null;
}