import { Network } from '../../../../domain/entities/network';
import { NetworkEntity } from '../../entities/network.entity';

export const networkMapper = {
  toDomain(entity: NetworkEntity): Network {
    return new Network(
      entity.id,
      entity.name,
      entity.code,
      entity.addressType,
      entity.thumbnail,
      entity.explorer,
      entity.chainId,
      entity.status,
      entity.mcap,
      entity.createdAt,
      entity.updatedAt,
    );
  },

  toEntity(domain: Network): NetworkEntity {
    const entity = new NetworkEntity();
    entity.id = domain.id;
    entity.name = domain.name;
    entity.code = domain.code;
    entity.addressType = domain.addressType;
    entity.thumbnail = domain.thumbnail;
    entity.explorer = domain.explorer;
    entity.chainId = domain.chainId;
    entity.status = domain.status;
    entity.mcap = domain.mcap;
    entity.createdAt = domain.createdAt;
    entity.updatedAt = domain.updatedAt;
    return entity;
  },
};
