Draft booking flow
This commit is contained in:
@@ -58,10 +58,15 @@ func GenerateShallow(request *tools.APIRequest) (*Planner, error) {
|
||||
|
||||
func generate(request *tools.APIRequest, shallow bool) (*Planner, error) {
|
||||
accessor := booking.NewAccessor(request)
|
||||
bookings, code, err := accessor.Search(nil, "*", false)
|
||||
// Include both confirmed (IsDraft=false) and draft (IsDraft=true) bookings
|
||||
// so the planner reflects the full picture: first-come first-served on all
|
||||
// pending reservations regardless of confirmation state.
|
||||
confirmed, code, err := accessor.Search(nil, "*", false)
|
||||
if code != 200 || err != nil {
|
||||
return nil, err
|
||||
}
|
||||
drafts, _, _ := accessor.Search(nil, "*", true)
|
||||
bookings := append(confirmed, drafts...)
|
||||
|
||||
p := &Planner{
|
||||
GeneratedAt: time.Now(),
|
||||
|
||||
Reference in New Issue
Block a user