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

@Entity('cf_stores')
export class Store {
  @PrimaryColumn({ type: 'varchar', length: 64 })
  id!: string;

  @Column({ type: 'varchar', length: 64, nullable: false })
  merchantId!: string;

  @Column({ type: 'varchar', length: 64, nullable: false })
  tenant_id!: string;

  @Column({ type: 'varchar', length: 64, nullable: false })
  shop_id!: string;

  @Column({ type: 'varchar', length: 32, nullable: false })
  platform!: string;

  @Column({ type: 'varchar', length: 200, nullable: false })
  name!: string;

  @Column({ type: 'varchar', length: 200, nullable: false })
  store_name!: string;

  @Column({ type: 'varchar', length: 500, nullable: true })
  description!: string;

  @Column({ type: 'varchar', length: 64, nullable: true })
  platformShopId!: string;

  @Column({ type: 'varchar', length: 100, nullable: true })
  access_token!: string;

  @Column({ type: 'varchar', length: 100, nullable: true })
  refresh_token!: string;

  @Column({ type: 'datetime', nullable: true })
  token_expires_at!: Date;

  @Column({ type: 'varchar', length: 16, default: 'ACTIVE' })
  status!: string;

  @CreateDateColumn()
  created_at!: Date;

  @UpdateDateColumn()
  updated_at!: Date;
}
