diff --git a/frontend-admin/src/api/api_admin.ts b/frontend-admin/src/api/api_admin.ts
index e3ddca5c..a1fc9490 100644
--- a/frontend-admin/src/api/api_admin.ts
+++ b/frontend-admin/src/api/api_admin.ts
@@ -264,17 +264,6 @@ export const notifyClientToDescend = async (commandId: number) => {
};
};
-export const confirmReceptionAdmin = async (commandId: number) => {
- const { data } = await apiClient.post(
- `${V2}/admin/protected/orders/${commandId}/confirm-reception`,
- );
- return {
- success: true,
- message: data.message,
- points_earned: data.points_earned,
- client_username: data.client_username,
- };
-};
// ============================================
@@ -935,13 +924,18 @@ export interface RewardCategoryConfig {
amount: number;
}
+export interface RewardItem {
+ product_id: number;
+ quantity: number;
+ price: number;
+}
+
export interface PointsReward {
threshold: number;
type: "free_product" | "half_price_product" | "custom";
description: string;
category_configs: RewardCategoryConfig[];
- reward_product_id?: number;
- reward_quantity?: number;
+ reward_items: RewardItem[];
}
export interface PointsPool {
diff --git a/frontend-admin/src/screens/admin/OrderDetailScreen.tsx b/frontend-admin/src/screens/admin/OrderDetailScreen.tsx
index 8f2f15ea..05cc6a12 100644
--- a/frontend-admin/src/screens/admin/OrderDetailScreen.tsx
+++ b/frontend-admin/src/screens/admin/OrderDetailScreen.tsx
@@ -23,7 +23,6 @@ import {
getCommandItems,
updateCommandStatus,
validateCommand,
- confirmReceptionAdmin,
notifyClientToDescend,
getDeliveryPersonDetails,
deleteCommandItem,
@@ -206,20 +205,6 @@ export default function OrderDetailScreen() {
);
};
- const handleConfirmReception = async () => {
- try {
- const res = await confirmReceptionAdmin(orderId);
- showSuccess(
- "Réception confirmée",
- `${res.points_earned} point(s) attribués au client ${res.client_username}`,
- );
- const updated = await getCommandByID(orderId);
- setCommand(updated.command);
- } catch (e: any) {
- showError("Erreur", e.message);
- }
- };
-
const handleDeleteCommand = () => {
Alert.alert(
"Supprimer la commande",
@@ -880,15 +865,7 @@ export default function OrderDetailScreen() {
style={{ marginTop: spacing.s }}
/>
)}
- {!["approved", "cancelled"].includes(command.status) && (
-
- )}
+