Skip to content

Conversation

@mrsaicharan1
Copy link
Member

@mrsaicharan1 mrsaicharan1 commented Jun 18, 2019

Fixes #6061

Checklist

  • I have read the Contribution & Best practices Guide and my PR follows them.
  • My branch is up-to-date with the Upstream development branch.
  • The unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)
  • All the functions created/modified in this PR contain relevant docstrings.

Short description of what this resolves:

  • Adds schemas & fields for donations

Changes proposed in this pull request:

  • Migration file
  • Schema & model additions
  • Added validation checks

@mrsaicharan1
Copy link
Member Author

@uds5501 @shreyanshdwivedi Please review.

@codecov
Copy link

codecov bot commented Jun 18, 2019

Codecov Report

Merging #6062 into development will increase coverage by <.01%.
The diff coverage is 77.77%.

Impacted file tree graph

@@               Coverage Diff               @@
##           development    #6062      +/-   ##
===============================================
+ Coverage        66.12%   66.12%   +<.01%     
===============================================
  Files              285      285              
  Lines            14089    14098       +9     
===============================================
+ Hits              9316     9323       +7     
- Misses            4773     4775       +2
Impacted Files Coverage Δ
app/models/ticket.py 72.91% <100%> (+1.17%) ⬆️
app/api/schema/tickets.py 86.84% <60%> (-1.9%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d78839b...eb18960. Read the comment docs.

Copy link
Member

@shreyanshdwivedi shreyanshdwivedi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mrsaicharan1 I think there should be a validation check so that min_price <= max_price.

@mrsaicharan1
Copy link
Member Author

@mrsaicharan1 I think there should be a validation check so that min_price <= max_price.

Yeah. Made it.

@mrsaicharan1
Copy link
Member Author

@uds5501 @shreyanshdwivedi @iamareebjamal Please review.


def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('tickets', sa.Column('max_price', sa.Float(), nullable=True))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here it's nullable false, I don't see any specification in the model file.

@mrsaicharan1 mrsaicharan1 force-pushed the donation-fields branch 3 times, most recently from 5b0b792 to 9e4f058 Compare June 19, 2019 11:10
@fossasia fossasia deleted a comment Jun 19, 2019
@mrsaicharan1
Copy link
Member Author

@CosmicCoder96 I've made the requested changes. Please review.

@mrsaicharan1 mrsaicharan1 changed the title feat: Model & schema additions for donations feat: Model & schema validations for donations Jun 19, 2019
@mrsaicharan1
Copy link
Member Author

@iamareebjamal Oh okay! I thought only boolean fields required a server_default. Understood now. Updated it.

@fossasia fossasia deleted a comment Jun 19, 2019
Updated validations & corrected pointer info

Updated revision head

provided defaults
@fossasia fossasia deleted a comment Jun 19, 2019
@abhinavk96 abhinavk96 merged commit 636c8ba into fossasia:development Jun 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: Max/Min price fields for donation tickets

6 participants