fix(sravni): update entities to match current sravni.ru API
dataSources changed from map[string]ReduxDataSource (objects) to map[string]string (simple key-value pairs). Dictionaries block removed from ReduxConfig entirely. ReduxConfigSorting now includes Name and Direction fields alongside Property.
This commit is contained in:
@ -85,19 +85,6 @@ type Filters struct {
|
|||||||
IsCourseProfeccion Flagged `json:"isCourseProfession"`
|
IsCourseProfeccion Flagged `json:"isCourseProfession"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type DataSourceType string
|
|
||||||
|
|
||||||
const (
|
|
||||||
DataSourceTypeDictionaryConfig DataSourceType = "dictionaryConfig"
|
|
||||||
DataSourceTypeDictionary DataSourceType = "dictionary"
|
|
||||||
DataSourceTypeOrganization DataSourceType = "organization"
|
|
||||||
)
|
|
||||||
|
|
||||||
type ReduxDataSource struct {
|
|
||||||
Type DataSourceType `json:"type"`
|
|
||||||
Source string `json:"source"`
|
|
||||||
}
|
|
||||||
|
|
||||||
type ReduxConfigDictionaryBaseUnit struct {
|
type ReduxConfigDictionaryBaseUnit struct {
|
||||||
Label string `json:"label"`
|
Label string `json:"label"`
|
||||||
Value string `json:"value"`
|
Value string `json:"value"`
|
||||||
@ -124,25 +111,18 @@ type ReduxConfigFilterUnit struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type ReduxConfigSorting struct {
|
type ReduxConfigSorting struct {
|
||||||
Property string `json:"property"`
|
Name string `json:"name"`
|
||||||
// 3 more fields
|
Property string `json:"property"`
|
||||||
|
Direction string `json:"direction"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ReduxConfig struct {
|
type ReduxConfig struct {
|
||||||
Default struct {
|
Default struct {
|
||||||
SortingParameters []ReduxConfigSorting `json:"sortingParameters"`
|
SortingParameters []ReduxConfigSorting `json:"sortingParameters"`
|
||||||
} `json:"default"`
|
} `json:"default"`
|
||||||
DataSources map[string]ReduxDataSource `json:"dataSources"`
|
DataSources map[string]string `json:"dataSources"`
|
||||||
Dictionaries struct {
|
Filters []ReduxConfigFilterUnit `json:"filters"`
|
||||||
PriceFilter []ReduxConfigDictionaryRangeUnit `json:"dictionaryPriceFilter"`
|
Sorting []ReduxConfigSorting `json:"sorting"`
|
||||||
GraphicFilter []ReduxConfigDictionaryBaseUnit `json:"dictionaryGraphicFilterNew"`
|
|
||||||
FormatFilter []ReduxConfigDictionaryBaseUnit `json:"dictionaryFormatFilterNew"`
|
|
||||||
LevelFilter []ReduxConfigDictionaryBaseUnit `json:"dictionaryLevelFilterNew"`
|
|
||||||
TimeFilter []ReduxConfigDictionaryRangeUnit `json:"dictionaryTimeFilter"`
|
|
||||||
InstallmentFilter []ReduxConfigDictionaryRangeUnit `json:"dictionaryInstallmentFilter"`
|
|
||||||
}
|
|
||||||
Filters []ReduxConfigFilterUnit `json:"filters"`
|
|
||||||
Sorting []ReduxConfigSorting `json:"sorting"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type InitialReduxState struct {
|
type InitialReduxState struct {
|
||||||
|
|||||||
Reference in New Issue
Block a user