Skip to content

Commit a1ccb98

Browse files
committed
feat: Adds ARI date update models
Adds models for Availability, Rates, and Inventory (ARI) updates, including structures for date-specific updates, rate plans, pricing, and guest occupancy. These models will be used for synchronizing availability data with external systems or APIs.
1 parent 8850457 commit a1ccb98

File tree

1 file changed

+187
-0
lines changed

1 file changed

+187
-0
lines changed
Lines changed: 187 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,187 @@
1+
// This work is licensed under the terms of the MIT license.
2+
// For a copy, see <https://opensource.org/licenses/MIT>.
3+
4+
using System.Text.Json.Serialization;
5+
6+
namespace HyperGuestSDK.Ari;
7+
8+
/// <summary>
9+
/// Represents a model for an ARI update, containing property-specific update records and related metadata.
10+
/// </summary>
11+
public class AriUpdate : Model<AriUpdate>
12+
{
13+
/// <summary>
14+
/// Gets or sets the collection of ARI update records associated with the date.
15+
/// </summary>
16+
[JsonPropertyName("ARIUpdate")]
17+
public AriDateUpdate[]? DateUpdates { get; set; }
18+
19+
/// <summary>
20+
/// Gets or sets the unique identifier for the property.
21+
/// </summary>
22+
[JsonPropertyName("propertyId")]
23+
public int PropertyId { get; set; }
24+
}
25+
26+
/// <summary>
27+
/// Represents an ARI (Availability, Rates, and Inventory) update for a specific room and date or date range.
28+
/// </summary>
29+
/// <remarks>This class is typically used to transmit or store information about room availability and related
30+
/// details for a given date or range of dates. All properties correspond to fields commonly used in ARI systems for
31+
/// hotel inventory management. Instances may be used when synchronizing availability data with external systems or
32+
/// APIs.</remarks>
33+
public class AriDateUpdate : Model<AriDateUpdate>
34+
{
35+
/// <summary>
36+
/// Gets or sets the date associated with this ARI update.
37+
/// </summary>
38+
[JsonPropertyName("date")]
39+
public DateTime? Date { get; set; }
40+
41+
/// <summary>
42+
/// Gets or sets the date range for this ARI update.
43+
/// </summary>
44+
[JsonPropertyName("dates")]
45+
public DatePair? Dates { get; set; }
46+
47+
/// <summary>
48+
/// Gets or sets the number of rooms currently available for booking.
49+
/// </summary>
50+
[JsonPropertyName("numberOfAvailableRooms")]
51+
public int? NumberOfAvailableRooms { get; set; }
52+
53+
/// <summary>
54+
/// Gets or sets the collection of rate plans to be updated for the specified dates.
55+
/// </summary>
56+
[JsonPropertyName("ratePlans")]
57+
public AriDateRatePlan[]? RatePlans { get; set; }
58+
59+
/// <summary>
60+
/// Gets or sets the unique identifier for the room.
61+
/// </summary>
62+
[JsonPropertyName("roomId")]
63+
public int RoomId { get; set; }
64+
65+
/// <summary>
66+
/// Gets or sets the code that uniquely identifies the type of room.
67+
/// </summary>
68+
[JsonPropertyName("roomTypeCode")]
69+
public string? RoomTypeCode { get; set; }
70+
}
71+
72+
/// <summary>
73+
/// Represents the availability and booking restrictions for a rate plan on specific dates, including open status,
74+
/// length-of-stay limits, and associated pricing details.
75+
/// </summary>
76+
/// <remarks>Use this class to specify or query the rules and pricing for a rate plan on a given date, such as
77+
/// whether bookings are allowed, minimum and maximum stay requirements, and price information. All properties are
78+
/// optional and may be null if not applicable for a particular rate plan or date.</remarks>
79+
public class AriDateRatePlan : Model<AriDateRatePlan>
80+
{
81+
/// <summary>
82+
/// Gets or sets a value indicating whether the rate plan is open for booking.
83+
/// </summary>
84+
[JsonPropertyName("isOpen")]
85+
public bool? IsOpen { get; set; }
86+
87+
/// <summary>
88+
/// Gets or sets a value indicating whether the location is open upon arrival.
89+
/// </summary>
90+
[JsonPropertyName("isOpenOnArrival")]
91+
public bool? IsOpenOnArrival { get; set; }
92+
93+
/// <summary>
94+
/// Gets or sets a value indicating whether the location is open at the time of departure.
95+
/// </summary>
96+
[JsonPropertyName("isOpenOnDeparture")]
97+
public bool? IsOpenOnDeparture { get; set; }
98+
99+
/// <summary>
100+
/// Gets or sets the number of days before arrival that a booking can be made.
101+
/// </summary>
102+
[JsonPropertyName("lastMinute")]
103+
public int? LastMinute { get; set; }
104+
105+
/// <summary>
106+
/// Gets or sets the maximum number of consecutive nights a guest may stay.
107+
/// </summary>
108+
[JsonPropertyName("maxLOS")]
109+
public int? MaximumLengthOfStay { get; set; }
110+
111+
/// <summary>
112+
/// Gets or sets the maximum number of nights allowed for a stay, including the check-out date.
113+
/// </summary>
114+
[JsonPropertyName("maxStayThrough")]
115+
public int? MaximumStayThrough { get; set; }
116+
117+
/// <summary>
118+
/// Gets or sets the minimum number of consecutive nights required for a stay.
119+
/// </summary>
120+
[JsonPropertyName("minLOS")]
121+
public int? MinimumLengthOfStay { get; set; }
122+
123+
/// <summary>
124+
/// Gets or sets the minimum number of consecutive nights required for a stay, including the specified end date.
125+
/// </summary>
126+
[JsonPropertyName("minStayThrough")]
127+
public int? MinimumStayThrough { get; set; }
128+
129+
/// <summary>
130+
/// Gets or sets the collection of price details associated with the rate plan for specific dates.
131+
/// </summary>
132+
[JsonPropertyName("prices")]
133+
public AriDateRatePlanPrice[]? Prices { get; set; }
134+
135+
/// <summary>
136+
/// Gets or sets the code that uniquely identifies the rate plan.
137+
/// </summary>
138+
[JsonPropertyName("ratePlanCode")]
139+
public string? RatePlanCode { get; set; }
140+
141+
/// <summary>
142+
/// Gets or sets the release period in days before which a booking can be made.
143+
/// </summary>
144+
[JsonPropertyName("release")]
145+
public int? Release { get; set; }
146+
}
147+
148+
/// <summary>
149+
/// Represents the pricing details for a specific rate plan on a given date, including guest occupancy information.
150+
/// </summary>
151+
public class AriDateRatePlanPrice : Model<AriDateRatePlanPrice>
152+
{
153+
/// <summary>
154+
/// Gets or sets the guest occupancy details associated with the rate plan.
155+
/// </summary>
156+
[JsonPropertyName("numberOfGuests")]
157+
public AriDateRatePlanGuests? NumberOfGuests { get; set; }
158+
159+
/// <summary>
160+
/// Gets or sets the price value associated with the item.
161+
/// </summary>
162+
[JsonPropertyName("price")]
163+
public decimal Price { get; set; }
164+
}
165+
166+
/// <summary>
167+
/// Represents the guest composition for a rate plan on a specific date, including the number of adults, children, and
168+
/// infants.
169+
/// </summary>
170+
/// <param name="Adults">The number of adult guests included in the rate plan. Must be zero or greater.</param>
171+
/// <param name="Children">The number of child guests included in the rate plan. Can be null if not specified; otherwise, must be zero or
172+
/// greater.</param>
173+
/// <param name="Infants">The number of infant guests included in the rate plan. Can be null if not specified; otherwise, must be zero or
174+
/// greater.</param>
175+
public record AriDateRatePlanGuests(
176+
[property: JsonPropertyName("adults")] int Adults,
177+
[property: JsonPropertyName("children")] int? Children,
178+
[property: JsonPropertyName("infants")] int? Infants);
179+
180+
/// <summary>
181+
/// Represents a pair of dates indicating a start and end period.
182+
/// </summary>
183+
/// <param name="From">The start date of the period.</param>
184+
/// <param name="To">The end date of the period.</param>
185+
public record DatePair(
186+
[property: JsonPropertyName("from")] DateTime From,
187+
[property: JsonPropertyName("to")] DateTime To);

0 commit comments

Comments
 (0)