func (r *GormWorkItemRepository) LoadBottomWorkitem(ctx context.Context) (*WorkItem, error) {
	res := WorkItemStorage{}
	db := r.db.Model(WorkItemStorage{})
	query := fmt.Sprintf("execution_order = (SELECT min(execution_order) FROM %[1]s)",
		WorkItemStorage{}.TableName(),
	)
	db = db.Where(query).First(&res)
	wiType, err := r.witr.LoadTypeFromDB(ctx, res.Type)
	if err != nil {
		return nil, errors.NewInternalError(err.Error())
	}
	return ConvertWorkItemStorageToModel(wiType, &res)
}
// LoadBottomWorkitem returns bottom work item of the list. Bottom most workitem has the lowest order.
// returns NotFoundError, ConversionError or InternalError
LoadBottomWorkitem returns bottom work item of the list. Bottom most workitem has the lowest order.
returns NotFoundError, ConversionError or InternalError
// LoadBottomWorkitem returns bottom work item of the list . Bottom most workitem has the lowest order . // returns NotFoundError ConversionError or InternalError
func (r *GormWorkItemRepository) LoadBottomWorkitem(ctx context.Context) (*WorkItem, error) {
	res := WorkItemStorage{}
	db := r.db.Model(WorkItemStorage{})
	query := fmt.Sprintf("execution_order = (SELECT min(execution_order) FROM %[1]s)",
		WorkItemStorage{}.TableName(),
	)
	db = db.Where(query).First(&res)
	wiType, err := r.witr.LoadTypeFromDB(ctx, res.Type)
	if err != nil {
		return nil, errors.NewInternalError(err.Error())
	}
	return ConvertWorkItemStorageToModel(wiType, &res)
}
func ( r * GormWorkItemRepository ) LoadBottomWorkitem ( ctx context . Context ) ( * WorkItem , error ) { res := WorkItemStorage { } db := r . db . Model ( WorkItemStorage { } ) query := fmt . Sprintf ( " " , WorkItemStorage { } . TableName ( ) , ) db = db . Where ( query ) . First ( & res ) wiType , err := r . witr . LoadTypeFromDB ( ctx , res . Type ) if err != nil { return nil , errors . NewInternalError ( err . Error ( ) ) } return ConvertWorkItemStorageToModel ( wiType , & res ) }
LoadBottomWorkitem returns bottom work item of the list.
LoadBottomWorkitem returns bottom work item of the list .