Demande: add nb_of_procedure, deadline and nb_of_dossier fields
This commit is contained in:
parent
159395dce2
commit
ee43650c32
5 changed files with 88 additions and 9 deletions
17
app/assets/stylesheets/new_design/demande.scss
Normal file
17
app/assets/stylesheets/new_design/demande.scss
Normal file
|
@ -0,0 +1,17 @@
|
|||
@import "constants";
|
||||
|
||||
.demande {
|
||||
padding-bottom: $default-padding;
|
||||
|
||||
h1 {
|
||||
margin-bottom: $default-padding;
|
||||
}
|
||||
|
||||
.intro {
|
||||
margin: $default-padding 0;
|
||||
}
|
||||
|
||||
b {
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
|
@ -12,7 +12,10 @@ class DemandesController < ApplicationController
|
|||
demande_params[:poste],
|
||||
demande_params[:source],
|
||||
demande_params[:organization_name],
|
||||
demande_params[:address]
|
||||
demande_params[:address],
|
||||
demande_params[:nb_of_procedures],
|
||||
demande_params[:nb_of_dossiers],
|
||||
demande_params[:deadline]
|
||||
)
|
||||
flash.notice = 'Votre demande a bien été enregistrée, nous vous contacterons rapidement.'
|
||||
redirect_to root_path
|
||||
|
@ -21,6 +24,17 @@ class DemandesController < ApplicationController
|
|||
private
|
||||
|
||||
def demande_params
|
||||
params.permit(:organization_name, :poste, :name, :email, :phone, :source, :address)
|
||||
params.permit(
|
||||
:organization_name,
|
||||
:poste,
|
||||
:name,
|
||||
:email,
|
||||
:phone,
|
||||
:source,
|
||||
:address,
|
||||
:nb_of_procedures,
|
||||
:nb_of_dossiers,
|
||||
:deadline
|
||||
)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -10,6 +10,20 @@ class Pipedrive::DealAdapter
|
|||
PIPEDRIVE_LOST_STATUS = "lost"
|
||||
PIPEDRIVE_LOST_REASON = "refusé depuis DS"
|
||||
|
||||
PIPEDRIVE_NB_OF_PROCEDURES_ATTRIBUTE_ID = "b22f8710352a7fb548623c062bf82ed6d1b6b704"
|
||||
PIPEDRIVE_NB_OF_PROCEDURES_DO_NOT_KNOW_VALUE = "Je ne sais pas"
|
||||
PIPEDRIVE_NB_OF_PROCEDURES_1_VALUE = "juste 1"
|
||||
PIPEDRIVE_NB_OF_PROCEDURES_1_TO_10_VALUE = "de 1 a 10"
|
||||
PIPEDRIVE_NB_OF_PROCEDURES_10_TO_100_VALUE = "de 10 a 100"
|
||||
PIPEDRIVE_NB_OF_PROCEDURES_ABOVE_100_VALUE = "Plus de 100"
|
||||
|
||||
PIPEDRIVE_DEADLINE_ATTRIBUTE_ID = "36a72c82af9d9f0d476b041ede8876844a249bf2"
|
||||
PIPEDRIVE_DEADLINE_ASAP_VALUE = "Le plus vite possible"
|
||||
PIPEDRIVE_DEADLINE_NEXT_3_MONTHS_VALUE = "Dans les 3 prochain mois"
|
||||
PIPEDRIVE_DEADLINE_NEXT_6_MONTHS_VALUE = "Dans les 6 prochain mois"
|
||||
PIPEDRIVE_DEADLINE_NEXT_12_MONTHS_VALUE = "Dans les 12 prochain mois"
|
||||
PIPEDRIVE_DEADLINE_NO_DATE_VALUE = "Pas de date"
|
||||
|
||||
def self.refuse_deal(deal_id, owner_id)
|
||||
params = {
|
||||
user_id: owner_id,
|
||||
|
@ -32,12 +46,15 @@ class Pipedrive::DealAdapter
|
|||
Pipedrive::API.put_deal(deal_id, params)
|
||||
end
|
||||
|
||||
def self.add_deal(organisation_id, person_id, title)
|
||||
def self.add_deal(organisation_id, person_id, title, nb_of_procedures, nb_of_dossiers, deadline)
|
||||
params = {
|
||||
org_id: organisation_id,
|
||||
person_id: person_id,
|
||||
title: title,
|
||||
user_id: Pipedrive::PersonAdapter::PIPEDRIVE_ROBOT_ID
|
||||
user_id: Pipedrive::PersonAdapter::PIPEDRIVE_ROBOT_ID,
|
||||
"#{PIPEDRIVE_NB_OF_PROCEDURES_ATTRIBUTE_ID}": nb_of_procedures,
|
||||
value: nb_of_dossiers,
|
||||
"#{PIPEDRIVE_DEADLINE_ATTRIBUTE_ID}": deadline,
|
||||
}
|
||||
|
||||
Pipedrive::API.post_deal(params)
|
||||
|
|
|
@ -17,9 +17,9 @@ class PipedriveService
|
|||
Pipedrive::PersonAdapter.get_demandes_from_persons_owned_by_robot
|
||||
end
|
||||
|
||||
def self.add_demande(email, phone, name, poste, source, organization_name, address)
|
||||
def self.add_demande(email, phone, name, poste, source, organization_name, address, nb_of_procedures, nb_of_dossiers, deadline)
|
||||
organization_id = Pipedrive::OrganizationAdapter.add_organization(organization_name, address)
|
||||
person_id = Pipedrive::PersonAdapter.add_person(email, phone, name, organization_id, poste, source)
|
||||
Pipedrive::DealAdapter.add_deal(organization_id, person_id, organization_name)
|
||||
Pipedrive::DealAdapter.add_deal(organization_id, person_id, organization_name, nb_of_procedures, nb_of_dossiers, deadline)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
.container
|
||||
.container.demande
|
||||
%h1 Demande de compte administrateur
|
||||
%p Pour obtenir un compte administrateur sur demarches-simplifiees.fr, veuillez remplir le formulaire ci-dessous et un membre de notre équipe vous contactera très prochainement.
|
||||
%p Tous les champs sont obligatoires.
|
||||
|
||||
%p.intro Attention, la création de compte administrateur est réservée <b>uniquement aux organismes publics</b>. Elle ne concerne ni les particuliers, ni les entreprises, ni les associations (sauf celles reconnues d'utilité publique), ni les personnes souhaitant remplir un dossier ou faire une démarche en ligne. Ce compte vous permettra de créer des démarches sur demarches-simplifiees.fr, vous pourrez ensuite les diffuser en ligne auprès de vos usagers.
|
||||
%p.intro Pour obtenir un compte administrateur sur demarches-simplifiees.fr, veuillez remplir le formulaire ci-dessous et un membre de notre équipe vous contactera dès que possible.
|
||||
%p.intro Tous les champs sont obligatoires.
|
||||
|
||||
= form_tag({ controller: 'demandes', action: 'create' }, class: 'form') do
|
||||
|
||||
|
@ -40,4 +42,33 @@
|
|||
%span.mandatory *
|
||||
= text_field_tag :address, nil, required: true
|
||||
|
||||
= label_tag :nb_of_procedures do
|
||||
Combien de procédures souhaitez-vous dématerialiser ?
|
||||
%span.mandatory *
|
||||
= select_tag :nb_of_procedures,
|
||||
options_for_select({ 'je ne sais pas' => Pipedrive::DealAdapter::PIPEDRIVE_NB_OF_PROCEDURES_DO_NOT_KNOW_VALUE,
|
||||
'1' => Pipedrive::DealAdapter::PIPEDRIVE_NB_OF_PROCEDURES_1_VALUE,
|
||||
'1 à 10' => Pipedrive::DealAdapter::PIPEDRIVE_NB_OF_PROCEDURES_1_TO_10_VALUE,
|
||||
'10 à 100 ' => Pipedrive::DealAdapter::PIPEDRIVE_NB_OF_PROCEDURES_10_TO_100_VALUE,
|
||||
'plus de 100' => Pipedrive::DealAdapter::PIPEDRIVE_NB_OF_PROCEDURES_ABOVE_100_VALUE }),
|
||||
prompt: 'choisir un intervalle',
|
||||
required: true
|
||||
|
||||
= label_tag :deadline do
|
||||
À quelle échance voudriez-vous dématerialiser ?
|
||||
%span.mandatory *
|
||||
= select_tag :deadline,
|
||||
options_for_select({ 'le plus vite possible' => Pipedrive::DealAdapter::PIPEDRIVE_DEADLINE_ASAP_VALUE,
|
||||
'dans les 3 prochains mois' => Pipedrive::DealAdapter::PIPEDRIVE_DEADLINE_NEXT_3_MONTHS_VALUE,
|
||||
'dans les 6 prochains mois' => Pipedrive::DealAdapter::PIPEDRIVE_DEADLINE_NEXT_6_MONTHS_VALUE,
|
||||
'dans les 12 prochains mois' => Pipedrive::DealAdapter::PIPEDRIVE_DEADLINE_NEXT_12_MONTHS_VALUE,
|
||||
'pas de date' => Pipedrive::DealAdapter::PIPEDRIVE_DEADLINE_NO_DATE_VALUE }),
|
||||
prompt: 'choisir une échéance',
|
||||
required: true
|
||||
|
||||
= label_tag :nb_of_dossiers do
|
||||
Nombre de dossiers usagers qui seront démateerialisés, par an ? (Mettez 0 si vous ne savez pas)
|
||||
%span.mandatory *
|
||||
= number_field_tag :nb_of_dossiers, nil, required: true
|
||||
|
||||
= submit_tag 'Envoyer', class: 'button', data: { disable: true }
|
||||
|
|
Loading…
Reference in a new issue