From c3cab7c06d5d6fbfaf3652f1e67e1498053d9d03 Mon Sep 17 00:00:00 2001 From: Danel Kungla Date: Mon, 11 Aug 2025 17:51:35 +0300 Subject: [PATCH] feat: update README for payment process clarity and enhance success notification button behavior --- README.md | 12 +++++++----- .../update-account/_lib/server/update-account.ts | 3 --- .../src/components/success-notification.tsx | 11 ++++++----- .../migrations/20250811174200_delete_employee.sql | 3 +++ 4 files changed, 16 insertions(+), 13 deletions(-) create mode 100644 supabase/migrations/20250811174200_delete_employee.sql diff --git a/README.md b/README.md index 3ace0ef..f3cca27 100644 --- a/README.md +++ b/README.md @@ -106,10 +106,12 @@ To access admin pages follow these steps: 1. Customer adds analysis to cart in **B2B** storefront 2. Customer checks out from cart and is redirected to **Montonio** 3. Customer pays and is redirected back to **B2B** `GET B2B/home/cart/montonio-callback?order-token=$JWT` - - **Medusa** order is created and cart is emptied - - email is sent to customer - - B2B sends order XML as private message to Medipost. - When **Montonio** has confirmed payment, it will call **Medusa** webhook endpoint and **Medusa** will mark order payment as captured. + +- **Medusa** order is created and cart is emptied +- email is sent to customer +- B2B sends order XML as private message to Medipost. + +When **Montonio** has confirmed payment, it will call **Medusa** webhook endpoint and **Medusa** will mark order payment as captured. In background a job will call `POST B2B/api/job/sync-analysis-results` every n minutes and sync private messages with responses from **Medipost**. @@ -121,7 +123,7 @@ In local dev environment, you can import products from B2B to Medusa with this A - `POST /api/job/sync-analysis-groups-store` - Syncs required data of `analyses`, `analysis_elements` data from **B2B** to **Medusa** and creates relevant products and categories. - If product or category already exists, then it is not recreated. Old entries are not deleted either currently. + If product or category already exists, then it is not recreated. Old entries are not deleted either currently. ## Jobs diff --git a/app/auth/update-account/_lib/server/update-account.ts b/app/auth/update-account/_lib/server/update-account.ts index 89191f6..9de3586 100644 --- a/app/auth/update-account/_lib/server/update-account.ts +++ b/app/auth/update-account/_lib/server/update-account.ts @@ -4,14 +4,11 @@ import { redirect } from 'next/navigation'; import { updateCustomer } from '@lib/data/customer'; -import { createAuthApi } from '@kit/auth/api'; import { enhanceAction } from '@kit/next/actions'; import { getSupabaseServerClient } from '@kit/supabase/server-client'; import pathsConfig from '~/config/paths.config'; -import { UpdateAccountSchema } from '../../schemas/update-account.schema'; - export interface AccountSubmitData { firstName: string; lastName: string; diff --git a/packages/features/notifications/src/components/success-notification.tsx b/packages/features/notifications/src/components/success-notification.tsx index 2702708..e961dfa 100644 --- a/packages/features/notifications/src/components/success-notification.tsx +++ b/packages/features/notifications/src/components/success-notification.tsx @@ -1,5 +1,5 @@ import Image from 'next/image'; -import Link from 'next/link'; +import { redirect } from 'next/navigation'; import { MedReportLogo } from '@/components/med-report-logo'; @@ -56,10 +56,11 @@ export const SuccessNotification = ({ )} {buttonProps && ( - )} diff --git a/supabase/migrations/20250811174200_delete_employee.sql b/supabase/migrations/20250811174200_delete_employee.sql new file mode 100644 index 0000000..82056e9 --- /dev/null +++ b/supabase/migrations/20250811174200_delete_employee.sql @@ -0,0 +1,3 @@ +grant + execute on function medreport.can_action_account_member (uuid, uuid) to authenticated, + service_role; \ No newline at end of file