mirror of
https://github.com/retailcrm/api-client-go.git
synced 2024-11-28 15:56:05 +03:00
В метод Setting добавлены настройки рабочего времени
This commit is contained in:
commit
995d19007d
@ -5035,7 +5035,23 @@ func TestClient_Settings(t *testing.T) {
|
|||||||
"timezone": {
|
"timezone": {
|
||||||
"value": "Europe/Moscow",
|
"value": "Europe/Moscow",
|
||||||
"updated_at": "2019-02-13 13:57:20"
|
"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" {
|
if data.Settings.Timezone.Value != "Europe/Moscow" {
|
||||||
t.Errorf("Invalid timezone value: %v", data.Settings.Timezone.Value)
|
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) {
|
func TestClient_Segments_Fail(t *testing.T) {
|
||||||
|
10
types.go
10
types.go
@ -694,11 +694,21 @@ type SettingsNode struct {
|
|||||||
UpdatedAt string `json:"updated_at"`
|
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.
|
// Settings type. Contains retailCRM configuration.
|
||||||
type Settings struct {
|
type Settings struct {
|
||||||
DefaultCurrency SettingsNode `json:"default_currency"`
|
DefaultCurrency SettingsNode `json:"default_currency"`
|
||||||
SystemLanguage SettingsNode `json:"system_language"`
|
SystemLanguage SettingsNode `json:"system_language"`
|
||||||
Timezone SettingsNode `json:"timezone"`
|
Timezone SettingsNode `json:"timezone"`
|
||||||
|
WorkTimes []WorkTime `json:"work_times"`
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user