main <- develop
main <- develop
This commit is contained in:
@@ -10,6 +10,7 @@ MEDIPOST_PASSWORD=your-medipost-password
|
|||||||
MEDIPOST_RECIPIENT=your-medipost-recipient
|
MEDIPOST_RECIPIENT=your-medipost-recipient
|
||||||
|
|
||||||
CONNECTED_ONLINE_URL=your-connected-online-url
|
CONNECTED_ONLINE_URL=your-connected-online-url
|
||||||
|
CONNECTED_ONLINE_CONFIRMED_URL=your-connected-confirmed-url
|
||||||
|
|
||||||
EMAIL_SENDER=
|
EMAIL_SENDER=
|
||||||
EMAIL_USER= # refer to your email provider's documentation
|
EMAIL_USER= # refer to your email provider's documentation
|
||||||
|
|||||||
@@ -66,14 +66,16 @@ async function OrdersPage() {
|
|||||||
({ medusa_order_id }) => medusa_order_id === medusaOrder.id,
|
({ medusa_order_id }) => medusa_order_id === medusaOrder.id,
|
||||||
);
|
);
|
||||||
|
|
||||||
const ttoReservation = ttoOrders.find(({ id }) => {
|
const orderIds = new Set(
|
||||||
const connectedOnlineReservationId =
|
(medusaOrder?.items ?? [])
|
||||||
medusaOrder?.items &&
|
.map((i) => i?.metadata?.connectedOnlineReservationId)
|
||||||
medusaOrder.items.find(
|
.filter(Boolean)
|
||||||
({ metadata }) => !!metadata?.connectedOnlineReservationId,
|
.map(String),
|
||||||
)?.metadata?.connectedOnlineReservationId;
|
);
|
||||||
return id === connectedOnlineReservationId;
|
|
||||||
});
|
const ttoReservation = ttoOrders.find((o) =>
|
||||||
|
orderIds.has(String(o.id)),
|
||||||
|
);
|
||||||
|
|
||||||
const medusaOrderItems = medusaOrder.items || [];
|
const medusaOrderItems = medusaOrder.items || [];
|
||||||
const medusaOrderItemsAnalysisPackages = medusaOrderItems.filter(
|
const medusaOrderItemsAnalysisPackages = medusaOrderItems.filter(
|
||||||
@@ -105,7 +107,6 @@ async function OrdersPage() {
|
|||||||
medusaOrderId={medusaOrder.id}
|
medusaOrderId={medusaOrder.id}
|
||||||
analysisOrder={analysisOrder}
|
analysisOrder={analysisOrder}
|
||||||
ttoReservation={ttoReservation}
|
ttoReservation={ttoReservation}
|
||||||
medusaOrderStatus={medusaOrder.status}
|
|
||||||
itemsAnalysisPackage={medusaOrderItemsAnalysisPackages}
|
itemsAnalysisPackage={medusaOrderItemsAnalysisPackages}
|
||||||
itemsTtoService={medusaOrderItemsTtoServices}
|
itemsTtoService={medusaOrderItemsTtoServices}
|
||||||
itemsOther={medusaOrderItemsOther}
|
itemsOther={medusaOrderItemsOther}
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import { Label } from '@medusajs/ui';
|
import { Label } from '@medusajs/ui';
|
||||||
import { useTranslation } from 'react-i18next';
|
|
||||||
|
|
||||||
import { RadioGroup, RadioGroupItem } from '@kit/ui/radio-group';
|
import { RadioGroup, RadioGroupItem } from '@kit/ui/radio-group';
|
||||||
import { Card } from '@kit/ui/shadcn/card';
|
import { Card } from '@kit/ui/shadcn/card';
|
||||||
@@ -8,7 +7,6 @@ import { Trans } from '@kit/ui/trans';
|
|||||||
import { useBooking } from './booking.provider';
|
import { useBooking } from './booking.provider';
|
||||||
|
|
||||||
const LocationSelector = () => {
|
const LocationSelector = () => {
|
||||||
const { t } = useTranslation();
|
|
||||||
const { selectedLocationId, setSelectedLocationId, locations } = useBooking();
|
const { selectedLocationId, setSelectedLocationId, locations } = useBooking();
|
||||||
|
|
||||||
const onLocationSelect = (locationId: number | string | null) => {
|
const onLocationSelect = (locationId: number | string | null) => {
|
||||||
@@ -16,6 +14,15 @@ const LocationSelector = () => {
|
|||||||
setSelectedLocationId(Number(locationId));
|
setSelectedLocationId(Number(locationId));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const uniqueLocations = locations?.filter((item, index, self) => {
|
||||||
|
return (
|
||||||
|
index ===
|
||||||
|
self.findIndex(
|
||||||
|
(loc) => loc.sync_id === item.sync_id && loc.name === item.name,
|
||||||
|
)
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Card className="mb-4 p-4">
|
<Card className="mb-4 p-4">
|
||||||
<h5 className="text-semibold mb-2">
|
<h5 className="text-semibold mb-2">
|
||||||
@@ -26,20 +33,23 @@ const LocationSelector = () => {
|
|||||||
className="mb-2 flex flex-col"
|
className="mb-2 flex flex-col"
|
||||||
onValueChange={(val) => onLocationSelect(val)}
|
onValueChange={(val) => onLocationSelect(val)}
|
||||||
>
|
>
|
||||||
<div className="flex items-center gap-2">
|
{/* <div className="flex items-center gap-2">
|
||||||
<RadioGroupItem
|
<RadioGroupItem
|
||||||
value={'all'}
|
value="all"
|
||||||
id={'all'}
|
id="all"
|
||||||
checked={selectedLocationId === null}
|
checked={selectedLocationId === null}
|
||||||
/>
|
/>
|
||||||
<Label htmlFor={'all'}>{t('booking:showAllLocations')}</Label>
|
<Label htmlFor="all">{t('booking:showAllLocations')}</Label>
|
||||||
</div>
|
</div> */}
|
||||||
{locations?.map((location) => (
|
{uniqueLocations?.map((location, index) => (
|
||||||
<div key={location.sync_id} className="flex items-center gap-2">
|
<div key={location.sync_id} className="flex items-center gap-2">
|
||||||
<RadioGroupItem
|
<RadioGroupItem
|
||||||
value={location.sync_id.toString()}
|
value={location.sync_id.toString()}
|
||||||
id={location.sync_id.toString()}
|
id={location.sync_id.toString()}
|
||||||
checked={selectedLocationId === location.sync_id}
|
checked={
|
||||||
|
selectedLocationId === location.sync_id ||
|
||||||
|
(index === 0 && selectedLocationId === null)
|
||||||
|
}
|
||||||
/>
|
/>
|
||||||
<Label htmlFor={location.sync_id.toString()}>
|
<Label htmlFor={location.sync_id.toString()}>
|
||||||
{location.name}
|
{location.name}
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ const CartItemDelete = ({
|
|||||||
<button
|
<button
|
||||||
className="text-ui-fg-subtle hover:text-ui-fg-base flex cursor-pointer gap-x-1"
|
className="text-ui-fg-subtle hover:text-ui-fg-base flex cursor-pointer gap-x-1"
|
||||||
onClick={() => handleDelete()}
|
onClick={() => handleDelete()}
|
||||||
|
type="button"
|
||||||
>
|
>
|
||||||
{isDeleting ? <Spinner className="animate-spin" /> : <Trash />}
|
{isDeleting ? <Spinner className="animate-spin" /> : <Trash />}
|
||||||
<span>{children}</span>
|
<span>{children}</span>
|
||||||
|
|||||||
@@ -66,7 +66,11 @@ export default function CartServiceItem({
|
|||||||
|
|
||||||
<TableCell className="px-4 text-right sm:px-6">
|
<TableCell className="px-4 text-right sm:px-6">
|
||||||
<span className="flex justify-end gap-x-1">
|
<span className="flex justify-end gap-x-1">
|
||||||
<Button size="sm" onClick={() => setEditingItem(item)}>
|
<Button
|
||||||
|
type="button"
|
||||||
|
size="sm"
|
||||||
|
onClick={() => setEditingItem(item)}
|
||||||
|
>
|
||||||
<Trans i18nKey="common:change" />
|
<Trans i18nKey="common:change" />
|
||||||
</Button>
|
</Button>
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
@@ -18,19 +18,19 @@ const MobileCartItems = ({
|
|||||||
productColumnLabelKey: string;
|
productColumnLabelKey: string;
|
||||||
}) => {
|
}) => {
|
||||||
const {
|
const {
|
||||||
i18n: { language },
|
i18n: { language, t },
|
||||||
} = useTranslation();
|
} = useTranslation();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Table className="border-separate rounded-lg border p-2">
|
<Table className="border-separate rounded-lg border p-2">
|
||||||
<TableBody>
|
<TableBody>
|
||||||
<MobileTableRow
|
<MobileTableRow
|
||||||
titleKey={productColumnLabelKey}
|
title={t(productColumnLabelKey)}
|
||||||
value={item.product_title}
|
value={item.product_title}
|
||||||
/>
|
/>
|
||||||
<MobileTableRow titleKey="cart:table.time" value={item.quantity} />
|
<MobileTableRow title={t('cart:table.time')} value={item.quantity} />
|
||||||
<MobileTableRow
|
<MobileTableRow
|
||||||
titleKey="cart:table.price"
|
title={t('cart:table.price')}
|
||||||
value={formatCurrency({
|
value={formatCurrency({
|
||||||
value: item.unit_price,
|
value: item.unit_price,
|
||||||
currencyCode,
|
currencyCode,
|
||||||
@@ -38,7 +38,7 @@ const MobileCartItems = ({
|
|||||||
})}
|
})}
|
||||||
/>
|
/>
|
||||||
<MobileTableRow
|
<MobileTableRow
|
||||||
titleKey="cart:table.total"
|
title={t('cart:table.total')}
|
||||||
value={
|
value={
|
||||||
item.total &&
|
item.total &&
|
||||||
formatCurrency({
|
formatCurrency({
|
||||||
|
|||||||
@@ -25,27 +25,30 @@ const MobileCartServiceItems = ({
|
|||||||
setEditingItem: (item: EnrichedCartItem | null) => void;
|
setEditingItem: (item: EnrichedCartItem | null) => void;
|
||||||
}) => {
|
}) => {
|
||||||
const {
|
const {
|
||||||
i18n: { language },
|
i18n: { language, t },
|
||||||
} = useTranslation();
|
} = useTranslation();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Table className="border-separate rounded-lg border p-2">
|
<Table className="border-separate rounded-lg border p-2">
|
||||||
<TableBody>
|
<TableBody>
|
||||||
<MobileTableRow
|
<MobileTableRow
|
||||||
titleKey={productColumnLabelKey}
|
title={t(productColumnLabelKey)}
|
||||||
value={item.product_title}
|
value={item.product_title}
|
||||||
/>
|
/>
|
||||||
<MobileTableRow
|
<MobileTableRow
|
||||||
titleKey="cart:table.time"
|
title={t('cart:table.time')}
|
||||||
value={formatDateAndTime(item.reservation.startTime.toString())}
|
value={formatDateAndTime(item.reservation.startTime.toString())}
|
||||||
/>
|
/>
|
||||||
<MobileTableRow
|
<MobileTableRow
|
||||||
titleKey="cart:table.location"
|
title={t('cart:table.location')}
|
||||||
value={item.reservation.location?.address ?? '-'}
|
value={item.reservation.location?.address ?? '-'}
|
||||||
/>
|
/>
|
||||||
<MobileTableRow titleKey="cart:table.quantity" value={item.quantity} />
|
|
||||||
<MobileTableRow
|
<MobileTableRow
|
||||||
titleKey="cart:table.price"
|
title={t('cart:table.quantity')}
|
||||||
|
value={item.quantity}
|
||||||
|
/>
|
||||||
|
<MobileTableRow
|
||||||
|
title={t('cart:table.price')}
|
||||||
value={formatCurrency({
|
value={formatCurrency({
|
||||||
value: item.unit_price,
|
value: item.unit_price,
|
||||||
currencyCode,
|
currencyCode,
|
||||||
@@ -53,7 +56,7 @@ const MobileCartServiceItems = ({
|
|||||||
})}
|
})}
|
||||||
/>
|
/>
|
||||||
<MobileTableRow
|
<MobileTableRow
|
||||||
titleKey="cart:table.total"
|
title={t('cart:table.total')}
|
||||||
value={
|
value={
|
||||||
item.total &&
|
item.total &&
|
||||||
formatCurrency({
|
formatCurrency({
|
||||||
@@ -67,7 +70,7 @@ const MobileCartServiceItems = ({
|
|||||||
<TableCell />
|
<TableCell />
|
||||||
<TableCell className="flex w-full items-center justify-end gap-4 p-0 pt-2">
|
<TableCell className="flex w-full items-center justify-end gap-4 p-0 pt-2">
|
||||||
<CartItemDelete id={item.id} />
|
<CartItemDelete id={item.id} />
|
||||||
<Button onClick={() => setEditingItem(item)}>
|
<Button type="button" onClick={() => setEditingItem(item)}>
|
||||||
<Trans i18nKey="common:change" />
|
<Trans i18nKey="common:change" />
|
||||||
</Button>
|
</Button>
|
||||||
</TableCell>
|
</TableCell>
|
||||||
|
|||||||
@@ -1,19 +1,16 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
import { Trans } from '@kit/ui/makerkit/trans';
|
|
||||||
import { TableCell, TableHead, TableRow } from '@kit/ui/shadcn/table';
|
import { TableCell, TableHead, TableRow } from '@kit/ui/shadcn/table';
|
||||||
|
|
||||||
const MobleTableRow = ({
|
const MobleTableRow = ({
|
||||||
titleKey,
|
title,
|
||||||
value,
|
value,
|
||||||
}: {
|
}: {
|
||||||
titleKey?: string;
|
title?: string;
|
||||||
value?: string | number;
|
value?: string | number;
|
||||||
}) => (
|
}) => (
|
||||||
<TableRow>
|
<TableRow>
|
||||||
<TableHead className="h-2 font-bold">
|
<TableHead className="h-2 font-bold">{title}</TableHead>
|
||||||
<Trans i18nKey={titleKey} />
|
|
||||||
</TableHead>
|
|
||||||
|
|
||||||
<TableCell className="p-0 text-right">
|
<TableCell className="p-0 text-right">
|
||||||
<p className="txt-medium-plus text-ui-fg-base">{value}</p>
|
<p className="txt-medium-plus text-ui-fg-base">{value}</p>
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ export default function OrderBlock({
|
|||||||
analysisOrder,
|
analysisOrder,
|
||||||
ttoLocation,
|
ttoLocation,
|
||||||
ttoReservation,
|
ttoReservation,
|
||||||
medusaOrderStatus,
|
|
||||||
itemsAnalysisPackage,
|
itemsAnalysisPackage,
|
||||||
itemsTtoService,
|
itemsTtoService,
|
||||||
itemsOther,
|
itemsOther,
|
||||||
@@ -22,7 +21,6 @@ export default function OrderBlock({
|
|||||||
analysisOrder?: AnalysisOrder;
|
analysisOrder?: AnalysisOrder;
|
||||||
ttoLocation?: { name: string };
|
ttoLocation?: { name: string };
|
||||||
ttoReservation?: TTOOrder;
|
ttoReservation?: TTOOrder;
|
||||||
medusaOrderStatus: string;
|
|
||||||
itemsAnalysisPackage: StoreOrderLineItem[];
|
itemsAnalysisPackage: StoreOrderLineItem[];
|
||||||
itemsTtoService: StoreOrderLineItem[];
|
itemsTtoService: StoreOrderLineItem[];
|
||||||
itemsOther: StoreOrderLineItem[];
|
itemsOther: StoreOrderLineItem[];
|
||||||
@@ -70,11 +68,12 @@ export default function OrderBlock({
|
|||||||
title="orders:table.ttoService"
|
title="orders:table.ttoService"
|
||||||
type="ttoService"
|
type="ttoService"
|
||||||
order={{
|
order={{
|
||||||
status: medusaOrderStatus.toUpperCase(),
|
status: ttoReservation?.status,
|
||||||
medusaOrderId,
|
medusaOrderId,
|
||||||
location: ttoLocation?.name,
|
location: ttoLocation?.name,
|
||||||
bookingCode: ttoReservation?.booking_code,
|
bookingCode: ttoReservation?.booking_code,
|
||||||
clinicId: ttoReservation?.clinic_id,
|
clinicId: ttoReservation?.clinic_id,
|
||||||
|
medusaLineItemId: ttoReservation?.medusa_cart_line_item_id,
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -1,12 +1,13 @@
|
|||||||
'use client';
|
'use client';
|
||||||
|
|
||||||
import { useState } from 'react';
|
import React, { useState } from 'react';
|
||||||
|
|
||||||
import { useRouter } from 'next/navigation';
|
import { redirect, useRouter } from 'next/navigation';
|
||||||
|
|
||||||
import ConfirmationModal from '@/packages/shared/src/components/confirmation-modal';
|
import ConfirmationModal from '@/packages/shared/src/components/confirmation-modal';
|
||||||
import { StoreOrderLineItem } from '@medusajs/types';
|
import { StoreOrderLineItem } from '@medusajs/types';
|
||||||
import { formatDate } from 'date-fns';
|
import { formatDate } from 'date-fns';
|
||||||
|
import { useTranslation } from 'react-i18next';
|
||||||
|
|
||||||
import { pathsConfig } from '@kit/shared/config';
|
import { pathsConfig } from '@kit/shared/config';
|
||||||
import { Button } from '@kit/ui/button';
|
import { Button } from '@kit/ui/button';
|
||||||
@@ -41,8 +42,16 @@ export default function OrderItemsTable({
|
|||||||
type?: OrderItemType;
|
type?: OrderItemType;
|
||||||
isPackage?: boolean;
|
isPackage?: boolean;
|
||||||
}) {
|
}) {
|
||||||
|
const {
|
||||||
|
i18n: { t },
|
||||||
|
} = useTranslation();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const [isConfirmOpen, setIsConfirmOpen] = useState(false);
|
const [isConfirmOpen, setIsConfirmOpen] = useState(false);
|
||||||
|
const isCancelOrderAllowed =
|
||||||
|
order?.bookingCode &&
|
||||||
|
order?.clinicId &&
|
||||||
|
order?.medusaLineItemId &&
|
||||||
|
order?.status === 'CONFIRMED';
|
||||||
|
|
||||||
if (!items || items.length === 0) {
|
if (!items || items.length === 0) {
|
||||||
return null;
|
return null;
|
||||||
@@ -69,34 +78,42 @@ export default function OrderItemsTable({
|
|||||||
(a.created_at ?? '') > (b.created_at ?? '') ? -1 : 1,
|
(a.created_at ?? '') > (b.created_at ?? '') ? -1 : 1,
|
||||||
)
|
)
|
||||||
.map((orderItem) => (
|
.map((orderItem) => (
|
||||||
<div key={`${orderItem.id}-mobile`}>
|
<React.Fragment key={`${orderItem.id}-mobile`}>
|
||||||
<MobileTableRow
|
<MobileTableRow
|
||||||
titleKey={title}
|
title={t(title)}
|
||||||
value={orderItem.product_title || ''}
|
value={orderItem.product_title || ''}
|
||||||
/>
|
/>
|
||||||
<MobileTableRow
|
<MobileTableRow
|
||||||
titleKey="orders:table.createdAt"
|
title={t('orders:table.createdAt')}
|
||||||
value={formatDate(orderItem.created_at, 'dd.MM.yyyy HH:mm')}
|
value={formatDate(orderItem.created_at, 'dd.MM.yyyy HH:mm')}
|
||||||
/>
|
/>
|
||||||
{order.location && (
|
{order.location && (
|
||||||
<MobileTableRow
|
<MobileTableRow
|
||||||
titleKey="orders:table.location"
|
title={t('orders:table.location')}
|
||||||
value={order.location}
|
value={order.location}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
<MobileTableRow
|
<MobileTableRow
|
||||||
titleKey="orders:table.status"
|
title={t('orders:table.status')}
|
||||||
value={
|
value={
|
||||||
isPackage
|
isPackage
|
||||||
? `orders:status.analysisPackageOrder.${order?.status ?? 'CONFIRMED'}`
|
? t(
|
||||||
: `orders:status.${type}.${order?.status ?? 'CONFIRMED'}`
|
`orders:status.analysisPackageOrder.${order?.status ?? 'CONFIRMED'}`,
|
||||||
|
)
|
||||||
|
: t(
|
||||||
|
`orders:status.${type}.${order?.status ?? 'CONFIRMED'}`,
|
||||||
|
)
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
<TableRow>
|
<TableRow>
|
||||||
<TableCell />
|
<TableCell />
|
||||||
<TableCell className="flex w-full items-center justify-end p-0 pt-2">
|
<TableCell className="flex w-full items-center justify-end gap-2 p-0 pt-2">
|
||||||
<Button size="sm" onClick={openDetailedView}>
|
<Button size="sm" onClick={openDetailedView}>
|
||||||
<Trans i18nKey="analysis-results:view" />
|
<Trans
|
||||||
|
i18nKey={
|
||||||
|
isTtoservice ? 'orders:view' : 'analysis-results:view'
|
||||||
|
}
|
||||||
|
/>
|
||||||
</Button>
|
</Button>
|
||||||
{isTtoservice && order.bookingCode && (
|
{isTtoservice && order.bookingCode && (
|
||||||
<Button
|
<Button
|
||||||
@@ -109,7 +126,7 @@ export default function OrderItemsTable({
|
|||||||
)}
|
)}
|
||||||
</TableCell>
|
</TableCell>
|
||||||
</TableRow>
|
</TableRow>
|
||||||
</div>
|
</React.Fragment>
|
||||||
))}
|
))}
|
||||||
</TableBody>
|
</TableBody>
|
||||||
</Table>
|
</Table>
|
||||||
@@ -169,9 +186,13 @@ export default function OrderItemsTable({
|
|||||||
|
|
||||||
<TableCell className="px-6 text-right">
|
<TableCell className="px-6 text-right">
|
||||||
<Button size="sm" onClick={openDetailedView}>
|
<Button size="sm" onClick={openDetailedView}>
|
||||||
<Trans i18nKey="analysis-results:view" />
|
<Trans
|
||||||
|
i18nKey={
|
||||||
|
isTtoservice ? 'orders:view' : 'analysis-results:view'
|
||||||
|
}
|
||||||
|
/>
|
||||||
</Button>
|
</Button>
|
||||||
{isTtoservice && order.bookingCode && (
|
{isCancelOrderAllowed && (
|
||||||
<Button
|
<Button
|
||||||
size="sm"
|
size="sm"
|
||||||
className="bg-warning/90 hover:bg-warning mt-2 w-full"
|
className="bg-warning/90 hover:bg-warning mt-2 w-full"
|
||||||
@@ -185,12 +206,18 @@ export default function OrderItemsTable({
|
|||||||
))}
|
))}
|
||||||
</TableBody>
|
</TableBody>
|
||||||
</Table>
|
</Table>
|
||||||
{order?.bookingCode && order?.clinicId && (
|
{isCancelOrderAllowed && (
|
||||||
<ConfirmationModal
|
<ConfirmationModal
|
||||||
isOpen={isConfirmOpen}
|
isOpen={isConfirmOpen}
|
||||||
onClose={() => setIsConfirmOpen(false)}
|
onClose={() => setIsConfirmOpen(false)}
|
||||||
onConfirm={async () => {
|
onConfirm={async () => {
|
||||||
await cancelTtoBooking(order.bookingCode!, order.clinicId!);
|
cancelTtoBooking(
|
||||||
|
order.bookingCode!,
|
||||||
|
order.clinicId!,
|
||||||
|
order.medusaLineItemId!,
|
||||||
|
).then(() => {
|
||||||
|
redirect(pathsConfig.app.myOrders);
|
||||||
|
});
|
||||||
}}
|
}}
|
||||||
titleKey="orders:confirmBookingCancel.title"
|
titleKey="orders:confirmBookingCancel.title"
|
||||||
descriptionKey="orders:confirmBookingCancel.description"
|
descriptionKey="orders:confirmBookingCancel.description"
|
||||||
|
|||||||
@@ -1,11 +1,15 @@
|
|||||||
'use server';
|
'use server';
|
||||||
|
|
||||||
|
import { getSupabaseServerClient } from '@/packages/supabase/src/clients/server-client';
|
||||||
import { updateLineItem } from '@lib/data/cart';
|
import { updateLineItem } from '@lib/data/cart';
|
||||||
import { StoreProductVariant } from '@medusajs/types';
|
import { StoreProductVariant } from '@medusajs/types';
|
||||||
|
|
||||||
import logRequestResult from '~/lib/services/audit.service';
|
import logRequestResult from '~/lib/services/audit.service';
|
||||||
import { handleAddToCart } from '~/lib/services/medusaCart.service';
|
import { handleAddToCart } from '~/lib/services/medusaCart.service';
|
||||||
import { createInitialReservation } from '~/lib/services/reservation.service';
|
import {
|
||||||
|
cancelReservation,
|
||||||
|
createInitialReservation,
|
||||||
|
} from '~/lib/services/reservation.service';
|
||||||
import { RequestStatus } from '~/lib/types/audit';
|
import { RequestStatus } from '~/lib/types/audit';
|
||||||
import { ConnectedOnlineMethodName } from '~/lib/types/connected-online';
|
import { ConnectedOnlineMethodName } from '~/lib/types/connected-online';
|
||||||
import { ExternalApi } from '~/lib/types/external';
|
import { ExternalApi } from '~/lib/types/external';
|
||||||
@@ -46,11 +50,16 @@ export async function createInitialReservationAction(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function cancelTtoBooking(bookingCode: string, clinicId: number) {
|
export async function cancelTtoBooking(
|
||||||
|
bookingCode: string,
|
||||||
|
clinicId: number,
|
||||||
|
medusaLineItemId: string,
|
||||||
|
) {
|
||||||
try {
|
try {
|
||||||
await fetch(
|
await fetch(
|
||||||
`${process.env.CONNECTED_ONLINE_URL}/${ConnectedOnlineMethodName.ConfirmedCancel}`,
|
`${process.env.CONNECTED_ONLINE_URL}/${ConnectedOnlineMethodName.ConfirmedCancel}`,
|
||||||
{
|
{
|
||||||
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json; charset=utf-8',
|
'Content-Type': 'application/json; charset=utf-8',
|
||||||
},
|
},
|
||||||
@@ -60,7 +69,14 @@ export async function cancelTtoBooking(bookingCode: string, clinicId: number) {
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
return null;
|
await cancelReservation(medusaLineItemId);
|
||||||
|
|
||||||
|
await logRequestResult(
|
||||||
|
ExternalApi.ConnectedOnline,
|
||||||
|
ConnectedOnlineMethodName.ConfirmedCancel,
|
||||||
|
RequestStatus.Success,
|
||||||
|
medusaLineItemId,
|
||||||
|
);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
await logRequestResult(
|
await logRequestResult(
|
||||||
ExternalApi.ConnectedOnline,
|
ExternalApi.ConnectedOnline,
|
||||||
@@ -74,3 +90,22 @@ export async function cancelTtoBooking(bookingCode: string, clinicId: number) {
|
|||||||
console.error('Error cancelling booking: ', error);
|
console.error('Error cancelling booking: ', error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export async function isPaymentRequiredForService(serviceId: number) {
|
||||||
|
const supabaseClient = getSupabaseServerClient();
|
||||||
|
|
||||||
|
try {
|
||||||
|
const { data } = await supabaseClient
|
||||||
|
.schema('medreport')
|
||||||
|
.from('connected_online_services')
|
||||||
|
.select('requires_payment')
|
||||||
|
.eq('id', serviceId)
|
||||||
|
.is('requires_payment', true)
|
||||||
|
.maybeSingle();
|
||||||
|
|
||||||
|
return !!data;
|
||||||
|
} catch (error) {
|
||||||
|
console.error('Error checking payment requirement: ', error);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -7,6 +7,8 @@ import type { StoreCart, StoreOrder } from '@medusajs/types';
|
|||||||
import jwt from 'jsonwebtoken';
|
import jwt from 'jsonwebtoken';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
|
|
||||||
|
import { getLogger } from '@kit/shared/logger';
|
||||||
|
|
||||||
import { createI18nServerInstance } from '~/lib/i18n/i18n.server';
|
import { createI18nServerInstance } from '~/lib/i18n/i18n.server';
|
||||||
import { bookAppointment } from '~/lib/services/connected-online.service';
|
import { bookAppointment } from '~/lib/services/connected-online.service';
|
||||||
import { sendOrderToMedipost } from '~/lib/services/medipost/medipostPrivateMessage.service';
|
import { sendOrderToMedipost } from '~/lib/services/medipost/medipostPrivateMessage.service';
|
||||||
@@ -139,6 +141,7 @@ export const initiatePayment = async ({
|
|||||||
};
|
};
|
||||||
|
|
||||||
export async function handlePlaceOrder({ cart }: { cart: StoreCart }) {
|
export async function handlePlaceOrder({ cart }: { cart: StoreCart }) {
|
||||||
|
const logger = await getLogger();
|
||||||
const { account } = await loadCurrentUserAccount();
|
const { account } = await loadCurrentUserAccount();
|
||||||
if (!account) {
|
if (!account) {
|
||||||
throw new Error('Account not found in context');
|
throw new Error('Account not found in context');
|
||||||
@@ -158,7 +161,7 @@ export async function handlePlaceOrder({ cart }: { cart: StoreCart }) {
|
|||||||
const existingAnalysisOrder = await getAnalysisOrder({
|
const existingAnalysisOrder = await getAnalysisOrder({
|
||||||
medusaOrderId: medusaOrder.id,
|
medusaOrderId: medusaOrder.id,
|
||||||
});
|
});
|
||||||
console.info(
|
logger.info(
|
||||||
`Analysis order already exists for medusaOrderId=${medusaOrder.id}, orderId=${existingAnalysisOrder.id}`,
|
`Analysis order already exists for medusaOrderId=${medusaOrder.id}, orderId=${existingAnalysisOrder.id}`,
|
||||||
);
|
);
|
||||||
return { success: true, orderId: existingAnalysisOrder.id };
|
return { success: true, orderId: existingAnalysisOrder.id };
|
||||||
@@ -183,7 +186,8 @@ export async function handlePlaceOrder({ cart }: { cart: StoreCart }) {
|
|||||||
let bookServiceResults: {
|
let bookServiceResults: {
|
||||||
success: boolean;
|
success: boolean;
|
||||||
reason?: FailureReason;
|
reason?: FailureReason;
|
||||||
serviceId?: number;
|
bookingCode: string | null;
|
||||||
|
clinicKey: string | null;
|
||||||
}[] = [];
|
}[] = [];
|
||||||
if (orderedTtoServices?.length) {
|
if (orderedTtoServices?.length) {
|
||||||
const bookingPromises = orderedTtoServices.map((service) =>
|
const bookingPromises = orderedTtoServices.map((service) =>
|
||||||
@@ -197,7 +201,6 @@ export async function handlePlaceOrder({ cart }: { cart: StoreCart }) {
|
|||||||
);
|
);
|
||||||
bookServiceResults = await Promise.all(bookingPromises);
|
bookServiceResults = await Promise.all(bookingPromises);
|
||||||
}
|
}
|
||||||
// TODO: SEND EMAIL
|
|
||||||
|
|
||||||
if (email) {
|
if (email) {
|
||||||
if (analysisPackageOrder) {
|
if (analysisPackageOrder) {
|
||||||
@@ -207,22 +210,35 @@ export async function handlePlaceOrder({ cart }: { cart: StoreCart }) {
|
|||||||
analysisPackageOrder,
|
analysisPackageOrder,
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
console.info(`Order has no analysis package, skipping email.`);
|
logger.info(`Order has no analysis package, skipping email.`);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (analysisItemsOrder) {
|
if (analysisItemsOrder) {
|
||||||
// @TODO send email for separate analyses
|
// @TODO send email for separate analyses
|
||||||
console.warn(
|
logger.warn(
|
||||||
`Order has analysis items, but no email template exists yet`,
|
`Order has analysis items, but no email template exists yet`,
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
console.info(`Order has no analysis items, skipping email.`);
|
logger.info(`Order has no analysis items, skipping email.`);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
console.error('Missing email to send order result email', orderResult);
|
logger.error('Missing email to send order result email', orderResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (env().isEnabledDispatchOnMontonioCallback) {
|
// if (bookServiceResults?.length) {
|
||||||
|
// bookServiceResults.forEach(async ({ bookingCode, clinicKey }) => {
|
||||||
|
// if (!bookingCode || !clinicKey) {
|
||||||
|
// logger.info('A booking is missing either bookingCode or clinicKey', {
|
||||||
|
// bookingCode,
|
||||||
|
// clinicKey,
|
||||||
|
// });
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
// await getConfirmedService(bookingCode, clinicKey);
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
|
||||||
|
if (env().isEnabledDispatchOnMontonioCallback && orderContainsSynlabItems) {
|
||||||
await sendOrderToMedipost({ medusaOrderId, orderedAnalysisElements });
|
await sendOrderToMedipost({ medusaOrderId, orderedAnalysisElements });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,19 +1,31 @@
|
|||||||
import { cache } from 'react';
|
import { cache } from 'react';
|
||||||
|
|
||||||
import { getProductCategories, listProducts } from '@lib/data';
|
import {
|
||||||
|
getProductCategories,
|
||||||
|
listProductTypes,
|
||||||
|
listProducts,
|
||||||
|
} from '@lib/data';
|
||||||
|
|
||||||
|
import { findProductTypeIdByHandle } from '~/lib/utils';
|
||||||
|
|
||||||
|
import { isPaymentRequiredForService } from './actions';
|
||||||
import { loadCountryCodes } from './load-analyses';
|
import { loadCountryCodes } from './load-analyses';
|
||||||
|
|
||||||
async function categoryLoader({ handle }: { handle: string }) {
|
async function categoryLoader({ handle }: { handle: string }) {
|
||||||
const [response, countryCodes] = await Promise.all([
|
const [response, countryCodes, { productTypes }] = await Promise.all([
|
||||||
getProductCategories({
|
getProductCategories({
|
||||||
handle,
|
handle,
|
||||||
limit: 1,
|
limit: 1,
|
||||||
}),
|
}),
|
||||||
loadCountryCodes(),
|
loadCountryCodes(),
|
||||||
|
listProductTypes(),
|
||||||
]);
|
]);
|
||||||
const category = response.product_categories[0];
|
const category = response.product_categories[0];
|
||||||
const countryCode = countryCodes[0]!;
|
const countryCode = countryCodes[0]!;
|
||||||
|
const ttoServiceTypeId = findProductTypeIdByHandle(
|
||||||
|
productTypes,
|
||||||
|
'tto-service',
|
||||||
|
);
|
||||||
|
|
||||||
if (!response.product_categories?.[0]?.id) {
|
if (!response.product_categories?.[0]?.id) {
|
||||||
return { category: null };
|
return { category: null };
|
||||||
@@ -26,6 +38,27 @@ async function categoryLoader({ handle }: { handle: string }) {
|
|||||||
queryParams: { limit: 100, category_id: response.product_categories[0].id },
|
queryParams: { limit: 100, category_id: response.product_categories[0].id },
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const productsWithNoRequiredPayment = categoryProducts.filter(
|
||||||
|
async (product) => {
|
||||||
|
if (product.type_id !== ttoServiceTypeId) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (product.metadata?.serviceIds) {
|
||||||
|
const serviceIds: number[] = JSON.parse(
|
||||||
|
product.metadata.serviceIds as string,
|
||||||
|
);
|
||||||
|
for (const serviceId of serviceIds) {
|
||||||
|
const requiresPayment = await isPaymentRequiredForService(serviceId);
|
||||||
|
if (requiresPayment) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
category: {
|
category: {
|
||||||
color:
|
color:
|
||||||
@@ -36,7 +69,7 @@ async function categoryLoader({ handle }: { handle: string }) {
|
|||||||
handle: category?.handle || '',
|
handle: category?.handle || '',
|
||||||
name: category?.name || '',
|
name: category?.name || '',
|
||||||
countryCode,
|
countryCode,
|
||||||
products: categoryProducts,
|
products: productsWithNoRequiredPayment,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import { RequestStatus } from '@/lib/types/audit';
|
|||||||
import {
|
import {
|
||||||
AvailableAppointmentsResponse,
|
AvailableAppointmentsResponse,
|
||||||
BookTimeResponse,
|
BookTimeResponse,
|
||||||
ConfirmedLoadResponse,
|
|
||||||
ConnectedOnlineMethodName,
|
ConnectedOnlineMethodName,
|
||||||
FailureReason,
|
FailureReason,
|
||||||
} from '@/lib/types/connected-online';
|
} from '@/lib/types/connected-online';
|
||||||
@@ -99,7 +98,12 @@ export async function bookAppointment(
|
|||||||
syncUserID: number,
|
syncUserID: number,
|
||||||
startTime: string,
|
startTime: string,
|
||||||
comments = '',
|
comments = '',
|
||||||
) {
|
): Promise<{
|
||||||
|
success: boolean;
|
||||||
|
reason?: FailureReason;
|
||||||
|
bookingCode: string | null;
|
||||||
|
clinicKey: string | null;
|
||||||
|
}> {
|
||||||
const logger = await getLogger();
|
const logger = await getLogger();
|
||||||
const supabase = getSupabaseServerClient();
|
const supabase = getSupabaseServerClient();
|
||||||
|
|
||||||
@@ -148,7 +152,7 @@ export async function bookAppointment(
|
|||||||
supabase
|
supabase
|
||||||
.schema('medreport')
|
.schema('medreport')
|
||||||
.from('connected_online_reservation')
|
.from('connected_online_reservation')
|
||||||
.select('id')
|
.select('id,location_sync_id')
|
||||||
.eq('clinic_id', clinicId)
|
.eq('clinic_id', clinicId)
|
||||||
.eq('service_id', serviceId)
|
.eq('service_id', serviceId)
|
||||||
.eq('start_time', formattedStartTime)
|
.eq('start_time', formattedStartTime)
|
||||||
@@ -202,8 +206,8 @@ export async function bookAppointment(
|
|||||||
},
|
},
|
||||||
param: JSON.stringify({
|
param: JSON.stringify({
|
||||||
ClinicID: clinic.id,
|
ClinicID: clinic.id,
|
||||||
ServiceID: service.sync_id,
|
ServiceID: service.id,
|
||||||
ClinicServiceID: service.id,
|
ClinicServiceID: service.sync_id,
|
||||||
UserID: appointmentUserId,
|
UserID: appointmentUserId,
|
||||||
SyncUserID: syncUserID,
|
SyncUserID: syncUserID,
|
||||||
StartTime: startTime,
|
StartTime: startTime,
|
||||||
@@ -216,6 +220,7 @@ export async function bookAppointment(
|
|||||||
AddToBasket: false,
|
AddToBasket: false,
|
||||||
Key: dbClinic.key,
|
Key: dbClinic.key,
|
||||||
Lang: 'et',
|
Lang: 'et',
|
||||||
|
Location: dbReservation.location_sync_id,
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@@ -275,16 +280,34 @@ export async function bookAppointment(
|
|||||||
'Booked time, updated reservation with id ' + updatedReservation?.id,
|
'Booked time, updated reservation with id ' + updatedReservation?.id,
|
||||||
);
|
);
|
||||||
|
|
||||||
await logRequestResult(
|
if (responseParts[1]) {
|
||||||
ExternalApi.ConnectedOnline,
|
await logRequestResult(
|
||||||
ConnectedOnlineMethodName.BookTime,
|
ExternalApi.ConnectedOnline,
|
||||||
RequestStatus.Success,
|
ConnectedOnlineMethodName.BookTime,
|
||||||
JSON.stringify(connectedOnlineBookingResponseData),
|
RequestStatus.Success,
|
||||||
startTime.toString(),
|
JSON.stringify(connectedOnlineBookingResponseData),
|
||||||
service.id,
|
startTime.toString(),
|
||||||
clinicId,
|
service.id,
|
||||||
);
|
clinicId,
|
||||||
return { success: true };
|
);
|
||||||
|
return {
|
||||||
|
success: true,
|
||||||
|
bookingCode: responseParts[1],
|
||||||
|
clinicKey: dbClinic.key,
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
logger.error(`Missing booking code: ${responseParts}`);
|
||||||
|
await logRequestResult(
|
||||||
|
ExternalApi.ConnectedOnline,
|
||||||
|
ConnectedOnlineMethodName.BookTime,
|
||||||
|
RequestStatus.Fail,
|
||||||
|
JSON.stringify(error),
|
||||||
|
startTime.toString(),
|
||||||
|
serviceId,
|
||||||
|
clinicId,
|
||||||
|
);
|
||||||
|
return { success: false, bookingCode: null, clinicKey: null };
|
||||||
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
logger.error(`Failed to book time, error: ${JSON.stringify(error)}`);
|
logger.error(`Failed to book time, error: ${JSON.stringify(error)}`);
|
||||||
await logRequestResult(
|
await logRequestResult(
|
||||||
@@ -296,41 +319,33 @@ export async function bookAppointment(
|
|||||||
serviceId,
|
serviceId,
|
||||||
clinicId,
|
clinicId,
|
||||||
);
|
);
|
||||||
return { success: false, reason };
|
return { success: false, reason, bookingCode: null, clinicKey: null };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function getConfirmedService(reservationCode: string) {
|
export async function getConfirmedService(
|
||||||
|
reservationCode: string,
|
||||||
|
clinicKey: string,
|
||||||
|
) {
|
||||||
try {
|
try {
|
||||||
const response = await axios.post(
|
const url = new URL(process.env.CONNECTED_ONLINE_CONFIRMED_URL!);
|
||||||
`${process.env.CONNECTED_ONLINE_URL!}/${ConnectedOnlineMethodName.ConfirmedLoad}`,
|
url.searchParams.set('code1', reservationCode);
|
||||||
{
|
url.searchParams.set('key', clinicKey);
|
||||||
headers: {
|
url.searchParams.set('lang', 'et');
|
||||||
'Content-Type': 'application/json; charset=utf-8',
|
await fetch(url, {
|
||||||
},
|
method: 'POST',
|
||||||
param: JSON.stringify({ Value: `${reservationCode}|7T624nlu|et` }),
|
headers: {
|
||||||
|
'Content-Type': 'application/json; charset=utf-8',
|
||||||
},
|
},
|
||||||
);
|
});
|
||||||
|
|
||||||
const responseData: ConfirmedLoadResponse = JSON.parse(response.data.d);
|
|
||||||
|
|
||||||
if (responseData?.ErrorCode !== 0) {
|
|
||||||
await logRequestResult(
|
|
||||||
ExternalApi.ConnectedOnline,
|
|
||||||
ConnectedOnlineMethodName.ConfirmedLoad,
|
|
||||||
RequestStatus.Fail,
|
|
||||||
JSON.stringify(responseData),
|
|
||||||
);
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
await logRequestResult(
|
await logRequestResult(
|
||||||
ExternalApi.ConnectedOnline,
|
ExternalApi.ConnectedOnline,
|
||||||
ConnectedOnlineMethodName.ConfirmedLoad,
|
ConnectedOnlineMethodName.ConfirmedLoad,
|
||||||
RequestStatus.Success,
|
RequestStatus.Success,
|
||||||
JSON.stringify(responseData),
|
'ok',
|
||||||
);
|
);
|
||||||
return responseData.Data;
|
return;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
await logRequestResult(
|
await logRequestResult(
|
||||||
ExternalApi.ConnectedOnline,
|
ExternalApi.ConnectedOnline,
|
||||||
|
|||||||
@@ -443,9 +443,6 @@ export async function readPrivateMessageResponse({
|
|||||||
medusaOrderId,
|
medusaOrderId,
|
||||||
orderStatus: 'PARTIAL_ANALYSIS_RESPONSE',
|
orderStatus: 'PARTIAL_ANALYSIS_RESPONSE',
|
||||||
});
|
});
|
||||||
if (IS_ENABLED_DELETE_PRIVATE_MESSAGE) {
|
|
||||||
await deletePrivateMessage(privateMessageId);
|
|
||||||
}
|
|
||||||
hasAnalysisResponse = true;
|
hasAnalysisResponse = true;
|
||||||
hasPartialAnalysisResponse = true;
|
hasPartialAnalysisResponse = true;
|
||||||
} else if (status.isCompleted) {
|
} else if (status.isCompleted) {
|
||||||
|
|||||||
@@ -194,6 +194,7 @@ export async function getTtoLocation(syncId?: number | null) {
|
|||||||
.from('connected_online_locations')
|
.from('connected_online_locations')
|
||||||
.select('name')
|
.select('name')
|
||||||
.eq('sync_id', syncId)
|
.eq('sync_id', syncId)
|
||||||
|
.limit(1)
|
||||||
.single();
|
.single();
|
||||||
|
|
||||||
if (error) {
|
if (error) {
|
||||||
|
|||||||
@@ -317,6 +317,7 @@ export async function updateReservationTime({
|
|||||||
sync_user_id: newSyncUserId,
|
sync_user_id: newSyncUserId,
|
||||||
start_time: newStartTime.toString(),
|
start_time: newStartTime.toString(),
|
||||||
location_sync_id: newLocationId,
|
location_sync_id: newLocationId,
|
||||||
|
updated_at: new Date().toISOString(),
|
||||||
})
|
})
|
||||||
.eq('id', reservationId)
|
.eq('id', reservationId)
|
||||||
.eq('user_id', user.id)
|
.eq('user_id', user.id)
|
||||||
|
|||||||
@@ -12,4 +12,5 @@ export type Order = {
|
|||||||
location?: string;
|
location?: string;
|
||||||
bookingCode?: string | null;
|
bookingCode?: string | null;
|
||||||
clinicId?: number;
|
clinicId?: number;
|
||||||
|
medusaLineItemId?: string | null;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -16,8 +16,6 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@headlessui/react": "^2.2.0",
|
"@headlessui/react": "^2.2.0",
|
||||||
"@medusajs/js-sdk": "latest",
|
|
||||||
"@medusajs/ui": "latest",
|
|
||||||
"@radix-ui/react-accordion": "^1.2.1",
|
"@radix-ui/react-accordion": "^1.2.1",
|
||||||
"@stripe/react-stripe-js": "^1.7.2",
|
"@stripe/react-stripe-js": "^1.7.2",
|
||||||
"@stripe/stripe-js": "^1.29.0",
|
"@stripe/stripe-js": "^1.29.0",
|
||||||
@@ -34,8 +32,6 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/core": "^7.17.5",
|
"@babel/core": "^7.17.5",
|
||||||
"@medusajs/types": "latest",
|
|
||||||
"@medusajs/ui-preset": "latest",
|
|
||||||
"@types/lodash": "^4.14.195",
|
"@types/lodash": "^4.14.195",
|
||||||
"@types/node": "17.0.21",
|
"@types/node": "17.0.21",
|
||||||
"@types/pg": "^8.11.0",
|
"@types/pg": "^8.11.0",
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import { redirect } from 'next/navigation';
|
|||||||
|
|
||||||
import { sdk } from '@lib/config';
|
import { sdk } from '@lib/config';
|
||||||
import medusaError from '@lib/util/medusa-error';
|
import medusaError from '@lib/util/medusa-error';
|
||||||
import { HttpTypes, StoreCart, StoreCartPromotion } from '@medusajs/types';
|
import type { HttpTypes, StoreCart, StoreCartPromotion } from '@medusajs/types';
|
||||||
|
|
||||||
import { getLogger } from '@kit/shared/logger';
|
import { getLogger } from '@kit/shared/logger';
|
||||||
|
|
||||||
|
|||||||
2033
pnpm-lock.yaml
generated
2033
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@@ -2,6 +2,7 @@
|
|||||||
"title": "Tellimused",
|
"title": "Tellimused",
|
||||||
"description": "Vaata oma tellimusi",
|
"description": "Vaata oma tellimusi",
|
||||||
"noOrders": "Tellimusi ei leitud",
|
"noOrders": "Tellimusi ei leitud",
|
||||||
|
"view": "Vaata tellimust",
|
||||||
"table": {
|
"table": {
|
||||||
"analysisPackage": "Analüüsi pakett",
|
"analysisPackage": "Analüüsi pakett",
|
||||||
"ttoService": "Broneering",
|
"ttoService": "Broneering",
|
||||||
@@ -25,7 +26,8 @@
|
|||||||
"FULL_ANALYSIS_RESPONSE": "Kõik tulemused käes",
|
"FULL_ANALYSIS_RESPONSE": "Kõik tulemused käes",
|
||||||
"COMPLETED": "Kinnitatud",
|
"COMPLETED": "Kinnitatud",
|
||||||
"REJECTED": "Tagastatud",
|
"REJECTED": "Tagastatud",
|
||||||
"CANCELLED": "Tühistatud"
|
"CANCELLED": "Tühistatud",
|
||||||
|
"CONFIRMED": "Kinnitatud"
|
||||||
},
|
},
|
||||||
"analysisPackageOrder": {
|
"analysisPackageOrder": {
|
||||||
"QUEUED": "Esitatud",
|
"QUEUED": "Esitatud",
|
||||||
|
|||||||
Reference in New Issue
Block a user