func updateIterationsWithCounts(wiCounts map[string]workitem.WICountsPerIteration) IterationConvertFunc {
	return func(request *goa.RequestData, itr *iteration.Iteration, appIteration *app.Iteration) {
		var counts workitem.WICountsPerIteration
		if _, ok := wiCounts[appIteration.ID.String()]; ok {
			counts = wiCounts[appIteration.ID.String()]
		} else {
			counts = workitem.WICountsPerIteration{}
		}
		if appIteration.Relationships == nil {
			appIteration.Relationships = &app.IterationRelations{}
		}
		if appIteration.Relationships.Workitems == nil {
			appIteration.Relationships.Workitems = &app.RelationGeneric{}
		}
		if appIteration.Relationships.Workitems.Meta == nil {
			appIteration.Relationships.Workitems.Meta = map[string]interface{}{}
		}
		appIteration.Relationships.Workitems.Meta["total"] = counts.Total
		appIteration.Relationships.Workitems.Meta["closed"] = counts.Closed
	}
}
// updateIterationsWithCounts accepts map of 'iterationID to a workitem.WICountsPerIteration instance'.
// This function returns function of type IterationConvertFunc
// Inner function is able to access `wiCounts` in closure and it is responsible
// for adding 'closed' and 'total' count of WI in relationship's meta for every given iteration.
updateIterationsWithCounts accepts map of 'iterationID to a workitem.WICountsPerIteration instance'.
This function returns function of type IterationConvertFunc
Inner function is able to access `wiCounts` in closure and it is responsible
for adding 'closed' and 'total' count of WI in relationship's meta for every given iteration.
// updateIterationsWithCounts accepts map of ' iterationID to a workitem . WICountsPerIteration instance ' . // This function returns function of type IterationConvertFunc // Inner function is able to access ` wiCounts ` in closure and it is responsible // for adding ' closed ' and ' total ' count of WI in relationship ' s meta for every given iteration .
func updateIterationsWithCounts(wiCounts map[string]workitem.WICountsPerIteration) IterationConvertFunc {
	return func(request *goa.RequestData, itr *iteration.Iteration, appIteration *app.Iteration) {
		var counts workitem.WICountsPerIteration
		if _, ok := wiCounts[appIteration.ID.String()]; ok {
			counts = wiCounts[appIteration.ID.String()]
		} else {
			counts = workitem.WICountsPerIteration{}
		}
		if appIteration.Relationships == nil {
			appIteration.Relationships = &app.IterationRelations{}
		}
		if appIteration.Relationships.Workitems == nil {
			appIteration.Relationships.Workitems = &app.RelationGeneric{}
		}
		if appIteration.Relationships.Workitems.Meta == nil {
			appIteration.Relationships.Workitems.Meta = map[string]interface{}{}
		}
		appIteration.Relationships.Workitems.Meta["total"] = counts.Total
		appIteration.Relationships.Workitems.Meta["closed"] = counts.Closed
	}
}
func updateIterationsWithCounts ( wiCounts map [ string ] workitem . WICountsPerIteration ) IterationConvertFunc { return func ( request * goa . RequestData , itr * iteration . Iteration , appIteration * app . Iteration ) { var counts workitem . WICountsPerIteration if _ , ok := wiCounts [ appIteration . ID . String ( ) ] ; ok { counts = wiCounts [ appIteration . ID . String ( ) ] } else { counts = workitem . WICountsPerIteration { } } if appIteration . Relationships == nil { appIteration . Relationships = & app . IterationRelations { } } if appIteration . Relationships . Workitems == nil { appIteration . Relationships . Workitems = & app . RelationGeneric { } } if appIteration . Relationships . Workitems . Meta == nil { appIteration . Relationships . Workitems . Meta = map [ string ] interface { } { } } appIteration . Relationships . Workitems . Meta [ " " ] = counts . Total appIteration . Relationships . Workitems . Meta [ " " ] = counts . Closed } }
updateIterationsWithCounts accepts map of 'iterationID to a workitem.WICountsPerIteration instance'.
updateIterationsWithCounts accepts map of ' iterationID to a workitem . WICountsPerIteration instance ' .