import { NetworkStatus } from '../value-objects/network-status';

export class Network {
  constructor(
    public readonly id: string,
    public readonly name: string,
    public readonly code: string,
    public readonly addressType: string,
    public readonly thumbnail: string | null,
    public readonly explorer: string,
    public readonly chainId: number | null,
    public readonly status: NetworkStatus,
    public readonly mcap: number | null,
    public readonly createdAt: Date,
    public readonly updatedAt: Date,
  ) {}

  public static create(
    id: string,
    name: string,
    code: string,
    addressType: string,
    thumbnail: string | null,
    explorer: string,
    chainId: number | null,
    status: NetworkStatus = 'active',
    mcap: number | null = null,
  ): Network {
    const now = new Date();
    return new Network(id, name, code, addressType, thumbnail, explorer, chainId, status, mcap, now, now);
  }
}
