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
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
110 commits
Select commit Hold shift + click to select a range
a069e59
✨(backend) add order states and flow for the new sales tunnel
kernicPanel May 16, 2024
de7f0e9
Revert "👔(backend) favor author organization at organization order as…
kernicPanel Sep 19, 2024
8e5e312
Revert "💩(backend) reassign organization for pending orders"
kernicPanel Sep 19, 2024
429c6ac
♻️(backend) assign orga in order create endpoint
kernicPanel May 22, 2024
22a4d85
♻️(backend) add ProductTargetCourseRelation on order creation
kernicPanel May 22, 2024
210ecf5
♻️(backend) create main invoice in order create endpoint
kernicPanel May 22, 2024
3ab5f70
♻️(backend) aadd credit card to order factory
kernicPanel May 23, 2024
4332346
🔥(backend) remove order abort endpoint
kernicPanel May 24, 2024
7cf816c
🔥(backend) remove order submit endpoint
kernicPanel May 24, 2024
81a5a81
🔥(backend) remove order validate endpoint
kernicPanel May 24, 2024
bc50182
🔥(backend) remove payment from submit transition
kernicPanel May 24, 2024
ca26ab5
🔥(backend) remove validated state usage
kernicPanel May 27, 2024
b006281
🔥(backend) remove order.submit
kernicPanel May 28, 2024
de08fce
🔥(backend) remove unused flow transitions
kernicPanel May 28, 2024
bbff8e0
🔥(backend) migrate order states
kernicPanel May 28, 2024
866d526
🔥(backend) remove pending flow transition
kernicPanel May 28, 2024
2ccca30
🔥(backend) remove validated state
kernicPanel May 28, 2024
64bfe0a
🔥(backend) remove submitted state
kernicPanel May 28, 2024
f30399f
✅(backend) fix flaky test
kernicPanel May 29, 2024
d52e442
➕(backend) add pytest-subtest
kernicPanel May 29, 2024
41fba57
✅(backend) fix submit signature order test
kernicPanel May 29, 2024
778e92e
✅(backend) use subtest in test loops
kernicPanel May 29, 2024
40b73cf
🎨(backend) cleanup order state flow
kernicPanel May 29, 2024
9b8f8f6
🩹(backend) fix pending transition conditions
kernicPanel May 29, 2024
2187fd7
🩹(backend) fix _post_transition_success state check
kernicPanel May 29, 2024
b3192c2
💡(backend) add todos
kernicPanel May 29, 2024
86eab7e
👔(backend) update contract queryset
kernicPanel May 29, 2024
d68c7e8
🔨(backend) add pylint ignore todos
kernicPanel May 30, 2024
f32247e
✅(backend) fix another flaky test
kernicPanel May 30, 2024
fca63c0
💬(backend) fix order cancel error message
kernicPanel May 30, 2024
26c470e
👔(backend) update filter nested order course
kernicPanel May 30, 2024
7ae5eaf
💬(backend) fix order submit_for_signature error message
kernicPanel May 30, 2024
9e0e87b
💡(backend) add todo for complete flow update
kernicPanel May 31, 2024
2b191d4
🩹(backend) check billing address before order assign
kernicPanel May 31, 2024
0076bac
✅(backend) fix order.submit_for_signature test
kernicPanel Jun 3, 2024
f81a65e
💡(backend) remove TODO
kernicPanel Jun 3, 2024
ea5a8f4
♻️(backend) rework flow.update
kernicPanel Jun 3, 2024
9a78159
♻️(backend) simplify order._set_installment_state
kernicPanel Jun 3, 2024
7f99be8
♻️(backend) rename flow.assign
kernicPanel Jun 3, 2024
3bd6fab
🔥(backend) remove to_sign_and_to_save_payment order state
kernicPanel Jun 3, 2024
31b30c2
♻️(backend) simplify flow.update
kernicPanel Jun 4, 2024
dc739e0
♻️(backend) extract assign transition
kernicPanel Jun 4, 2024
7d0d817
🔨(ci) fix pylint ignore todos
kernicPanel Jun 11, 2024
dbc1c3c
♻️(backend) deprecate `has_consent_to_terms` for Order model
jonathanreveille Jun 10, 2024
edbed89
🎨(backend) update context for contract for terms and conditions
jonathanreveille Jun 10, 2024
a04e486
✅(backend) fix flow order tests
kernicPanel Jun 13, 2024
f508e00
✨(backend) sign all contracts but canceled orders
kernicPanel Jun 7, 2024
9b7a75d
🧑‍💻(backend) add new order factory
kernicPanel Jun 5, 2024
0afa232
✨(backend) generate payment schedule before signing
kernicPanel Jun 11, 2024
8a8027f
✨(backend) create order contract on init_flow
kernicPanel Jun 13, 2024
964ba45
🐛(backend) update order state after student signature
kernicPanel Jun 13, 2024
964a7f5
✨(backend) get signature reference exclude canceled orders
kernicPanel Jun 10, 2024
92f358c
✨(backend) use product contract definition for has_unsigned_contract
kernicPanel Jun 14, 2024
8952b54
✨(backend) order add payment method api endpoint
kernicPanel Jun 14, 2024
6e4f0a5
🩹(backend) force card storage on payment
kernicPanel Jun 14, 2024
b447c3b
✨(backend) use all enrollable order states for enroll mode
kernicPanel Jun 18, 2024
b3333b9
🩹(backend) always use installments for orders
kernicPanel Jun 18, 2024
0c10dbb
✅(backend) fix tests
kernicPanel Jun 21, 2024
50906c7
✅(backend) fix tests
kernicPanel Jun 26, 2024
29e269e
🎨(backend) installment required in payment methods
kernicPanel Jun 20, 2024
debc847
🐛(backend) always use stockholm for installment amount
kernicPanel Jun 20, 2024
7b18a4b
🐛(frontend) use new order states
kernicPanel Jun 24, 2024
a9ea441
✨(backend) add payment schedule to order admin api
kernicPanel Jun 24, 2024
4d9509b
✨(frontend) add payment schedule to order view
kernicPanel Jun 27, 2024
25236c4
🐛(back) manage lyra card tokenization without order for a user
lunika Jun 27, 2024
5795a4d
🐛(back) fix payment debug view
lunika Jun 27, 2024
7fb975c
✨(backend) catch up on late payment schedule event
jonathanreveille Jun 14, 2024
4ffc432
🗃️(backend) store Order images through DocumentImage model
kernicPanel Jul 2, 2024
50992b3
🐛(backend) add signing order state
kernicPanel Jun 28, 2024
dbadec8
🐛(backend) realistic dummy signature behavior
kernicPanel Jul 2, 2024
fbbb852
🐛(backend) update state on signature reset
kernicPanel Jul 2, 2024
011d005
🐛(backend) fix handle_notification of dummy signature backend
jbpenrath Jul 4, 2024
c6d8b0f
🐛(frontend/admin) add support of signing order state
jbpenrath Jul 4, 2024
1b4b656
👔(backend) update condition to transition order to pending_payment
jbpenrath Jul 11, 2024
76ad53f
✨(backend) add property has_submitted_contract to Order model
jbpenrath Jul 11, 2024
2d623ca
👔(backend) prevent signing Order to go back to_sign state if submitted
jbpenrath Jul 11, 2024
0bfe52b
✨(backend) sort credit card per is_main then creation date
jbpenrath Aug 1, 2024
01cf1fb
🔧(tray) add cronjob for process_payment_schedule management command
lunika Aug 1, 2024
35dba5b
🔧(backend) update PAYMENT_SCHEDULE_LIMITS
jbpenrath Aug 1, 2024
bdca6dd
✨(backend) manage payment_schedule with certificate product
jbpenrath Aug 1, 2024
954d4de
✨(backend) nestedOrderCourseViewSet filters order with binding states
jbpenrath Aug 1, 2024
9ed5803
🔧(tray) add configMap env into db_migrate job
jbpenrath Aug 7, 2024
265a5b5
🚚(tray) fix cronjob app service extension
jbpenrath Aug 8, 2024
30d1c7d
🔥(admin) remove has_consent_to_terms
jbpenrath Aug 8, 2024
8082d2c
✨(backend) allow to generate payment schedule for any kind of product
jbpenrath Aug 8, 2024
ddc23a6
👔(backend) update find_today_installments to retrieve past due payment
jbpenrath Aug 8, 2024
4418fcf
✨(backend) prevent duplicate addresses for a user or an organization
jonathanreveille Aug 12, 2024
30f0fda
🐛(backend) fix payment schedule date calculation
kernicPanel Aug 14, 2024
74b3d68
✨(backend) installment paid email mjml template
jonathanreveille Jul 18, 2024
6ec8abf
✨(backend) all installment paid email mjml template
jonathanreveille Aug 6, 2024
c41c1d6
🧑‍💻(backend) debug view for installment payment email
jonathanreveille Jul 18, 2024
db0e5cf
🧑‍💻(backend) debug view all installments paid email
jonathanreveille Aug 6, 2024
ed16031
✨(backend) send an email when new installment is paid
jonathanreveille Jul 1, 2024
1383619
✨(backend) bind payment_schedule into OrderLightSerializer
jbpenrath Aug 22, 2024
5e1ab9d
✨(backend) installment refused debit email mjml template
jonathanreveille Aug 7, 2024
c6c4d6a
🧑‍💻(backend) debug view refused debit installment email
jonathanreveille Aug 7, 2024
db63c06
✨(backend) send an email when installment debit refused
jonathanreveille Aug 8, 2024
29689ee
✨(backend) cast due_date to date, amount to Money in payment_schedule
jonathanreveille Aug 27, 2024
a269f08
✨(backend) installment debit reminder email mjml template
jonathanreveille Aug 16, 2024
a0ffc58
🧑‍💻(backend) debug view reminder debit installment email
jonathanreveille Aug 16, 2024
6f8cc2e
✨(backend) send email reminder of upcoming debit installment
jonathanreveille Aug 20, 2024
5bda0b5
🔧(tray) add cronjob for send_mail_upcoming_debit management command
jonathanreveille Aug 22, 2024
c86f34f
✨(backend) bind credit card info to order admin serializer
jbpenrath Aug 20, 2024
dd95b52
✨(backoffice) add utils numbers.toDigitString
jbpenrath Aug 22, 2024
fab6a1d
👽️(backoffice) add credit_card field to Order resource
jbpenrath Aug 22, 2024
725513c
✨(backoffice) add CreditCard component
jbpenrath Aug 22, 2024
e9216ad
✨(backoffice) display credit card in order detail view
jbpenrath Aug 22, 2024
ef1e8d3
✨(backend) debit installment if due date is current day
jonathanreveille Aug 23, 2024
35f1361
✨(backend) get signing progress on document for signature backends
jonathanreveille Sep 13, 2024
7c2897b
🚧(backend) student_signed_on with signature provider on serializer
jonathanreveille Sep 20, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ generate-version-file: &generate-version-file
"$CIRCLE_PROJECT_REPONAME" \
"$CIRCLE_BUILD_URL" > src/backend/joanie/version.json

