Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AF-25] Create Bids #26

Merged
merged 3 commits into from
Mar 6, 2024
Merged

[AF-25] Create Bids #26

merged 3 commits into from
Mar 6, 2024

Conversation

ricardopacheco
Copy link
Owner

@ricardopacheco ricardopacheco commented Mar 6, 2024

Issue number: resolves #25

Summary 🔴

This PR includes all the minimum resources necessary to create an bid, whether at the database level or at the business rule level. The version 0.8.0 Changelog contains all the details.

Proposed / Possible solution 🔴

We create a specific context for the bid, and we follow all already established standards and conventions. As the bid has actions that are very specific, and can be complex, we created an additional internal module to deal with these complexities, respecting the SRP.

How to test 👮‍♂️

Start the related services, and open the console with the command bin/console. After that

Closed bid

attributes = {}

AuctionFunCore::Operations::BidContext::CreateBidClosedOperation.call(attributes) do |result|
  result.success { |auction| puts auction.to_h }
  result.failure { |failure| puts failure.errors.to_h }
end

Penny bid

attributes = {}

AuctionFunCore::Operations::BidContext::CreateBidPennyOperation.call(attributes) do |result|
  result.success { |auction| puts auction.to_h }
  result.failure { |failure| puts failure.errors.to_h }
end

Standard bid

attributes = {}

AuctionFunCore::Operations::BidContext::CreateBidStandardOperation.call(attributes) do |result|
  result.success { |auction| puts auction.to_h }
  result.failure { |failure| puts failure.errors.to_h }
end

To simulate successful creation, change the hash of the attributes variable so that it meets all contract requirements.

Risks / Impacts 🔴

  • None anticipated

Requirements for deployment 🔴

  • Execute the migrate command before starting the deployment process.

- Create bid resources;
- Add operations for each bid type;
@ricardopacheco ricardopacheco self-assigned this Mar 6, 2024
@ricardopacheco ricardopacheco added type:feature A suggestion for general features status:in-review In Review status priority:high High priority labels Mar 6, 2024
@ricardopacheco ricardopacheco merged commit 736b60b into main Mar 6, 2024
1 check passed
@ricardopacheco ricardopacheco deleted the AF-25 branch March 6, 2024 16:41
@ricardopacheco ricardopacheco added status:done Done status and removed status:in-review In Review status labels Mar 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority:high High priority status:done Done status type:feature A suggestion for general features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create bids
1 participant