20 lines
602 B
TypeScript
20 lines
602 B
TypeScript
import { Injectable } from '@nestjs/common';
|
|
import { Converter } from './converter';
|
|
import { BrandHiboutikDto } from '../hiboutikDTO/brand.hiboutik.dto';
|
|
import { BrandCreateInput } from '../../../prisma/generated/models/Brand';
|
|
|
|
@Injectable()
|
|
export class BrandConverter extends Converter<BrandCreateInput, BrandHiboutikDto> {
|
|
fromHiboutik(dto: BrandHiboutikDto): BrandCreateInput {
|
|
return {
|
|
hiboutikId: dto.brand_id,
|
|
name: dto.brand_name,
|
|
enabled: dto.brand_enabled === 1,
|
|
};
|
|
}
|
|
|
|
toHiboutik(): BrandHiboutikDto {
|
|
throw new Error('Method not implemented.');
|
|
}
|
|
}
|