mirror of
https://gitlab.com/mobicoop/v3/service/matcher.git
synced 2025-12-31 08:22:41 +00:00
refactor to ddh, first commit
This commit is contained in:
18
old/modules/ad/mappers/ad.profile.ts
Normal file
18
old/modules/ad/mappers/ad.profile.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import { createMap, Mapper } from '@automapper/core';
|
||||
import { AutomapperProfile, InjectMapper } from '@automapper/nestjs';
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { Ad } from '../domain/entities/ad';
|
||||
import { CreateAdRequest } from '../domain/dtos/create-ad.request';
|
||||
|
||||
@Injectable()
|
||||
export class AdProfile extends AutomapperProfile {
|
||||
constructor(@InjectMapper() mapper: Mapper) {
|
||||
super(mapper);
|
||||
}
|
||||
|
||||
override get profile() {
|
||||
return (mapper: any) => {
|
||||
createMap(mapper, CreateAdRequest, Ad);
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user