diff --git a/apps/server/src/database/prisma/mappers/prisma-expiration-date-notification-mapper.ts b/apps/server/src/database/prisma/mappers/prisma-expiration-date-notification-mapper.ts
index 79aaef77..e747dd79 100644
--- a/apps/server/src/database/prisma/mappers/prisma-expiration-date-notification-mapper.ts
+++ b/apps/server/src/database/prisma/mappers/prisma-expiration-date-notification-mapper.ts
@@ -1,16 +1,16 @@
import { ExpirationDateNotification } from '@stocker/core/entities'
import type { PrismaExpirationDateNotification } from '../types'
+import { PrismaBatchesMapper } from './prisma-batches-mapper'
export class PrismaExpirationDateNotificationMapper {
toDomain(
prismaExpirationDateNotification: PrismaExpirationDateNotification,
): ExpirationDateNotification {
+ const batchMapper = new PrismaBatchesMapper()
+
return ExpirationDateNotification.create({
id: prismaExpirationDateNotification.id,
- batch: {
- id: prismaExpirationDateNotification.batch_id,
- code: prismaExpirationDateNotification.Batch.code,
- },
+ batchDto: batchMapper.toDomain(prismaExpirationDateNotification.batch).dto,
sentAt: prismaExpirationDateNotification.registered_at,
companyId: prismaExpirationDateNotification.company_id,
})
@@ -19,14 +19,13 @@ export class PrismaExpirationDateNotificationMapper {
toPrisma(
expirationDateNotification: ExpirationDateNotification,
): PrismaExpirationDateNotification {
+ const batchMapper = new PrismaBatchesMapper()
+
return {
id: expirationDateNotification.id,
registered_at: expirationDateNotification.sentAt,
batch_id: expirationDateNotification.batch.id,
- Batch: {
- id: expirationDateNotification.batch.id,
- code: expirationDateNotification.batch.code,
- },
+ batch: batchMapper.toPrisma(expirationDateNotification.batch),
company_id: expirationDateNotification.companyId,
}
}
diff --git a/apps/web/src/ui/components/pages/profile/employees-cards/index.tsx b/apps/web/src/ui/components/pages/profile/employees-cards/index.tsx
index 766b20e4..7ce7f47f 100644
--- a/apps/web/src/ui/components/pages/profile/employees-cards/index.tsx
+++ b/apps/web/src/ui/components/pages/profile/employees-cards/index.tsx
@@ -14,13 +14,13 @@ export const EmployeesCards = async () => {