Skip to content
Extraits de code Groupes Projets
Valider e7b9f9ed rédigé par salaheddine zidani's avatar salaheddine zidani
Parcourir les fichiers

add attributes of relay point in order entity

parent 65679320
Branches
1 requête de fusion!484MS-88/Fix relay point display in order info of back office
......@@ -8,23 +8,23 @@ import { RefundOrderItem } from "./refundOrder";
export enum NoteType {
PRIVATE = 'PRIVATE',
TO_CLIENT = 'TO_CLIENT',
FROM_CLIENT="FROM_CLIENT"
FROM_CLIENT = "FROM_CLIENT"
}
export const noteTypeLabels: Record<NoteType, string> = {
[NoteType.PRIVATE]: 'Privé',
[NoteType.TO_CLIENT]: 'Pour le client',
[NoteType.FROM_CLIENT]: 'du client',
[NoteType.PRIVATE]: 'Privé',
[NoteType.TO_CLIENT]: 'Pour le client',
[NoteType.FROM_CLIENT]: 'du client',
};
export const order_options = {
FAILED: "Échoué",
ON_HOLD: "En attente",
IN_PROGRESS: "En cours",
FINISHED: "Terminé",
CANCELED: "Annulé",
PARTIALLY_REFUNDED: "Remboursé partiellement",
REFUNDED: "Remboursé",
DELETED: "Supprimé",
FAILED: "Échoué",
ON_HOLD: "En attente",
IN_PROGRESS: "En cours",
FINISHED: "Terminé",
CANCELED: "Annulé",
PARTIALLY_REFUNDED: "Remboursé partiellement",
REFUNDED: "Remboursé",
DELETED: "Supprimé",
};
export enum ItemSource {
......@@ -137,8 +137,8 @@ export type OrderAddress = {
export interface OrderWithClientDetails extends Order {
clientFullName: string;
clientEmail: string;
clientFullName: string;
clientEmail: string;
}
export interface Order {
id: string;
......@@ -160,6 +160,13 @@ export interface Order {
shippingMethodType: ShippingMethodType;
shippingPrice: number;
shippingAddress: OrderAddress;
relayRef: string;
relayPointName: string;
relayPointAddress1: string;
relayPointAddress2: string;
relayPointZipCode: string;
relayPointCity: string;
relayPointCountry: string;
billingAddress: OrderAddress;
paymentMethodType: string;
transactionId?: string;
......@@ -179,27 +186,27 @@ export interface Order {
voucherBalanceUsed: number;
}
export interface IOrderPage {
content: OrderWithClientDetails[];
pageable: {
content: OrderWithClientDetails[];
pageable: {
sort: {
empty: boolean;
sorted: boolean;
unsorted: boolean;
};
offset: number;
pageNumber: number;
pageSize: number;
unpaged: boolean;
paged: boolean;
};
totalPages: number;
totalElements: number;
last: boolean;
sort: {
empty: boolean;
sorted: boolean;
unsorted: boolean;
empty: boolean;
sorted: boolean;
unsorted: boolean;
};
offset: number;
pageNumber: number;
pageSize: number;
unpaged: boolean;
paged: boolean;
};
totalPages: number;
totalElements: number;
last: boolean;
sort: {
empty: boolean;
sorted: boolean;
unsorted: boolean;
};
}
......
......@@ -4,8 +4,11 @@ import Stack from "@mui/material/Stack";
import Divider from "@mui/material/Divider";
import CardHeader from "@mui/material/CardHeader";
import Typography from "@mui/material/Typography";
import {CardContent,Chip,Grid,Pagination,Table,TableBody,TableCell,TableContainer,TableRow} from "@mui/material";
import { CardContent, Chip, Grid, Pagination, Table, TableBody, TableCell, TableContainer, TableRow } from "@mui/material";
import CircularProgress from "@mui/material/CircularProgress";
import { OrderStatusHistoryDTO, getStatusInFrench, OrderStatus } from "../../../types/order";
import { useGetUserById } from "@/shared/api/user";
import { useEffect, useState } from "react";
import {OrderStatusHistoryDTO,getStatusInFrench,OrderStatus} from "../../../types/order";
import { findUserById, useGetUserById } from "@/shared/api/user";
import { useCallback, useEffect, useState } from "react";
......@@ -227,9 +230,9 @@ export default function OrderDetailsInfo({ order }: Props) {
const sortedNotes = order?.notes
? order.notes.sort(
(a, b) =>
new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime()
)
(a, b) =>
new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime()
)
: [];
const paginatedNotes = sortedNotes.slice(
......@@ -293,10 +296,10 @@ export default function OrderDetailsInfo({ order }: Props) {
type === "page"
? `PageNote ${page}`
: type === "next"
? "PageNote suivante"
: type === "previous"
? "PageNote précédente"
: ""
? "PageNote suivante"
: type === "previous"
? "PageNote précédente"
: ""
}
sx={{
mt: 2,
......@@ -366,9 +369,8 @@ export default function OrderDetailsInfo({ order }: Props) {
>
Adresse
</Box>
{`${order.billingAddress.street || ""} ${
order.billingAddress.home || ""
}`}
{`${order.billingAddress.street || ""} ${order.billingAddress.home || ""
}`}
</Stack>
<Stack direction="row">
<Box
......@@ -418,9 +420,8 @@ export default function OrderDetailsInfo({ order }: Props) {
>
Adresse
</Box>
{`${order.shippingAddress.street || ""} ${
order.shippingAddress.home || ""
}`}
{`${order.shippingAddress.street || ""} ${order.shippingAddress.home || ""
}`}
</Stack>
<Stack direction="row">
<Box
......@@ -449,22 +450,78 @@ export default function OrderDetailsInfo({ order }: Props) {
</Box>
{order.shippingAddress.country || ""}
</Stack>
<Stack direction="row">
<Box
component="span"
sx={{ color: "text.secondary", width: 118, flexShrink: 0 }}
>
Mode d’expédition
</Box>
{getShippingMethodNameInFrench(order.shippingMethodType) || ""}
</Stack>
</Stack>
) : (
<Box sx={{ p: 3, typography: "body2", color: "text.secondary" }}>
Commande n'a pas d'adresse de livraison
</Box>
)}
<Stack spacing={1.5} sx={{ p: 3, typography: "body2" }}>
<Stack direction="row">
<Box
component="span"
sx={{ color: "text.secondary", width: 118, flexShrink: 0 }}
>
Nom
</Box>
{order?.relayPointName}
</Stack>
<Stack direction="row">
<Box
component="span"
sx={{ color: "text.secondary", width: 118, flexShrink: 0 }}
>
Addresse 1
</Box>
{order?.relayPointAddress1}
</Stack>
<Stack direction="row">
<Box
component="span"
sx={{ color: "text.secondary", width: 118, flexShrink: 0 }}
>
Addresse 2
</Box>
{order?.relayPointAddress2}
</Stack>
<Stack direction="row">
<Box
component="span"
sx={{ color: "text.secondary", width: 118, flexShrink: 0 }}
>
Code postal
</Box>
{order?.relayPointZipCode}
</Stack>
<Stack direction="row">
<Box
component="span"
sx={{ color: "text.secondary", width: 118, flexShrink: 0 }}
>
Ville
</Box>
{order?.relayPointCity}
</Stack>
<Stack direction="row">
<Box
component="span"
sx={{ color: "text.secondary", width: 118, flexShrink: 0 }}
>
Pays
</Box>
{order?.relayPointCountry}
</Stack>
<Stack direction="row">
<Box
component="span"
sx={{ color: "text.secondary", width: 118, flexShrink: 0 }}
>
Mode d’expédition
</Box>
{getShippingMethodNameInFrench(order.shippingMethodType) || ""}
</Stack>
</Stack>
</>
);
......
0% ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter