Skip to content

Commit

Permalink
review changes
Browse files Browse the repository at this point in the history
  • Loading branch information
civsiv committed Mar 27, 2024
1 parent e831d3a commit 729c67a
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Examples/BookingSystem.AspNetCore/Feeds/FacilitiesFeeds.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ protected override async Task<List<RpdeItem<FacilityUse>>> 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<FacilityUse>
{
Kind = RpdeKind.FacilityUse,
Expand Down
2 changes: 1 addition & 1 deletion Examples/BookingSystem.AspNetCore/Feeds/SessionsFeeds.cs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ protected override async Task<List<RpdeItem<SessionSeries>>> 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<SessionSeries>
Expand Down
21 changes: 15 additions & 6 deletions Examples/BookingSystem.AspNetCore/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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.
Expand All @@ -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.

0 comments on commit 729c67a

Please sign in to comment.