Skip to content

Commit

Permalink
🔖(minor) release minor version of joanie
Browse files Browse the repository at this point in the history
Added
- Debit installment on pending order transition if due date is on current day
- Display order credit card detail in the back office
- Send an email reminder to the user when an installment
  will be debited on his credit card on his order's payment schedule
- Send an email to the user when an installment debit has been
  refused
- Send an email to the user when an installment is successfully
  paid
- Support of payment_schedule for certificate products
- Display payment schedule in contract template

Changed
- Updated `OrderPaymentScheduleDecoder` to return a `date` object for
  the `due_date` attribute and a `Money` object for `amount` attribute
  in the payment_schedule, instead of string values
- Bind payment_schedule into `OrderLightSerializer`
- Generate payment schedule for any kind of product
- Sort credit card list by is_main then descending creation date
- Rework order statuses
- Update the task `debit_pending_installment` to catch up on late
  payments of installments that are in the past
- Deprecated field `has_consent_to_terms` for `Order` model
- Move signature fields before appendices in contract definition template
- Update `handle_notification` signature backend to confirm signature

Fixed
- Prevent duplicate Address objects for a user or an organization

Removed
- Remove the `has_consent_to_terms` field from the `Order` edit view
  in the back office application
  • Loading branch information
jbpenrath committed Oct 16, 2024
1 parent 6c7a6bb commit a46769f
Show file tree
Hide file tree
Showing 23 changed files with 1,566 additions and 765 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ and this project adheres to

## [Unreleased]

## [2.8.0] - 2024-10-16

### Added

- Debit installment on pending order transition if due date is on current day
Expand Down Expand Up @@ -450,7 +452,8 @@ and this project adheres to
- First working version serving sellable micro-credentials for multiple
organizations synchronized to a remote catalog

[unreleased]: https://github.com/openfun/joanie/compare/v2.7.1...main
[unreleased]: https://github.com/openfun/joanie/compare/v2.8.0...main
[2.8.0]: https://github.com/openfun/joanie/compare/v2.7.1...v2.8.0
[2.7.1]: https://github.com/openfun/joanie/compare/v2.7.0...v2.7.1
[2.7.0]: https://github.com/openfun/joanie/compare/v2.6.1...v2.7.0
[2.6.1]: https://github.com/openfun/joanie/compare/v2.6.0...v2.6.1
Expand Down
2 changes: 1 addition & 1 deletion arnold.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# arnold.yml
metadata:
name: joanie
version: 2.7.1
version: 2.8.0
source:
path: src/tray
8 changes: 4 additions & 4 deletions src/backend/joanie/tests/core/tasks/test_payment_schedule.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,11 +353,11 @@ def test_payment_scheduled_send_mail_reminder_installment_debit_task_full_cycle(
first_name="John",
last_name="Doe",
email="john.doe@acme.org",
language="fr-fr",
language="en-us",
)
UserAddressFactory(owner=owner_1)
owner_2 = UserFactory(
first_name="Sam", last_name="Doe", email="sam@fun-test.fr", language="fr-fr"
first_name="Sam", last_name="Doe", email="sam@fun-test.fr", language="en-us"
)
UserAddressFactory(owner=owner_2)
order_1 = OrderGeneratorFactory(
Expand Down Expand Up @@ -431,7 +431,7 @@ def test_payment_scheduled_send_mail_reminder_installment_debit_task_full_cycle(
self.assertIn(f"Hello {fullname_1}", email_content_1)
self.assertIn("installment will be withdrawn on 2 days", email_content_1)
self.assertIn("We will try to debit an amount of", email_content_1)
self.assertIn("3,5", email_content_1)
self.assertIn("3.5", email_content_1)
self.assertIn("Product 1", email_content_1)

# Trigger now the task `send_mail_reminder_installment_debit_task` for order_2
Expand All @@ -447,5 +447,5 @@ def test_payment_scheduled_send_mail_reminder_installment_debit_task_full_cycle(
self.assertIn(f"Hello {fullname_2}", email_content_2)
self.assertIn("installment will be withdrawn on 2 days", email_content_2)
self.assertIn("We will try to debit an amount of", email_content_2)
self.assertIn("1,5", email_content_2)
self.assertIn("1.5", email_content_2)
self.assertIn("Product 2", email_content_2)
25 changes: 18 additions & 7 deletions src/backend/joanie/tests/payment/base_payment.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,27 @@ def _check_installment_refused_email_sent(self, email, order):
# Check we send it to the right email
self.assertEqual(mail.outbox[0].to[0], email)

self.assertIn("An installment debit has failed", mail.outbox[0].subject)

# Check body
email_content = " ".join(mail.outbox[0].body.split())
fullname = order.owner.get_full_name()
self.assertIn(f"Hello {fullname}", email_content)
self.assertIn("installment debit has failed.", email_content)
self.assertIn(
"Please correct the failed payment as soon as possible using", email_content
)

if "fr" in order.owner.language:
self.assertRegex(
mail.outbox[0].subject,
"Le prélèvement d'une échéance d'un montant de .* a échoué",
)
self.assertIn(f"Bonjour {fullname}", email_content)
self.assertIn(
"Merci de régulariser le paiement en échec dès que possible depuis de",
email_content,
)
else:
self.assertIn("An installment debit has failed", mail.outbox[0].subject)
self.assertIn(f"Hello {fullname}", email_content)
self.assertIn(
"Please correct the failed payment as soon as possible using",
email_content,
)
# Check the product title is in the correct language
with switch_language(order.product, order.owner.language):
self.assertIn(order.product.title, email_content)
Expand Down
1 change: 1 addition & 0 deletions src/backend/joanie/tests/payment/test_backend_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,7 @@ def test_payment_backend_base_do_on_payment_failure_with_installment(self):
"""
backend = TestBasePaymentBackend()
order = OrderFactory(
owner__language="en-us",
payment_schedule=[
{
"id": "d9356dd7-19a6-4695-b18e-ad93af41424a",
Expand Down
Binary file modified src/backend/locale/es_ES/LC_MESSAGES/django.mo
Binary file not shown.
Loading

0 comments on commit a46769f

Please sign in to comment.