detail_order
This commit is contained in:
@@ -26,8 +26,8 @@ const OrderItemsDetails: FC<OrderItemsDetailsProps> = ({ order, getStatusColor }
|
|||||||
|
|
||||||
const orderItems: OrderItemTable[] = order.items.map((item: OrderItemType) => ({
|
const orderItems: OrderItemTable[] = order.items.map((item: OrderItemType) => ({
|
||||||
id: item.id,
|
id: item.id,
|
||||||
image: item.food?.images?.[0] || '',
|
image: '',
|
||||||
title: item.food?.title || '-',
|
title: item.variant?.value?.trim() ? item.variant.value : 'محصول',
|
||||||
quantity: item.quantity,
|
quantity: item.quantity,
|
||||||
unitPrice: item.unitPrice,
|
unitPrice: item.unitPrice,
|
||||||
discount: item.discount,
|
discount: item.discount,
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ export interface ServiceArea {
|
|||||||
coordinates: number[][][];
|
coordinates: number[][][];
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface RestaurantScore {
|
export interface OrderShopScore {
|
||||||
scoreAmount: string;
|
scoreAmount: string;
|
||||||
scoreCredit: string;
|
scoreCredit: string;
|
||||||
birthdayScore: string;
|
birthdayScore: string;
|
||||||
@@ -33,7 +33,7 @@ export interface RestaurantScore {
|
|||||||
marriageDateScore: string;
|
marriageDateScore: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface OrderRestaurant {
|
export interface OrderShop {
|
||||||
id: string;
|
id: string;
|
||||||
createdAt: string;
|
createdAt: string;
|
||||||
updatedAt: string;
|
updatedAt: string;
|
||||||
@@ -45,7 +45,7 @@ export interface OrderRestaurant {
|
|||||||
menuColor: string | null;
|
menuColor: string | null;
|
||||||
latitude: number | null;
|
latitude: number | null;
|
||||||
longitude: number | null;
|
longitude: number | null;
|
||||||
serviceArea: ServiceArea;
|
serviceArea: ServiceArea | null;
|
||||||
isActive: boolean;
|
isActive: boolean;
|
||||||
establishedYear: number | null;
|
establishedYear: number | null;
|
||||||
phone: string;
|
phone: string;
|
||||||
@@ -59,9 +59,10 @@ export interface OrderRestaurant {
|
|||||||
images: string[] | null;
|
images: string[] | null;
|
||||||
vat: number;
|
vat: number;
|
||||||
domain: string;
|
domain: string;
|
||||||
score: RestaurantScore;
|
score: OrderShopScore;
|
||||||
plan: string;
|
subscriptionId: string | null;
|
||||||
subscriptionId: string;
|
subscriptionEndDate: string | null;
|
||||||
|
subscriptionStartDate: string | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface OrderDeliveryMethod {
|
export interface OrderDeliveryMethod {
|
||||||
@@ -70,7 +71,7 @@ export interface OrderDeliveryMethod {
|
|||||||
updatedAt: string;
|
updatedAt: string;
|
||||||
deletedAt: string | null;
|
deletedAt: string | null;
|
||||||
method: string;
|
method: string;
|
||||||
restaurant: string;
|
shop: string;
|
||||||
deliveryFee: number;
|
deliveryFee: number;
|
||||||
deliveryFeeType: string;
|
deliveryFeeType: string;
|
||||||
perKilometerFee: number | null;
|
perKilometerFee: number | null;
|
||||||
@@ -104,7 +105,7 @@ export interface OrderPaymentMethod {
|
|||||||
createdAt: string;
|
createdAt: string;
|
||||||
updatedAt: string;
|
updatedAt: string;
|
||||||
deletedAt: string | null;
|
deletedAt: string | null;
|
||||||
restaurant: string;
|
shop: string;
|
||||||
method: string;
|
method: string;
|
||||||
gateway: string | null;
|
gateway: string | null;
|
||||||
description: string;
|
description: string;
|
||||||
@@ -113,28 +114,14 @@ export interface OrderPaymentMethod {
|
|||||||
merchantId: string | null;
|
merchantId: string | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface OrderFood {
|
export interface OrderVariant {
|
||||||
id: string;
|
id: string;
|
||||||
createdAt: string;
|
createdAt?: string;
|
||||||
updatedAt: string;
|
updatedAt?: string;
|
||||||
deletedAt: string | null;
|
deletedAt?: string | null;
|
||||||
restaurant: string;
|
product: string;
|
||||||
category: string;
|
value: string;
|
||||||
title: string;
|
|
||||||
desc: string;
|
|
||||||
content: string[];
|
|
||||||
price: number;
|
price: number;
|
||||||
order: number | null;
|
|
||||||
prepareTime: number | null;
|
|
||||||
weekDays: number[];
|
|
||||||
mealTypes: string[];
|
|
||||||
isActive: boolean;
|
|
||||||
images: string[];
|
|
||||||
inPlaceServe: boolean;
|
|
||||||
pickupServe: boolean;
|
|
||||||
score: number;
|
|
||||||
discount: number;
|
|
||||||
isSpecialOffer: boolean;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface OrderItem {
|
export interface OrderItem {
|
||||||
@@ -143,7 +130,7 @@ export interface OrderItem {
|
|||||||
updatedAt: string;
|
updatedAt: string;
|
||||||
deletedAt: string | null;
|
deletedAt: string | null;
|
||||||
order: string;
|
order: string;
|
||||||
food: OrderFood;
|
variant: OrderVariant;
|
||||||
quantity: number;
|
quantity: number;
|
||||||
unitPrice: number;
|
unitPrice: number;
|
||||||
discount: number;
|
discount: number;
|
||||||
@@ -153,6 +140,25 @@ export interface OrderItem {
|
|||||||
export interface OrderHistory {
|
export interface OrderHistory {
|
||||||
status: string;
|
status: string;
|
||||||
changedAt: string;
|
changedAt: string;
|
||||||
|
desc?: string | null;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface PaymentVerifyResponseData {
|
||||||
|
fee?: number;
|
||||||
|
code?: number;
|
||||||
|
wages?: unknown;
|
||||||
|
ref_id?: number;
|
||||||
|
message?: string;
|
||||||
|
card_pan?: string;
|
||||||
|
fee_type?: string;
|
||||||
|
order_id?: string;
|
||||||
|
card_hash?: string;
|
||||||
|
shaparak_fee?: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface OrderPaymentVerifyResponse {
|
||||||
|
data?: PaymentVerifyResponseData;
|
||||||
|
errors?: unknown[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface OrderPayment {
|
export interface OrderPayment {
|
||||||
@@ -168,7 +174,7 @@ export interface OrderPayment {
|
|||||||
transactionId: string | null;
|
transactionId: string | null;
|
||||||
status: string;
|
status: string;
|
||||||
cardPan: string | null;
|
cardPan: string | null;
|
||||||
verifyResponse: unknown | null;
|
verifyResponse: OrderPaymentVerifyResponse | null;
|
||||||
paidAt: string | null;
|
paidAt: string | null;
|
||||||
failedAt: string | null;
|
failedAt: string | null;
|
||||||
description: string | null;
|
description: string | null;
|
||||||
@@ -189,7 +195,7 @@ export interface Order extends RowDataType {
|
|||||||
updatedAt: string;
|
updatedAt: string;
|
||||||
deletedAt: string | null;
|
deletedAt: string | null;
|
||||||
user: OrderUser;
|
user: OrderUser;
|
||||||
restaurant: OrderRestaurant;
|
shop: OrderShop;
|
||||||
deliveryMethod: OrderDeliveryMethod;
|
deliveryMethod: OrderDeliveryMethod;
|
||||||
userAddress: UserAddress | null;
|
userAddress: UserAddress | null;
|
||||||
carAddress: CarAddress | null;
|
carAddress: CarAddress | null;
|
||||||
@@ -206,7 +212,7 @@ export interface Order extends RowDataType {
|
|||||||
total: number;
|
total: number;
|
||||||
totalItems: number;
|
totalItems: number;
|
||||||
description: string;
|
description: string;
|
||||||
tableNumber: string | null;
|
tableNumber?: string | null;
|
||||||
status: string;
|
status: string;
|
||||||
paymentStatus?: string;
|
paymentStatus?: string;
|
||||||
history: OrderHistory[];
|
history: OrderHistory[];
|
||||||
|
|||||||
Reference in New Issue
Block a user