mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-09-06 13:35:03 +00:00
36 lines
965 B
TypeScript
36 lines
965 B
TypeScript
import { api } from '../auth/http';
|
||
|
||
export interface Rate {
|
||
id: string;
|
||
rateType: string;
|
||
appliesTo: string;
|
||
trigger: string;
|
||
containerTypeId: string | null;
|
||
cargoTypeId: string | null;
|
||
tradeDirection: string | null;
|
||
currency: string;
|
||
rateValue: string;
|
||
rateUnit: string;
|
||
/** PER_LITER fuel rates only: price = baseLiters × rateValue, once per booking. */
|
||
baseLiters?: string | null;
|
||
status: string;
|
||
proposedByStaffId: string;
|
||
approvedByCeoId: string | null;
|
||
approvedAt: string | null;
|
||
createdAt: string;
|
||
updatedAt: string;
|
||
deletedAt: string | null;
|
||
}
|
||
|
||
export interface RatesListResponse {
|
||
data: Rate[];
|
||
meta: { total: number; page: number; pageSize: number; totalPages: number };
|
||
}
|
||
|
||
export const ratesService = {
|
||
list: (pageSize = 1000) =>
|
||
api.get<RatesListResponse>(`/rates?pageSize=${pageSize}`),
|
||
getByType: (rateType: string) =>
|
||
api.get<RatesListResponse>(`/rates?rateType=${rateType}&pageSize=1000`),
|
||
};
|