feat(sync): add converters from Hiboutik DTOs to Prisma inputs
This commit is contained in:
19
src/models/converter/brand.converter.ts
Normal file
19
src/models/converter/brand.converter.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
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.');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user