because I got bored of customising my CV for every job
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat(base): introduce mapper interface and base module

- Add BaseMapper interface with toDomain and mapToDomain methods
- Include TypeScript overloads for null handling
- Update BaseModule to export the mapper interface
- Establish foundation for entity mapping architecture

+20 -1
+1 -1
apps/server/src/modules/base/base.module.ts
··· 5 5 providers: [], 6 6 exports: [], 7 7 }) 8 - export class BaseModule {} 8 + export class BaseModule {}
+19
apps/server/src/modules/base/mapper.interface.ts
··· 1 + /** 2 + * Base interface for mapping between Prisma entities and domain entities 3 + */ 4 + export interface BaseMapper<TPrismaEntity, TDomainEntity> { 5 + /** 6 + * Maps a single Prisma entity to a domain entity 7 + */ 8 + toDomain(prismaEntity: TPrismaEntity): TDomainEntity; 9 + 10 + /** 11 + * Maps a single Prisma entity to a domain entity, handling null input 12 + */ 13 + toDomain(prismaEntity: TPrismaEntity | null): TDomainEntity | null; 14 + 15 + /** 16 + * Maps an array of Prisma entities to domain entities 17 + */ 18 + mapToDomain(prismaEntities: TPrismaEntity[]): TDomainEntity[]; 19 + }