From e4fcafa57c6cd9421a0448f10f1b056ff7033a70 Mon Sep 17 00:00:00 2001 From: Karli Date: Fri, 26 Sep 2025 17:23:23 +0300 Subject: [PATCH 1/6] feat(MED-97): add dev key for medusa benefits payment --- .env.development | 1 + 1 file changed, 1 insertion(+) diff --git a/.env.development b/.env.development index 2cc0b56..4fdb0cc 100644 --- a/.env.development +++ b/.env.development @@ -43,6 +43,7 @@ MEDIPOST_ENABLE_DISPATCH_ON_MONTONIO_CALLBACK=true #MEDIPOST_ENABLE_DISPATCH_ON_MONTONIO_CALLBACK=false # MEDUSA +COMPANY_BENEFITS_PAYMENT_SECRET_KEY=NzcwMzE2NmEtOThiMS0xMWYwLWI4NjYtMDMwZDQzMjFhMjExCg== MEDUSA_BACKEND_URL=http://localhost:9000 MEDUSA_BACKEND_PUBLIC_URL=http://localhost:9000 From 02645aa59887d648969d0514fffe1ea93558bf57 Mon Sep 17 00:00:00 2001 From: Danel Kungla Date: Mon, 29 Sep 2025 11:11:33 +0300 Subject: [PATCH 2/6] include credentials --- packages/features/medusa-storefront/src/lib/data/orders.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/features/medusa-storefront/src/lib/data/orders.ts b/packages/features/medusa-storefront/src/lib/data/orders.ts index 8a655cb..464a747 100644 --- a/packages/features/medusa-storefront/src/lib/data/orders.ts +++ b/packages/features/medusa-storefront/src/lib/data/orders.ts @@ -25,6 +25,7 @@ export const retrieveOrder = async (id: string, allowCache = true) => { headers, next, ...(allowCache ? { cache: 'force-cache' } : {}), + credentials: 'include', }) .then(({ order }) => order) .catch((err) => medusaError(err)); @@ -55,6 +56,7 @@ export const listOrders = async ( }, headers, next, + credentials: 'include', }) .then(({ orders }) => orders) .catch((err) => medusaError(err)); From 1e19e0ab8ab08d1749563bc0d609a99b1ce41a0e Mon Sep 17 00:00:00 2001 From: Karli Date: Mon, 29 Sep 2025 23:09:28 +0300 Subject: [PATCH 3/6] feat: delete analysis responses in medipost in test/prod --- .env.development | 1 + lib/services/medipost/medipostPrivateMessage.service.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.env.development b/.env.development index 4fdb0cc..ac3067a 100644 --- a/.env.development +++ b/.env.development @@ -34,6 +34,7 @@ MEDIPOST_PASSWORD=SRB48HZMV MEDIPOST_RECIPIENT=trvurgtst MEDIPOST_MESSAGE_SENDER=trvurgtst MEDIPOST_ENABLE_DISPATCH_ON_MONTONIO_CALLBACK=true +MEDIPOST_ENABLE_DELETE_RESPONSE_PRIVATE_MESSAGE_ON_READ=false #MEDIPOST_URL=https://medipost2.medisoft.ee:8443/Medipost/MedipostServlet #MEDIPOST_USER=medreport diff --git a/lib/services/medipost/medipostPrivateMessage.service.ts b/lib/services/medipost/medipostPrivateMessage.service.ts index 57380a4..9027079 100644 --- a/lib/services/medipost/medipostPrivateMessage.service.ts +++ b/lib/services/medipost/medipostPrivateMessage.service.ts @@ -43,7 +43,7 @@ const USER = process.env.MEDIPOST_USER!; const PASSWORD = process.env.MEDIPOST_PASSWORD!; const RECIPIENT = process.env.MEDIPOST_RECIPIENT!; -const IS_ENABLED_DELETE_PRIVATE_MESSAGE = false as boolean; +const IS_ENABLED_DELETE_PRIVATE_MESSAGE = process.env.MEDIPOST_ENABLE_DELETE_RESPONSE_PRIVATE_MESSAGE_ON_READ === 'true'; export async function getLatestPrivateMessageListItem({ excludedMessageIds, From bf10741786b033fa54fb319bff90f329d5615d18 Mon Sep 17 00:00:00 2001 From: Karli Date: Tue, 30 Sep 2025 14:40:57 +0300 Subject: [PATCH 4/6] feat: fix incorrect component imports --- .../(user)/settings/_components/account-preferences-form.tsx | 2 +- app/home/(user)/settings/_components/account-settings-form.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/home/(user)/settings/_components/account-preferences-form.tsx b/app/home/(user)/settings/_components/account-preferences-form.tsx index 54aa472..7fbd6f5 100644 --- a/app/home/(user)/settings/_components/account-preferences-form.tsx +++ b/app/home/(user)/settings/_components/account-preferences-form.tsx @@ -2,8 +2,8 @@ import { zodResolver } from '@hookform/resolvers/zod'; import { useForm } from 'react-hook-form'; -import { Trans } from 'react-i18next'; +import { Trans } from '@kit/ui/trans'; import { useRevalidatePersonalAccountDataQuery } from '@kit/accounts/hooks/use-personal-account-data'; import type { AccountWithParams } from '@kit/accounts/types/accounts'; import { Button } from '@kit/ui/button'; diff --git a/app/home/(user)/settings/_components/account-settings-form.tsx b/app/home/(user)/settings/_components/account-settings-form.tsx index 2aaa91e..0ab1bdc 100644 --- a/app/home/(user)/settings/_components/account-settings-form.tsx +++ b/app/home/(user)/settings/_components/account-settings-form.tsx @@ -2,8 +2,8 @@ import { zodResolver } from '@hookform/resolvers/zod'; import { useForm } from 'react-hook-form'; -import { Trans } from 'react-i18next'; +import { Trans } from '@kit/ui/trans'; import { useRevalidatePersonalAccountDataQuery } from '@kit/accounts/hooks/use-personal-account-data'; import type { AccountWithParams } from '@kit/accounts/types/accounts'; import { Button } from '@kit/ui/button'; From 2868875044da9ab9e0c4774e11c7cf5e6334dedf Mon Sep 17 00:00:00 2001 From: Karli Date: Tue, 30 Sep 2025 14:44:28 +0300 Subject: [PATCH 5/6] feat: fix % should be rounded, not 33.333... --- .../[account]/_lib/server/load-team-account-health-details.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/home/[account]/_lib/server/load-team-account-health-details.ts b/app/home/[account]/_lib/server/load-team-account-health-details.ts index 9568dda..094072a 100644 --- a/app/home/[account]/_lib/server/load-team-account-health-details.ts +++ b/app/home/[account]/_lib/server/load-team-account-health-details.ts @@ -62,13 +62,13 @@ export const getAccountHealthDetailsFields = ( return [ { title: 'teams:healthDetails.women', - value: `${femalePercentage}% (${numberOfFemaleMembers})`, + value: `${femalePercentage.toFixed(0)}% (${numberOfFemaleMembers})`, Icon: User, iconBg: 'bg-success', }, { title: 'teams:healthDetails.men', - value: `${malePercentage}% (${numberOfMaleMembers})`, + value: `${malePercentage.toFixed(0)}% (${numberOfMaleMembers})`, Icon: User, iconBg: 'bg-success', }, From f477bfaa135708e0c6ebfa0f7d37e18713d153df Mon Sep 17 00:00:00 2001 From: Karli Date: Tue, 30 Sep 2025 15:52:50 +0300 Subject: [PATCH 6/6] feat: delete partial analysis responses in medipost after sync --- lib/services/medipost/medipostPrivateMessage.service.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/services/medipost/medipostPrivateMessage.service.ts b/lib/services/medipost/medipostPrivateMessage.service.ts index 9027079..0ff60b2 100644 --- a/lib/services/medipost/medipostPrivateMessage.service.ts +++ b/lib/services/medipost/medipostPrivateMessage.service.ts @@ -435,6 +435,9 @@ export async function readPrivateMessageResponse({ medusaOrderId, orderStatus: 'PARTIAL_ANALYSIS_RESPONSE', }); + if (IS_ENABLED_DELETE_PRIVATE_MESSAGE) { + await deletePrivateMessage(privateMessageId); + } hasAnalysisResponse = true; hasPartialAnalysisResponse = true; } else if (status.isCompleted) {