-
Notifications
You must be signed in to change notification settings - Fork 1.9k
feat: Added function for previous month's ticket sales count #6287
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
feat: Added function for previous month's ticket sales count #6287
Conversation
c96e5a2 to
2829e15
Compare
2829e15 to
7e8c43c
Compare
Codecov Report
@@ Coverage Diff @@
## development #6287 +/- ##
===============================================
- Coverage 65.26% 65.24% -0.02%
===============================================
Files 287 287
Lines 14713 14719 +6
===============================================
+ Hits 9602 9604 +2
- Misses 5111 5115 +4
Continue to review full report at Codecov.
|
|
@iamareebjamal @uds5501 @shreyanshdwivedi Please have a look |
uds5501
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please see the comments
| def calc_tickets_sold_prev_month(self): | ||
| """Calculate tickets sold in the previous month""" | ||
| previous_month = datetime.datetime.now().month - 1 | ||
| return self.tickets_sold.filter_by(completed_at=previous_month).count() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't it be self.tickets_sold_object instead of self.tickets_sold ?
Fixes #6282
Short description of what this resolves:
Implemented function for previous month's ticket sales count. Also refactored object method to reduce code dupl.
Changes proposed in this pull request:
Checklist
developmentbranch.