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

@Entity('tokens')
export class TokenEntity {
  @PrimaryGeneratedColumn('uuid')
  id!: string;

  @Column({ name: 'is_native' })
  isNative!: boolean;

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

  @Column({ name: 'network_id' })
  networkId!: string;

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

  @Column()
  name!: string;

  @Column()
  symbol!: string;

  @Column()
  decimals!: number;

  @Column()
  code!: string;

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

  @Column({ name: 'is_active', default: true })
  isActive!: boolean;

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

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

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

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