GroupID management
Some checks failed
Build and Push Docker Image / build_and_push (push) Failing after 3m9s

This commit is contained in:
Arnaud Delcasse
2025-10-16 17:21:45 +02:00
parent 723c12a657
commit e0882db1bc
8 changed files with 68 additions and 5 deletions

View File

@@ -229,3 +229,20 @@ func (s MongoDBStorage) UpdateBookingStatus(bookingid string, newStatus string,
return nil
}
func (s MongoDBStorage) GetBookingsByGroupId(groupId string) ([]*types.Booking, error) {
filter := bson.M{"groupid": groupId}
cursor, err := s.Collections.Bookings.Find(context.Background(), filter)
if err != nil {
return nil, err
}
defer cursor.Close(context.Background())
var bookings []*types.Booking
if err := cursor.All(context.Background(), &bookings); err != nil {
return nil, err
}
return bookings, nil
}