chore: add new features
This commit is contained in:
@@ -159,6 +159,18 @@ export const validateCommand = async (commandId: number) => {
|
||||
return { success: true, message: data.message };
|
||||
};
|
||||
|
||||
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,
|
||||
};
|
||||
};
|
||||
|
||||
// ============================================
|
||||
// LIVREURS
|
||||
// ============================================
|
||||
|
||||
@@ -31,6 +31,18 @@ export const updateItemStatus = async (itemId: number, status: string) => {
|
||||
return { success: true, message: data.message };
|
||||
};
|
||||
|
||||
export const confirmReceptionCabine = async (commandId: number) => {
|
||||
const { data } = await apiClient.post(
|
||||
`${API}/commands/${commandId}/confirm-reception`,
|
||||
);
|
||||
return {
|
||||
success: true,
|
||||
message: data.message,
|
||||
points_earned: data.points_earned,
|
||||
client_username: data.client_username,
|
||||
};
|
||||
};
|
||||
|
||||
// ============================================
|
||||
// PENALITES
|
||||
// ============================================
|
||||
@@ -105,6 +117,24 @@ export const deleteCommand = async (commandId: number) => {
|
||||
return { success: true, message: data.message };
|
||||
};
|
||||
|
||||
export const getCabineLivreursList = async (): Promise<
|
||||
{ id: number; username: string }[]
|
||||
> => {
|
||||
const { data } = await apiClient.get(`${API}/all/deliveryman`);
|
||||
return data.users || [];
|
||||
};
|
||||
|
||||
export const assignDeliveryPersonByCabine = async (
|
||||
commandId: number,
|
||||
livreurUsername: string,
|
||||
) => {
|
||||
const { data } = await apiClient.post(
|
||||
`${API}/commands/${commandId}/assign`,
|
||||
{ livreur_username: livreurUsername },
|
||||
);
|
||||
return { success: true, message: data.message };
|
||||
};
|
||||
|
||||
export const getDeliverymanLocationForCommand = async (commandId: number) => {
|
||||
try {
|
||||
const { data } = await apiClient.get(
|
||||
|
||||
Reference in New Issue
Block a user