version: 2
version: 2.1
jobs:
# Git jobs
# Check that the git history is clean and complies with our expectations
Expand Down Expand Up @@ -158,9 +158,21 @@ jobs:
- run:
name: Lint code with ruff
command: ~/.local/bin/ruff check joanie
- run:
name: Lint code with pylint
command: ~/.local/bin/pylint joanie
- when:
condition:
not:
matches: { pattern: "^dev_/.+$", value: << pipeline.git.branch >> }
steps:
- run:
name: Lint code with pylint
command: ~/.local/bin/pylint joanie
- when:
condition:
matches: { pattern: "^dev_/.+$", value: << pipeline.git.branch >> }
steps:
- run:
name: Lint code with pylint, ignoring TODOs
command: ~/.local/bin/pylint joanie --disable=fixme

test-back:
docker:
Expand Down
33 changes: 30 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,44 @@ and this project adheres to

## [Unreleased]

### Added

- Signature backend can now retrieve the signing progression of a document
- 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

### Changed

- Update round robin logic to favor author organizations
- Reassign organization for pending orders
- 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

### Fixed

- Improve signature backend `handle_notification` error catching
- Prevent duplicate Address objects for a user or an organization
- Allow to cancel an enrollment order linked to an archived course run

### Removed

- Remove the `has_consent_to_terms` field from the `Order` edit view
in the back office application


