Add promotion details and modal to orders and promotions
Introduces promotion-related fields to the Order interface and displays promotion discounts in both the order details and order table. Adds a PromotionDetailsModal component for viewing detailed promotion analytics and eligibility, and integrates it into the PromotionsList with a new 'view details' action.
This commit is contained in:
@@ -69,6 +69,11 @@ interface Order {
|
||||
lastBalanceReceived?: number;
|
||||
cryptoTotal?: number;
|
||||
paymentAddress?: string;
|
||||
// Promotion fields
|
||||
promotion?: string;
|
||||
promotionCode?: string;
|
||||
discountAmount?: number;
|
||||
subtotalBeforeDiscount?: number;
|
||||
}
|
||||
|
||||
interface OrderInList extends Order {
|
||||
@@ -697,6 +702,17 @@ export default function OrderDetailsPage() {
|
||||
<TableCell className="text-right font-medium">Shipping ({order?.shippingMethod.type})</TableCell>
|
||||
<TableCell className="text-right">£{order?.shippingMethod.price.toFixed(2)}</TableCell>
|
||||
</TableRow>
|
||||
{order?.promotionCode && order?.discountAmount && order?.discountAmount > 0 && (
|
||||
<TableRow>
|
||||
<TableCell colSpan={2} />
|
||||
<TableCell className="text-right font-medium text-green-600">
|
||||
Promotion ({order.promotionCode})
|
||||
</TableCell>
|
||||
<TableCell className="text-right text-green-600">
|
||||
-£{order.discountAmount.toFixed(2)}
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
)}
|
||||
<TableRow>
|
||||
<TableCell colSpan={2} />
|
||||
<TableCell className="text-right font-bold">Total</TableCell>
|
||||
|
||||
Reference in New Issue
Block a user