import { ResponseApi } from "./response.types"; import { CacheState, ErrorState, SelectState } from "./store.types"; export interface DeviceRepositoryProps { getAll: () => Promise; getDeviceById: (id: string) => Promise; createDevice: (device: DeviceRequest) => Promise, "status">>; updateDevice: (id: string, device: DeviceRequest) => Promise, "status">>; getTowerSelect: () => Promise; } export interface Device { id: string; device_code: string; device_type: string; longitude: string | number; latitude: string | number; port_amount: number; status: DeviceStatus; tower_id: string | null; created_at: string; updated_at: string; } export type DeviceStatus = "active" | "inactive" | "maintenance"; export interface DeviceRequest extends Omit {} /** * Device State * ============= */ export interface DeviceState extends ErrorState, CacheState { data?: DeviceDataTable[]; device?: Device | null; isLoading: boolean; lastUpdate: number | null; towerSelect: SelectState[] | null; getTowerSelect: () => Promise; getAll: () => Promise; find: (id: string) => Promise; create: (device: DeviceRequest) => Promise; update: (id: string, device: DeviceRequest) => Promise; clearDevice: () => void; } export interface DeviceDataTable extends Pick { address: string; total_used_port: string | number; } export interface IGetTowerSelect { id: string; tower_code: string; }