Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
22bd534
temp: Debug race conditions
nickevansuk Aug 31, 2021
10c11e9
Further fixes
nickevansuk Aug 31, 2021
211ab7f
Merge branch 'master' into temp/debug-race-conditions
nickevansuk Sep 30, 2021
0ce4876
Merge branch 'master' into temp/debug-race-conditions
nickevansuk Oct 1, 2021
a22ba75
Update to latest OpenActive.NET
nickevansuk Nov 23, 2021
2a5f07c
Update OpenActive.NET
nickevansuk Nov 24, 2021
6bbf963
Remove AuthenticatedCustomer
nickevansuk Nov 24, 2021
dbe129f
Initial additions to support Customer Accounts
nickevansuk Nov 24, 2021
6962003
Fix CustomerAccountIdBaseUrl
nickevansuk Nov 24, 2021
cd58220
Further hacks
nickevansuk Nov 25, 2021
ca22c7c
Refactor to allow price to change during the lease/book flow (for exa…
nickevansuk Dec 2, 2021
b70a526
Find-and-replace all instances of `SellerIdComponents` with `SimpleId…
nickevansuk May 27, 2022
c2a0194
Revert `simpleIdComponents` to `sellerIdComponents`
nickevansuk May 27, 2022
40a30b1
Fix for missing settings
nickevansuk May 27, 2022
ae46336
Fix for AugmentOrderWithTotals
nickevansuk May 27, 2022
e1655e5
Second fix attempt
nickevansuk May 27, 2022
e6b2093
Fix for IncompleteOrderItemError
nickevansuk May 27, 2022
d8e0170
Further fix for IncompleteOrderItemError
nickevansuk May 27, 2022
d6c689a
Fix for OrderRequiresApproval
nickevansuk May 27, 2022
9badbea
Remove critical section console logs
nickevansuk May 27, 2022
787b13c
Merge branch 'master' into coverage/b-detailed-errors
nickevansuk May 27, 2022
caa5816
Return a 409 status code if any OrderItem level errors exist at P
nickevansuk May 27, 2022
59739c3
Fix orderRequiresApproval
nickevansuk May 27, 2022
d52e834
feat: fix attendee details being lost between P and B
civsiv Jun 1, 2022
a76f696
update framework from core
civsiv Jun 1, 2022
b65b3e7
fix 500 errors and pass object to fake db
civsiv Jun 1, 2022
c24ea69
feat: add additional details support
civsiv Jun 1, 2022
38a5a5f
undo launchSettings
civsiv Jun 1, 2022
b9e5dc6
update framework from core
civsiv Jun 1, 2022
29a241f
Fix framework build to windows-2019
nickevansuk Jun 1, 2022
fec47ac
Revert Examples/BookingSystem.AspNetFramework/Web.config
nickevansuk Jun 6, 2022
ed99636
Fix comment
nickevansuk Jun 6, 2022
ec66ae1
Fix comment
nickevansuk Jun 6, 2022
3904b12
Fix comments
nickevansuk Jun 6, 2022
ca9e7f0
review changes
civsiv Jun 6, 2022
22b8e1d
Merge branch 'coverage/b-detailed-errors' of https://github.com/opena…
civsiv Jun 6, 2022
f4b15b6
add core -> framework changes
civsiv Jun 6, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/openactive-test-suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ jobs:
connection_string: ${{ secrets.CONFORMANCE_CERTIFICATE_BLOB_STORAGE_CONNECTION_STRING }}
sync: false
framework:
runs-on: windows-latest
runs-on: windows-2019
strategy:
fail-fast: false
matrix:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<Publish Condition="'%(PackageReference.Version)' == ''">true</Publish>
</PackageReference>
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="2.1.2" />
<PackageReference Include="OpenActive.NET" Version="15.2.6" />
<PackageReference Include="OpenActive.NET" Version="15.2.11" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public async Task<ContentResult> OrderQuoteCreationC1([FromServices] IBookingEng
{
try
{
(string clientId, Uri sellerId) = User.GetAccessTokenOpenBookingClaims();
(string clientId, Uri sellerId, _) = User.GetAccessTokenOpenBookingClaims();
return (await bookingEngine.ProcessCheckpoint1(clientId, sellerId, uuid, orderQuote)).GetContentResult();
}
catch (OpenBookingException obe)
Expand All @@ -52,7 +52,7 @@ public async Task<ContentResult> OrderQuoteCreationC2([FromServices] IBookingEng
{
try
{
(string clientId, Uri sellerId) = User.GetAccessTokenOpenBookingClaims();
(string clientId, Uri sellerId, _) = User.GetAccessTokenOpenBookingClaims();
return (await bookingEngine.ProcessCheckpoint2(clientId, sellerId, uuid, orderQuote)).GetContentResult();
}
catch (OpenBookingException obe)
Expand All @@ -71,7 +71,7 @@ public async Task<ContentResult> OrderProposalCreationP([FromServices] IBookingE
{
try
{
(string clientId, Uri sellerId) = User.GetAccessTokenOpenBookingClaims();
(string clientId, Uri sellerId, _) = User.GetAccessTokenOpenBookingClaims();
return (await bookingEngine.ProcessOrderProposalCreationP(clientId, sellerId, uuid, orderProposal)).GetContentResult();
}
catch (OpenBookingException obe)
Expand All @@ -90,7 +90,7 @@ public async Task<IActionResult> OrderQuoteDeletion([FromServices] IBookingEngin
{
try
{
(string clientId, Uri sellerId) = User.GetAccessTokenOpenBookingClaims();
(string clientId, Uri sellerId, _) = User.GetAccessTokenOpenBookingClaims();
return (await bookingEngine.DeleteOrderQuote(clientId, sellerId, uuid)).GetContentResult();
}
catch (OpenBookingException obe)
Expand All @@ -109,7 +109,7 @@ public async Task<ContentResult> OrderCreationB([FromServices] IBookingEngine bo
{
try
{
(string clientId, Uri sellerId) = User.GetAccessTokenOpenBookingClaims();
(string clientId, Uri sellerId, _) = User.GetAccessTokenOpenBookingClaims();
return (await bookingEngine.ProcessOrderCreationB(clientId, sellerId, uuid, order)).GetContentResult();
}
catch (OpenBookingException obe)
Expand All @@ -128,7 +128,7 @@ public async Task<IActionResult> OrderDeletion([FromServices] IBookingEngine boo
{
try
{
(string clientId, Uri sellerId) = User.GetAccessTokenOpenBookingClaims();
(string clientId, Uri sellerId, _) = User.GetAccessTokenOpenBookingClaims();
return (await bookingEngine.DeleteOrder(clientId, sellerId, uuid)).GetContentResult();
}
catch (OpenBookingException obe)
Expand All @@ -147,7 +147,7 @@ public async Task<IActionResult> OrderUpdate([FromServices] IBookingEngine booki
{
try
{
(string clientId, Uri sellerId) = User.GetAccessTokenOpenBookingClaims();
(string clientId, Uri sellerId, _) = User.GetAccessTokenOpenBookingClaims();
return (await bookingEngine.ProcessOrderUpdate(clientId, sellerId, uuid, order)).GetContentResult();
}
catch (OpenBookingException obe)
Expand All @@ -167,7 +167,7 @@ public async Task<IActionResult> OrderProposalUpdate([FromServices] IBookingEngi
{
try
{
(string clientId, Uri sellerId) = User.GetAccessTokenOpenBookingClaims();
(string clientId, Uri sellerId, _) = User.GetAccessTokenOpenBookingClaims();
return (await bookingEngine.ProcessOrderProposalUpdate(clientId, sellerId, uuid, order)).GetContentResult();
}
catch (OpenBookingException obe)
Expand All @@ -183,7 +183,7 @@ public async Task<IActionResult> GetOrderStatus([FromServices] IBookingEngine bo
{
try
{
(string clientId, Uri sellerId) = User.GetAccessTokenOpenBookingClaims();
(string clientId, Uri sellerId, _) = User.GetAccessTokenOpenBookingClaims();
return (await bookingEngine.GetOrderStatus(clientId, sellerId, uuid)).GetContentResult();
}
catch (OpenBookingException obe)
Expand Down
2 changes: 1 addition & 1 deletion Examples/BookingSystem.AspNetCore/Feeds/FacilitiesFeeds.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ protected override async Task<List<RpdeItem<FacilityUse>>> GetRpdeItems(long? af
IsOpenBookingAllowed = true,
} : new Organization
{
Id = RenderSellerId(new SellerIdComponents { SellerIdLong = result.Item2.Id }),
Id = RenderSellerId(new SimpleIdComponents { IdLong = result.Item2.Id }),
Name = result.Item2.Name,
TaxMode = result.Item2.IsTaxGross ? TaxMode.TaxGross : TaxMode.TaxNet,
TermsOfService = new List<Terms>
Expand Down
4 changes: 2 additions & 2 deletions Examples/BookingSystem.AspNetCore/Feeds/SessionsFeeds.cs
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,13 @@ protected override async Task<List<RpdeItem<SessionSeries>>> GetRpdeItems(long?
IsOpenBookingAllowed = true,
} : result.Item2.IsIndividual ? (ILegalEntity)new Person
{
Id = RenderSellerId(new SellerIdComponents { SellerIdLong = result.Item2.Id }),
Id = RenderSellerId(new SimpleIdComponents { IdLong = result.Item2.Id }),
Name = result.Item2.Name,
TaxMode = result.Item2.IsTaxGross ? TaxMode.TaxGross : TaxMode.TaxNet,
IsOpenBookingAllowed = true,
} : (ILegalEntity)new Organization
{
Id = RenderSellerId(new SellerIdComponents { SellerIdLong = result.Item2.Id }),
Id = RenderSellerId(new SimpleIdComponents { IdLong = result.Item2.Id }),
Name = result.Item2.Name,
TaxMode = result.Item2.IsTaxGross ? TaxMode.TaxGross : TaxMode.TaxNet,
TermsOfService = new List<Terms>
Expand Down
12 changes: 6 additions & 6 deletions Examples/BookingSystem.AspNetCore/Settings/EngineConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -111,15 +111,15 @@ public static StoreBookingEngine CreateStoreBookingEngine(AppSettings appSetting
/*
// Multiple Seller Mode
SellerStore = new AcmeSellerStore(),
SellerIdTemplate = new SingleIdTemplate<SellerIdComponents>(
"{+BaseUrl}/sellers/{SellerIdLong}"
SellerIdTemplate = new SingleIdTemplate<SimpleIdComponents>(
"{+BaseUrl}/sellers/{IdLong}"
),
*/

/*
// Single Seller Mode
SellerStore = new AcmeSellerStore(),
SellerIdTemplate = new SingleIdTemplate<SellerIdComponents>(
SellerIdTemplate = new SingleIdTemplate<SimpleIdComponents>(
"{+BaseUrl}/seller"
),
HasSingleSeller = true,
Expand All @@ -128,11 +128,11 @@ public static StoreBookingEngine CreateStoreBookingEngine(AppSettings appSetting
// Reference implementation is configurable to allow both modes to be tested
SellerStore = new AcmeSellerStore(appSettings.FeatureFlags.SingleSeller),
SellerIdTemplate = appSettings.FeatureFlags.SingleSeller ?
new SingleIdTemplate<SellerIdComponents>(
new SingleIdTemplate<SimpleIdComponents>(
"{+BaseUrl}/seller"
) :
new SingleIdTemplate<SellerIdComponents>(
"{+BaseUrl}/sellers/{SellerIdLong}"
new SingleIdTemplate<SimpleIdComponents>(
"{+BaseUrl}/sellers/{IdLong}"
),
HasSingleSeller = appSettings.FeatureFlags.SingleSeller,

Expand Down
44 changes: 34 additions & 10 deletions Examples/BookingSystem.AspNetCore/Stores/FacilityStore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ protected override async Task<FacilityOpportunity> CreateOpportunityWithinTestDa
OpportunityType opportunityType,
TestOpportunityCriteriaEnumeration criteria,
TestOpenBookingFlowEnumeration openBookingFlow,
SellerIdComponents seller)
SimpleIdComponents seller)
{
if (!_appSettings.FeatureFlags.SingleSeller && !seller.SellerIdLong.HasValue)
if (!_appSettings.FeatureFlags.SingleSeller && !seller.IdLong.HasValue)
throw new OpenBookingException(new OpenBookingError(), "Seller must have an ID in Multiple Seller Mode");

long? sellerId = _appSettings.FeatureFlags.SingleSeller ? null : seller.SellerIdLong;
long? sellerId = _appSettings.FeatureFlags.SingleSeller ? null : seller.IdLong;
var requiresApproval = openBookingFlow == TestOpenBookingFlowEnumeration.OpenBookingApprovalFlow;

switch (opportunityType)
Expand Down Expand Up @@ -286,7 +286,7 @@ protected override async Task TriggerTestAction(OpenBookingSimulateAction simula
// Similar to the RPDE logic, this needs to render and return an new hypothetical OrderItem from the database based on the supplied opportunity IDs
protected override async Task GetOrderItems(List<OrderItemContext<FacilityOpportunity>> orderItemContexts, StoreBookingFlowContext flowContext, OrderStateContext stateContext)
{
// Note the implementation of this method must also check that this OrderItem is from the Seller specified by context.SellerIdComponents (this is not required if using a Single Seller)
// Note the implementation of this method must also check that this OrderItem is from the Seller specified by context.SellerId (this is not required if using a Single Seller)

// Additionally this method must check that there are enough spaces in each entry

Expand Down Expand Up @@ -377,7 +377,7 @@ protected override async Task GetOrderItems(List<OrderItemContext<FacilityOpport
: null,
OrderItemIntakeFormResponse = orderItemContext.RequestOrderItem.OrderItemIntakeFormResponse,
},
SellerId = _appSettings.FeatureFlags.SingleSeller ? new SellerIdComponents() : new SellerIdComponents { SellerIdLong = facility.SellerId },
SellerId = _appSettings.FeatureFlags.SingleSeller ? new SimpleIdComponents() : new SimpleIdComponents { IdLong = facility.SellerId },
slot.RequiresApproval,
BookedOrderItemInfo = bookedOrderItemInfo,
slot.RemainingUses
Expand Down Expand Up @@ -433,7 +433,7 @@ protected override async ValueTask LeaseOrderItems(Lease lease, List<OrderItemCo
else
{
// Attempt to lease for those with the same IDs, which is atomic
var (result, capacityErrors, capacityLeaseErrors) = await FakeDatabase.LeaseOrderItemsForFacilitySlot(databaseTransaction.FakeDatabaseTransaction, flowContext.OrderId.ClientId, flowContext.SellerId.SellerIdLong ?? null /* Hack to allow this to work in Single Seller mode too */, flowContext.OrderId.uuid, ctxGroup.Key.SlotId.Value, ctxGroup.Count());
var (result, capacityErrors, capacityLeaseErrors) = await FakeDatabase.LeaseOrderItemsForFacilitySlot(databaseTransaction.FakeDatabaseTransaction, flowContext.OrderId.ClientId, flowContext.SellerId.IdLong ?? null /* Hack to allow this to work in Single Seller mode too */, flowContext.OrderId.uuid, ctxGroup.Key.SlotId.Value, ctxGroup.Count());

switch (result)
{
Expand Down Expand Up @@ -504,13 +504,25 @@ protected override async ValueTask BookOrderItems(List<OrderItemContext<Facility
var (result, bookedOrderItemInfos) = await FakeDatabase.BookOrderItemsForFacilitySlot(
databaseTransaction.FakeDatabaseTransaction,
flowContext.OrderId.ClientId,
flowContext.SellerId.SellerIdLong ?? null /* Hack to allow this to work in Single Seller mode too */,
flowContext.SellerId.IdLong ?? null /* Hack to allow this to work in Single Seller mode too */,
flowContext.OrderId.uuid,
ctxGroup.Key.SlotId.Value,
RenderOpportunityId(ctxGroup.Key),
RenderOfferId(ctxGroup.Key),
ctxGroup.Count(),
false
false,
ctxGroup
.Select(x =>
x.RequestOrderItem.Attendee == null
? null
: OpenActiveSerializer.Serialize(x.RequestOrderItem.Attendee))
.ToList(),
ctxGroup
.Select(x =>
x.RequestOrderItem.OrderItemIntakeFormResponse == null
? null
: OpenActiveSerializer.SerializeList(x.RequestOrderItem.OrderItemIntakeFormResponse))
.ToList()
);

switch (result)
Expand Down Expand Up @@ -555,13 +567,25 @@ protected override async ValueTask ProposeOrderItems(List<OrderItemContext<Facil
var (result, bookedOrderItemInfos) = await FakeDatabase.BookOrderItemsForFacilitySlot(
databaseTransaction.FakeDatabaseTransaction,
flowContext.OrderId.ClientId,
flowContext.SellerId.SellerIdLong ?? null /* Hack to allow this to work in Single Seller mode too */,
flowContext.SellerId.IdLong ?? null /* Hack to allow this to work in Single Seller mode too */,
flowContext.OrderId.uuid,
ctxGroup.Key.SlotId.Value,
RenderOpportunityId(ctxGroup.Key),
RenderOfferId(ctxGroup.Key),
ctxGroup.Count(),
true
true,
ctxGroup
.Select(x =>
x.RequestOrderItem.Attendee == null
? null
: OpenActiveSerializer.Serialize(x.RequestOrderItem.Attendee))
.ToList(),
ctxGroup
.Select(x =>
x.RequestOrderItem.OrderItemIntakeFormResponse == null
? null
: OpenActiveSerializer.SerializeList(x.RequestOrderItem.OrderItemIntakeFormResponse))
.ToList()
);

switch (result)
Expand Down
Loading