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

✨(models/api) add models and API endpoints for contract #358

Merged
merged 3 commits into from
Sep 26, 2023

Conversation

sampaccoud
Copy link

@sampaccoud sampaccoud commented Jul 26, 2023

Purpose

We want a student and an organization to be able to sign a contract on courses that are subject to it.

Proposal

  • Add a ContractDefinition model for the course managers to declare a contract template on a product.
  • Add a Contract model attached to an order to record the student and organization signatures of a contract for an order on which it is required.
  • Add an endpoint for staff users to edit contract definitions via the admin API (in a later evolution we might want to let teachers edit contract definitions themselves)
  • Add an endpoint for the client to handle contracts linked to orders

src/backend/locale/fr_FR/LC_MESSAGES/django.po Outdated Show resolved Hide resolved
src/backend/locale/fr_FR/LC_MESSAGES/django.po Outdated Show resolved Hide resolved
src/backend/locale/fr_FR/LC_MESSAGES/django.po Outdated Show resolved Hide resolved
src/backend/locale/fr_FR/LC_MESSAGES/django.po Outdated Show resolved Hide resolved
src/backend/locale/fr_FR/LC_MESSAGES/django.po Outdated Show resolved Hide resolved
@jonathanreveille jonathanreveille force-pushed the add-contract branch 4 times, most recently from c514337 to b2d976a Compare August 21, 2023 14:58
src/backend/joanie/core/utils/issuers.py Outdated Show resolved Hide resolved
src/backend/joanie/core/serializers/client.py Outdated Show resolved Hide resolved
src/backend/locale/fr_FR/LC_MESSAGES/django.po Outdated Show resolved Hide resolved
src/backend/joanie/core/models/contracts.py Outdated Show resolved Hide resolved
src/backend/joanie/core/factories.py Outdated Show resolved Hide resolved
src/backend/joanie/core/api/admin.py Outdated Show resolved Hide resolved
src/backend/locale/es_ES/LC_MESSAGES/django.po Outdated Show resolved Hide resolved
src/backend/setup.cfg Outdated Show resolved Hide resolved
src/backend/joanie/tests/core/test_utils_issuers.py Outdated Show resolved Hide resolved
src/backend/joanie/core/models/contracts.py Outdated Show resolved Hide resolved
src/backend/joanie/core/models/contracts.py Outdated Show resolved Hide resolved
src/backend/joanie/core/models/contracts.py Outdated Show resolved Hide resolved
src/backend/joanie/core/utils/issuers.py Outdated Show resolved Hide resolved
src/backend/joanie/settings.py Outdated Show resolved Hide resolved
src/backend/joanie/core/models/contracts.py Outdated Show resolved Hide resolved
src/backend/joanie/core/factories.py Outdated Show resolved Hide resolved
src/backend/joanie/core/serializers/client.py Outdated Show resolved Hide resolved
src/backend/joanie/core/models/contracts.py Outdated Show resolved Hide resolved
src/backend/joanie/core/serializers/admin.py Outdated Show resolved Hide resolved
src/backend/joanie/core/api/client.py Show resolved Hide resolved
body = factory.Faker("paragraphs", nb=3)
description = factory.Faker("paragraph", nb_sentences=5)
language = factory.fuzzy.FuzzyChoice([lang[0] for lang in settings.LANGUAGES])
name = factory.fuzzy.FuzzyChoice([name[0] for name in enums.CONTRACT_NAME_CHOICES])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reminder : I should do the same for certificate_definition

src/backend/joanie/core/models/products.py Outdated Show resolved Hide resolved
@sampaccoud sampaccoud force-pushed the add-contract branch 3 times, most recently from 25e304b to a6efc6f Compare September 26, 2023 09:55
Copy link
Member

@jbpenrath jbpenrath left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM ✅

Samuel Paccoud - France Université Numérique added 2 commits September 26, 2023 14:33
We have recently introduced a "Params" field that holds a "ref_date".
This date is computed when the Python code first loads. When the full
test suite is run, the gap between the ref_date and "now" computed in
tests can be significant and lead to random test failures because a
course run created with a state ONGOING_OPEN can in fact be closed...
This test required that the number of seats on the order group be
at least 3. It was randomly failing when the random number of seats
was chosen to be less than 3...
We want to be able to sign learning conventions with students.
On the model of what was done for certificates, we add a
"ContractDefinition" model for universities to define the content
of the contract they want students to sign and a "Contract" model
to record actual contracts for each student on an order.
@sampaccoud sampaccoud enabled auto-merge (rebase) September 26, 2023 12:54
@sampaccoud sampaccoud merged commit dead809 into main Sep 26, 2023
13 of 14 checks passed
@sampaccoud sampaccoud deleted the add-contract branch September 26, 2023 13:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants