mirror of
https://github.com/retailcrm/api-client-go.git
synced 2024-11-21 20:36:03 +03:00
Add Settings
field NonWorkingDays
This commit is contained in:
commit
a51bab6df4
@ -5150,6 +5150,16 @@ func TestClient_Settings(t *testing.T) {
|
||||
"lunch_start_time": "13:00",
|
||||
"lunch_end_time": "14:00"
|
||||
}
|
||||
],
|
||||
"non_working_days": [
|
||||
{
|
||||
"start_date": "01.02",
|
||||
"end_date": "01.07"
|
||||
},
|
||||
{
|
||||
"start_date": "12.31",
|
||||
"end_date": "12.31"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@ -5183,6 +5193,10 @@ func TestClient_Settings(t *testing.T) {
|
||||
if data.Settings.WorkTimes[0].DayType != "Monday" {
|
||||
t.Errorf("Invalid work times: %v", data.Settings.WorkTimes[0].DayType)
|
||||
}
|
||||
|
||||
if data.Settings.NonWorkingDays[0].StartDate != "01.02" {
|
||||
t.Errorf("Invalid excluded days: %v", data.Settings.NonWorkingDays[0].StartDate)
|
||||
}
|
||||
}
|
||||
|
||||
func TestClient_Segments_Fail(t *testing.T) {
|
||||
|
7
types.go
7
types.go
@ -705,6 +705,12 @@ type WorkTime struct {
|
||||
LunchEndTime string `json:"lunch_end_time"`
|
||||
}
|
||||
|
||||
// NonWorkingDays type.
|
||||
type NonWorkingDays struct {
|
||||
StartDate string `json:"start_date"`
|
||||
EndDate string `json:"end_date"`
|
||||
}
|
||||
|
||||
type SerializedBaseLoyaltyAccount struct {
|
||||
PhoneNumber string `json:"phoneNumber,omitempty"`
|
||||
CardNumber string `json:"cardNumber,omitempty"`
|
||||
@ -726,6 +732,7 @@ type Settings struct {
|
||||
SystemLanguage SettingsNode `json:"system_language"`
|
||||
Timezone SettingsNode `json:"timezone"`
|
||||
WorkTimes []WorkTime `json:"work_times"`
|
||||
NonWorkingDays []NonWorkingDays `json:"non_working_days"`
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user