frontend fully integreated with the backend
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
import { api } from '@/lib/api'
|
||||
import type {
|
||||
PaginatedResponse,
|
||||
StockBalanceResponse,
|
||||
StockMovementResponse,
|
||||
LocationType,
|
||||
MovementType,
|
||||
} from '@/types/api'
|
||||
|
||||
import type { PageParams } from './master'
|
||||
|
||||
export interface StockBalanceParams extends PageParams {
|
||||
locationId?: string
|
||||
locationType?: LocationType
|
||||
itemId?: string
|
||||
}
|
||||
|
||||
export interface StockMovementParams extends PageParams {
|
||||
itemId?: string
|
||||
locationId?: string
|
||||
type?: MovementType
|
||||
from?: string
|
||||
to?: string
|
||||
}
|
||||
|
||||
export const stock = {
|
||||
balances: (params?: StockBalanceParams) =>
|
||||
api.get<PaginatedResponse<StockBalanceResponse>>('/stock/balances', { params }).then(r => r.data),
|
||||
|
||||
movements: (params?: StockMovementParams) =>
|
||||
api.get<PaginatedResponse<StockMovementResponse>>('/stock/movements', { params }).then(r => r.data),
|
||||
}
|
||||
Reference in New Issue
Block a user