Skip to content
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

✨(backend) signature backend new endpoint to get signature state of a signing procedure #925

Open
wants to merge 110 commits into
base: dev
Choose a base branch
from

Commits on Sep 19, 2024

  1. ✨(backend) add order states and flow for the new sales tunnel

    New order states are needed for the new sales tunnel:
    - ORDER_STATE_ASSIGNED
    - ORDER_STATE_TO_SAVE_PAYMENT_METHOD
    - ORDER_STATE_TO_SIGN
    - ORDER_STATE_TO_SIGN_AND_TO_SAVE_PAYMENT_METHOD
    kernicPanel committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    a069e59 View commit details
    Browse the repository at this point in the history
  2. Revert "👔(backend) favor author organization at organization order as…

    …signment"
    
    This reverts commit ce938db.
    kernicPanel committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    de7f0e9 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    8e5e312 View commit details
    Browse the repository at this point in the history
  4. ♻️(backend) assign orga in order create endpoint

    With the new sale tunnel, we need to assign an organization directly on
    order creation.
    kernicPanel committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    429c6ac View commit details
    Browse the repository at this point in the history
  5. ♻️(backend) add ProductTargetCourseRelation on order creation

    As order submit endpoint will be removed, we set ProductTargetCourseRelation
    directly on order creation.
    kernicPanel committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    22a4d85 View commit details
    Browse the repository at this point in the history
  6. ♻️(backend) create main invoice in order create endpoint

    As a main invoice is created at the first payment scgedule installment,
    we create it at order creation, and use it to store the billing address.
    kernicPanel committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    210ecf5 View commit details
    Browse the repository at this point in the history
  7. ♻️(backend) aadd credit card to order factory

    We want to store the chosen credit card in an order, and use it to
    trigger scheduled payments.
    kernicPanel committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    3ab5f70 View commit details
    Browse the repository at this point in the history
  8. 🔥(backend) remove order abort endpoint

    As pending order state will be deleted, the abort endpoint will be
    useless.
    kernicPanel committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    4332346 View commit details
    Browse the repository at this point in the history
  9. 🔥(backend) remove order submit endpoint

    As payment process is being rewritten, the submit endpoint will be
    useless.
    kernicPanel committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    7cf816c View commit details
    Browse the repository at this point in the history
  10. 🔥(backend) remove order validate endpoint

    As validate order state will be deleted, the validate endpoint will be
    useless.
    kernicPanel committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    81a5a81 View commit details
    Browse the repository at this point in the history
  11. 🔥(backend) remove payment from submit transition

    As the submit transition will be removed, the code executed in it is
    removed, and the tests are accordingly modified.
    kernicPanel committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    bc50182 View commit details
    Browse the repository at this point in the history
  12. 🔥(backend) remove validated state usage

    As the validated order state will not be used anymore, its usage has
    been removed.
    kernicPanel committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    ca26ab5 View commit details
    Browse the repository at this point in the history
  13. 🔥(backend) remove order.submit

    As order.submit content has been removed, we can delete it.
    kernicPanel committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    b006281 View commit details
    Browse the repository at this point in the history
  14. 🔥(backend) remove unused flow transitions

    As some order flows has been removed, we can delete them.
    kernicPanel committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    de08fce View commit details
    Browse the repository at this point in the history
  15. 🔥(backend) migrate order states

    As the unused states have been removed, we have to add a database
    migration to replace them.
    
    Strings are used here to allow us to delete them from our enums module.
    kernicPanel committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    bbff8e0 View commit details
    Browse the repository at this point in the history
  16. 🔥(backend) remove pending flow transition

    Pending order state transition will not be used anymore.
    kernicPanel committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    866d526 View commit details
    Browse the repository at this point in the history
  17. 🔥(backend) remove validated state

    Validated order state is not used anymore.
    kernicPanel committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    2ccca30 View commit details
    Browse the repository at this point in the history
  18. 🔥(backend) remove submitted state

    Submitted state is not used anymore.
    kernicPanel committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    64bfe0a View commit details
    Browse the repository at this point in the history
  19. ✅(backend) fix flaky test

    A test (probably randomized somewhere) was missing an object database
    refresh.
    kernicPanel committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    f30399f View commit details
    Browse the repository at this point in the history
  20. ➕(backend) add pytest-subtest

    As we now have many test which contains asserts in loop, using subtests
    allows to continue the test to run, even if one of the assert fails.
    kernicPanel committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    d52e442 View commit details
    Browse the repository at this point in the history
  21. ✅(backend) fix submit signature order test

    This test was wrong with our new states.
    Subtest usage is introduced here.
    
    Also reverse path usage has been replaced by real path.
    kernicPanel committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    41fba57 View commit details
    Browse the repository at this point in the history
  22. ✅(backend) use subtest in test loops

    To ensure all cases are tested, even if one fails, subtest is added.
    kernicPanel committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    778e92e View commit details
    Browse the repository at this point in the history
  23. 🎨(backend) cleanup order state flow

    Order conditions and transitions were grouped by type.
    They are now grouped by usage, which make the code easier to read.
    kernicPanel committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    40b73cf View commit details
    Browse the repository at this point in the history
  24. 🩹(backend) fix pending transition conditions

    Order state pending transition was missing source targets.
    We can actually go from assigned, to_sign, to_save_payment_method, and
    to_sign_and_to_save_payment_method to pending.
    kernicPanel committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    9b8f8f6 View commit details
    Browse the repository at this point in the history
  25. 🩹(backend) fix _post_transition_success state check

    Order state _post_transition_success was missing source states to create
    an enrollment.
    kernicPanel committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    2187fd7 View commit details
    Browse the repository at this point in the history
  26. 💡(backend) add todos

    Many things needs to be done before using the new states.
    Each of them are noted as TODO.
    kernicPanel committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    b3192c2 View commit details
    Browse the repository at this point in the history
  27. 👔(backend) update contract queryset

    Contracts returned by the GenericContractViewSet queryset needs to be
    updated with the new state.
    kernicPanel committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    86eab7e View commit details
    Browse the repository at this point in the history
  28. 🔨(backend) add pylint ignore todos

    As TODOs are used temporarily, CI linting needs to ignore them.
    Also, convenient make tasks have been added.
    kernicPanel committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    d68c7e8 View commit details
    Browse the repository at this point in the history
  29. ✅(backend) fix another flaky test

    As a test needs unique email generated, those provided by faker may
    collide.
    kernicPanel committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    f32247e View commit details
    Browse the repository at this point in the history
  30. 💬(backend) fix order cancel error message

    As states changed, an error message needed to be updated accordingly.
    kernicPanel committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    fca63c0 View commit details
    Browse the repository at this point in the history
  31. 👔(backend) update filter nested order course

    Orders returned by the NestedOrderCourseViewSet queryset needs to be
    updated with the new state.
    kernicPanel committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    26c470e View commit details
    Browse the repository at this point in the history
  32. 💬(backend) fix order submit_for_signature error message

    As states changed, an error message needed to be updated accordingly.
    kernicPanel committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    7ae5eaf View commit details
    Browse the repository at this point in the history
  33. 💡(backend) add todo for complete flow update

    TODO added for triying to add more transitions to flow.update().
    kernicPanel committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    9e0e87b View commit details
    Browse the repository at this point in the history
  34. 🩹(backend) check billing address before order assign

    Order assign transition needs a billing address when creating the main
    invoice. If not present, the transition should fail.
    kernicPanel committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    2b191d4 View commit details
    Browse the repository at this point in the history
  35. ✅(backend) fix order.submit_for_signature test

    Since user enrollment is not done at signature anymore, a test needs to
    be apdated accordingly.
    kernicPanel committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    0076bac View commit details
    Browse the repository at this point in the history
  36. 💡(backend) remove TODO

    A TODO was added to check if we need to set an enrollment in the LMS
    before unenrolling a user. As we need to keep it, the TODO is removed.
    kernicPanel committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    f81a65e View commit details
    Browse the repository at this point in the history
  37. ♻️(backend) rework flow.update

    Order states stransitions related to payment weren't managed by
    flow.update.
    Now, in our code, everytime we want to change the order state, calling
    flow.update will suffice.
    kernicPanel committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    ea5a8f4 View commit details
    Browse the repository at this point in the history
  38. ♻️(backend) simplify order._set_installment_state

    As all the states are managed in flow.update, we do not need to check if
    the current updated installment is the first or the last one.
    kernicPanel committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    9a78159 View commit details
    Browse the repository at this point in the history
  39. ♻️(backend) rename flow.assign

    As flow.assign is doing more than setting the order state to assign, and
    as it has to be called the first on an order lifetime, it has been
    renamed to init.
    kernicPanel committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    7f99be8 View commit details
    Browse the repository at this point in the history
  40. 🔥(backend) remove to_sign_and_to_save_payment order state

    As we are simplifying the order state flow by signing contract before
    saving a payment method, the to_sign_and_to_save_payment state is no
    longer needed.
    kernicPanel committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    3bd6fab View commit details
    Browse the repository at this point in the history
  41. ♻️(backend) simplify flow.update

    The order flowupdate method can be simplified.
    kernicPanel committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    31b30c2 View commit details
    Browse the repository at this point in the history
  42. ♻️(backend) extract assign transition

    For clarity in the order state flow, we extract the assign transition
    from the init method.
    kernicPanel committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    dc739e0 View commit details
    Browse the repository at this point in the history
  43. 🔨(ci) fix pylint ignore todos

    As the branch names have changed, the CI job needs to be updated as
    well.
    kernicPanel committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    7d0d817 View commit details
    Browse the repository at this point in the history
  44. ♻️(backend) deprecate has_consent_to_terms for Order model

    From now on, the terms and conditions (CGV in French) must be
    specific to each organization. We can no longer use a global
    version for the entire platform. These terms will be included
    directly in the contract's context, so the Order model no longer
    needs to track user acceptance, as this will happen during contract
    signing.
    
    Fix #816
    jonathanreveille authored and kernicPanel committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    dbc1c3c View commit details
    Browse the repository at this point in the history
  45. 🎨(backend) update context for contract for terms and conditions

    The terms and conditions will be written and stored in the
    contract definition body field. There's no need to prepare them
    separately for the contract context anymore. We've updated the
    generation of context by removing the key `terms_and_conditions`
    in the preparation. In this commit, we have also updated
    the contract definition html template for the section "Appendices".
    The use of `SiteConfig` to prepare terms and conditions in html
    is now deprecated.
    jonathanreveille authored and kernicPanel committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    edbed89 View commit details
    Browse the repository at this point in the history
  46. ✅(backend) fix flow order tests

    Fix flow order tests after merging main.
    kernicPanel committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    a04e486 View commit details
    Browse the repository at this point in the history
  47. ✨(backend) sign all contracts but canceled orders

    Contracts needs to be signed as soon as possible by the organizations.
    kernicPanel committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    f508e00 View commit details
    Browse the repository at this point in the history
  48. 🧑‍💻(backend) add new order factory

    Our order tests often needs related objects to be created.
    A new order factory takes care of this, depending on the order state.
    kernicPanel committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    9b7a75d View commit details
    Browse the repository at this point in the history
  49. ✨(backend) generate payment schedule before signing

    The order payment schedule needs to be generated before signing the
    contract.
    kernicPanel committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    0afa232 View commit details
    Browse the repository at this point in the history
  50. ✨(backend) create order contract on init_flow

    The order contract needs to be created before the signature submission.
    kernicPanel committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    8a8027f View commit details
    Browse the repository at this point in the history
  51. 🐛(backend) update order state after student signature

    Once the student signs a contract, the order state needs to be updated.
    kernicPanel committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    964ba45 View commit details
    Browse the repository at this point in the history
  52. ✨(backend) get signature reference exclude canceled orders

    Signature backends should return all contracts, except for the cancelled
    orders.
    kernicPanel committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    964a7f5 View commit details
    Browse the repository at this point in the history
  53. ✨(backend) use product contract definition for has_unsigned_contract

    The contract is created on the fly when the learner ask to sign it so
    we could have case where the order has no contract but there is one to sign.
    kernicPanel committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    92f358c View commit details
    Browse the repository at this point in the history
  54. ✨(backend) order add payment method api endpoint

    An endpoint is needed to bind a credit card to an order.
    kernicPanel committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    8952b54 View commit details
    Browse the repository at this point in the history
  55. 🩹(backend) force card storage on payment

    We need to force the credit card tokenization on payment.
    #801 (comment)
    kernicPanel committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    6e4f0a5 View commit details
    Browse the repository at this point in the history
  56. ✨(backend) use all enrollable order states for enroll mode

    As we now allow more order states for enrollments, we use them to
    determine the enrollment mode used.
    kernicPanel committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    b447c3b View commit details
    Browse the repository at this point in the history
  57. 🩹(backend) always use installments for orders

    We will always use installments for all orders.
    kernicPanel committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    b3333b9 View commit details
    Browse the repository at this point in the history
  58. ✅(backend) fix tests

    Fix tests after merging main.
    kernicPanel committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    0c10dbb View commit details
    Browse the repository at this point in the history
  59. ✅(backend) fix tests

    Fix tests after merging main.
    kernicPanel committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    50906c7 View commit details
    Browse the repository at this point in the history
  60. 🎨(backend) installment required in payment methods

    As we will always use installments for payments, all payment methods
    should not have an optional installment parameter, but a mandatory one.
    kernicPanel committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    29e269e View commit details
    Browse the repository at this point in the history
  61. 🐛(backend) always use stockholm for installment amount

    Amounts conversions to centimes using regular python types can lead to
    errors. Using Stockholm avoids problems.
    kernicPanel committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    debc847 View commit details
    Browse the repository at this point in the history
  62. 🐛(frontend) use new order states

    As we have new order states, we need to use them in admin frontend.
    kernicPanel committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    7b18a4b View commit details
    Browse the repository at this point in the history
  63. ✨(backend) add payment schedule to order admin api

    As we want to display payment schedule in our admin frontend, we need to
    add it to the admin api.
    kernicPanel committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    a9ea441 View commit details
    Browse the repository at this point in the history
  64. ✨(frontend) add payment schedule to order view

    We want to display the payment schedule in orders.
    kernicPanel committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    4d9509b View commit details
    Browse the repository at this point in the history
  65. 🐛(back) manage lyra card tokenization without order for a user

    A user can tokenize a card outside any payment process and in this case
    no order information is receivend by the handle_notification endpoint.
    We have to deal with this case to create a card just linked to user and
    without order information
    lunika authored and kernicPanel committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    25236c4 View commit details
    Browse the repository at this point in the history
  66. 🐛(back) fix payment debug view

    The payment debug view has not been updated since backend payment
    signature has changed. This commit fix it and add a new case where we
    want to tokenize a card directly for a user without order information.
    lunika authored and kernicPanel committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    5795a4d View commit details
    Browse the repository at this point in the history
  67. ✨(backend) catch up on late payment schedule event

    When the due date has come, the task `process_today_installment`
    now verifies if there are previous installments on the order
    that require a payment. Now, the task will trigger a payment
    for the installments that are in the past that are unpaid.
    
    Fix #792
    jonathanreveille authored and kernicPanel committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    7fb975c View commit details
    Browse the repository at this point in the history
  68. 🗃️(backend) store Order images through DocumentImage model

    Currently, we are storing order images (organization logo) into json
    field as base64 encoded string. This is weird as it takes a lot of space
    in database then we duplicate images in each certificate where they are used.
    
    That's why, we decide to stop that and store Order images in a DocumentImage.
    kernicPanel committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    4ffc432 View commit details
    Browse the repository at this point in the history
  69. 🐛(backend) add signing order state

    As the signature backend may take some time to validate a signature, a
    new state is added to properly wait for it.
    kernicPanel committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    50992b3 View commit details
    Browse the repository at this point in the history
  70. 🐛(backend) realistic dummy signature behavior

    Real behavior of signature provider is to set the
    submitted_for_signature_on when asking for a signature link, and to set
    student_signed_on when handle_notification is called.
    kernicPanel committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    dbadec8 View commit details
    Browse the repository at this point in the history
  71. 🐛(backend) update state on signature reset

    When a signature is refused, we need to update the order state.
    kernicPanel committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    fbbb852 View commit details
    Browse the repository at this point in the history
  72. 🐛(backend) fix handle_notification of dummy signature backend

    We recently remove the automatic update of contract when an API consumer request
     an invitation link with the dummy signature backend. That means now, the API
     consumer has to call manually the notification endpoint to confirm the
     signature but some information where missing to update properly the contract,
     so we complete the invitation_link method to bind missing information.
    jbpenrath authored and kernicPanel committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    011d005 View commit details
    Browse the repository at this point in the history
  73. 🐛(frontend/admin) add support of signing order state

    We recently add a new order state: "signing". But we do not update the admin
    application accordingly, so order views were broken when a signing order must be
     displayed.
    jbpenrath authored and kernicPanel committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    c6d8b0f View commit details
    Browse the repository at this point in the history
  74. 👔(backend) update condition to transition order to pending_payment

    Currently, an order in pending state is able to transition to pending_payment
    once no installment has been refused. That means we are able to transition to
    this state order to which we never try to pay an installment that is weird.
    Indeed, only orders with the first installment paid and all others installment
    not refused should be allowed to transition to pending_payment state
    jbpenrath authored and kernicPanel committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    1b4b656 View commit details
    Browse the repository at this point in the history
  75. ✨(backend) add property has_submitted_contract to Order model

    The `has_submitted_contract` returns True if the related Order has contract with
     field `submitted_for_signature_on` not None
    jbpenrath authored and kernicPanel committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    76ad53f View commit details
    Browse the repository at this point in the history
  76. 👔(backend) prevent signing Order to go back to_sign state if submitted

    Until a contract is submitted, it should not be possible to transition back to
    to_sign state.
    jbpenrath authored and kernicPanel committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    2d623ca View commit details
    Browse the repository at this point in the history
  77. ✨(backend) sort credit card per is_main then creation date

    The list credit card endpoint now returns first the main credit card then all
    others credit cards sorted by descending creation date.
    jbpenrath authored and kernicPanel committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    0bfe52b View commit details
    Browse the repository at this point in the history
  78. 🔧(tray) add cronjob for process_payment_schedule management command

    We have to add a cronjob in the tray to manage the
    process_payment_schedule management command.
    lunika authored and kernicPanel committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    01cf1fb View commit details
    Browse the repository at this point in the history
  79. 🔧(backend) update PAYMENT_SCHEDULE_LIMITS

    For product with a price less than 150, payment schedule should contain only one
     installment.
    jbpenrath authored and kernicPanel committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    35dba5b View commit details
    Browse the repository at this point in the history
  80. ✨(backend) manage payment_schedule with certificate product

    Currently, some logic were missing to be able to generate a payment schedule for
     a certificate product (which have no target_courses)
    jbpenrath authored and kernicPanel committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    bdca6dd View commit details
    Browse the repository at this point in the history
  81. ✨(backend) nestedOrderCourseViewSet filters order with binding states

    The nested endpoint `courses/<course_code>/orders/` should return all order in
    binding states. Indeed, course manager should be able to list all learners who
    have subscribed to their trainings.
    jbpenrath authored and kernicPanel committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    954d4de View commit details
    Browse the repository at this point in the history
  82. 🔧(tray) add configMap env into db_migrate job

    Currently, the env configMap volume is not mounted but we need it to be able to
    access to S3 Storage.
    jbpenrath authored and kernicPanel committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    9ed5803 View commit details
    Browse the repository at this point in the history
  83. 🚚(tray) fix cronjob app service extension

    The extension of the file to declare the cronjob process payment schedule was
    wrong
    jbpenrath authored and kernicPanel committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    265a5b5 View commit details
    Browse the repository at this point in the history
  84. 🔥(admin) remove has_consent_to_terms

    With the new workflow, the order field has_consent_to_terms has been deprecated
    so we can remove it from the order detail view in the BO application
    jbpenrath authored and kernicPanel committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    30d1c7d View commit details
    Browse the repository at this point in the history
  85. ✨(backend) allow to generate payment schedule for any kind of product

    Currently, the payment schedule was generated on the signature submit. But this
    was weird as some product can have no contract and in this case, no payment
    schedule is generated. So in order to support this kind of product, we move the
    payment schedule generation logic on pending transition success.
    jbpenrath authored and kernicPanel committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    8082d2c View commit details
    Browse the repository at this point in the history
  86. 👔(backend) update find_today_installments to retrieve past due payment

    `find_today_installments` currently retrieve only installments which have a
    due_date sets to today. Instead we would like to retrieve all installements
    which are due to payment today.
    jbpenrath authored and kernicPanel committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    ddc23a6 View commit details
    Browse the repository at this point in the history
  87. ✨(backend) prevent duplicate addresses for a user or an organization

    We have added a new uniqueness constraint into the model
    Address. A user or an organization can only have 1 address
    with the same values for the fields  `address`, `postcode`, `city`,
    `country`,  `first_name`, `last_name`.
    
    Fix #873
    jonathanreveille authored and kernicPanel committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    4418fcf View commit details
    Browse the repository at this point in the history
  88. 🐛(backend) fix payment schedule date calculation

    The payment schedule dates were wrong when the withdrawal date was after
    the session start date.
    kernicPanel committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    30f0fda View commit details
    Browse the repository at this point in the history
  89. ✨(backend) installment paid email mjml template

    For every installment paid in a payment schedule, we
    trigger an email with the information about the last
    payment done. We needed to prepare a new MJML template
    for the email that is sent to the user.
    jonathanreveille authored and kernicPanel committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    74b3d68 View commit details
    Browse the repository at this point in the history
  90. ✨(backend) all installment paid email mjml template

    When all installments are paid on the order's payment
    schedule, we needed to prepare a new MJML template for the
    email that is sent to the user summarizing all the
    installments paid and also confirming that the user has
    successfully paid every step on the payment schedule.
    jonathanreveille authored and kernicPanel committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    6ec8abf View commit details
    Browse the repository at this point in the history
  91. 🧑‍💻(backend) debug view for installment payment email

    To ease the life of our fellow developers, we have created a debug
    view to see the layout and how the email is rendered for
    installment payment that are paid.
    jonathanreveille authored and kernicPanel committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    c41c1d6 View commit details
    Browse the repository at this point in the history
  92. 🧑‍💻(backend) debug view all installments paid email

    To ease the life of our fellow developers, we have created a debug
    view to see the layout and how the email is rendered for
    when all the installments are paid on the payment schedule
    for the user.
    jonathanreveille authored and kernicPanel committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    db0e5cf View commit details
    Browse the repository at this point in the history
  93. ✨(backend) send an email when new installment is paid

    Once an installment is paid, we now send an email
    with the data on the payment made by the user.
    There are 2 different email templates, one is used
    when 1 installment is paid, an the other template
    is used when all the installments are paid on the
    payment schedule.
    
    Fix #862
    jonathanreveille authored and kernicPanel committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    ed16031 View commit details
    Browse the repository at this point in the history
  94. ✨(backend) bind payment_schedule into OrderLightSerializer

    On enrollment order resource, our api consumer needs to be able to retrieve
    payment schedule information so we update the OrderLightSerializer to add this
    field.
    jbpenrath authored and kernicPanel committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    1383619 View commit details
    Browse the repository at this point in the history
  95. ✨(backend) installment refused debit email mjml template

    When an installment debit has failed in a payment schedule,
    we trigger an email with the information. First, we need
    to create a new MJML template for this situation.
    jonathanreveille authored and kernicPanel committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    5e1ab9d View commit details
    Browse the repository at this point in the history
  96. 🧑‍💻(backend) debug view refused debit installment email

    For our fellow developers, we have created a debug view
    to checkout the layout and the rendering of the email
    that is sent when an installment has failed to be debited.
    jonathanreveille authored and kernicPanel committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    c6c4d6a View commit details
    Browse the repository at this point in the history
  97. ✨(backend) send an email when installment debit refused

    Once an installment debit has been refused, we send an email
    with the data about the failed payment in the payment
    schedule of the order.
    
    Fix #863
    jonathanreveille authored and kernicPanel committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    db63c06 View commit details
    Browse the repository at this point in the history
  98. ✨(backend) cast due_date to date, amount to Money in payment_schedule

    The `OrderPaymentScheduleDecoder` was returning a string
    representation of the `due_date` instead of a `datetime.date` object.
    The same way, it was returning a string representing the `amount`
    instead of a `Money` object. This behavior complicated
    comparisons and operations, as handling both strings
    and money and date objects increased the complexity.
    To simplify date and money handling and ensure consistency,
    a cast was added to the decoder, converting the string
    from the database into a `datetime.date` object for `due_date`,
    and the `amount` into a `Money` object. This change ensures that
    `due_date` is always a `date` object, and `amount` is always
    a `Money` object. It makes it easier to work with
    throughout the codebase. For our fellow developers, they
    can now freely pass strings to prepare their payment schedule
    with the `OrderFactory` or the `OrderGeneratorFactory`
    in tests, where for the fields `due_date` and `amount`, they
    both will be casted to their respective types after being created.
    jonathanreveille authored and kernicPanel committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    29689ee View commit details
    Browse the repository at this point in the history
  99. ✨(backend) installment debit reminder email mjml template

    When an installment debit will occur in the payment schedule
    of an order, we should trigger an email mentioning when
    the next debit will be and its amount. First, we need to
    create a new MJML template for the reminder of the next
    installment payment debit.
    jonathanreveille authored and kernicPanel committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    a269f08 View commit details
    Browse the repository at this point in the history
  100. 🧑‍💻(backend) debug view reminder debit installment email

    For our fellow developers, we have created a debug view
    to checkout the layout and the rendering of the reminder
    email that is sent when the next installment will
    be debited.
    jonathanreveille authored and kernicPanel committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    a0ffc58 View commit details
    Browse the repository at this point in the history
  101. ✨(backend) send email reminder of upcoming debit installment

    The new django command `send_mail_upcoming_debit` will
    retrieve all 'pending' state installments on orders
    payment schedules and send a reminder email with a certain
    amount of days in advance (configured with
    `JOANIE_INSTALLMENT_REMINDER_PERIOD_DAYS`) to the order's
    owner notifying them that they will be debited on their
    credit card.
    
    Fix #864
    jonathanreveille authored and kernicPanel committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    6f8cc2e View commit details
    Browse the repository at this point in the history
  102. 🔧(tray) add cronjob for send_mail_upcoming_debit management command

    We have to add a cronjob in the tray to manage the
    `send_mail_upcoming_debit` management command.
    jonathanreveille authored and kernicPanel committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    5bda0b5 View commit details
    Browse the repository at this point in the history
  103. ✨(backend) bind credit card info to order admin serializer

    Now a credit card is linked to an order, we want to display that in our back
    office application to we bind this data the AdminOrderSerializer.
    jbpenrath authored and lunika committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    c86f34f View commit details
    Browse the repository at this point in the history
  104. ✨(backoffice) add utils numbers.toDigitString

    Add an util to transform a number into a string. If the value is less than 10,
    it prefix it with a `0`
    jbpenrath authored and lunika committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    dd95b52 View commit details
    Browse the repository at this point in the history
  105. 👽️(backoffice) add credit_card field to Order resource

    Now Joanie admin api returns credit card related to the order.
    jbpenrath authored and lunika committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    fab6a1d View commit details
    Browse the repository at this point in the history
  106. ✨(backoffice) add CreditCard component

    Add a presentational component to render credit card information
    jbpenrath authored and lunika committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    725513c View commit details
    Browse the repository at this point in the history
  107. ✨(backoffice) display credit card in order detail view

    If an order has a payment method, we display it within the payment schedule
    section otherwise a warning alert message is displayed.
    jbpenrath authored and lunika committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    e9216ad View commit details
    Browse the repository at this point in the history

