Changelog of Gym Auto project
This page contains description for all changes made to the API. Here you can find mentions of added or deleted endpoints, added fields or filters.
Each change bumps patch version. Of big changes we bump major version.
2.0.114
Add new Payment/PaymentsGroup status: In Queue
Provide more information about celery task for payment. New fields are
available in admin for Payment model
Task: GYMAUTO-491
2.0.113
Provide ability to save student related objects after deactivation.
DELETE - /api/v1/users/students/bulk-deactivate now contains
not required save_related_data parameter not to remove related objects.
Added new save_related_data_for_deactivated field to FullStudentRequest
scheme that is used in PUT - /api/v1/users/students/{id} not to remove
related objects of deactivated student.
Task: GYMAUTO-476
2.0.112
Add api for parent users viewing
GET-/api/v1/users/parent-users/- list of parent usersGET-/api/v1/users/parent-users/{id}/- get parent user detailsGET-/api/v1/users/parent-users/profile/- get current parent user profile
Task: GYMAUTO-485
2.0.111
Add new intended_class_groups field to FullStudentSerializer
Provide permission to users with PARENT type to endpoints:
POST-/api/v1/payment/payments/get-setup-intent-secret/POST-/api/v1/payment/payments/detach_card/
Add endpoint for parent to create/update students
POST-/api/v1/users/students/parent-create/PUT-/api/v1/users/students/{id}/parent-update/
Task: GYMAUTO-485
2.0.110
Add endpoint to get studios data for unauthorized users
GET-/api/v1/studios/studio-autocomplete/- list of cut studios data
Task: GYMAUTO-483
2.0.109
Add endpoint to sign up parents
POST-/api/v1/auth/parent-sign-up/create new ParentUser and Parent objects.
Also added new value for User.user_type field - PARENT
Task: GYMAUTO-483
2.0.108
Add endpoint for ClassGroup objects
GET-/api/v1/studios/class-groups/list of active class groups (Available for unauthorized users)POST-/api/v1/studios/class-groups/create new class groupPUT-/api/v1/studios/class-groups/<id>/update class groupDELETE-/api/v1/studios/class-groups/<id>/deactivate class group
Task: GYMAUTO-480
2.0.107
Add pre-registration page for parents:
GET/POST-sign-up/form to send registration data. Email will be sent to all studio managers of selected studio.GET-/api/v1/parent-pre-sign-ups/<id>/show registration data (admin/manager only)
Also added ParentPreSignUp model and autocomplete endpoints, required
for the registration form.
Task: GYMAUTO-477
2.0.106
Add api to deactivate several students
Task: GYMAUTO-474
2.0.105
Add payment due fields for student
Task: GYMAUTO-472
2.0.104
Add separate endpoint for searching students
Task: GYMAUTO-469
2.0.103
Add handling of rare case when student can be enrolled multiple times to one event if holiday was deleted after manager added student to class.
Task: GYMAUTO-467
2.0.102
Rework payment system to take makeup credits into account when manager edits schedule of student.
Task: GYMAUTO-461
2.0.101
Make group_by_parent_export return zip file
Task: GYMAUTO-456
2.0.100
Add include_payment_info option to group_by_parent_export
Task: GYMAUTO-456
2.0.99
Adjust date in payment api
Task: GYMAUTO-452
2.0.98
Adjust payment info annotations for students
Task: GYMAUTO-450
2.0.97
Improve sentry logging during stripe payments
Task: GYMAUTO-449
2.0.96
Add status__in parameter to export student data api:
GET - /api/v1/studios/class-events/export-students-data/
Task: GYMAUTO-441
2.0.95
Allow pass null for instructor in class event update api:
POST - /api/v1/studios/class-events/{gym_class}/{date}/
Task: GYMAUTO-432
2.0.94
Change logic of membership payments generation. First payment date of membership is equal start date of membership, date for next payment will equal end date of previous membership
Task: GYMAUTO-398
2.0.93
Extend logic of calculate-price api:
POST - /api/v1/payment/payments/calculate-price/
Handle processed one-time discounts and return them in discounts_reduce_values field
Task: GYMAUTO-402
2.0.92
Add paid_reduced_price field to response of calculate-price api.
Task: GYMAUTO-396
2.0.91
Add reduced_price param to calculate-price api:
POST - /api/v1/payment/payments/calculate-price/
Task: GYMAUTO-395
2.0.90
Skip payment reduction when status of attendance is being updated and related payment status is PAID
Task: GYMAUTO-397
2.0.89
Added logic to reduce the final payment.
POST - /api/v1/payment/payments/make-payment/ - add reduced_price parameter
final payment price will be reduced by reduced_price value
Task: GYMAUTO-395
2.0.88
Change filtration by instructor at class-event-list api:
- replace
gym_class__instructorsparam withinstructorparam
Task: GYMAUTO-400
2.0.87
Modify endpoint for scheduler parent info export
GET - api/v1/studios/class-events/export-students-data/ - get text file with parent emails and filter data
Remove date range filters from export file. Extend export file name with date range data.
Task: GYMAUTO-389
2.0.86
Add endpoint for scheduler parent info export
GET - api/v1/studios/class-events/export-students-data/ - get csv file with parent emails and filter data
Task: GYMAUTO-389
2.0.85
Add medical_info field to class-event-detail endpoint
Task: GYMAUTO-392
2.0.84
Add class_event__instructor and class_event__instructor__in filters for
attendance-list api:
GET - api/v1/studios/attendance/ - get list of attendances at specified date range
Task: GYMAUTO-387
2.0.83
Add instructor field to Schedule and ClassEvent models.
Add start_date, end_date, start_time and end_time query params to
instructor-list endpoint for availability check.
Task: GYMAUTO-383
2.0.82
Fix issue of payments stuck with PROCESSING status and failed on stripe side.
Task: GYMAUTO-386
2.0.81
Add auto enrollment feature
If student cancels their class event and class event has an empty spot, the first waitlisted student by priority(attendance creation) will be enrolled into class event.
Task: GYMAUTO-385
2.0.80
Update logic related to attendance cancellation:
If attendance cancelled, then update one of related invoices price to zero. If attendance restored, then update one of related invoices with zero price to original base rate.
Task: GYMAUTO-381
2.0.79
Update logic related to student membership_date field update:
If membership_date updated to current year then create it at provided date.
If membership_date updated to past years then create membership for
past years and for future year in case if student has any enrollments
in date of renewal.
Task: GYMAUTO-378
2.0.78
Change membership generation task. If the user did not have any active classes in the month of membership renewal, then there is no need to renew the membership then
Task: GYMAUTO-378
2.0.77
Add field enrollment_ends to /api/v1/studios/attendance/ endpoint.
Task: GYMAUTO-373
2.0.76
Add new param ordering_nulls_last for ordering by date field at payments list endpoints:
GET-/api/v1/payment/payments/group-by-parent/GET-/api/v1/payment/payments/
If sorting in descending order, then null values will be last in order
Task: GYMAUTO-364
2.0.75
Add filters to gym class list endpoint:
GET-/api/v1/studios/gym-classes/
weekday__contains - filter by gym class weekdays
start_time__starts_with - filter by start_time starting string value
end_time__starts_with - filter by end_time starting string value
instructors_abbreviations__starts_with - filter by related instructor abbreviations starting
Task: GYMAUTO-358
2.0.74
Change logic of generating start_date and end_date
for student schedules at student detail endpoint:
GET-/api/v1/users/students/{id}Consider gym class dates: If student enrolled to all classes in provided months: if gym class start_date > first month first day, then start_date should equal gym class start_date if gym class end_date < last month last day, then end_date should equal gym class end_date
Consider canceled attendances If student enrolled to one month and has canceled attendances in it, then start_date and end_date should equal first and last not canceled attendances
If student enrolled more than one month: If canceled dates in first month, then start_date first not canceled attendance if canceled dates in last month, then end_date last not canceled attendance
Task: GYMAUTO-354
2.0.73
Change logic of generating enrollment_ends field for class-event detail endpoint:
GET-/api/v1/studios/class-events/<gym_class>/<date>/
enrollment_ends field have same value as generated end_date at student-detail endpoint
GET-/api/v1/users/students/{id}
Task: GYMAUTO-353
2.0.72
Change logic of generating start_date and end_date
for student schedules at student detail endpoint:
GET-/api/v1/users/students/{id}If student enrolled in all classes in enrolled months, then
start_dateshould equal the first day of enrollment month, andend_dateshould equal the last day of enrollment monthIf all attendances of student schedule have status
CANCELLED, thenstart_dateandend_dateshould equalNone.If student enrolled for more than one month, then
start_dateshould equal the first day of the month if student enrolled in all classes in the first month.If student enrolled partly in the first month, then
start_dateshould equal the date of the first attendance in the month.end_dateshould equal the last day of the month if student enrolled in all classes in the latest month.If the student enrolled partly in the latest month, then
end_dateshould equal the date of last attendance in the month.If there are cancelled attendances at the end then
end_datemust be last not cancelled attendance.
Task: GYMAUTO-352
2.0.71
Remove payments with zero price from output of payment list endpoints:
GET-/api/v1/payment/payments/group-by-parent/GET-/api/v1/payment/payments/
Task: GYMAUTO-350
2.0.70
Change logic of makeup credits.
If enroll student with makeup credits, then
- create
ClassEventInvoiceIteminstances withprice=0anduse_makeup_credit=Truefor all events, - create related
PaymentsGroupinstances withstatus=PAIDfor all payments, - reduce student credits to amount of events.
Task: GYMAUTO-349
2.0.69
Add new payment method CREDITS for PaymentsGroup model.
Add new field use_makeup_credit for ClassEventInvoiceItem model.
Change logic of student enrollment to class with use_makeup_credit = True:
- Create enrollment and invoices with
use_makeup_credit = Trueequal to count of student credits - Create related
PaymentsGroupinstance withstatus=PAIDfor payments where all related invoices haveuse_makeup_credit = True
Add total_credits_count field to calculate-price endpoint:
POST-/api/v1/payment/payments/calculate-price/
Prohibit add student to class with use_makeup_credit=True if student has less than 1 credit point at:
POST-/api/v1/studios/gym-classes/{id}/add-student/
Task: GYMAUTO-344
2.0.68
Change logic of add student at:
POST-/api/v1/studios/gym-classes/{id}/add-student/
If student have cancelled attendance at some date and we try to enroll him to same date and same class then new attendance with new status will be created
Add attendance_ids field to edit-students-schedule endpoint:
POST-/api/v1/studios/gym-classes/{id}/edit-students-schedule/
Since we modified logic of add-student we can have several attendances with same date, gym class and status.
So we need attendance id in edit-students-schedule to make it work properly with new logic
Modified constraint of StudentAttendance model: now we can't have instances with same class_event, student and status
if status!=CANCELED
Also moved out Status text choices class from StudentAttendance to make it accessible to StudentAttendance.Meta class.
And rename it to AttendanceStatus for better naming
Task: GYMAUTO-340
2.0.67
Change logic of generating start_date and end_date
for student schedules for hourly gym classes with custom prices at student detail endpoint:
GET-/api/v1/users/students/{id}If student enrolled to one day thenstart_dateandend_dateshould equal to one day.
If student enrolled more than to one day
and gym class start date month equal to month of student enroll
then start_date should equal to gym class start date.
If student enrolled more than to one day
and gym class start date month not equal to month of student enroll
then start_date should equal to first day of student schedule month.
If there're cancelled attendances at the end of student schedule
then end_date should equal to date of last not cancelled attendance.
If there're no cancelled attendances at the end of student schedule
then end_date should equal to last day of the student schedule month.
Task: GYMAUTO-341
2.0.66
Make schedule_list field required at add student to class endpoint:
POST-/api/v1/studios/gym-classes/{id}/add-student/
Add filtering by student_schedule_id to attendances list endpoint:
GET-/api/v1/studios/attendance/
Task: GYMAUTO-339
2.0.65
Change logic of generating end_date for student schedules at student detail endpoint:
GET-/api/v1/users/students/{id}
If related gym class works until the end of month which is last for student schedule, and last attendance not cancelled
Then display end_date should equal last day of this month.
If all attendances of student schedule have status CANCELLED
Then start_date and end_date should equal None.
If related gym class not works until the end of student schedule month
then end_date is last student attendance.
If there are cancelled attendances at the end then end_date must be
last not cancelled attendance.
Task: GYMAUTO-332
2.0.64
Change logic of generating start_date and end_date for student schedules at student detail endpoint:
GET-/api/v1/users/students/{id}
If related gym class works until the end of month which is last for student schedule, and last attendance not cancelled
Then display end_date should equal last day of this month.
If all attendances of student schedule have status CANCELLED
Then start_date and end_date should equal None.
In other cases end_date should equal last attendance date.
Task: GYMAUTO-329
2.0.63
New endpoint to cancel payments:
POST-/api/v1/payment/payments/cancel-payment/
Accept a parent ID and an array of payment IDs, similarly to the make payment endpoint.
When deactivating students, their current/past payments are now cancelled instead of being deleted.
Payments now have 2 more possible statuses: CANCELLED and REFUNDED.
Tasks: GYMAUTO-307, GYMAUTO-309
2.0.62
Add student__parent__name ordering for the grouped payments endpoint:
GET-/api/v1/payment/payments/group-by-parent/
Task: GYMAUTO-292
2.0.61
Change getting most expensive payment algorithm for several siblings.
If two or more students have same most expensive payment then we choose student with most total sum.
Task: GYMAUTO-306
2.0.60
New endpoint to return a CSV file with exported payment info:
GET-/api/v1/payment/payments/group-by-parent-export/
Accepts the same query parameters as the group-by-parent endpoint.
Task: GYMAUTO-292
2.0.59
Now when a Student is set to inactive, they are archived:
- future attendance is deleted
- unpaid class enrollments are deleted
- student schedule without attendance (after deleting future attendance) is deleted
- for the rest of student's schedules, set end date to today
Task: GYMAUTO-287
2.0.58
Change type of Payment objects date fields to datetime to avoid timezone-related issues. Note that names are kept the same.
GET-/api/v1/payment/payments/group-by-parent/- fielddateis now datetimeGET-/api/v1/payment/payments/-dateis now datetimeGET-/api/v1/users/students/fieldsmonthly_dueandmembership_dueare now datetime
Task: GYMAUTO-295
2.0.57
Support for multiple Stripe accounts. Using the Django admin panel, studios.Studio objects must now have the
stripe_account field set,
each djstripe.Account object must have a related WebhookEndpoint endpoint, and 2 related APIKey objects - secret
and publishable.
The get-setup-intent-secret endpoint is updated to also return the publishable_api_key value for frontend to use.
POST-/api/v1/studios/payments/get-setup-intent-secret/
See docs/INSTALL.md for guide on backend transition from djstripe 2.6.1 to djstripe 2.7.0rc2
Task: GYMAUTO-294
2.0.56
Change RECEIPT value for PaymentsGroup.payment_method to CHECK.
Add payments_group__payment_method filters (in and exact) for endpoints:
GET-/api/v1/payment/payments/payments/GET-/api/v1/payment/payments/group-by-parent/GET-/api/v1/payment/payments/total-price-for-grouped-by-parent/
Tasks: GYMAUTO-290, GYMAUTO-291
2.0.55
Sibling discounts update:
- Now reduce value calculates for each payment instead one reduce value from most expensive payment.
Task: GYMAUTO-293
2.0.54
Now discounts not applying on drop in fee enrollments
Task: GYMAUTO-286
2.0.53
Update discounts logic:
- Monthly discounts now applying to all payments
- Sibling discounts now depends on number of students in payments:
- 1 student - discount not applying
- 2 students - discount applying to most expensive price and received reduce value subtracts from all payments of student with most expensive class
- 3 and more students - discount applying to most expensive price and received reduce value subtracts from all payments except payments of student with the cheapest class
Task: GYMAUTO-283
2.0.52
Updated the daily task of creating memberships. Skip students, which have membership date in the future.
Task: GYMAUTO-282
2.0.51
Updated logic of autopay. Starting from the autopay start date, all payments up to the same day of the next month are collected and paid. If payments are added to the already entered autopay "cycle", they are paid as soon as possible (the task is ran once everyday).
Once the autopay day of a new month arrives, next month of payments is made.
Task: GYMAUTO-278
2.0.50
Updated logic of monthly amount discounts. Now they are applying on each class enrollment payment.
Task: GYMAUTO-266
unattended_classes_amount added to Parent
API updates:
POST-/api/v1/payment/payments/calculate-price/- addedused_unattended_classes_amountPOST-/api/v1/users/parents/{id}/- addedunattended_classes_amount
Task: GYMAUTO-264
2.0.49
Now drop in fee enrollment creates only if student added through scheduler
API updates:
POST-/api/v1/studios/gym-classes/{id}/edit-student-schedule/- if added to hourly class and student has membership date, then creates drop in fee enrolmentPOST-/api/v1/studios/gym-classes/{id}/add-student/- now can't create drop in fee enrollment
Task: GYMAUTO-258
2.0.48
Now not final discounts also has order.
API updates:
POST-/api/v1/payment/discounts/attach-discounts/- nowdiscountssaves in provided order- removed
sibling_monthly_discountsfromparent_datanow they stored inordinary_monthly_discounts
Task: GYMAUTO-256
2.0.47
API updates:
GET-/api/v1/payment/payments/group-by-parent/- now price is balance_due reduced by monthly discounts for not paid paymentsGET-/api/v1/payment/payments/total-price-for-grouped-by-parent/- now calculates with attention to monthly discounts
Task: GYMAUTO-257
2.0.46
API updates:
GET-/api/v1/payment/payments/total-price-for-grouped-by-parent/- added
Task: GYMAUTO-255
2.0.45
API updates:
GET-/api/v1/payment/payments/group-by-parent/- nowdateequals to paid date if payments were paid.
Task: GYMAUTO-255
2.0.44
API updates:
POST-/api/v1/payment/payments/make-payment/- removed fieldcalculated_pricePOST-/api/v1/payment/payments/calculate-price/- added
Task: GYMAUTO-250
2.0.43
Added error code description and next step.
API updates:
GET-/api/v1/payment/payments/- added fieldsstripe_error_description,stripe_error_next_stepGET-/api/v1/payment/payments/group-by-parent/- added fieldsstripe_error_description,stripe_error_next_step
Task: GYMAUTO-245
2.0.42
Added new flag for discount is_sibling.
is_sibling and is_final can't be set for one discount.
Sibling discount applies to most expensive class enrollment.
Logic example
Payments:
Class enrollment 1 - 10$
Class enrollment 2 - 20$
Discounts:
Discount 1 - default 20%
Discount 2 - sibling 10%
Then final price will calculate this way:
# Firstly we calculate reduced price of most expensive class enrollment most_expensive_class_enrollment_price = 20$ - (20$ * 0.1)) = 18$ # Then we sum this price with other class enrollments prices new_sum = 18$ + 10$ = 28$ # Then we applying other discounts to this sum result = 28$ - (28$ * 0.2) = 22.4$
API updates:
POST-/api/v1/payment/discounts/- added new fieldis_siblingGET-/api/v1/payment/discounts/- added new fieldis_siblingGET-/api/v1/payment/discounts/{id}/- added new fieldis_sibling
Task: GYMAUTO-243
2.0.41
Now membership price excluded from discounts calculations.
Example
Payments:
Class enrollment 10$
Membership payment 10$
Use discount 10%. Then final price will calculate this way
final_price = 10$ - (10$ * 0.1%) + 10$ = 19$
API updates:
GET-/api/v1/payment/payments/- added fieldapplies_discountsGET-/api/v1/payment/payments/group-by-parent/- fieldapplies_monthly_discounts_listrenamed toapplies_discounts_list
Task: GYMAUTO-240
2.0.40
Removed stretching of class enrollments. Reworked calculations for multi hourly and multi hourly mandatory classes:
- now price for one event calculates this way:
price = per week rate / number of classes in month
API updates:
POST-/api/v1/studios/gym-classes/- now for multi hourly mandatory must be only oneclass_pricingwithdaysequals to number of days in week.
Task: GYMAUTO-240
2.0.39
Now there are no limit for final discounts count, so implemented logic of ordering of final discounts. Added ability to set order by user.
Order logic:
- firstly applied sorted monthly discount
- and then one time final discounts in provided order.
API updates:
POST-/api/v1/payment/discounts/attach-discounts/- added fieldfinal_discount. They will be saved in provided order.GET-/api/v1/users/parents/- fieldmonthly_discountschanged to two separate fieldsordinary_monthly_discountsandfinal_monthly_discounts(not ordered).POST-/api/v1/payment/payments/make-payment/- added fieldfinal_discountsaccepts only final one-time discounts. Now it's forbidden to provide final discounts todiscounts.
Task: GYMAUTO-236
2.0.38
POST-/api/v1/payment/payments/make-payment/- fieldfinal_discountsremoved. now it should be provided indiscountsfield. Firstly applies monthly final discount and then one-time final discount. Will raise error if more then one final discount provided.POST-/api/v1/payment/discounts/- removed discount typeFINAL, added fieldis_final.POST-/api/v1/payment/attach-discounts/- will raise error if more then one final discount provided.
Task: GYMAUTO-230
2.0.37
POST-/api/v1/studios/gym-classes/- nowdrop_in_fee_costrequired only for per_hour_custom
Now drop in fee counts for single class if student has membership date.
Task: GYMAUTO-235
2.0.36
POST-/api/v1/studios/gym-classes/{id}/add-student/- now doesn't create payments ifuse_makeup_creditis True
Task: GYMAUTO-215
2.0.35
Now all make payments are processing through PaymentsGroups. That
means that all discounts applying to PaymentGroup instead of applying
them to each payment.
GET-/api/v1/payment/payments/- added fieldpayments_group_id. Also added filterpayments_group_id.GET-/api/v1/payment/payments/group-by-parent/- added fieldpayments_group_idPOST-/api/v1/payment/payments/payments/approve-receipt/- now acceptspayments_group_idPOST-/api/v1/payment/payments/payments/decline-receipt/- now acceptspayments_group_id
Task: GYMAUTO-225
2.0.34
GET-/api/v1/payment/payments/- added fieldschedulefor membership payments it'sNone. Start/end date it's start/end of ClassEnrolment
Task: GYMAUTO-220
2.0.33
Now When recording a student on any day of the month (possibly on the 1st or 30th), the accrual must be formed for the month (including all classes attended and all that were before the recording) The exception is the beginning of the class. If the class is not formed from the first day of the month.
Task: GYMAUTO-215
2.0.32
Updated logic of class pricing.
- added new pricing type -
PER_HOUR_CUSTOM days_in_weekchanged todaysbecause it will be used inPER_HOUR_CUSTOMtoo
Description of PER_HOUR_CUSTOM type:
number of class prices must be 6:
- trial class - days=1
- single class - days=1
- 2 classes - days=2
- 3 classes - days=3
- 4 classes - days=4
- 5 classes - days=5
base_rate,daysandis_trial_class_costmust be setprice for one month depends on number of class_events in this period
POST-/api/v1/studios/gym-classes/-class_pricinghas updated fields, see description above
Task: GYMAUTO-208
2.0.31
Added new field to Payment - stripe_error_code this field will store
error that can occur on make payment.
Added ability to bulk make payment
POST-/api/v1/payment/payments/payments/make-payment/- now bulkPOST-/api/v1/payment/payments/payments/approve-receipt/- now bulkPOST-/api/v1/payment/payments/payments/decline-receipt/- now bulkGET-/api/v1/payment/payments/group-by-parent/- added fieldsreceipt_numberandstripe_error_code.GET-/api/v1/payment/payments/- added fieldstripe_error_code.
Task: GYMAUTO-209
2.0.30
Make membership_date for Student optional. But it is required if we want to
add student to class for multiple days.
Task: GYMAUTO-219
2.0.29
Add new discount type FINAL. It should be applied as the last one, and it can be
applied only on class enrollments.
Task: GYMAUTO-212
2.0.28
Payment:
- new fields
final_priceanddate_paid
Added grouping by parents with filtering by dates.
GET-/api/v1/payment/payments/group-by-parent/- added new endpoint.date- earlier payment due of payments ordate_paid. To get details just pass ids as filter to/api/v1/payment/payments/.GET-/api/v1/payment/payments/payments/- nowfinal_priceandbalance_dueare one field -price. New fielddateispayment_dueordate_paidif payment is paid
Task: GYMAUTO-209
2.0.27
Now all location fields moved from student to parent.
GET-/api/v1/users/students/{id}/-city,address,city_data,state_dataandzip_codemoved toparent_dataPOST-/api/v1/users/students/-city,addressandzip_coderemovedPOST-/api/v1/users/parents/-city,addressandzip_codeaddedGET-/api/v1/users/parents/- now returns full parent dataGET-/api/v1/users/parents/{id}/- now returns full parent data
Task: GYMAUTO-205
2.0.26
POST-/api/v1/users/parents/{id}/set-autopay-payments- restoredPOST-/api/v1/users/parents/{id}/unset-autopay-payments- restored
Task: GYMAUTO-180
2.0.25
POST-/api/v1/users/parents/{id}/set-autopay-payments- removedPOST-/api/v1/users/parents/{id}/unset-autopay-payments- removed
Now to set autopay need to provide data to payment method metadata:
is_autopay_payments_enabled- boolautopay_payments_start_date- date sting, formatYYYY-MM-DDPOST-/api/v1/payment/payments/detach-card/- unset autopay
Task: GYMAUTO-195
2.0.24
POST-/api/v1/payment/discounts/attach-discounts/- now overrides all parent's monthly discounts.
2.0.23
POST-/api/v1/payment/discounts/attach-discounts/- can raise error if provided already attached discountPOST-/api/v1/payment/payments/make-payment/- now discounts can repeatGET-/api/v1/users/students/{id}/-payment_datanow containsdefault_payment_methodfield with all data needed for front(cardholder name inbilling_details)
2.0.22
POST-/api/v1/users/parents/{id}/toogle-autopay-paymentsremovedPOST-/api/v1/users/parents/{id}/set-autopay-payments- can raise 403 if parent has no card, or if autopay payments setPOST-/api/v1/users/parents/{id}/unset-autopay-payments- can raise 403 if autopay payments isn't set
Task: GYMAUTO-202
2.0.21
POST-/api/v1/payment/payments/detach-card/- new endpoint
Task: GYMAUTO-202
2.0.20
GET-/api/v1/users/students/- added new fieldsmembership_dueit can be(in order):- None if no membership exist for this student
- date of first unpaid membership
- date of last paid membership + one year
monthly_dueit can be(in order):- None if no class enrollments exist for this student
- date of first unpaid class enrolment
- date of last paid class enrolment
is_membership_unpaid:Trueandmembership_duedate in past, date must be highlighted with red
is_enrolment_unpaid:Trueandmonthly_duedate in past, date must be highlighted with red
Task: GYMAUTO-197
2.0.19
Added monthly discount processing:
POST-/api/v1/payment/payments/{id}/make-payment/now expects only one-time discounts, monthly discounts will be applied automatically.POST-/api/v1/payments/discounts/attach-discounts/uses for attaching monthly discounts to parent.
Added autopay of payments:
POST-/api/v1/users/parent/{id}/toggle-autopay-payments/- it will return 403 if parent has no card.GET-/api/v1/users/students/- now contains fieldis_autopay_payments_enabledinparent_dataGET-/api/v1/users/students/{id}/- now contains fieldis_autopay_payments_enabledandmonthly_discountsinparent_data
Added new status to payment - FAILED. It will be set
if payment failed during autopay.
Task: GYMAUTO-189
2.0.18
GET-/api/v1/payment/discounts/- added filter by type
Updated receipt payments processing.
GET-/api/v1/payment/payments/- now contains fieldreceipt_numberPOST-/api/v1/payment/payments/{id}/make-payment/- now contains fieldreceipt_number. It must be provided only for receipt payment, otherwise it will raise error.
Added endpoint
POST-/api/v1/payment/payments/{id}/decline-receipt/
Task: GYMAUTO-189
2.0.17
Added API for create SetupIntent
POST-/api/v1/studios/payments/get-setup-intent-secret/
Task: GYMAUTO-189
2.0.16
Now if student added to hourly gym class in which he wasn't enrolled in then to default class event price drop in fee will be added.
It can occur in:
POST-/api/v1/studios/gym-classes/{id}/edit-student-schedule/- also it will raise 403 if class has no price (FOR FRONTEND DEVELOPERS: PLEASE SHOW THIS ERROR IN UI)POST-/api/v1/studios/gym-classes/{id}/add-student/
Task: GYMAUTO-189
2.0.15
Added membership.
Membership creates for every year from student's membership date and it's just a membership fee and doesn't affect any application logic.
Changed endpoints:
POST-/api/v1/studios/studios/added fieldmembership_costGET-/api/v1/studios/studios/added fieldmembership_costGET-/api/v1/payments/payments/now also returns membership paymentsPOST-/api/v1/users/students/fieldmembership_dateis required. It will raise 403 if studio has nomembership_cost(FOR FRONTEND DEVELOPERS: PLEASE SHOW THIS ERROR IN UI)PUT-/api/v1/users/students/{id}/fieldmembership_dateis required
Task: GYMAUTO-189
2.0.14
Now if student schedule was deleted and ClassEnrolment wasn't paid
then ClassEnrolment deletes.
If can occur in:
POST-/api/v1/studios/gym-classes/{id}/delete-student-schedule/POST-/api/v1/studios/gym-classes/{id}/edit-student-schedule/- if days changed.
Task: GYMAUTO-189
2.0.13
Added API for make payment:
POST-/api/v1/payments/{id}/make-payment/payment can be paid in 3 different ways:- card: card must be added to parent.
- cash: payment status will be set to
PAID - receipt: payment status will be set to
PROCESSING
Added API to approve receipt:
POST-/api/v1/payments/{id}/approve-receipt/
Added API to connect card:
POST-/api/v1/payments/connect-card/- this will create Stripe Checkout Session and return it.
Task: GYMAUTO-188
2.0.12
Added API for payment history:
GET-/api/v1/payments/payments/list of all payments in studio, to get list for student passstudent_idquery param
Task: GYMAUTO-189
2.0.11
Updated endpoint:
POST-/api/v1/studios/gym-class/{id}/add-student/now will raise permission error if class has no price (FOR FRONTEND DEVELOPERS: PLEASE SHOW THIS ERROR IN UI)
Task: GYMAUTO-189
2.0.10
Now when user is added to the class, payments for each month are created for him
Task: GYMAUTO-185
2.0.9
Changed endpoints:
GET-/api/v1/users/students/{id}/addedmilitary_proofsandmilitary_proofs_uploaded_atfieldsPOST-/api/v1/users/students/{id}/addedmilitary_proofsfield
Task: GYMAUTO-174
2.0.8
- Field
notesreturned toStudent - StudentNotes renamed to StudentCommunicationLogs
GET-/api/v1/users/student/{id}/now returns all student's communication logs incommunication_logsfield.- changed
student-notestocommunication-logspostfix in all endpoints:GET-/api/v1/users/student-notes/GET-/api/v1/users/student-notes/{id}/POST-/api/v1/users/student-notes/PUT-/api/v1/users/student-notes/{id}/PATCH-/api/v1/users/student-notes/{id}/DELETE-/api/v1/users/student-notes/{id}/
Task: GYMAUTO-167
2.0.7
Changed endpoints:
GET-/api/v1/users/studio-users/added is_active filter
Task: GYMAUTO-176
2.0.6
- Add logic with holidays
Changed endpoints:
POST-/api/v1/studios/gym-classes/{id}/edit-students-schedule/now will return error if passedevent_datewill be on holiday.GET-/api/v1/studios/class-events/{gym_class}/now don't return events on holidaysGET-/api/v1/studios/class-events/{gym_class}/{date}/now don't return events on holidaysPOST-/api/v1/studios/class-events/{gym_class}/{date}/attendance/now will return 404 if passed event date will be on holiday.
Task: GYMAUTO-172
2.0.5
- Added history of gym class prices at admin page.
Task: GYMAUTO-173
2.0.4
- Add Parent table fields
email,parent_name,phone,home_phonewere moved from Student to Parent.
Need to update students creation and listing
Endpoints:
added
GET-/api/v1/users/parents/get all parents.added
POST-/api/v1/users/parents/create new parent.added
PUT-/api/v1/users/parents/{id}/update parent.added
PATCH-/api/v1/users/parents/{id}/partial update parent.updated
GET-/api/v1/users/students/addedparent_datafield andemail,parent_name,phone,home_phonewere moved to it.updated
POST-/api/v1/users/students/addedparentthat must be id of some already existing parent.
Task: GYMAUTO-174
2.0.3
- Add HolidaySchedule model
- Holidays can be repeatable and not repeatable. If year set, that means that holiday is not repeatable.
New endpoints:
GET-/api/v1/studios/holidays/get all existing holidays.GET-/api/v1/studios/holidays/dates-between/get holiday dates between some dates gap. Use this endpoint to get holidays for schedule.GET-/api/v1/studios/holidays/{id}/retrieve holiday.POST-/api/v1/studios/holidays/{id}/create holiday.DELETE-/api/v1/studios/holidays/{id}/archive holiday.
Task: GYMAUTO-166
2.0.2
- Add ClassPrice model
GET-/api/v1/studios/class-prices/.- updated endpoint
GET-/api/v1/studios/gym-classes/now also containsclass_pricing - updated endpoint
GET-/api/v1/studios/gym-classes/{id}/now also containsclass_pricing - updated endpoint
POST-/api/v1/studios/gym-classes/addedclass_pricing - updated endpoint
PUT-/api/v1/studios/gym-classes/addedclass_pricing
Task: GYMAUTO-165
2.0.1
- Add StudentNote model
GET-/api/v1/users/student/{id}/now returns all student's notes innotesfield.- added endpoint
POST-/api/v1/users/student-notes/for notes creation - added endpoint
DELETE-/api/v1/users/student-notes/for notes deletion
Task: GYMAUTO-167
2.0.0
- add api for discounts
GET-/api/v1/payment/discount/POST-/api/v1/payment/discount/GET-/api/v1/payment/discount/{id}/DELETE-/api/v1/payment/discount/{id}/(makes discount inactive)
Task: GYMAUTO-164
1.0.9
- Make code-filter for class event case-insensitive and add filter
startswith - Add api endpoint to get gym classes' codes
GET-/api/v1/studios/gym-classes/list-codes/
Task: GYMAUTO-158
1.0.8
Add enrollment_ends to StudentAttendance. It is calculated from the last student schedule for and the last event
for class in DB. Between the two, we pick the one that is later than the other.
Also fix performance issue with attendance generation
Task: GYMAUTO-155
1.0.7
Add API method to remove student schedule. It can delete GymClassStudentSchedule instance, but only
when all student's attendance in past or today is canceled.(we ignore attendance for future events). Also, it
allows to delete singular events that were added manually, same validation logic: if it is in the past, or today it
should be canceled.
- POST
/api/v1/studios/gym-classes/{id}/delete-student-schedule/- Delete student schedule
Task: GYMAUTO-154
1.0.6
Set default ordering for instructors to first_name in instructors api
Task: GYMAUTO-152
1.0.5
Fix bug when with have class with event in future that in db. And manager adds student to
that class for period that doesn't contain event in db. Result would be that student would be added to that event, but it's student_schedule_data won't make sense,
and it shouldn't be added in first place.
Task: GYMAUTO-150
1.0.4
Add filter by class code for ClassEvent API
Task: GYMAUTO-146
1.0.3
Add schedule_list_data to api/v1/users/students/{id}
schedule_list_data objects contain:
idbyweekdaystart_timeend_time
Task: GYMAUTO-141
1.0.2
Add ordering by weekdays and start times in classes api
_weekdays- order by schedules' weekdays_start_times- order by schedules' start times
Task: GYMAUTO-137
1.0.1
Fix date range filtration in class event and attendance API
Task: GYMAUTO-135
1.0.0
Initial release
Task: GYMAUTO-99
0.0.51
Prepare admin for students import and extend django_cities_light
- Prepare admin, form and resource which will be used in
student import. - Extend
django_cities_light, to include cities with population of500, allow adding/edit/delete cities, improve performance indjango_cities_light's admin panels.
Task: GYMAUTO-124
0.0.50
Change validation for date range when we are adding student.
Now the length of range doesn't matter(event one day range is allowed),
now it matters if there are any events for picked schedules on this date range.
If not we return an error.
Task: GYMAUTO-120
0.0.49
Changes to how we act on schedule change in gym_class when we have students in it.
If student is enrolled to multi-hourly class and one of schedules
change, we need to set end_date to the current date for
all students schedules, including active schedules. But for student
schedules for active schedules(not edited), we create a new one
starting from next day and ending when the old one is supposed to
end. Student attendance for future events should reference a new
student schedule.
Task: GYMAUTO-109
0.0.48
Remove COMPETITIVE_TEAM program from GymClass
Task: GYMAUTO-105
0.0.47
Add validation of enrolled students count in api/v1/studios/class-events/{gym_class}/{date}/attendance/.
Now we prevent cases when there more enrolled students that max_students of gym_class
Task: GYMAUTO-104
0.0.46
- Make all
student schedulesbearchivedonmandatory/competitiveclass schedule editing - Make all
student schedulesbearchivedif class becamemandatory/competitive - Fix
creditusage inEditStudentSchedule - Extend
student scheduledata withschedule listofids - Add
schedulefilters toclass_eventsandattendanceapi
Task: GYMAUTO-95
0.0.45
Merge
start_dateandend_dateofGymClassStudentScheduleintodate_range. Add constraint forbidding overlaps inGymClassStudentScheduleFix bug with adding student with added event in the future.
Task: GYMAUTO-101
0.0.44
Make Student as non-user based model
- Make
emailinStudentmodel non-unique - Remove
statefield inStudentmodel - Update student admin pane
Also: set up ReadOnlyInProductionMixin for several admins
Task: GYMAUTO-97
0.0.43
Update schedule archiving
During schedule archiving, student schedule is deleted if it has no events.
Task: GYMAUTO-95
0.0.42
Allow negative values in EditStudentMakeUpCredit
Task: GYMAUTO-70
0.0.41
Make GymClass keep track of order of instructors
Task: GYMAUTO-86
0.0.40
Add studio filter and field for Instructor API.
Task: GYMAUTO-51
0.0.39
Add code to StudentScheduleListSerializer
Task: GYMAUTO-72
0.0.38
When instructor becomes inactive, instructor will be auto removed from class.
Task: GYMAUTO-44
0.0.37
Reworked Schedule model, now dtstart and until are spilt into
start_date, start_time and end_date, end_time. It will make easier for
us and for frontend to manipulate and validate schedule.
Task: GYMAUTO-85
0.0.36
Add schedule.gym_class_program for the Student retrieve endpoint.
Task: GYMAUTO-72
0.0.35
Add schedule ID for several endpoints for classes and class events.
Task: GYMAUTO-56
0.0.34
Forbid empty instructors and schedule in class api creation/editing
Task: GYMAUTO-79
0.0.33
Validation and archive logic adjustments for Schedule
- Now schedule won't be
archivedwhendtstartanduntilhas only changed it dates. But we forbid change if we have student enrolled to class, whichdatesareoutsideof class(for exampleend_dateis afteruntilofschedule) - On archiving we remove created events in future and set end date of student schedules to current date.
- Fix validation of
scheduleagainstoperation hours(now it adjusts to timezone of studio)
Task: GYMAUTO-79
0.0.32
Make makeup_credits read-only for Student create/update/retrieve endpoints.
Task: GYMAUTO-63
0.0.31
Add abbreviation to GymClassInstructorSerializer
Task: GYMAUTO-51
0.0.30
Forbid setting date_of_birth for Student in future
Task: GYMAUTO-75
0.0.29
- Add
phonetoStudentSerializer - Add
student_schedule_datatoStudentAttendanceSerializer
Task: GYMAUTO-49
0.0.28
Add class_event__gym_class filter to /api/v1/studios/attendance/ endpoint
Task: GYMAUTO-63
0.0.27
Add studio_data for Users in 2 endpoints:
- GET
/api/v1/users/users/profile/- Retrieve Profile - POST
/api/v1/auth/login/- Log In
Task: GYMAUTO-67
0.0.26
Make contract in Student nullable
Task: GYMAUTO-7
0.0.25
Restrict Frequency in Schedule
Removed HOURLY, MINUTELY, SECONDLY
Task: GYMAUTO-11
0.0.24
Add region and region_data fields to CitySerializer
Task: GYMAUTO-39
0.0.23
GET-/api/v1/users/students/{id}/update the Student retrieve endpoint
Now includes a read-only contract_uploaded_at datetime field,
which is set whenever a new contract is uploaded.
Will be set to null if contract is unset.
Task: GYMAUTO-69
0.0.22
GET-/api/v1/users/students/{id}/update the Student retrieve endpoint
Now includes a schedule array, which supports a new filter - active_schedule:
trueexcludes schedule for finished classesfalsereturns only schedule for finished classes
Without it, returns all classes.
Task: GYMAUTO-64
0.0.21
Set up Makeup Credits system for student. It's simple and very straight-forward.
POST - /api/v1/users/students/{id}/edit-makeup-credits/ Update students credits
Make use_makeup_credit work in endpoint related to editing attendance, and adding student
to class. For each added event (ENROLLED orWAITLISTED) student loses one credit(can go below
zero), and for each removed event(CANCELED) student receives one credit. There are no restrictions
for now(only on front-end).
Task: GYMAUTO-68
0.0.20
Make /api/v1/studios/class-events/{gym_class}/{date}/attendance work in bulk. Refactor
attendance create/update logic.
Task: GYMAUTO-65
0.0.19
Add param to /api/v1/studios/class-events/ (include_attendance), so that api users could get events with
attendance.
Refactor tests
Task: GYMAUTO-62
0.0.18
Make /api/v1/studios/class-events/{gym_class}/{date}/attendance enroll student to
all events of gym studio on week, if program is MANDATORY
Task: GYMAUTO-26
0.0.17
Add API for adding/removing student for class events of GymClass
POST - /api/v1/studios/gym-classes/{id}/edit-students-schedule/ To edit student's class schedule
To remove student set to_add to false
Example of request:
[
{
"class_date": "2023-01-04",
"student": 18,
"to_add": true
},
{
"class_date": "2023-01-25",
"student": 18,
"to_add": false
}
]
Task: GYMAUTO-62
0.0.16
Update API to get a list of GymClass objects
GET - /api/v1/studios/gym-classes/
Supports 2 new filters:
without_student-StudentID to exclude Classes he's already added to.no_past- providetrueto exclude past Classes.
Add API to add a Student to a GymClass
POST - /api/v1/studios/gym-classes/{id}/add-student/
Available to Managers. GymClass can not be past - its end_date should be in the future.
student must be active, of the same studio.
If he already has lessons for this class, the submitted dates can not overlap.
They can overlap for MULTI_HOURLY, if previously unselected days are chosen.
start_date and end_date must be at least 6 days apart, and within GymClass dates.
schedule_list as a list of Schedule objects' IDs is only validated for MULTI_HOURLY classes.
The field is still required for other types of classes, but can be null or [].
use_makeup_credit is currently unused, non-required, and defaults to False.
Task: GYMAUTO-60
0.0.15
Add API for listing StudentAttendance of Student for period of time
GET - /api/v1/studios/attendance/ List attendance for period of time
It has several params:
class_event__date__gte-Start of period (required)class_event__date__lte-End of period (required)student- filter by student
Also:
- Allow admin view
class-eventsapi - Add period restrictions(one year max) to
class-eventsandattendanceAPI
Task: GYMAUTO-34
0.0.14
Add API for editing attendance info of ClassEvent
POST - /api/v1/studios/class-events/{gym_class}/{date}/attendance Create/Edit attendance
Example of request
{
"student": 24,
"status": "ENROLLED",
"attended": true
}
status can be null(if you are adding student it will be set depending on if there are any empty spots
in class). If you change attendance info in the future, then generate class event will be created with
attendance in db.
Task: GYMAUTO-26
0.0.13
Updated Studio Users read endpoints:
GET-/api/v1/users/studio-users/GET-/api/v1/users/studio-users/{id}/
Now includes a read-only studio_data field, which contains studio id and name.
0.0.12
Updated Instructor's detail page - GET - /api/v1/users/instructors/{id}/
It now hides past classes - classes without upcoming events.
Add membership_date field for Student users.
Can be used for Students list filtering, displayed and edited (only by Manager) on Student detail page.
Task: GYMAUTO-35
0.0.11
Add API for retrieving ClassEvent with student attendance.
GET - /api/v1/studios/class-events/{gym_class}/{date}/ get full class event info
Additional info about events and attendance generation:
ClassEvent is generated, when user of api attends to get it from future(celery task(generate_passed_events)
generates events from past). Event can be generated only if there matching schedule for it, if not then404 will be
returned.
StudentAttendance is generated based on GymClassStudentSchedule(of how many students were assigned to GymClass)
for ClassEvent's date period. Status of StudentAttendance is determined in following way, the first students
before reaching max_students of GymClass, will be ENROLLED, the rest will be WAITLISTED.
Celery task generate_passed_events generates ClassEvent that are in the past. It uses same logic described above.
The only difference, is that it saves it in db.
Task: GYMAUTO-26
0.0.10
Add API for getting ClassEvent
GET - /api/v1/studios/class-events/ view all class events (studio users only)
It has several params:
date__gte-Start of period (required)date__gte-End of period (required)gym_class__instructors- filter by instructorgym_class__program- filter by programgym_class__studio- filter by studio
Task: GYMAUTO-25
0.0.9
Add Create/Read/Update operations for Studio Users to work with Students. All operations are available to Managers, only Read operations are available to Staff.
GET-/api/v1/users/students/list studentsGET-/api/v1/users/students/{id}/retrieve a single studentPOST-/api/v1/users/students/create a student (Manager)PUT/PATCH-/api/v1/users/students/update a student (Manager)
Remove Admin permissions for instructors endpoints - now only Managers can create/edit.
Add a studio foreign key for instructors, similar to students.
When Studio Users list/retrieve instructors and students, results are filtered
to show only theirs Studio's users.
When a Manager creates instructors and students, his Studio is used for new objects.
Update the Student model to make additional fields optional.
Make phone field non-unique for all types of users.
Task: GYMAUTO-15
0.0.8
Add endpoint for getting base user info
GET-/api/v1/users/users/profile/Get info about user, same as info alter login
Task: GYMAUTO-13
0.0.7
Add API for viewing/creating/editing GymClasses
GET-/api/v1/studios/gym-classes/view all gym classes (manager/staff)POST-/api/v1/studios/gym-classes/create new gym class (manager only)GET/PUT/PATCH-/api/v1/studios/gym-classes/{id}/view/edit gym classes(manager view/edit, staff view)
For now, we have the following schedule validations:
- We're checking that schedule is valid for studio's operation hours
- We're checking that schedule is not overlapping with schedules from other studio's classes
- We're checking that schedules of class is not overlapping with each other
- We're checking that schedule of instructor in not overlapping with its schedules from other classes
Task: GYMAUTO-17
0.0.6
Add Create/Read/Update operations for Admins and Studio Users to work with instructors, and a view for instructors to access their profiles.
Studio Users with role STAFF can only retrieve/list instructors; with role MANAGER can in addition create and update instructors.
Add a restriction for both Admins and Managers - can not set Instructor's is_active field
to False if he has classes without other instructors assigned to it - classes,
where he's the last instructor.
Task: GYMAUTO-10
0.0.5
Add info about user in login response(user field of Token). Also added tests for
password reset workflow.
Task: GYMAUTO-8
0.0.4
Add API for viewing/creating/editing Studios
GET-/api/v1/studios/studios/view all studios (admin only)POST-/api/v1/studios/studios/create new studio (admin only)GET/PUT/PATCH-/api/v1/studios/studios/{id}/view/edit studios(admin only)
Task: GYMAUTO-12
0.0.3
Add API for viewing/creating/editing StudioUser
GET-/api/v1/users/studio-users/view all studio users (admin only)POST-/api/v1/users/studio-users/create new studio users (admin only)GET/PUT/PATCH-/api/v1/users/studio-users/{id}/view/edit studio user(admin only)GET-/api/v1/users/studio-users/profile/get current user profile
Task: GYMAUTO-9
0.0.2
Set up Studios App
- Add models
Studio,OperationHour,GymClass,ClassEvent,GymClassStudentSchedule,StudentAttendance - Set up admin panels
- Set up factories
Task: GYMAUTO-11
0.0.1
Set up Users App
- Add models
StudioUser,Instructor,Student - Set up admin panels
- Set up factories
Task: GYMAUTO-7
0.0.0
Project initialise
Task: GYMAUTO-20