demarches-normaliennes/spec
Sébastien Carceles 20136b7ac8
feat(demarche): create and prefill a dossier with POST request (#8233)
* add base controller for public api

* add dossiers controller with basic checks

* create the dossier

* ensure content-type is json

* prefill dossier with given values

* mark a dossier as prefilled

When a dossier is prefilled, it's allowed not to have a user.

Plus, we add a secure token to the dossier, which we will need later to set a
user after sign in / sign up.

* set user as owner of an orphan prefilled dossier

When a visitor comes from the dossier_url answered by the public api,
the dossier is orphan:
- when the user is already authenticated: they become the owner
- when the user is not authenticated: they can sign in / sign up / france_connect
and then they become the owner

So here is the procedure:
- allow to sign in / sign up / france connect when user is unauthenticated
- set dossier ownership when the dossier is orphan
- check dossier ownership when the dossier is not
- redirect to brouillon path when user is signed in and owner

* mark the dossier as prefilled when it's prefilled
(even with a GET request, because it will be useful later on, for
exmample in order to cleanup the unused prefilled dossiers)

* system spec: prefilling dossier with post request
2023-01-03 14:46:10 +01:00
..
components fix linter 2022-12-15 10:04:25 +01:00
controllers feat(demarche): create and prefill a dossier with POST request (#8233) 2023-01-03 14:46:10 +01:00
factories feat(demarche): create and prefill a dossier with POST request (#8233) 2023-01-03 14:46:10 +01:00
fixtures fix(dossier): update spec 2022-12-21 14:03:02 +01:00
graphql test(api): add a test to cover single (flat) attachment extension 2022-12-05 10:47:10 +01:00
helpers feat(procedure): includes read duration of explication/non fillable champs 2022-10-31 12:17:16 +01:00
jobs extract ds_opendata_enabled 2022-12-20 12:52:56 +01:00
lib correctif(ChampDepartement): gere les departement a 3 codes 2022-12-27 14:55:57 +01:00
mailers feat(demarche): create and prefill a dossier with POST request (#8233) 2023-01-03 14:46:10 +01:00
middlewares specs: always require rails_helper 2020-03-31 12:48:32 +02:00
models feat(demarche): create and prefill a dossier with POST request (#8233) 2023-01-03 14:46:10 +01:00
policies refactor(dossier): champs -> champs_public 2022-11-10 22:44:39 +00:00
serializers fix(apiv1): piece_justificative continue to returns a single attachment 2022-12-06 15:47:06 +01:00
services correctif(ChampDepartement): gere les departement a 3 codes 2022-12-27 14:55:57 +01:00
support feat(demarche): create and prefill a dossier with POST request (#8233) 2023-01-03 14:46:10 +01:00
system feat(demarche): create and prefill a dossier with POST request (#8233) 2023-01-03 14:46:10 +01:00
views Merge pull request #8267 from mfo/a11y/use-alert-for-dossier-state 2022-12-26 17:44:59 +01:00
rails_helper.rb test(flipper): reset flipper flags before each test 2022-10-12 14:14:30 +02:00
spec_helper.rb Chore(test): enable rspec only-failures support 2021-04-15 14:17:39 +02:00