Added some logging that could have helped when debugging

This commit is contained in:
pb
2025-04-30 17:22:48 +02:00
parent 3a92e28235
commit ac3f7deff5
3 changed files with 70 additions and 50 deletions

View File

@@ -15,6 +15,8 @@ type WorkflowController struct {
beego.Controller
}
var logger = oclib.GetLogger()
var paths = map[tools.DataType]map[tools.METHOD]string{ // paths to call other OC services
tools.BOOKING: {
tools.POST: "/booking/",
@@ -173,9 +175,10 @@ func (o *WorkflowController) Check() {
},
})
isAvailable, err := workflow.CheckBooking(caller) // check booking
fmt.Println("isAvailable", isAvailable, o.Ctx.Input.Param(":start_date"), o.Ctx.Input.Param(":end_date"), err)
logger.Info().Msg(fmt.Sprintf("Result of availability check on %v between %v and %v : %v", peerID, o.Ctx.Input.Param(":start_date"), o.Ctx.Input.Param(":end_date"), isAvailable))
code := 200
if !isAvailable { // if not available then its a conflict
logger.Info().Msg("Returning code 409 after checking availability, error value :" + fmt.Sprint(err))
code = 409
}
o.Data["json"] = map[string]interface{}{