import { Feature, FeatureCollection } from 'dasf-web/lib/model/Features';
import { Timeseries } from 'dasf-web/lib/model/Timeseries';
import Geometry from 'ol/geom/Geometry';
import { JsonObject, JsonProperty } from 'json2typescript';

export interface Properties {
    gid: number;
    name: string;
    river: string;
}

export interface Gauge extends Feature {
    properties: Properties;
    returnPeriod: Timeseries;
    discharge: Timeseries;
    floodEventDischarge: Timeseries[];
    basin: Geometry;
}

@JsonObject('GaugeNetworkEdge')
export class GaugeNetworkEdge {
    @JsonProperty('source_gid', Number)
    public source: number;

    @JsonProperty('target_gid', Number)
    public target: number;

    public constructor() {
        this.source = -1;
        this.target = -1;
    }
}

@JsonObject('GaugeNetwork')
export class GaugeNetwork {
    @JsonProperty('gid', Number)
    public gid: number;

    @JsonProperty('data', [GaugeNetworkEdge])
    public data: GaugeNetworkEdge[];

    public constructor() {
        this.gid = -1;
        this.data = [];
    }
}

export interface Gauges extends FeatureCollection<Gauge> {
}
