20 lines
640 B
TypeScript
20 lines
640 B
TypeScript
import { Injectable } from '@nestjs/common';
|
|
import { SupplierHiboutikDto } from '../hiboutikDTO/supplier.hiboutik.dto';
|
|
import { Converter } from './converter';
|
|
import { SupplierCreateInput } from '../../../prisma/generated/models/Supplier';
|
|
|
|
@Injectable()
|
|
export class SupplierConverter extends Converter<SupplierCreateInput, SupplierHiboutikDto> {
|
|
fromHiboutik(dto: SupplierHiboutikDto): SupplierCreateInput {
|
|
return {
|
|
hiboutikId: dto.supplier_id,
|
|
name: dto.supplier_name,
|
|
enabled: dto.supplier_enabled == 1,
|
|
};
|
|
}
|
|
|
|
toHiboutik(): SupplierHiboutikDto {
|
|
throw new Error('Method not implemented.');
|
|
}
|
|
}
|