Skip to content

Commit a085ba4

Browse files
committed
Add synchronize single booking action
1 parent 3061ad2 commit a085ba4

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

Modules/Sources/Yosemite/Actions/BookingAction.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,13 @@ public enum BookingAction: Action {
1717
startDateAfter: String? = nil,
1818
shouldClearCache: Bool = false,
1919
onCompletion: (Result<Bool, Error>) -> Void)
20+
/// Synchronizes the Booking matching the specified criteria.
21+
///
22+
/// - Parameter onCompletion: called when sync completes, returns an error in case of a failure or empty in case of success.
23+
///
24+
case synchronizeBooking(siteID: Int64,
25+
bookingID: Int64,
26+
onCompletion: (Result<Void, Error>) -> Void)
2027

2128
/// Checks if the store already has any bookings.
2229
/// Returns `false` if the store has no bookings.

Modules/Sources/Yosemite/Stores/BookingStore.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ public class BookingStore: Store {
4747
startDateAfter: startDateAfter,
4848
shouldClearCache: shouldClearCache,
4949
onCompletion: onCompletion)
50+
case .synchronizeBooking(siteID: let siteID, bookingID: let bookingID, onCompletion: let onCompletion):
51+
synchronizeBooking(siteID: siteID, bookingID: bookingID, onCompletion: onCompletion)
5052
case let .checkIfStoreHasBookings(siteID, onCompletion):
5153
checkIfStoreHasBookings(siteID: siteID, onCompletion: onCompletion)
5254
case let .searchBookings(siteID, searchQuery, pageNumber, pageSize, startDateBefore, startDateAfter, onCompletion):

0 commit comments

Comments
 (0)