Skip to content

Commit

Permalink
Move allowCustomerCancellationFullRefund to Offer (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
openactive-bot authored Mar 1, 2021
1 parent 18b3845 commit 0f631fe
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 33 deletions.
6 changes: 3 additions & 3 deletions OpenActive.NET.Generator/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion OpenActive.NET.Generator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"author": "Nick Evans",
"license": "MIT",
"dependencies": {
"@openactive/data-models": "^2.0.174",
"@openactive/data-models": "^2.0.177",
"fs-extra": "^7.0.1",
"sync-request": "^6.0.0"
}
Expand Down
2 changes: 1 addition & 1 deletion OpenActive.NET.Test/OrderTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ public void OrderQuote_EncodeDecode()
"\"@id\":\"https://example.com/events/452#/offers/878\"," +
"\"name\":\"Speedball winger position\"," +
"\"description\":\"Winger space for Speedball.\"," +
"\"allowCustomerCancellationFullRefund\":true," +
"\"latestCancellationBeforeStartDate\":\"P1D\"," +
"\"price\":0," +
"\"priceCurrency\":\"GBP\"," +
Expand All @@ -193,7 +194,6 @@ public void OrderQuote_EncodeDecode()
"\"text\":\"0123456789\"" +
"}" +
"]," +
"\"allowCustomerCancellationFullRefund\":true," +
"\"orderedItem\":{" +
"\"@type\":\"ScheduledSession\"," +
"\"@id\":\"https://example.com/events/452/subEvents/132\"," +
Expand Down
26 changes: 17 additions & 9 deletions OpenActive.NET/models/Offer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -149,26 +149,34 @@ public override string ToString()
public virtual QuantitativeValue AgeRestriction { get; set; }


/// <summary>
/// Whether the opportunity can be cancelled with a full refund at any time before the `startDate`, or before the `latestCancellationBeforeStartDate` if provided.
/// </summary>
[DataMember(Name = "allowCustomerCancellationFullRefund", EmitDefaultValue = false, Order = 14)]
[JsonConverter(typeof(ValuesConverter))]
public virtual bool? AllowCustomerCancellationFullRefund { get; set; }


/// <summary>
/// The channels through which a booking can be made.
/// </summary>
[DataMember(Name = "availableChannel", EmitDefaultValue = false, Order = 14)]
[DataMember(Name = "availableChannel", EmitDefaultValue = false, Order = 15)]
[JsonConverter(typeof(ValuesConverter))]
public new virtual List<AvailableChannelType> AvailableChannel { get; set; }


/// <summary>
/// The duration before the startDate during which this Offer may not be cancelled, given in ISO 8601 format.
/// </summary>
[DataMember(Name = "latestCancellationBeforeStartDate", EmitDefaultValue = false, Order = 15)]
[DataMember(Name = "latestCancellationBeforeStartDate", EmitDefaultValue = false, Order = 16)]
[JsonConverter(typeof(OpenActiveTimeSpanToISO8601DurationValuesConverter))]
public virtual TimeSpan? LatestCancellationBeforeStartDate { get; set; }


/// <summary>
/// Can include https://openactive.io/OpenBookingIntakeForm, https://openactive.io/OpenBookingAttendeeDetails, https://openactive.io/OpenBookingApproval, https://openactive.io/OpenBookingNegotiation, https://openactive.io/OpenBookingMessageExchange
/// </summary>
[DataMember(Name = "openBookingFlowRequirement", EmitDefaultValue = false, Order = 16)]
[DataMember(Name = "openBookingFlowRequirement", EmitDefaultValue = false, Order = 17)]
[JsonConverter(typeof(ValuesConverter))]
public virtual List<OpenBookingFlowRequirement> OpenBookingFlowRequirement { get; set; }

Expand All @@ -181,7 +189,7 @@ public override string ToString()
/// "prepayment": "https://openactive.io/Required"
/// </code>
/// </example>
[DataMember(Name = "prepayment", EmitDefaultValue = false, Order = 17)]
[DataMember(Name = "prepayment", EmitDefaultValue = false, Order = 18)]
[JsonConverter(typeof(ValuesConverter))]
public virtual RequiredStatusType? Prepayment { get; set; }

Expand All @@ -197,7 +205,7 @@ public override string ToString()
/// "price": 33
/// </code>
/// </example>
[DataMember(Name = "price", EmitDefaultValue = false, Order = 18)]
[DataMember(Name = "price", EmitDefaultValue = false, Order = 19)]
[JsonConverter(typeof(ValuesConverter))]
public new virtual decimal? Price { get; set; }

Expand All @@ -210,7 +218,7 @@ public override string ToString()
/// "priceCurrency": "GBP"
/// </code>
/// </example>
[DataMember(Name = "priceCurrency", EmitDefaultValue = false, Order = 19)]
[DataMember(Name = "priceCurrency", EmitDefaultValue = false, Order = 20)]
[JsonConverter(typeof(ValuesConverter))]
public new virtual string PriceCurrency { get; set; }

Expand All @@ -223,15 +231,15 @@ public override string ToString()
/// "url": "http://www.rphs.org.uk/"
/// </code>
/// </example>
[DataMember(Name = "url", EmitDefaultValue = false, Order = 20)]
[DataMember(Name = "url", EmitDefaultValue = false, Order = 21)]
[JsonConverter(typeof(ValuesConverter))]
public new virtual Uri Url { get; set; }


/// <summary>
/// The duration before the startDate for which this Offer is valid, given in ISO 8601 format. This is a relatively-defined equivalent of schema:validFrom, to allow for Offer inheritance.
/// </summary>
[DataMember(Name = "validFromBeforeStartDate", EmitDefaultValue = false, Order = 21)]
[DataMember(Name = "validFromBeforeStartDate", EmitDefaultValue = false, Order = 22)]
[JsonConverter(typeof(OpenActiveTimeSpanToISO8601DurationValuesConverter))]
public virtual TimeSpan? ValidFromBeforeStartDate { get; set; }

Expand All @@ -242,7 +250,7 @@ public override string ToString()
///
/// If you are using this property, please join the discussion at proposal [#250](https://github.com/openactive/modelling-opportunity-data/issues/250).
/// </summary>
[DataMember(Name = "beta:partySize", EmitDefaultValue = false, Order = 1022)]
[DataMember(Name = "beta:partySize", EmitDefaultValue = false, Order = 1023)]
[JsonConverter(typeof(ValuesConverter))]
public virtual QuantitativeValue PartySize { get; set; }

Expand Down
4 changes: 4 additions & 0 deletions OpenActive.NET/models/OfferOverride.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ public override string ToString()
public override QuantitativeValue AgeRestriction { get; set; }


[Obsolete("This property is disinherited in this type, and must not be used.", true)]
public override bool? AllowCustomerCancellationFullRefund { get; set; }


[Obsolete("This property is disinherited in this type, and must not be used.", true)]
public override List<AvailableChannelType> AvailableChannel { get; set; }

Expand Down
30 changes: 11 additions & 19 deletions OpenActive.NET/models/OrderItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,98 +79,90 @@ public override string ToString()
public virtual List<ImageObject> AccessPass { get; set; }


/// <summary>
/// Whether the event can be cancelled.
/// </summary>
[DataMember(Name = "allowCustomerCancellationFullRefund", EmitDefaultValue = false, Order = 11)]
[JsonConverter(typeof(ValuesConverter))]
public virtual bool? AllowCustomerCancellationFullRefund { get; set; }


/// <summary>
/// The person attending the Opportunity related to the OrderItem.
/// </summary>
[DataMember(Name = "attendee", EmitDefaultValue = false, Order = 12)]
[DataMember(Name = "attendee", EmitDefaultValue = false, Order = 11)]
[JsonConverter(typeof(ValuesConverter))]
public new virtual Person Attendee { get; set; }


/// <summary>
/// The properties of `schema:Person` that are required to describe an `attendee` for this `OrderItem`.
/// </summary>
[DataMember(Name = "attendeeDetailsRequired", EmitDefaultValue = false, Order = 13)]
[DataMember(Name = "attendeeDetailsRequired", EmitDefaultValue = false, Order = 12)]
[JsonConverter(typeof(ValuesConverter))]
public virtual List<Uri> AttendeeDetailsRequired { get; set; }


/// <summary>
/// A message set by the Seller in the event of Opportunity cancellation, only applicable for an `Order` and where the `OrderItem` has `orderItemStatus` set to `https://openactive.io/SellerCancelled`
/// </summary>
[DataMember(Name = "cancellationMessage", EmitDefaultValue = false, Order = 14)]
[DataMember(Name = "cancellationMessage", EmitDefaultValue = false, Order = 13)]
[JsonConverter(typeof(ValuesConverter))]
public virtual string CancellationMessage { get; set; }


/// <summary>
/// A message set by the Seller to trigger a notification to the Customer, only applicable for an `Order` and where the `OrderItem` has `orderItemStatus` set to `https://openactive.io/OrderItemConfirmed` or `https://openactive.io/CustomerAttended`
/// </summary>
[DataMember(Name = "customerNotice", EmitDefaultValue = false, Order = 15)]
[DataMember(Name = "customerNotice", EmitDefaultValue = false, Order = 14)]
[JsonConverter(typeof(ValuesConverter))]
public virtual string CustomerNotice { get; set; }


/// <summary>
/// Array of errors related to the OrderItem being included in the Order, only applicable for an OrderQuote.
/// </summary>
[DataMember(Name = "error", EmitDefaultValue = false, Order = 16)]
[DataMember(Name = "error", EmitDefaultValue = false, Order = 15)]
[JsonConverter(typeof(ValuesConverter))]
public new virtual List<OpenBookingError> Error { get; set; }


/// <summary>
/// The specific bookable Thing that has been selected by the Customer. See the [Modelling-Opportunity-Data] for more information on these types. Note that the Broker Request and Orders feed only require id within these objects to be included; in these contexts, all other properties are ignored.
/// </summary>
[DataMember(Name = "orderedItem", EmitDefaultValue = false, Order = 17)]
[DataMember(Name = "orderedItem", EmitDefaultValue = false, Order = 16)]
[JsonConverter(typeof(ValuesConverter))]
public new virtual Event OrderedItem { get; set; }


/// <summary>
/// PropertyValueSpecifications that describe fields in the orderItemIntakeForm.
/// </summary>
[DataMember(Name = "orderItemIntakeForm", EmitDefaultValue = false, Order = 18)]
[DataMember(Name = "orderItemIntakeForm", EmitDefaultValue = false, Order = 17)]
[JsonConverter(typeof(ValuesConverter))]
public virtual List<PropertyValueSpecification> OrderItemIntakeForm { get; set; }


/// <summary>
/// PropertyValues that contains a text value responses to the orderItemIntakeForm.
/// </summary>
[DataMember(Name = "orderItemIntakeFormResponse", EmitDefaultValue = false, Order = 19)]
[DataMember(Name = "orderItemIntakeFormResponse", EmitDefaultValue = false, Order = 18)]
[JsonConverter(typeof(ValuesConverter))]
public virtual List<PropertyValue> OrderItemIntakeFormResponse { get; set; }


/// <summary>
///
/// </summary>
[DataMember(Name = "orderItemStatus", EmitDefaultValue = false, Order = 20)]
[DataMember(Name = "orderItemStatus", EmitDefaultValue = false, Order = 19)]
[JsonConverter(typeof(ValuesConverter))]
public new virtual OrderItemStatus? OrderItemStatus { get; set; }


/// <summary>
/// An integer representing the order of OrderItems within the array.
/// </summary>
[DataMember(Name = "position", EmitDefaultValue = false, Order = 21)]
[DataMember(Name = "position", EmitDefaultValue = false, Order = 20)]
[JsonConverter(typeof(ValuesConverter))]
public new virtual long? Position { get; set; }


/// <summary>
/// Breakdown of tax payable for the OrderItem.
/// </summary>
[DataMember(Name = "unitTaxSpecification", EmitDefaultValue = false, Order = 22)]
[DataMember(Name = "unitTaxSpecification", EmitDefaultValue = false, Order = 21)]
[JsonConverter(typeof(ValuesConverter))]
public virtual List<TaxChargeSpecification> UnitTaxSpecification { get; set; }

Expand Down

0 comments on commit 0f631fe

Please sign in to comment.