Add Plan page with day planner

This commit is contained in:
Martin Pander
2022-11-26 18:41:39 +01:00
parent d9b92ab4e9
commit 32346e0aa9
48 changed files with 2400 additions and 148 deletions

View File

@ -0,0 +1,53 @@
/*
* Dash API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* API version: 0.1
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
*/
package dashapi
type PlanDay struct {
Date string `json:"date"`
Morning []string `json:"morning,omitempty"`
Midday []string `json:"midday,omitempty"`
Afternoon []string `json:"afternoon,omitempty"`
Evening []string `json:"evening,omitempty"`
Pleasant []string `json:"pleasant,omitempty"`
Reminders []string `json:"reminders,omitempty"`
}
// AssertPlanDayRequired checks if the required fields are not zero-ed
func AssertPlanDayRequired(obj PlanDay) error {
elements := map[string]interface{}{
"date": obj.Date,
}
for name, el := range elements {
if isZero := IsZeroValue(el); isZero {
return &RequiredError{Field: name}
}
}
return nil
}
// AssertRecursePlanDayRequired recursively checks if required fields are not zero-ed in a nested slice.
// Accepts only nested slice of PlanDay (e.g. [][]PlanDay), otherwise ErrTypeAssertionError is thrown.
func AssertRecursePlanDayRequired(objSlice interface{}) error {
return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error {
aPlanDay, ok := obj.(PlanDay)
if !ok {
return ErrTypeAssertionError
}
return AssertPlanDayRequired(aPlanDay)
})
}