import { Injectable } from '@angular/core';
import { SupplierDTO } from '@swagger/remi';
import { RemissionSupplier } from '../models';
import { Mapper } from './mapper';

@Injectable()
export class SupplierDtoToRemissionSupplier implements Mapper<SupplierDTO, RemissionSupplier> {
  get sourceName(): string {
    return 'SupplierDTO';
  }

  get targetName(): string {
    return 'RemissionSupplier';
  }

  map(source: SupplierDTO): RemissionSupplier {
    return {
      name: source.name || '',
      supplierNumber: source.supplierNumber || '',
      id: source.id,
    };
  }
}
