Class: AuctionFunCore::Contracts::AuctionContext::PostAuction::WinnerContract

Inherits:
AuctionFunCore::Contracts::ApplicationContract show all
Defined in:
lib/auction_fun_core/contracts/auction_context/post_auction/winner_contract.rb

Overview

This class validates the identification of the winning bidder in an auction context. It ensures that both the auction and the winner exist and are correctly associated within the system.

Examples:

Using this class to validate a winner

contract = AuctionFunCore::Contracts::AuctionContext::PostAuction::WinnerContract.new
attributes = { auction_id: 1, winner_id: 102 }
validation_result = contract.call(attributes)
if validation_result.success?
  puts "Winner validation passed"
else
  puts "Winner validation failed: #{validation_result.errors.to_h}"
end

Constant Summary collapse

I18N_SCOPE =

Internationalization (i18n) scope for error messages related to winner validation.

"contracts.errors.custom.auction_context.post_auction.winner"

Constants inherited from AuctionFunCore::Contracts::ApplicationContract

AuctionFunCore::Contracts::ApplicationContract::EMAIL_REGEX, AuctionFunCore::Contracts::ApplicationContract::I18N_MACRO_SCOPE

Constants included from Business::Configuration

Business::Configuration::AUCTION_KINDS, Business::Configuration::AUCTION_MAX_TITLE_LENGTH, Business::Configuration::AUCTION_MIN_TITLE_LENGTH, Business::Configuration::AUCTION_STATUSES, Business::Configuration::AUCTION_STOPWATCH_MAX_VALUE, Business::Configuration::AUCTION_STOPWATCH_MIN_VALUE, Business::Configuration::MAX_NAME_LENGTH, Business::Configuration::MAX_PASSWORD_LENGTH, Business::Configuration::MIN_NAME_LENGTH, Business::Configuration::MIN_PASSWORD_LENGTH