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

@Entity('networks')
export class NetworkEntity {
  @PrimaryGeneratedColumn('uuid')
  id!: string;

  @Column()
  name!: string;

  @Column({ default: '' })
  code!: string;

  @Column({ name: 'address_type' })
  addressType!: string;

  @Column({ type: 'varchar', length: 512, nullable: true })
  thumbnail!: string | null;

  @Column({ type: 'varchar', length: 512 })
  explorer!: string;

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

  @Column({ type: 'enum', enum: ['active', 'inactive', 'deprecated'] })
  status!: 'active' | 'inactive' | 'deprecated';

  @Column({ name: 'mcap', type: 'double', nullable: true })
  mcap!: number | null;

  @CreateDateColumn({ name: 'created_at' })
  createdAt!: Date;

  @UpdateDateColumn({ name: 'updated_at' })
  updatedAt!: Date;
}
