303 lines
6.2 KiB
TypeScript
303 lines
6.2 KiB
TypeScript
declare namespace Model {
|
|
interface LoginRequestBody {
|
|
guid: string;
|
|
email: string;
|
|
password: string;
|
|
}
|
|
interface LoginResponse {
|
|
enabled2fa: boolean;
|
|
token?: string;
|
|
}
|
|
|
|
interface GPSResponse {
|
|
lat: number;
|
|
lon: number;
|
|
s: number;
|
|
h: number;
|
|
fishing: boolean;
|
|
t: number;
|
|
}
|
|
interface Alarm {
|
|
name: string;
|
|
t: number; // timestamp (epoch seconds)
|
|
level: number;
|
|
id: string;
|
|
}
|
|
|
|
interface AlarmResponse {
|
|
alarms: Alarm[];
|
|
level: number;
|
|
}
|
|
|
|
interface ShipTrackPoint {
|
|
time: number;
|
|
lon: number;
|
|
lat: number;
|
|
s: number;
|
|
h: number;
|
|
}
|
|
interface EntityResponse {
|
|
id: string;
|
|
v: number;
|
|
vs: string;
|
|
t: number;
|
|
type: string;
|
|
}
|
|
interface TransformedEntity {
|
|
id: string;
|
|
value: number;
|
|
valueString: string;
|
|
time: number;
|
|
type: string;
|
|
}
|
|
|
|
// Banzones
|
|
// Banzone
|
|
interface Zone {
|
|
id?: string;
|
|
name?: string;
|
|
type?: number;
|
|
conditions?: Condition[];
|
|
enabled?: boolean;
|
|
updated_at?: Date;
|
|
geom?: Geom;
|
|
}
|
|
|
|
interface Condition {
|
|
max?: number;
|
|
min?: number;
|
|
type?: Type;
|
|
to?: number;
|
|
from?: number;
|
|
}
|
|
|
|
enum Type {
|
|
LengthLimit = "length_limit",
|
|
MonthRange = "month_range",
|
|
}
|
|
|
|
interface Geom {
|
|
geom_type?: number;
|
|
geom_poly?: string;
|
|
geom_lines?: string;
|
|
geom_point?: string;
|
|
geom_radius?: number;
|
|
}
|
|
|
|
interface SosRequest {
|
|
message?: string;
|
|
}
|
|
|
|
interface SosResponse {
|
|
active: boolean;
|
|
message?: string;
|
|
started_at?: number;
|
|
}
|
|
// Trip
|
|
interface Trip {
|
|
id: string;
|
|
ship_id: string;
|
|
ship_length: number;
|
|
vms_id: string;
|
|
name: string;
|
|
fishing_gears: FishingGear[]; // Dụng cụ đánh cá
|
|
crews?: TripCrews[]; // Thuyền viên
|
|
departure_time: string; // ISO datetime string
|
|
departure_port_id: number;
|
|
arrival_time: string; // ISO datetime string
|
|
arrival_port_id: number;
|
|
fishing_ground_codes: number[];
|
|
total_catch_weight: number | null;
|
|
total_species_caught: number | null;
|
|
trip_cost: TripCost[]; // Chi phí chuyến đi
|
|
trip_status: number;
|
|
approved_by: string;
|
|
notes: string | null;
|
|
fishing_logs: FishingLog[] | null; // tuỳ dữ liệu chi tiết có thể định nghĩa thêm
|
|
sync: boolean;
|
|
}
|
|
|
|
// Dụng cụ đánh cá
|
|
interface FishingGear {
|
|
name: string;
|
|
number: string;
|
|
}
|
|
// Thuyền viên
|
|
interface TripCrews {
|
|
TripID: string;
|
|
PersonalID: string;
|
|
role: string;
|
|
joined_at: Date;
|
|
left_at: Date | null;
|
|
note: string | null;
|
|
Person: TripCrewPerson;
|
|
}
|
|
interface TripCrewPerson {
|
|
personal_id: string;
|
|
name: string;
|
|
phone: string;
|
|
email: string;
|
|
birth_date: Date; // ISO string (có thể chuyển sang Date nếu parse trước)
|
|
note: string;
|
|
address: string;
|
|
created_at: Date;
|
|
updated_at: Date;
|
|
}
|
|
// Chi phí chuyến đi
|
|
interface TripCost {
|
|
type: string;
|
|
unit: string;
|
|
amount: number;
|
|
total_cost: number;
|
|
cost_per_unit: number;
|
|
}
|
|
// Thông tin mẻ lưới
|
|
interface FishingLog {
|
|
fishing_log_id: string;
|
|
trip_id: string;
|
|
start_at: Date; // ISO datetime
|
|
end_at: Date; // ISO datetime
|
|
start_lat: number;
|
|
start_lon: number;
|
|
haul_lat: number;
|
|
haul_lon: number;
|
|
status: number;
|
|
weather_description: string;
|
|
info?: FishingLogInfo[]; // Thông tin cá
|
|
sync: boolean;
|
|
}
|
|
// Thông tin cá
|
|
interface FishingLogInfo {
|
|
fish_species_id?: number;
|
|
fish_name?: string;
|
|
catch_number?: number;
|
|
catch_unit?: string;
|
|
fish_size?: number;
|
|
fish_rarity?: number;
|
|
fish_condition?: string;
|
|
gear_usage?: string;
|
|
}
|
|
interface NewFishingLogRequest {
|
|
trip_id: string;
|
|
start_at: Date; // ISO datetime
|
|
start_lat: number;
|
|
start_lon: number;
|
|
weather_description: string;
|
|
}
|
|
|
|
interface TripUpdateStateRequest {
|
|
status: number;
|
|
note?: string;
|
|
}
|
|
//Fish
|
|
interface FishSpeciesResponse {
|
|
id: number;
|
|
name: string;
|
|
scientific_name: string;
|
|
group_name: string;
|
|
species_code: string;
|
|
note: string;
|
|
default_unit: string;
|
|
rarity_level: number;
|
|
created_at: string;
|
|
updated_at: string;
|
|
is_deleted: boolean;
|
|
}
|
|
interface FishRarity {
|
|
id: number;
|
|
code: string;
|
|
label: string;
|
|
description: string;
|
|
iucn_code: any;
|
|
cites_appendix: any;
|
|
vn_law: boolean;
|
|
}
|
|
|
|
// Seagateway Owner Appp
|
|
interface SearchThingBody {
|
|
offset?: number;
|
|
limit?: number;
|
|
order?: string;
|
|
sort?: "asc" | "desc";
|
|
name?: string;
|
|
metadata?: any;
|
|
}
|
|
|
|
interface ThingsResponse {
|
|
total?: number;
|
|
offset?: number;
|
|
limit?: number;
|
|
order?: string;
|
|
direction?: string;
|
|
metadata?: ThingsResponseMetadata;
|
|
things?: Thing[];
|
|
}
|
|
|
|
interface ThingsResponseMetadata {
|
|
total_connected?: number;
|
|
total_filter?: number;
|
|
total_sos?: number;
|
|
total_state_level_0?: number;
|
|
total_state_level_1?: number;
|
|
total_state_level_2?: number;
|
|
total_thing?: number;
|
|
}
|
|
|
|
interface Thing {
|
|
id?: string;
|
|
name?: string;
|
|
key?: string;
|
|
metadata?: ThingMetadata;
|
|
}
|
|
|
|
interface ThingMetadata {
|
|
address?: string;
|
|
alarm_list?: string;
|
|
basename?: string;
|
|
cfg_channel_id?: string;
|
|
cfg_id?: string;
|
|
connected?: boolean;
|
|
ctrl_channel_id?: string;
|
|
data_channel_id?: string;
|
|
enduser?: string;
|
|
external_id?: string;
|
|
gps?: string;
|
|
gps_time?: string;
|
|
group_id?: string;
|
|
req_channel_id?: string;
|
|
ship_group_id?: string;
|
|
ship_id?: string;
|
|
ship_length?: string;
|
|
ship_name?: string;
|
|
ship_power?: string;
|
|
ship_reg_number?: string;
|
|
ship_type?: string;
|
|
sos?: string;
|
|
sos_time?: string;
|
|
state?: string;
|
|
state_level?: number;
|
|
state_updated_time?: number;
|
|
trip_state?: string;
|
|
type?: string;
|
|
updated_time?: number;
|
|
uptime?: number;
|
|
zone_approaching_alarm_list?: string;
|
|
zone_entered_alarm_list?: string;
|
|
zone_fishing_alarm_list?: string;
|
|
}
|
|
|
|
// Ship
|
|
interface ShipType {
|
|
id?: number;
|
|
name?: string;
|
|
description?: string;
|
|
}
|
|
|
|
interface ShipGroup {
|
|
id?: string;
|
|
name?: string;
|
|
owner_id?: string;
|
|
description?: string;
|
|
}
|
|
}
|