Commits on Sep 20, 2024

  1. ✨(backend) debit installment if due date is current day

    We have added in post transition success to 'pending' state
    of an order that will trigger a payment to let the user
    have access to the course immediately when the installment's
    due date is on the current day. This case may happen when
    we generate the payment schedule and if the course has
    already started, the 1st installment due date of the order's
    payment schedule will be set to the current day. Since we only
    debit the next night through a cronjob, we need to be able to
    make the user pay to have access to his course, and avoid that the
    has to wait the next day to start it.
    
    Fix #913
    jonathanreveille committed Sep 20, 2024
    Configuration menu
    Copy the full SHA
    ef1e8d3 View commit details
    Browse the repository at this point in the history
  2. ✨(backend) get signing progress on document for signature backends

    Instead of waiting for the webhook that a document has been signed
    from the signature provider (the cause would be a latency to send us
    the notification event), we have decided to add a new endpoint
    on the backend signature provide to get the information if whether
    the student or the organization have signed the document. The new
    method returns a dictionary with boolean value that informs the
    progression of signing procedure of a document.
    jonathanreveille committed Sep 20, 2024
    Configuration menu
    Copy the full SHA
    35f1361 View commit details
    Browse the repository at this point in the history
  3. 🚧(backend) student_signed_on with signature provider on serializer

    For the serializer client ContractLightSerializer, whether the
    notification from the signature provider takes some time
    to let us know that the student has signed, when the viewset is called,
    it will trigger our serializer method that will check if the
    student has finished signing his part on the document.
    That allows the frontend to get the latest information when
    the student gets to his dashboard of course orders.
    jonathanreveille committed Sep 20, 2024
    Configuration menu
    Copy the full SHA
    7c2897b View commit details
    Browse the repository at this point in the history