diff --git a/Examples/BookingSystem.AspNetCore/Feeds/FacilitiesFeeds.cs b/Examples/BookingSystem.AspNetCore/Feeds/FacilitiesFeeds.cs index 182e3784..4ea35f33 100644 --- a/Examples/BookingSystem.AspNetCore/Feeds/FacilitiesFeeds.cs +++ b/Examples/BookingSystem.AspNetCore/Feeds/FacilitiesFeeds.cs @@ -48,7 +48,7 @@ protected override async Task>> GetRpdeItems(long? af .Select(result => { var faker = new Faker() { Random = new Randomizer((int)result.Item1.Id) }; - var isGoldenRecord = faker.Random.Bool(); + var isGoldenRecord = faker.Random.Number(0, 1) > 0.75; var facilityUseRpdeItem = new RpdeItem { Kind = RpdeKind.FacilityUse, diff --git a/Examples/BookingSystem.AspNetCore/Feeds/SessionsFeeds.cs b/Examples/BookingSystem.AspNetCore/Feeds/SessionsFeeds.cs index 9d1b1eab..302aa382 100644 --- a/Examples/BookingSystem.AspNetCore/Feeds/SessionsFeeds.cs +++ b/Examples/BookingSystem.AspNetCore/Feeds/SessionsFeeds.cs @@ -109,7 +109,7 @@ protected override async Task>> GetRpdeItems(long? var faker = new Faker() { Random = new Randomizer((int)result.Item1.Id) }; // here we randomly decide whether the item is going to be a golden record or not by using Faker // See the README for more detail on golden records. - var isGoldenRecord = faker.Random.Bool(); + var isGoldenRecord = faker.Random.Number(0, 1) > 0.75; var sessionSeriesRpdeItem = new RpdeItem diff --git a/Examples/BookingSystem.AspNetCore/README.md b/Examples/BookingSystem.AspNetCore/README.md index f8762cf3..38bd0a32 100644 --- a/Examples/BookingSystem.AspNetCore/README.md +++ b/Examples/BookingSystem.AspNetCore/README.md @@ -2,7 +2,8 @@ An example OpenActive.Server.NET implementation. -This implementation is also used as a Reference Implementation for the [Test Suite](https://github.com/openactive/openactive-test-suite) to run its tests against. +This implementation is also used as a reference implementation for the [Test Suite](https://github.com/openactive/openactive-test-suite) to run its tests against and therefore is often to as Reference Implementation. +Until there are more reference implementations, all references to Reference Implementation refer to this implementation and Reference Implementation and BookingSystem.AspNetCore can be used interchangeably. ## Running Locally using Visual Studio @@ -24,17 +25,17 @@ Run: dotnet run ``` -If you want to start the Reference Implementation in a specific environment run the following: +If you want to start BookingSystem.AspNetCore in a specific environment run the following: ```sh ASPNETCORE_ENVIRONMENT=no-auth dotnet run --no-launch-profile --project ./BookingSystem.AspNetCore.csproj --configuration Release --no-build ``` -The above example starts the Reference Implementation in `no-auth` mode. +The above example starts the BookingSystem.AspNetCore in `no-auth` mode. -## Reference Implementation Data Generation +## BookingSystem.AspNetCore Data Generation -Reference Implementation has three main uses that make it very important in the OpenActive ecosystem: +BookingSystem.AspNetCore has three main uses that make it very important in the OpenActive ecosystem: - For data publishers / booking systems: It is used to demonstrate the properties and shape of data and APIs, according to the OpenActive specifications - For data users / brokers: It is used as a trial integration where testing can be done with no ramifications - For contributors: It is used to ensure the Test Suite tests are correct and passing, for different combinations of Open Booking API features. @@ -51,10 +52,18 @@ or not. For example, `Price` is important to booking and there is generated in F needed for booking, and therefore is generated at request time. ### Lorem Fitsum mode -When Reference Implementation is run in Lorem Fitsum (a play on [Lorem Ipsum](https://en.wikipedia.org/wiki/Lorem_ipsum)) mode, the data generated contains all the possible fields specified by the OpenActive Modelling Specification. +When BookingSystem.AspNetCore is run in Lorem Fitsum (a play on [Lorem Ipsum](https://en.wikipedia.org/wiki/Lorem_ipsum)) mode, the data generated contains all the possible fields specified by the OpenActive Modelling Specification. They are unrealistic representations of data, and the presence of all the fields should not be relied on when developing front-end representations of the data. However it is very useful for data consumers and deciding on how to present the data to the users. +Lorem Fitsum mode can be running by setting the environment variable `IS_LOREM_FITSUM_MODE` to `true`. +In Visual Studio this can be done in Properties > BookingSystem.AspNetCore Properties > Run > Default > Environment Variables. +In the CLI this can be done by running the following command for example: + +```sh +IS_LOREM_FITSUM_MODE=true dotnet run --no-launch-profile --project ./BookingSystem.AspNetCore.csproj --configuration Release --no-build +``` + ### Golden Records Golden records are randomly generated records that have maximally enriched properties in the generated data. For example where a record might have one image normally, a golden record will have four.