demarches-normaliennes/app/models/concerns
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
..
.keep First Commit 2015-08-10 11:05:06 +02:00
attachment_titre_identite_watermark_concern.rb active_storage: refactor concerns 2021-03-16 11:49:14 +01:00
attachment_virus_scanner_concern.rb active_storage: refactor concerns 2021-03-16 11:49:14 +01:00
blob_signed_id_concern.rb Rails app:update 2020-07-07 18:03:56 +02:00
blob_titre_identite_watermark_concern.rb active_storage: refactor concerns 2021-03-16 11:49:14 +01:00
blob_virus_scanner_concern.rb refactor(piece_justificative): UX follows mockups 2022-12-05 10:47:10 +01:00
dossier_filtering_concern.rb feat(instructeur/procedure#index): enhance filter to support processed_at and state [plus en_instruction_at/since] 2022-09-27 17:19:54 +02:00
dossier_prefillable_concern.rb feat(demarche): create and prefill a dossier with POST request (#8233) 2023-01-03 14:46:10 +01:00
dossier_rebase_concern.rb refactor(revision): changes should be domain objects 2022-12-27 10:58:53 +00:00
email_sanitizable_concern.rb [Fix #1479] Create a sanitize email concern 2018-03-14 17:41:45 +01:00
encryptable_concern.rb add encryptable_concern 2021-07-30 11:18:44 +02:00
mail_template_concern.rb mailers: add deposit receipt to initiated_mail 2022-05-17 10:25:13 +02:00
password_complexity_concern.rb models: extract password complexity to a concern 2021-09-09 09:40:39 -05:00
procedure_stats_concern.rb fix(dossier): use depose_at instead of en_construction_at 2021-12-06 15:49:17 +01:00
tags_substitution_concern.rb amelioration(attestation.et.mail): desactive les tags sur les champs conditionnés et informe l'usager que ca arrivera 2022-12-19 09:28:46 +01:00
transient_models_with_purgeable_job_concern.rb fix(exports): purge stuck (pending) exports, not generated or failed 2022-07-27 15:26:59 +02:00
trusted_device_concern.rb Rename gestionnaire in code to instructeur 2019-08-12 13:47:01 +02:00