declare namespace SgwModel {
  interface ShipBaseInfo {
    name?: string;
    reg_number?: string;
    ship_type?: number;
    ship_length?: number;
    ship_power?: number;
    home_port?: number;
    fishing_license_number?: string;
    fishing_license_expiry_date?: string;
    ship_group_id?: string | null; // Lưu ý: Update có thể cần null để gỡ nhóm
  }

  interface ShipType {
    id?: number;
    name?: string;
    description?: string;
  }
  interface ShipMetadata {
    crew_count?: number;
    home_port?: string;
    home_port_point?: string;
    ship_type?: string;
    trip_arrival_port?: string;
    trip_arrival_port_point?: string;
    trip_arrival_time?: Date;
    trip_depart_port?: string;
    trip_depart_port_point?: string;
    trip_departure_time?: Date;
    trip_id?: string;
    trip_name?: string;
    trip_state?: number;
  }

  interface ShipDetail extends ShipBaseInfo {
    id?: string;
    thing_id?: string;
    owner_id?: string;
    imo_number?: string;
    mmsi_number?: string;
    province_code?: string;
    created_at?: Date | string;
    updated_at?: Date | string;
    metadata?: ShipMetadata;
  }
  interface ShipCreateParams extends ShipBaseInfo {
    thing_id?: string;
  }
  interface ShipUpdateParams {
    metadata?: Record<string, unknown>;
  }
  interface ShipQueryParams extends MasterModel.SearchPaginationBody {
    order?: string;
    registration_number?: string;
    ship_type?: number;
    ship_group_id?: string;
    thing_id?: string;
  }
  interface ShipQueryResponse extends MasterModel.PaginationReponse {
    ships: ShipDetail[];
  }

  // Ship Group

  interface ShipGroupBaseInfo {
    name: string;
    owner_id?: string;
    description?: string;
  }

  interface ShipGroup extends ShipGroupBaseInfo {
    id: string;
    created_at?: Date | string;
    updated_at?: Date | string;
    metadata?: Record<string, unknown>;
  }

  interface GroupShipResponse extends ShipGroupBaseInfo {
    id?: string;
  }

  interface ShipGroupCreateParams extends ShipGroupBaseInfo {
    metadata?: Record<string, unknown>;
  }

  interface ShipGroupUpdateParams extends ShipGroupBaseInfo {
    metadata?: Record<string, unknown>;
  }
}
