package models

type Category struct {
	ID       int    `json:"id"`
	Name     string `json:"name"`
	ParentID int    `json:"parent_id"`
	Level    int    `json:"level"`
	Notes    string `json:"notes,omitempty"`
}

type CategoryResponse struct {
	RealtimeStart string    `json:"realtime_start"`
	RealtimeEnd   string    `json:"realtime_end"`
	Category      *Category `json:"category"`
}

type CategoriesResponse struct {
	RealtimeStart string     `json:"realtime_start"`
	RealtimeEnd   string     `json:"realtime_end"`
	Categories    []Category `json:"categories"`
}

type Series struct {
	ID                      string `json:"id"`
	RealtimeStart           string `json:"realtime_start"`
	RealtimeEnd             string `json:"realtime_end"`
	Title                   string `json:"title"`
	ObservationStart        string `json:"observation_start"`
	ObservationEnd          string `json:"observation_end"`
	Frequency               string `json:"frequency"`
	FrequencyShort          string `json:"frequency_short"`
	Units                   string `json:"units"`
	UnitsShort              string `json:"units_short"`
	SeasonalAdjustment      string `json:"seasonal_adjustment"`
	SeasonalAdjustmentShort string `json:"seasonal_adjustment_short"`
	LastUpdated             string `json:"last_updated"`
	Popularity              int    `json:"popularity"`
	Notes                   string `json:"notes,omitempty"`
}

type SeriesListResponse struct {
	RealtimeStart string   `json:"realtime_start"`
	RealtimeEnd   string   `json:"realtime_end"`
	Seriess       []Series `json:"seriess"`
}

type SeriesResponse struct {
	RealtimeStart string `json:"realtime_start"`
	RealtimeEnd   string `json:"realtime_end"`
	Series        Series `json:"series"`
}

type Observation struct {
	RealtimeStart string `json:"realtime_start"`
	RealtimeEnd   string `json:"realtime_end"`
	Date          string `json:"date"`
	Value         string `json:"value"`
}

type ObservationsResponse struct {
	RealtimeStart    string        `json:"realtime_start"`
	RealtimeEnd      string        `json:"realtime_end"`
	ObservationStart string        `json:"observation_start"`
	ObservationEnd   string        `json:"observation_end"`
	Units            string        `json:"units"`
	OutputType       int           `json:"output_type"`
	FileType         string        `json:"file_type"`
	OrderBy          string        `json:"order_by"`
	SortOrder        string        `json:"sort_order"`
	Count            int           `json:"count"`
	Offset           int           `json:"offset"`
	Limit            int           `json:"limit"`
	Observations     []Observation `json:"observations"`
}

type SearchResult struct {
	ID                      string `json:"id"`
	RealtimeStart           string `json:"realtime_start"`
	RealtimeEnd             string `json:"realtime_end"`
	Title                   string `json:"title"`
	Frequency               string `json:"frequency"`
	FrequencyShort          string `json:"frequency_short"`
	Units                   string `json:"units"`
	UnitsShort              string `json:"units_short"`
	SeasonalAdjustment      string `json:"seasonal_adjustment"`
	SeasonalAdjustmentShort string `json:"seasonal_adjustment_short"`
	LastUpdated             string `json:"last_updated"`
	Popularity              int    `json:"popularity"`
	Notes                   string `json:"notes,omitempty"`
}

type SearchResponse struct {
	RealtimeStart string         `json:"realtime_start"`
	RealtimeEnd   string         `json:"realtime_end"`
	Count         int            `json:"count"`
	Offset        int            `json:"offset"`
	Limit         int            `json:"limit"`
	OrderBy       string         `json:"order_by"`
	SortOrder     string         `json:"sort_order"`
	Results       []SearchResult `json:"seriess"`
}

type Release struct {
	ID            int    `json:"id"`
	RealtimeStart string `json:"realtime_start"`
	RealtimeEnd   string `json:"realtime_end"`
	Link          string `json:"link"`
	Name          string `json:"name"`
	PressRelease  bool   `json:"press_release"`
	Notes         string `json:"notes,omitempty"`
}

type ReleasesResponse struct {
	RealtimeStart string    `json:"realtime_start"`
	RealtimeEnd   string    `json:"realtime_end"`
	Count         int       `json:"count"`
	Offset        int       `json:"offset"`
	Limit         int       `json:"limit"`
	Releases      []Release `json:"releases"`
}

type ReleaseResponse struct {
	RealtimeStart string  `json:"realtime_start"`
	RealtimeEnd   string  `json:"realtime_end"`
	Release       Release `json:"release"`
}

