Add Plan page with day planner
This commit is contained in:
45
backend/dashapi/model_plan_week_item.go
Normal file
45
backend/dashapi/model_plan_week_item.go
Normal file
@ -0,0 +1,45 @@
|
||||
/*
|
||||
* 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 PlanWeekItem struct {
|
||||
|
||||
Item string `json:"item"`
|
||||
|
||||
NumTodos int32 `json:"numTodos,omitempty"`
|
||||
|
||||
NumDone int32 `json:"numDone,omitempty"`
|
||||
}
|
||||
|
||||
// AssertPlanWeekItemRequired checks if the required fields are not zero-ed
|
||||
func AssertPlanWeekItemRequired(obj PlanWeekItem) error {
|
||||
elements := map[string]interface{}{
|
||||
"item": obj.Item,
|
||||
}
|
||||
for name, el := range elements {
|
||||
if isZero := IsZeroValue(el); isZero {
|
||||
return &RequiredError{Field: name}
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// AssertRecursePlanWeekItemRequired recursively checks if required fields are not zero-ed in a nested slice.
|
||||
// Accepts only nested slice of PlanWeekItem (e.g. [][]PlanWeekItem), otherwise ErrTypeAssertionError is thrown.
|
||||
func AssertRecursePlanWeekItemRequired(objSlice interface{}) error {
|
||||
return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error {
|
||||
aPlanWeekItem, ok := obj.(PlanWeekItem)
|
||||
if !ok {
|
||||
return ErrTypeAssertionError
|
||||
}
|
||||
return AssertPlanWeekItemRequired(aPlanWeekItem)
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user