add sales visits ui
This commit is contained in:
@@ -9,6 +9,7 @@ import type {
|
||||
RegionHierarchyResponse,
|
||||
RegionDashboardResponse,
|
||||
RouteResponse,
|
||||
RouteVisitResponse,
|
||||
VehicleResponse,
|
||||
WarehouseResponse,
|
||||
VehicleType,
|
||||
@@ -148,6 +149,18 @@ export const routes = {
|
||||
|
||||
remove: (id: string) =>
|
||||
api.delete(`/routes/${id}`),
|
||||
|
||||
assignStores: (id: string, storeIds: string[]) =>
|
||||
api.post<RouteResponse>(`/routes/${id}/stores`, { storeIds }).then(r => r.data),
|
||||
|
||||
assignOwner: (id: string, salesRepId: string) =>
|
||||
api.put<RouteResponse>(`/routes/${id}/owner`, { salesRepId }).then(r => r.data),
|
||||
|
||||
checkIn: (id: string, body: { storeId: string; latitude: number; longitude: number }) =>
|
||||
api.post<RouteVisitResponse>(`/routes/${id}/visits/check-in`, body).then(r => r.data),
|
||||
|
||||
checkOut: (id: string, body: { storeId: string }) =>
|
||||
api.post<RouteVisitResponse>(`/routes/${id}/visits/check-out`, body).then(r => r.data),
|
||||
}
|
||||
|
||||
// ─── Vehicles ─────────────────────────────────────────────────────────────────
|
||||
|
||||
@@ -5,6 +5,7 @@ import type {
|
||||
KycDocumentResponse,
|
||||
OutstandingBalanceResponse,
|
||||
StoreDashboardResponse,
|
||||
StoreVisitHistoryItem,
|
||||
KycStatus,
|
||||
} from '@/types/api'
|
||||
|
||||
@@ -58,4 +59,7 @@ export const stores = {
|
||||
|
||||
updateKycStatus: (id: string, kycStatus: KycStatus) =>
|
||||
api.patch<StoreResponse>(`/stores/${id}/kyc-status`, { kycStatus }).then(r => r.data),
|
||||
|
||||
visitHistory: (id: string) =>
|
||||
api.get<StoreVisitHistoryItem[]>(`/stores/${id}/visit-history`).then(r => r.data),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user