demarches-normaliennes/spec/models
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
..
champs correctif(ChampDepartement): gere les departement a 3 codes 2022-12-27 14:55:57 +01:00
concern feat(demarche): create and prefill a dossier with POST request (#8233) 2023-01-03 14:46:10 +01:00
logic add a test 2022-09-28 10:06:32 +02:00
types_de_champ add code insee libelle for commune export 2021-08-19 08:04:47 +02:00
administrateur_spec.rb feat(api_token): add APIToken model 2022-12-07 18:19:37 +01:00
api_entreprise_token_spec.rb refactor(API Entreprise): raise an error on blank token 2022-02-07 15:18:16 +01:00
api_token_spec.rb clean(api_token): remove administrateur token support 2022-12-08 17:35:21 +01:00
archive_spec.rb fix(archives): purge stuck pending archives 2022-07-27 15:26:59 +02:00
assign_to_spec.rb chore(create_procedure_presentation): homogénéise l'interface sur les procédure présentation. pas d'objet 'build', sinon les export/filtres deviennent compliqués 2022-10-31 09:29:27 +01:00
attestation_template_spec.rb refactor(dossier): champs -> champs_public 2022-11-10 22:44:39 +00:00
avis_spec.rb clean(deadcode): remove dead methods 2022-05-24 14:23:40 +02:00
batch_operation_spec.rb remove redundant and failing test 2022-12-15 10:04:25 +01:00
bill_signature_spec.rb fix(spec): update spec with new timestamp 2022-12-07 19:28:01 +01:00
champ_private_spec.rb specs: always require rails_helper 2020-03-31 12:48:32 +02:00
champ_shared_example.rb clean(type_de_champ): remove magic factory 2022-12-01 16:36:59 +01:00
champ_spec.rb fix(dossier): update spec 2022-12-21 14:03:02 +01:00
commentaire_spec.rb fix(messages): retry stale blobs 2022-11-02 09:19:51 +01:00
condition_form_spec.rb fix(conditional): only parse user input as int if compared with a number 2022-09-09 11:28:32 +02:00
deleted_dossier_spec.rb specs: remove unused require 2021-03-25 13:24:53 +01:00
dossier_preloader_spec.rb refactor(dossier): flatten champ attributes 2022-12-14 13:03:06 +01:00
dossier_rebase_concern_spec.rb feat(dossier): allow to rebase champs with value made mandatory 2022-12-22 13:08:04 +01:00
dossier_spec.rb feat(demarche): create and prefill a dossier with POST request (#8233) 2023-01-03 14:46:10 +01:00
dossier_transfer_spec.rb fix(dossier_transfer): requires an actual email 2022-08-03 11:44:54 +02:00
dubious_procedure_spec.rb fix(spec): fix dubious procedure spec 2022-10-11 11:50:41 +02:00
etablissement_spec.rb export bilans in ods and xlsx 2020-06-04 15:31:16 +02:00
exercice_spec.rb specs: always require rails_helper 2020-03-31 12:48:32 +02:00
expert_spec.rb fix(messages): retry stale blobs 2022-11-02 09:19:51 +01:00
experts_procedure_spec.rb experts_procedure should not be optional 2021-03-23 13:46:33 +01:00
export_spec.rb feat(export): add GeoJSON export 2022-11-18 10:04:35 +01:00
france_connect_information_spec.rb associate_user take a target email 2021-10-14 14:47:50 +02:00
france_connect_particulier_client_spec.rb specs: always require rails_helper 2020-03-31 12:48:32 +02:00
geo_area_spec.rb feat(export.xslx): add code commune to geo_area.label 2022-09-17 08:59:06 +02:00
groupe_instructeur_spec.rb fix(instructeur): copy notifications settings from previous groupe instructeur 2021-12-23 13:55:25 +01:00
individual_spec.rb models: require belong_to associations on individual 2020-08-18 15:57:37 +02:00
instructeur_spec.rb refactor(demarche): make declarative demarche processing syncroneous 2022-12-06 11:41:25 +01:00
invite_spec.rb fix(sentry/3422144920): old email using TargetUserLink creates confusing errors 2022-10-04 11:41:32 +02:00
logic_spec.rb compatibility from left 2022-09-28 10:06:31 +02:00
mail_template_spec.rb amelioration(attestion.et.mail): deduplique les message d'erreur, améliore les messages d'erreur, gère la pluralisation des erreurs lorsque plusieurs tags sont concernés 2022-12-19 09:28:46 +01:00
prefill_description_spec.rb hide values and examples for unprefillable champs (#8309) 2022-12-20 13:37:25 +00:00
prefill_params_spec.rb feat(prefill): allow to prefill private annotations 2022-12-26 22:14:17 +00:00
procedure_overview_spec.rb fix(dossier): excluded deleted dossiers from demarche overview 2022-11-29 16:41:31 +01:00
procedure_presentation_and_revisions_spec.rb refactor(revision): rename find_or_clone_type_de_champ 2022-05-31 08:58:53 +02:00
procedure_presentation_spec.rb style(instructeurs): human/i18n value for state filter 2022-12-15 09:34:10 +01:00
procedure_revision_spec.rb refactor(revision): changes should be domain objects 2022-12-27 10:58:53 +00:00
procedure_spec.rb remove feature flag zonage 2022-12-21 09:02:16 +01:00
service_spec.rb refactor(service): explicit call to service job to avoid test side effect 2022-10-25 14:44:43 +02:00
siret_spec.rb specs: always require rails_helper 2020-03-31 12:48:32 +02:00
stat_spec.rb stats: move date formatting out of the Stat model 2022-02-02 14:13:53 +01:00
super_admin_spec.rb models: improve password complexity specs 2021-09-09 09:40:39 -05:00
targeted_user_link_spec.rb feat(invite): wrap invitation with targeted_user_links 2022-06-17 16:44:37 +02:00
trusted_device_token_spec.rb models: require belong_to associations on trusted_device_token 2020-08-18 15:57:37 +02:00
type_de_champ_private_spec.rb specs: always require rails_helper 2020-03-31 12:48:32 +02:00
type_de_champ_shared_example.rb feat(EditComponent): add max_file_size and content_types to upload buttons inspired by dsfr 2022-06-28 17:44:35 +02:00
type_de_champ_spec.rb Allow prefill civility 2022-12-20 14:38:05 +01:00
user_spec.rb refactor(user): rename delete_and_keep_track_dossiers 2022-11-16 17:52:47 +01:00
zone_spec.rb can choose multiple zones 2022-10-07 10:48:35 +02:00