import { Entity, PrimaryColumn, Column } from 'typeorm';
import type { SyncPlatform } from './sync-log.entity';

@Entity('sync_state')
export class SyncState {
  @PrimaryColumn({ type: 'varchar', length: 20 })
  platform: SyncPlatform;

  @Column({ name: 'last_sync_at', type: 'datetime', nullable: true })
  lastSyncAt: Date | null;

  @Column({ name: 'run_id', type: 'varchar', length: 64, nullable: true })
  runId: string | null;

  @Column({ name: 'running_since', type: 'datetime', nullable: true })
  runningSince: Date | null;
}