type ReleaseDatesResponse struct {
	RealtimeStart string `json:"realtime_start"`
	RealtimeEnd   string `json:"realtime_end"`
	Count         int    `json:"count"`
	Offset        int    `json:"offset"`
	Limit         int    `json:"limit"`
	ReleaseDates  []struct {
		ReleaseID   int    `json:"release_id"`
		Date        string `json:"date"`
		ReleaseName string `json:"release_name"`
	} `json:"release_dates"`
}

type Source struct {
	ID            int    `json:"id"`
	RealtimeStart string `json:"realtime_start"`
	RealtimeEnd   string `json:"realtime_end"`
	Name          string `json:"name"`
	Link          string `json:"link"`
	Notes         string `json:"notes,omitempty"`
}

type SourcesResponse struct {
	RealtimeStart string   `json:"realtime_start"`
	RealtimeEnd   string   `json:"realtime_end"`
	Count         int      `json:"count"`
	Offset        int      `json:"offset"`
	Limit         int      `json:"limit"`
	Sources       []Source `json:"sources"`
}

type SourceResponse struct {
	RealtimeStart string `json:"realtime_start"`
	RealtimeEnd   string `json:"realtime_end"`
	Source        Source `json:"source"`
}

type Tag struct {
	Name       string `json:"name"`
	GroupName  string `json:"group_name"`
	Serverity  string `json:"serverity"`
	Notes      string `json:"notes,omitempty"`
	Popularity int    `json:"popularity"`
}

type TagsResponse struct {
	RealtimeStart string `json:"realtime_start"`
	RealtimeEnd   string `json:"realtime_end"`
	Count         int    `json:"count"`
	Offset        int    `json:"offset"`
	Limit         int    `json:"limit"`
	Tags          []Tag  `json:"tags"`
}

type RelatedTagsResponse struct {
	RealtimeStart string `json:"realtime_start"`
	RealtimeEnd   string `json:"realtime_end"`
	Count         int    `json:"count"`
	Offset        int    `json:"offset"`
	Limit         int    `json:"limit"`
	RelatedTags   []Tag  `json:"related_tags"`
}

type SeriesUpdate struct {
	ID            string `json:"id"`
	RealtimeStart string `json:"realtime_start"`
	RealtimeEnd   string `json:"realtime_end"`
	Title         string `json:"title"`
	Frequency     string `json:"frequency"`
	Units         string `json:"units"`
	LastUpdated   string `json:"last_updated"`
}

type SeriesUpdatesResponse struct {
	RealtimeStart string         `json:"realtime_start"`
	RealtimeEnd   string         `json:"realtime_end"`
	Count         int            `json:"count"`
	Offset        int            `json:"offset"`
	Limit         int            `json:"limit"`
	Observations  []SeriesUpdate `json:"seriess"`
}

type VintageDatesResponse struct {
	VintageDates []string `json:"vintage_dates"`
}

type CategorySeriesResponse struct {
	RealtimeStart string   `json:"realtime_start"`
	RealtimeEnd   string   `json:"realtime_end"`
	Series        []Series `json:"seriess"`
}

type CategoryTagsResponse struct {
	RealtimeStart string `json:"realtime_start"`
	RealtimeEnd   string `json:"realtime_end"`
	Tags          []Tag  `json:"tags"`
}

type SeriesTagsResponse struct {
	RealtimeStart string `json:"realtime_start"`
	RealtimeEnd   string `json:"realtime_end"`
	Tags          []Tag  `json:"tags"`
}

type SeriesCategoriesResponse struct {
	RealtimeStart string     `json:"realtime_start"`
	RealtimeEnd   string     `json:"realtime_end"`
	Categories    []Category `json:"categories"`
}

type ReleaseSourcesResponse struct {
	RealtimeStart string   `json:"realtime_start"`
	RealtimeEnd   string   `json:"realtime_end"`
	Sources       []Source `json:"sources"`
}

type ReleaseTagsResponse struct {
	RealtimeStart string `json:"realtime_start"`
	RealtimeEnd   string `json:"realtime_end"`
	Tags          []Tag  `json:"tags"`
}

type ReleaseTablesResponse struct {
	Result struct {
		Data []struct {
			SeriesID    string `json:"series_id"`
			Title       string `json:"title"`
			StartDate   string `json:"start_date"`
			EndDate     string `json:"end_date"`
			LastUpdated string `json:"last_updated"`
			Frequency   string `json:"frequency"`
			Units       string `json:"units"`
			SeasonalAdj string `json:"seasonal_adjustment"`
		} `json:"data"`
	} `json:"result"`
}

type ErrorResponse struct {
	ErrorCode    string `json:"error_code"`
	ErrorMessage string `json:"error_message"`
}