## [2.6.1] - 2024-07-25

### Fixed
Expand Down Expand Up @@ -50,7 +78,6 @@ and this project adheres to

- Do not update OpenEdX enrollment if this one is already
up-to-date on the remote lms
-

## [2.4.0] - 2024-06-21

Expand Down
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -175,11 +175,21 @@ lint-pylint: ## lint back-end python sources with pylint only on changed files f
bin/pylint --diff-only=origin/main
.PHONY: lint-pylint

lint-pylint-todo: ## lint back-end python sources with pylint only on changed files from main without fixme warnings
@echo 'lint:pylint started…'
bin/pylint --diff-only=origin/main --disable=fixme
.PHONY: lint-pylint-todo

lint-pylint-all: ## lint back-end python sources with pylint
@echo 'lint:pylint-all started…'
bin/pylint joanie
.PHONY: lint-pylint-all

lint-pylint-all-todo: ## lint back-end python sources with pylint without fixme warnings
@echo 'lint:pylint-all started…'
bin/pylint joanie --disable=fixme
.PHONY: lint-pylint-all-todo

test: ## run project tests
@$(MAKE) test-back-parallel
@$(MAKE) admin-test
Expand Down
5 changes: 4 additions & 1 deletion env.d/development/common.dist
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ DJANGO_EMAIL_PORT=1025
# Richie
JOANIE_CATALOG_BASE_URL=http://richie:8070
JOANIE_CATALOG_NAME=richie
JOANIE_CONTRACT_CONTEXT_PROCESSORS =
JOANIE_CONTRACT_CONTEXT_PROCESSORS =

# Backoffice
JOANIE_BACKOFFICE_BASE_URL="http://localhost:8072"
Expand All @@ -75,3 +75,6 @@ DEVELOPER_EMAIL="[email protected]"

# Security for remote endpoints API
JOANIE_AUTHORIZED_API_TOKENS = "secretTokenForRemoteAPIConsumer"

# Add here the dashboard link of orders for email sent when an installment is paid
JOANIE_DASHBOARD_ORDER_LINK = "http://localhost:8070/dashboard/courses/orders/:orderId/"
1 change: 0 additions & 1 deletion src/backend/joanie/core/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,6 @@ class OrderAdmin(DjangoObjectActions, admin.ModelAdmin):
readonly_fields = (
"state",
"total",
"has_consent_to_terms",
"invoice",
"certificate",
)
Expand Down
1 change: 1 addition & 0 deletions src/backend/joanie/core/api/admin/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -596,6 +596,7 @@ class OrderViewSet(
"certificate",
"certificate__certificate_definition",
"order_group",
"credit_card",
)
filter_backends = [DjangoFilterBackend, OrderingFilter]
ordering_fields = ["created_on"]
Expand Down
Loading