-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: elaborate TODOs #227
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
using System; | ||
Check warning on line 1 in OpenActive.Server.NET/CustomBookingEngine/CustomBookingEngine.cs GitHub Actions / framework (random, no-auth)
Check warning on line 1 in OpenActive.Server.NET/CustomBookingEngine/CustomBookingEngine.cs GitHub Actions / framework (random, no-auth)
Check warning on line 1 in OpenActive.Server.NET/CustomBookingEngine/CustomBookingEngine.cs GitHub Actions / framework (random, no-auth)
Check warning on line 1 in OpenActive.Server.NET/CustomBookingEngine/CustomBookingEngine.cs GitHub Actions / framework (controlled, no-auth)
Check warning on line 1 in OpenActive.Server.NET/CustomBookingEngine/CustomBookingEngine.cs GitHub Actions / framework (controlled, no-auth)
|
||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Net; | ||
|
@@ -70,8 +70,7 @@ | |
if (settings.CustomerAccountIdTemplate != null) settings.CustomerAccountIdTemplate.RequiredBaseUrl = settings.CustomerAccountIdBaseUrl; | ||
|
||
// Create a lookup of each IdTemplate to pass into the appropriate RpdeGenerator | ||
// TODO: Output better error if there is a feed assigned across two templates | ||
// (there should never be, as each template represents everyting you need in one feed) | ||
// TODO: Output better error if there is a feed assigned across two templates (there should never be, as each template represents everyting you need in one feed) | ||
this.feedAssignedTemplates = settings.IdConfiguration.SelectMany(t => t.IdConfigurations.Select(x => new | ||
{ | ||
assignedFeed = x.AssignedFeed, | ||
|
@@ -151,7 +150,7 @@ | |
/// Handler for Dataset Site endpoint | ||
/// </summary> | ||
/// <returns></returns> | ||
public async Task<ResponseContent> RenderDatasetSite() | ||
Check warning on line 153 in OpenActive.Server.NET/CustomBookingEngine/CustomBookingEngine.cs GitHub Actions / test-server
|
||
{ | ||
if (datasetSettings == null || supportedFeeds == null) throw new NotSupportedException("RenderDatasetSite is only supported if DatasetSiteGeneratorSettings are supplied to the IBookingEngine"); | ||
// TODO add caching layer in front of dataset site rendering | ||
|
@@ -730,6 +729,7 @@ | |
throw new OpenBookingException(new OpenBookingError(), "Only bookable opportunities are permitted in the test interface"); | ||
|
||
// TODO: add this error class to the library | ||
// CS: Is this still the case? Unclear where this library is, and hard to believe OpenBookingError would not be in the libary | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not fully sure I understand what this is talking about, so ignore me if this is irrelevant, but it looks like Could this comment be referring to OpenBookingException? And if so, what library..? Or maybe it means that there should be a special OnlyBookableOpportunitesPermittedInTestInterfaceError class or something, idk There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeh I'm also very confused by the comment. I think OnlyBookableOpportunitesPermittedInTestInterfaceError in OpenActive.Net makes most sense so will amend the comment |
||
} | ||
|
||
if (!genericEvent.TestOpportunityCriteria.HasValue) | ||
|
@@ -868,7 +868,7 @@ | |
|
||
// Throw error if TotalPaymentDue is not specified at B or P | ||
if (order.TotalPaymentDue?.Price.HasValue != true && (stage == FlowStage.B || stage == FlowStage.P)) | ||
// TODO replace this with a more specific error | ||
// TODO replace this with a more specific error ie a subclass of OpenBookingError like TotalPaymentMissingAtBOrPError | ||
civsiv marked this conversation as resolved.
Show resolved
Hide resolved
|
||
throw new OpenBookingException(new OpenBookingError(), "TotalPaymentDue must have a price set"); | ||
|
||
var payer = order.BrokerRole == BrokerType.ResellerBroker ? order.Broker : order.Customer; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -417,20 +417,24 @@ public Uri RenderOrderId(OrderType orderType, Guid uuid) | |
return this.RenderOrderId(new OrderIdComponents { OrderType = orderType, uuid = uuid }); | ||
} | ||
|
||
//TODO reduce duplication of the strings / logic below | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Implemented |
||
public Uri RenderOrderItemId(OrderType orderType, Guid uuid, Guid orderItemId) | ||
private void ValidateOrderType(OrderType orderType) | ||
{ | ||
if (orderType != OrderType.Order) throw new ArgumentOutOfRangeException(nameof(orderType), "The Open Booking API 1.0 specification only permits OrderItem Ids to exist within Orders, not OrderQuotes or OrderProposals."); | ||
} | ||
|
||
public Uri RenderOrderItemId(OrderType orderType, Guid uuid, Guid orderItemId) | ||
{ | ||
ValidateOrderType(orderType); | ||
return this.RenderOrderItemId(new OrderIdComponents { OrderType = orderType, uuid = uuid, OrderItemIdGuid = orderItemId }); | ||
} | ||
public Uri RenderOrderItemId(OrderType orderType, Guid uuid, string orderItemId) | ||
{ | ||
if (orderType != OrderType.Order) throw new ArgumentOutOfRangeException(nameof(orderType), "The Open Booking API 1.0 specification only permits OrderItem Ids to exist within Orders, not OrderQuotes or OrderProposals."); | ||
ValidateOrderType(orderType); | ||
return this.RenderOrderItemId(new OrderIdComponents { OrderType = orderType, uuid = uuid, OrderItemIdString = orderItemId }); | ||
} | ||
public Uri RenderOrderItemId(OrderType orderType, Guid uuid, long orderItemId) | ||
{ | ||
if (orderType != OrderType.Order) throw new ArgumentOutOfRangeException(nameof(orderType), "The Open Booking API 1.0 specification only permits OrderItem Ids to exist within Orders, not OrderQuotes or OrderProposals."); | ||
ValidateOrderType(orderType); | ||
return this.RenderOrderItemId(new OrderIdComponents { OrderType = orderType, uuid = uuid, OrderItemIdLong = orderItemId }); | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could this cause any bugs at present? If yes then maybe should be a GH issue?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, not yet I think