diff --git a/client_test.go b/client_test.go index 57e20ac..771acc9 100644 --- a/client_test.go +++ b/client_test.go @@ -5035,7 +5035,23 @@ func TestClient_Settings(t *testing.T) { "timezone": { "value": "Europe/Moscow", "updated_at": "2019-02-13 13:57:20" - } + }, + "work_times": [ + { + "day_type": "Monday", + "start_time": "08:00", + "end_time": "18:30", + "lunch_start_time": "15:00", + "lunch_end_time": "16:00" + }, + { + "day_type": "Tuesday", + "start_time": "09:00", + "end_time": "17:00", + "lunch_start_time": "13:00", + "lunch_end_time": "14:00" + } + ] } } `) @@ -5064,6 +5080,10 @@ func TestClient_Settings(t *testing.T) { if data.Settings.Timezone.Value != "Europe/Moscow" { t.Errorf("Invalid timezone value: %v", data.Settings.Timezone.Value) } + + if data.Settings.WorkTimes[0].DayType != "Monday" { + t.Errorf("Invalid work times: %v", data.Settings.WorkTimes[0].DayType) + } } func TestClient_Segments_Fail(t *testing.T) { diff --git a/types.go b/types.go index 54bee5f..2b4c90d 100644 --- a/types.go +++ b/types.go @@ -694,11 +694,21 @@ type SettingsNode struct { UpdatedAt string `json:"updated_at"` } +// WorkTime type. +type WorkTime struct { + DayType string `json:"day_type"` + StartTime string `json:"start_time"` + EndTime string `json:"end_time"` + LunchStartTime string `json:"lunch_start_time"` + LunchEndTime string `json:"lunch_end_time"` +} + // Settings type. Contains retailCRM configuration. type Settings struct { DefaultCurrency SettingsNode `json:"default_currency"` SystemLanguage SettingsNode `json:"system_language"` Timezone SettingsNode `json:"timezone"` + WorkTimes []WorkTime `json:"work_times"` } /**