Repository navigation
first pass at fixing - #124
Conversation
| // Response OrderItems must be updated into supplied orderItemContexts (including duplicates for multi-party booking) | ||
|
|
||
| using (var db = FakeBookingSystem.Database.Mem.Database.Open()) | ||
| var query = orderItemContexts.Select((orderItemContext) => |
There was a problem hiding this comment.
This has been refactor to call a function on FakeDatabase instead of manipulating the tables from here
| } | ||
| }, | ||
| Activity = new List<Concept> | ||
| var getOccurrenceInfoResult = FakeBookingSystem.Database.GetOccurrenceAndBookedOrderItemInfoIfRelevantBySlotId(flowContext.OrderId.uuid, orderItemContext.RequestBookableOpportunityOfferId.SlotId); |
There was a problem hiding this comment.
This call has the database logic
| }, | ||
| Activity = new List<Concept> | ||
| var getOccurrenceInfoResult = FakeBookingSystem.Database.GetOccurrenceAndBookedOrderItemInfoIfRelevantBySlotId(flowContext.OrderId.uuid, orderItemContext.RequestBookableOpportunityOfferId.SlotId); | ||
| if (getOccurrenceInfoResult.Item1 == FakeDatabaseGetOccurrenceAndBookedOrderItemInfoResult.OccurrenceWasNotFound) |
There was a problem hiding this comment.
Destructure this, don't use Item1
| EndDate = (DateTimeOffset)slot.End, | ||
| MaximumUses = slot.MaximumUses, | ||
| // Exclude current Order from the returned lease count | ||
| RemainingUses = slot.RemainingUses - db.Count<OrderItemsTable>( |
There was a problem hiding this comment.
Make this into another db call that returns number of remaining uses minus leases
|
|
||
| private static void AddPropertiesToBookedOrderItem(OrderItemContext<FacilityOpportunity> ctx, BookedOrderItemInfo bookedOrderItemInfo, StoreBookingFlowContext flowContext) | ||
| { | ||
| ctx.SetOrderItemId(flowContext, bookedOrderItemInfo.OrderItemId); |
There was a problem hiding this comment.
Remove this as it's already set
| } | ||
| } | ||
|
|
||
| private static void AddPropertiesToBookedOrderItem(OrderItemContext<FacilityOpportunity> ctx, BookedOrderItemInfo bookedOrderItemInfo, StoreBookingFlowContext flowContext) |
There was a problem hiding this comment.
Abstract this out and make generic
|
|
||
|
|
||
| return ( | ||
| FakeDatabaseGetOccurrenceAndBookedOrderItemInfoResult.OccurrenceAndBookedOrderItemInfoSuccessfullyGot, |
There was a problem hiding this comment.
Rename to be shorter
| } | ||
| } | ||
|
|
||
| public (FakeDatabaseGetOccurrenceAndBookedOrderItemInfoResult, FacilityUseTable, SlotTable, BookedOrderItemInfo) GetOccurrenceAndBookedOrderItemInfoIfRelevantBySlotId(string uuid, long? slotId) |
There was a problem hiding this comment.
Rename to Slot not Occurrence
| ImageUrl = orderItem.ImageUrl, | ||
| BarCodeText = orderItem.BarCodeText, | ||
| MeetingId = orderItem.MeetingId, | ||
| MeetingPassword = orderItem.MeetingPassword, |
There was a problem hiding this comment.
Meeting* fields do not exist for facilities
Waiting on #131 to merge as it will fix the CI issues with this PR