Skip to content

Commit

Permalink
Fixes auctions with sale artworks that are missing high estimates.
Browse files Browse the repository at this point in the history
  • Loading branch information
ashfurrow committed Nov 21, 2016
1 parent dfbb5dc commit 93f211b
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions Artsy/Models/API_Models/LiveAuctionLot.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic, copy, readonly) NSString *currency;
@property (nonatomic, copy, readonly) NSString *currencySymbol;

@property (nonatomic, assign, readonly) UInt64 lowEstimateCents;
@property (nonatomic, assign, readonly) UInt64 highEstimateCents;
@property (nonatomic, assign, readonly) NSNumber *_Nullable lowEstimateCents;
@property (nonatomic, assign, readonly) NSNumber *_Nullable highEstimateCents;
@property (nonatomic, copy, readonly) NSString *_Nullable estimate;
@property (nonatomic, assign, readonly) UInt64 askingPriceCents;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class LiveAuctionBidViewModel: NSObject {
let nextBid = salesPerson.bidIncrements.minimumNextBidCentsIncrement(bidIncrements[i])
bidIncrements += [nextBid]
i += 1
} while bidIncrements[i] < (3 * max(lotVM.askingPrice, lotVM.highEstimateCents))
} while bidIncrements[i] < (3 * max(lotVM.askingPrice, lotVM.highEstimateCents ?? 0))
}

var availableIncrements: Int {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ protocol LiveAuctionLotViewModelType: class {
var lotArtworkDimensions: String? { get }

var estimateString: String? { get }
var highEstimateCents: UInt64 { get }
var highEstimateCents: UInt64? { get }
var lotName: String { get }
var lotID: String { get }
var lotIndex: String { get }
Expand Down Expand Up @@ -241,8 +241,8 @@ class LiveAuctionLotViewModel: NSObject, LiveAuctionLotViewModelType {
return model.estimate
}

var highEstimateCents: UInt64 {
return model.highEstimateCents
var highEstimateCents: UInt64? {
return model.highEstimateCents?.unsignedLongLongValue
}

var eventIDs: [String] {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ class Test_LiveAuctionLotViewModel: LiveAuctionLotViewModelType {
var numberOfDerivedEvents = 1
var lotIndex = "2"
var lotNumber = "2"
var highEstimateCents: UInt64 = 2_000_00
var highEstimateCents: UInt64? = 2_000_00
var numberOfBids = 1
var currencySymbol = "$"
var imageAspectRatio: CGFloat = 1
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ upcoming:
- Fixes performance issues on the live auctions lot list - ash
- Fixes bug in GeneVC where fetching was starting on page 2 - sarah
- Update home view artworks rails order - maxim
- Fix for live sale artworks with missing high estimates - ash
- Fixes artist link to auction results - alloy
- Ensures artists in context of a gallery are shown in the new artist view - sarah + alloy

Expand Down

0 comments on commit 93f211b

Please sign in to comment.