demarches-normaliennes/spec/factories
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
..
administrateur.rb feat(api_token): add APIToken model 2022-12-07 18:19:37 +01:00
administrateurs_procedure.rb feat(Administrateurs::ProcedureAdministrateurs): ensure admin from super admin can not add administrateur 2022-08-23 13:28:10 +02:00
archive.rb fix(export): when it takes more than 3 hours, exports are purge before being generated. make it possible to have an export that takes more than 3 hours and share this behaviour with kind of same class archive 2022-07-25 10:48:54 +02:00
assign_to.rb models: require belong_to associations on assign_to 2020-08-18 15:57:36 +02:00
attestation.rb models: require belong_to associations on attestation 2020-08-18 15:57:36 +02:00
attestation_template.rb refactor(attestation_template): move to procedure 2022-11-23 12:26:26 +01:00
avis.rb experts_procedure should not be optional 2021-03-23 13:46:33 +01:00
batch_operation.rb add bulk action feature for 'passer_en_instruction' 2022-12-15 10:04:25 +01:00
bill_signature.rb WIP 2020-07-07 18:03:56 +02:00
bulk_message.rb fix(bulk_messages): destroy bulk messages with procedures 2021-12-09 16:16:40 +01:00
champ.rb correctif(ChampDepartement): gere les departement a 3 codes 2022-12-27 14:55:57 +01:00
commentaire.rb models: require belong_to associations on commentaire 2020-08-18 15:57:36 +02:00
deleted_dossier.rb test(dossier): update spec to use visible_by_administration 2022-03-10 14:29:40 +01:00
dossier.rb feat(demarche): create and prefill a dossier with POST request (#8233) 2023-01-03 14:46:10 +01:00
dossier_operation_log.rb Add BillSignature Model 2019-06-17 16:16:28 +02:00
dossier_submitted_message.rb feat(dossier_submitted_message): add a new system to customize the standby page (/merci) after an user created his folder. this is a basic feature that will come with more options asap 2022-02-25 14:01:18 +01:00
dossier_transfer.rb fix(dossier): do not attempt to destroy transfers when a dossier is destroyed 2021-10-06 17:51:09 +02:00
etablissement.rb chore(schema): add entreprise_etat_administratif to etablissements 2022-07-25 10:58:02 +02:00
exercice.rb models: require belong_to associations on dossier 2020-08-18 15:57:36 +02:00
expert.rb factories: cleanup Administrateur, Instructeur and Expert factories 2021-10-26 12:03:30 +02:00
experts_procedure.rb experts_procedure should not be optional 2021-03-23 13:46:33 +01:00
export.rb correct(export): la creation d'archive pour un groupe d'instructeur, avec des filtres differents et identique doit etre consistante 2022-10-31 09:29:27 +01:00
follow.rb models: require belong_to associations on follow 2020-08-18 15:57:37 +02:00
france_connect_information.rb add :with_user trait to fci as user_id is mandatory 2021-05-05 14:28:20 +02:00
geo_area.rb feat(carte/export): list geo labels 2022-09-05 11:02:51 +02:00
groupe_instructeur.rb fix(bulk_messages): destroy bulk messages with procedures 2021-12-09 16:16:40 +01:00
individual.rb specs: avoid executing business logic in Procedure factory 2021-11-23 08:07:07 +01:00
instructeur.rb specs: use Instructeur.bypass_email_login_token in the tests 2021-12-02 08:51:52 +01:00
invite.rb models: require belong_to associations on invite 2020-08-18 15:57:37 +02:00
mail_templates.rb models: require belong_to associations on mail templates 2020-08-18 15:57:37 +02:00
procedure.rb correctif(api/v1): ajoute la methode manquante for_api sur le type de champs departement 2022-12-27 11:45:43 +01:00
procedure_presentation.rb models: require belong_to associations on assign_to 2020-08-18 15:57:36 +02:00
procedure_revision.rb refactor(attestation_template): move to procedure 2022-11-23 12:26:26 +01:00
procedure_revision_type_de_champ.rb specs: avoid executing business logic in Procedure factory 2021-11-23 08:07:07 +01:00
service.rb chore(schema): +services#etablissement_{infos,geopoint} 2022-09-06 09:23:52 +02:00
super_admin.rb superadmin: check complexity password server side 2020-12-15 16:26:09 +01:00
targeted_user_links.rb feat(invite): wrap invitation with targeted_user_links 2022-06-17 16:44:37 +02:00
traitement.rb lint(rubocop): come on, maybe i will find the inspiration to setup it up in my ide 2021-11-19 14:36:21 +01:00
trusted_device_token.rb models: require belong_to associations on trusted_device_token 2020-08-18 15:57:37 +02:00
type_de_champ.rb Merge branch 'main' into feature/add_rna_type_de_champs 2022-10-05 12:38:24 +02:00
user.rb Change factory user password to be compatible with admin pass constraint 2021-10-28 14:39:13 +02:00
zone.rb add zone label 2022-09-26 16:58:53 +02:00