Skip to content

Commit

Permalink
Merge pull request #595 from SuperCoopBerlin/fix_resignation_transfer…
Browse files Browse the repository at this point in the history
…_shares_created_on_same_day

This would mean that on the resignation day, there are two shares active for each transferred share.
The created shares should start a day after.
  • Loading branch information
Theophile-Madet authored Dec 11, 2024
2 parents 466497b + fb88a46 commit 338b3b2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion tapir/coop/services/membership_resignation_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ def update_shifts_and_shares_and_pay_out_day(
shares_to_create = [
ShareOwnership(
share_owner=resignation.transferring_shares_to,
start_date=resignation.cancellation_date,
start_date=resignation.cancellation_date
+ datetime.timedelta(days=1),
transferred_from=share,
)
for share in shares
Expand Down
2 changes: 1 addition & 1 deletion tapir/coop/tests/membership_resignation/test_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def test_updateShiftsAndSharesAndPayOutDay_resignationTypeTransfer_newSharesCrea
self.assertIsNone(share.transferred_from)
continue
self.assertEqual(None, share.end_date)
self.assertEqual(self.TODAY, share.start_date)
self.assertEqual(self.TODAY + datetime.timedelta(days=1), share.start_date)
self.assertIn(share.transferred_from, gifting_member.share_ownerships.all())
shares_of_gifting_member.remove(
share.transferred_from
Expand Down

0 comments on commit 338b3b2

Please sign in to comment.