Skip to content

Commit 0f631fe

Browse files
Move allowCustomerCancellationFullRefund to Offer (#16)
1 parent 18b3845 commit 0f631fe

6 files changed

Lines changed: 37 additions & 33 deletions

File tree

OpenActive.NET.Generator/package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

OpenActive.NET.Generator/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"author": "Nick Evans",
1212
"license": "MIT",
1313
"dependencies": {
14-
"@openactive/data-models": "^2.0.174",
14+
"@openactive/data-models": "^2.0.177",
1515
"fs-extra": "^7.0.1",
1616
"sync-request": "^6.0.0"
1717
}

OpenActive.NET.Test/OrderTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ public void OrderQuote_EncodeDecode()
182182
"\"@id\":\"https://example.com/events/452#/offers/878\"," +
183183
"\"name\":\"Speedball winger position\"," +
184184
"\"description\":\"Winger space for Speedball.\"," +
185+
"\"allowCustomerCancellationFullRefund\":true," +
185186
"\"latestCancellationBeforeStartDate\":\"P1D\"," +
186187
"\"price\":0," +
187188
"\"priceCurrency\":\"GBP\"," +
@@ -193,7 +194,6 @@ public void OrderQuote_EncodeDecode()
193194
"\"text\":\"0123456789\"" +
194195
"}" +
195196
"]," +
196-
"\"allowCustomerCancellationFullRefund\":true," +
197197
"\"orderedItem\":{" +
198198
"\"@type\":\"ScheduledSession\"," +
199199
"\"@id\":\"https://example.com/events/452/subEvents/132\"," +

OpenActive.NET/models/Offer.cs

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -149,26 +149,34 @@ public override string ToString()
149149
public virtual QuantitativeValue AgeRestriction { get; set; }
150150

151151

152+
/// <summary>
153+
/// Whether the opportunity can be cancelled with a full refund at any time before the `startDate`, or before the `latestCancellationBeforeStartDate` if provided.
154+
/// </summary>
155+
[DataMember(Name = "allowCustomerCancellationFullRefund", EmitDefaultValue = false, Order = 14)]
156+
[JsonConverter(typeof(ValuesConverter))]
157+
public virtual bool? AllowCustomerCancellationFullRefund { get; set; }
158+
159+
152160
/// <summary>
153161
/// The channels through which a booking can be made.
154162
/// </summary>
155-
[DataMember(Name = "availableChannel", EmitDefaultValue = false, Order = 14)]
163+
[DataMember(Name = "availableChannel", EmitDefaultValue = false, Order = 15)]
156164
[JsonConverter(typeof(ValuesConverter))]
157165
public new virtual List<AvailableChannelType> AvailableChannel { get; set; }
158166

159167

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

167175

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

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

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

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

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

230238

231239
/// <summary>
232240
/// 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.
233241
/// </summary>
234-
[DataMember(Name = "validFromBeforeStartDate", EmitDefaultValue = false, Order = 21)]
242+
[DataMember(Name = "validFromBeforeStartDate", EmitDefaultValue = false, Order = 22)]
235243
[JsonConverter(typeof(OpenActiveTimeSpanToISO8601DurationValuesConverter))]
236244
public virtual TimeSpan? ValidFromBeforeStartDate { get; set; }
237245

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

OpenActive.NET/models/OfferOverride.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ public override string ToString()
5959
public override QuantitativeValue AgeRestriction { get; set; }
6060

6161

62+
[Obsolete("This property is disinherited in this type, and must not be used.", true)]
63+
public override bool? AllowCustomerCancellationFullRefund { get; set; }
64+
65+
6266
[Obsolete("This property is disinherited in this type, and must not be used.", true)]
6367
public override List<AvailableChannelType> AvailableChannel { get; set; }
6468

OpenActive.NET/models/OrderItem.cs

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -79,98 +79,90 @@ public override string ToString()
7979
public virtual List<ImageObject> AccessPass { get; set; }
8080

8181

82-
/// <summary>
83-
/// Whether the event can be cancelled.
84-
/// </summary>
85-
[DataMember(Name = "allowCustomerCancellationFullRefund", EmitDefaultValue = false, Order = 11)]
86-
[JsonConverter(typeof(ValuesConverter))]
87-
public virtual bool? AllowCustomerCancellationFullRefund { get; set; }
88-
89-
9082
/// <summary>
9183
/// The person attending the Opportunity related to the OrderItem.
9284
/// </summary>
93-
[DataMember(Name = "attendee", EmitDefaultValue = false, Order = 12)]
85+
[DataMember(Name = "attendee", EmitDefaultValue = false, Order = 11)]
9486
[JsonConverter(typeof(ValuesConverter))]
9587
public new virtual Person Attendee { get; set; }
9688

9789

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

10597

10698
/// <summary>
10799
/// 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`
108100
/// </summary>
109-
[DataMember(Name = "cancellationMessage", EmitDefaultValue = false, Order = 14)]
101+
[DataMember(Name = "cancellationMessage", EmitDefaultValue = false, Order = 13)]
110102
[JsonConverter(typeof(ValuesConverter))]
111103
public virtual string CancellationMessage { get; set; }
112104

113105

114106
/// <summary>
115107
/// 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`
116108
/// </summary>
117-
[DataMember(Name = "customerNotice", EmitDefaultValue = false, Order = 15)]
109+
[DataMember(Name = "customerNotice", EmitDefaultValue = false, Order = 14)]
118110
[JsonConverter(typeof(ValuesConverter))]
119111
public virtual string CustomerNotice { get; set; }
120112

121113

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

129121

130122
/// <summary>
131123
/// 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.
132124
/// </summary>
133-
[DataMember(Name = "orderedItem", EmitDefaultValue = false, Order = 17)]
125+
[DataMember(Name = "orderedItem", EmitDefaultValue = false, Order = 16)]
134126
[JsonConverter(typeof(ValuesConverter))]
135127
public new virtual Event OrderedItem { get; set; }
136128

137129

138130
/// <summary>
139131
/// PropertyValueSpecifications that describe fields in the orderItemIntakeForm.
140132
/// </summary>
141-
[DataMember(Name = "orderItemIntakeForm", EmitDefaultValue = false, Order = 18)]
133+
[DataMember(Name = "orderItemIntakeForm", EmitDefaultValue = false, Order = 17)]
142134
[JsonConverter(typeof(ValuesConverter))]
143135
public virtual List<PropertyValueSpecification> OrderItemIntakeForm { get; set; }
144136

145137

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

153145

154146
/// <summary>
155147
///
156148
/// </summary>
157-
[DataMember(Name = "orderItemStatus", EmitDefaultValue = false, Order = 20)]
149+
[DataMember(Name = "orderItemStatus", EmitDefaultValue = false, Order = 19)]
158150
[JsonConverter(typeof(ValuesConverter))]
159151
public new virtual OrderItemStatus? OrderItemStatus { get; set; }
160152

161153

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

169161

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

0 commit comments

Comments
 (0)