Remove entreprise and rna_information models
This commit is contained in:
parent
81179ceba9
commit
ad24fd5991
15 changed files with 75 additions and 123 deletions
|
@ -14,7 +14,6 @@ class Dossier < ApplicationRecord
|
||||||
SOUMIS = EN_CONSTRUCTION_OU_INSTRUCTION + TERMINE
|
SOUMIS = EN_CONSTRUCTION_OU_INSTRUCTION + TERMINE
|
||||||
|
|
||||||
has_one :etablissement, dependent: :destroy
|
has_one :etablissement, dependent: :destroy
|
||||||
has_one :entreprise, dependent: :destroy
|
|
||||||
has_one :individual, dependent: :destroy
|
has_one :individual, dependent: :destroy
|
||||||
has_one :attestation
|
has_one :attestation
|
||||||
has_many :cerfa, dependent: :destroy
|
has_many :cerfa, dependent: :destroy
|
||||||
|
@ -56,7 +55,7 @@ class Dossier < ApplicationRecord
|
||||||
scope :en_construction, -> { not_archived.state_en_construction }
|
scope :en_construction, -> { not_archived.state_en_construction }
|
||||||
scope :en_instruction, -> { not_archived.state_en_instruction }
|
scope :en_instruction, -> { not_archived.state_en_instruction }
|
||||||
scope :termine, -> { not_archived.state_termine }
|
scope :termine, -> { not_archived.state_termine }
|
||||||
scope :downloadable_sorted, -> { state_not_brouillon.includes(:entreprise, :etablissement, :champs, :champs_private).order(en_construction_at: 'asc') }
|
scope :downloadable_sorted, -> { state_not_brouillon.includes(:etablissement, :champs, :champs_private).order(en_construction_at: 'asc') }
|
||||||
scope :en_cours, -> { not_archived.state_en_construction_ou_instruction }
|
scope :en_cours, -> { not_archived.state_en_construction_ou_instruction }
|
||||||
scope :without_followers, -> { left_outer_joins(:follows).where(follows: { id: nil }) }
|
scope :without_followers, -> { left_outer_joins(:follows).where(follows: { id: nil }) }
|
||||||
scope :followed_by, -> (gestionnaire) { joins(:follows).where(follows: { gestionnaire: gestionnaire }) }
|
scope :followed_by, -> (gestionnaire) { joins(:follows).where(follows: { gestionnaire: gestionnaire }) }
|
||||||
|
@ -64,8 +63,7 @@ class Dossier < ApplicationRecord
|
||||||
|
|
||||||
accepts_nested_attributes_for :individual
|
accepts_nested_attributes_for :individual
|
||||||
|
|
||||||
delegate :siren, to: :entreprise
|
delegate :siret, :siren, to: :etablissement, allow_nil: true
|
||||||
delegate :siret, to: :etablissement, allow_nil: true
|
|
||||||
delegate :types_de_piece_justificative, to: :procedure
|
delegate :types_de_piece_justificative, to: :procedure
|
||||||
delegate :types_de_champ, to: :procedure
|
delegate :types_de_champ, to: :procedure
|
||||||
delegate :france_connect_information, to: :user
|
delegate :france_connect_information, to: :user
|
||||||
|
@ -220,7 +218,7 @@ class Dossier < ApplicationRecord
|
||||||
when 'france_connect_information'
|
when 'france_connect_information'
|
||||||
self.user.france_connect_information&.send(column)
|
self.user.france_connect_information&.send(column)
|
||||||
when 'entreprise'
|
when 'entreprise'
|
||||||
self.entreprise&.send(column)
|
self.etablissement&.send(:"entreprise_#{column}")
|
||||||
when 'etablissement'
|
when 'etablissement'
|
||||||
self.etablissement&.send(column)
|
self.etablissement&.send(column)
|
||||||
when 'type_de_champ'
|
when 'type_de_champ'
|
||||||
|
@ -235,8 +233,8 @@ class Dossier < ApplicationRecord
|
||||||
end
|
end
|
||||||
|
|
||||||
def owner_name
|
def owner_name
|
||||||
if entreprise.present?
|
if etablissement.present?
|
||||||
entreprise.raison_sociale
|
etablissement.entreprise_raison_sociale
|
||||||
elsif individual.present?
|
elsif individual.present?
|
||||||
"#{individual.nom} #{individual.prenom}"
|
"#{individual.nom} #{individual.prenom}"
|
||||||
end
|
end
|
||||||
|
@ -298,8 +296,8 @@ class Dossier < ApplicationRecord
|
||||||
|
|
||||||
def export_etablissement_data
|
def export_etablissement_data
|
||||||
if etablissement.present?
|
if etablissement.present?
|
||||||
etablissement_attr = EtablissementCsvSerializer.new(self.etablissement).attributes.transform_keys { |k| "etablissement.#{k}".parameterize.underscore.to_sym }
|
etablissement_attr = EtablissementCsvSerializer.new(etablissement).attributes.transform_keys { |k| "etablissement.#{k}".parameterize.underscore.to_sym }
|
||||||
entreprise_attr = EntrepriseSerializer.new(self.entreprise).attributes.transform_keys { |k| "entreprise.#{k}".parameterize.underscore.to_sym }
|
entreprise_attr = EntrepriseSerializer.new(etablissement.entreprise).attributes.transform_keys { |k| "entreprise.#{k}".parameterize.underscore.to_sym }
|
||||||
else
|
else
|
||||||
etablissement_attr = EtablissementSerializer.new(Etablissement.new).attributes.transform_keys { |k| "etablissement.#{k}".parameterize.underscore.to_sym }
|
etablissement_attr = EtablissementSerializer.new(Etablissement.new).attributes.transform_keys { |k| "etablissement.#{k}".parameterize.underscore.to_sym }
|
||||||
entreprise_attr = EntrepriseSerializer.new(Entreprise.new).attributes.transform_keys { |k| "entreprise.#{k}".parameterize.underscore.to_sym }
|
entreprise_attr = EntrepriseSerializer.new(Entreprise.new).attributes.transform_keys { |k| "entreprise.#{k}".parameterize.underscore.to_sym }
|
||||||
|
|
|
@ -1,16 +1,20 @@
|
||||||
class Entreprise < ApplicationRecord
|
class Entreprise < Hashie::Dash
|
||||||
belongs_to :dossier
|
def read_attribute_for_serialization(attribute)
|
||||||
has_one :etablissement
|
self[attribute]
|
||||||
has_one :rna_information, dependent: :destroy
|
|
||||||
|
|
||||||
validates :siren, presence: true
|
|
||||||
validates :dossier_id, uniqueness: true
|
|
||||||
|
|
||||||
accepts_nested_attributes_for :rna_information, update_only: true
|
|
||||||
|
|
||||||
before_save :default_values
|
|
||||||
|
|
||||||
def default_values
|
|
||||||
self.raison_sociale ||= ''
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
property :siren
|
||||||
|
property :capital_social
|
||||||
|
property :numero_tva_intracommunautaire
|
||||||
|
property :forme_juridique
|
||||||
|
property :forme_juridique_code
|
||||||
|
property :nom_commercial
|
||||||
|
property :raison_sociale
|
||||||
|
property :siret_siege_social
|
||||||
|
property :code_effectif_entreprise
|
||||||
|
property :date_creation
|
||||||
|
property :nom
|
||||||
|
property :prenom
|
||||||
|
|
||||||
|
property :inline_adresse
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,18 +1,20 @@
|
||||||
class Etablissement < ApplicationRecord
|
class Etablissement < ApplicationRecord
|
||||||
belongs_to :dossier
|
belongs_to :dossier
|
||||||
belongs_to :entreprise, dependent: :destroy
|
|
||||||
|
|
||||||
has_one :champ, class_name: 'Champs::SiretChamp'
|
has_one :champ, class_name: 'Champs::SiretChamp'
|
||||||
has_many :exercices, dependent: :destroy
|
has_many :exercices, dependent: :destroy
|
||||||
|
|
||||||
accepts_nested_attributes_for :exercices
|
accepts_nested_attributes_for :exercices
|
||||||
accepts_nested_attributes_for :entreprise, update_only: true
|
|
||||||
|
|
||||||
validates :siret, presence: true
|
validates :siret, presence: true
|
||||||
validates :dossier_id, uniqueness: { allow_nil: true }
|
validates :dossier_id, uniqueness: { allow_nil: true }
|
||||||
|
|
||||||
validate :validate_signature
|
validate :validate_signature
|
||||||
|
|
||||||
|
def siren
|
||||||
|
entreprise_siren
|
||||||
|
end
|
||||||
|
|
||||||
def geo_adresse
|
def geo_adresse
|
||||||
[numero_voie, type_voie, nom_voie, complement_adresse, code_postal, localite].join(' ')
|
[numero_voie, type_voie, nom_voie, complement_adresse, code_postal, localite].join(' ')
|
||||||
end
|
end
|
||||||
|
@ -22,10 +24,6 @@ class Etablissement < ApplicationRecord
|
||||||
"#{numero_voie} #{type_voie} #{nom_voie}, #{complement_adresse}, #{code_postal} #{localite}".squeeze(' ')
|
"#{numero_voie} #{type_voie} #{nom_voie}, #{complement_adresse}, #{code_postal} #{localite}".squeeze(' ')
|
||||||
end
|
end
|
||||||
|
|
||||||
def titre
|
|
||||||
entreprise_raison_sociale || association_titre
|
|
||||||
end
|
|
||||||
|
|
||||||
def verify
|
def verify
|
||||||
SignatureService.verify(signature, message_for_signature)
|
SignatureService.verify(signature, message_for_signature)
|
||||||
end
|
end
|
||||||
|
@ -36,29 +34,26 @@ class Etablissement < ApplicationRecord
|
||||||
|
|
||||||
attr_accessor :signature
|
attr_accessor :signature
|
||||||
|
|
||||||
def entreprise_raison_sociale_or_name
|
def association?
|
||||||
entreprise_raison_sociale.presence || "#{entreprise_nom} #{entreprise_prenom}"
|
association_rna.present?
|
||||||
end
|
end
|
||||||
|
|
||||||
def entreprise_effectif
|
def entreprise
|
||||||
{
|
Entreprise.new(
|
||||||
'NN' => "Unités non employeuses (pas de salarié au cours de l'année de référence et pas d'effectif au 31/12).",
|
siren: entreprise_siren,
|
||||||
'00' => "0 salarié (n'ayant pas d'effectif au 31/12 mais ayant employé des salariés au cours de l'année de référence)",
|
capital_social: entreprise_capital_social,
|
||||||
'01' => '1 ou 2 salariés',
|
numero_tva_intracommunautaire: entreprise_numero_tva_intracommunautaire,
|
||||||
'02' => '3 à 5 salariés',
|
forme_juridique: entreprise_forme_juridique,
|
||||||
'03' => '6 à 9 salariés',
|
forme_juridique_code: entreprise_forme_juridique_code,
|
||||||
'11' => '10 à 19 salariés',
|
nom_commercial: entreprise_nom_commercial,
|
||||||
'12' => '20 à 49 salariés',
|
raison_sociale: entreprise_raison_sociale,
|
||||||
'21' => '50 à 99 salariés',
|
siret_siege_social: entreprise_siret_siege_social,
|
||||||
'22' => '100 à 199 salariés',
|
code_effectif_entreprise: entreprise_code_effectif_entreprise,
|
||||||
'31' => '200 à 249 salariés',
|
date_creation: entreprise_date_creation,
|
||||||
'32' => '250 à 499 salariés',
|
nom: entreprise_nom,
|
||||||
'41' => '500 à 999 salariés',
|
prenom: entreprise_prenom,
|
||||||
'42' => '1 000 à 1 999 salariés',
|
inline_adresse: inline_adresse
|
||||||
'51' => '2 000 à 4 999 salariés',
|
)
|
||||||
'52' => '5 000 à 9 999 salariés',
|
|
||||||
'53' => '10 000 salariés et plus'
|
|
||||||
}[entreprise_code_effectif_entreprise]
|
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
|
@ -285,12 +285,12 @@ class Procedure < ApplicationRecord
|
||||||
|
|
||||||
if !for_individual || (for_individual && individual_with_siret)
|
if !for_individual || (for_individual && individual_with_siret)
|
||||||
fields << [
|
fields << [
|
||||||
field_hash('SIREN', 'entreprise', 'siren'),
|
field_hash('SIREN', 'etablissement', 'entreprise_siren'),
|
||||||
field_hash('Forme juridique', 'entreprise', 'forme_juridique'),
|
field_hash('Forme juridique', 'etablissement', 'entreprise_forme_juridique'),
|
||||||
field_hash('Nom commercial', 'entreprise', 'nom_commercial'),
|
field_hash('Nom commercial', 'etablissement', 'entreprise_nom_commercial'),
|
||||||
field_hash('Raison sociale', 'entreprise', 'raison_sociale'),
|
field_hash('Raison sociale', 'etablissement', 'entreprise_raison_sociale'),
|
||||||
field_hash('SIRET siège social', 'entreprise', 'siret_siege_social'),
|
field_hash('SIRET siège social', 'etablissement', 'entreprise_siret_siege_social'),
|
||||||
field_hash('Date de création', 'entreprise', 'date_creation')
|
field_hash('Date de création', 'etablissement', 'entreprise_date_creation')
|
||||||
]
|
]
|
||||||
|
|
||||||
fields << [
|
fields << [
|
||||||
|
|
|
@ -1,9 +0,0 @@
|
||||||
class RNAInformation < ApplicationRecord
|
|
||||||
belongs_to :entreprise
|
|
||||||
|
|
||||||
validates :association_id, presence: true, allow_blank: false, allow_nil: false
|
|
||||||
|
|
||||||
def rna=(id)
|
|
||||||
write_attribute(:association_id, id)
|
|
||||||
end
|
|
||||||
end
|
|
|
@ -34,6 +34,10 @@ class DossierSerializer < ActiveModel::Serializer
|
||||||
object.user.try(:email)
|
object.user.try(:email)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def entreprise
|
||||||
|
object.etablissement&.entreprise
|
||||||
|
end
|
||||||
|
|
||||||
def state
|
def state
|
||||||
case object.state
|
case object.state
|
||||||
when 'en_construction'
|
when 'en_construction'
|
||||||
|
|
|
@ -11,4 +11,8 @@ class EntrepriseSerializer < ActiveModel::Serializer
|
||||||
:date_creation,
|
:date_creation,
|
||||||
:nom,
|
:nom,
|
||||||
:prenom
|
:prenom
|
||||||
|
|
||||||
|
def date_creation
|
||||||
|
object.date_creation ? object.date_creation.to_datetime : nil
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -14,8 +14,6 @@ FactoryBot.define do
|
||||||
trait :with_entreprise do
|
trait :with_entreprise do
|
||||||
after(:build) do |dossier, _evaluator|
|
after(:build) do |dossier, _evaluator|
|
||||||
etablissement = create(:etablissement)
|
etablissement = create(:etablissement)
|
||||||
entreprise = create(:entreprise, etablissement: etablissement)
|
|
||||||
dossier.entreprise = entreprise
|
|
||||||
dossier.etablissement = etablissement
|
dossier.etablissement = etablissement
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,14 +0,0 @@
|
||||||
FactoryBot.define do
|
|
||||||
factory :entreprise do
|
|
||||||
siren '440117620'
|
|
||||||
capital_social 537_100_000
|
|
||||||
numero_tva_intracommunautaire 'FR27440117620'
|
|
||||||
forme_juridique 'SA à conseil d\'administration (s.a.i.)'
|
|
||||||
forme_juridique_code '5599'
|
|
||||||
nom_commercial 'GRTGAZ'
|
|
||||||
raison_sociale 'GRTGAZ'
|
|
||||||
siret_siege_social '44011762001530'
|
|
||||||
code_effectif_entreprise '51'
|
|
||||||
date_creation Time.at(1453976189).to_datetime
|
|
||||||
end
|
|
||||||
end
|
|
|
@ -1,11 +0,0 @@
|
||||||
FactoryBot.define do
|
|
||||||
factory :rna_information do
|
|
||||||
association_id "W072000535"
|
|
||||||
titre "ASSOCIATION POUR LA PROMOTION DE SPECTACLES AU CHATEAU DE ROCHEMAURE"
|
|
||||||
objet "mise en oeuvre et réalisation de spectacles au chateau de rochemaure"
|
|
||||||
date_creation "1990-04-24"
|
|
||||||
date_declaration "2014-11-28"
|
|
||||||
date_publication "1990-05-16"
|
|
||||||
association :entreprise, factory: [:entreprise]
|
|
||||||
end
|
|
||||||
end
|
|
|
@ -27,8 +27,6 @@ describe Dossier do
|
||||||
|
|
||||||
describe 'methods' do
|
describe 'methods' do
|
||||||
let(:dossier) { create(:dossier, :with_entreprise, user: user) }
|
let(:dossier) { create(:dossier, :with_entreprise, user: user) }
|
||||||
|
|
||||||
let(:entreprise) { dossier.entreprise }
|
|
||||||
let(:etablissement) { dossier.etablissement }
|
let(:etablissement) { dossier.etablissement }
|
||||||
|
|
||||||
subject { dossier }
|
subject { dossier }
|
||||||
|
@ -200,7 +198,7 @@ describe Dossier do
|
||||||
it { expect(subject[:entreprise_raison_sociale]).to eq('GRTGAZ') }
|
it { expect(subject[:entreprise_raison_sociale]).to eq('GRTGAZ') }
|
||||||
it { expect(subject[:entreprise_siret_siege_social]).to eq('44011762001530') }
|
it { expect(subject[:entreprise_siret_siege_social]).to eq('44011762001530') }
|
||||||
it { expect(subject[:entreprise_code_effectif_entreprise]).to eq('51') }
|
it { expect(subject[:entreprise_code_effectif_entreprise]).to eq('51') }
|
||||||
it { expect(subject[:entreprise_date_creation]).to eq('Thu, 28 Jan 2016 10:16:29 UTC +00:0') }
|
it { expect(subject[:entreprise_date_creation]).to eq('1990-04-24T00:00:00+00:00') }
|
||||||
it { expect(subject[:entreprise_nom]).to be_nil }
|
it { expect(subject[:entreprise_nom]).to be_nil }
|
||||||
it { expect(subject[:entreprise_prenom]).to be_nil }
|
it { expect(subject[:entreprise_prenom]).to be_nil }
|
||||||
|
|
||||||
|
@ -311,7 +309,7 @@ describe Dossier do
|
||||||
"GRTGAZ",
|
"GRTGAZ",
|
||||||
"44011762001530",
|
"44011762001530",
|
||||||
"51",
|
"51",
|
||||||
dossier.entreprise.date_creation,
|
"1990-04-24T00:00:00+00:00",
|
||||||
nil,
|
nil,
|
||||||
nil
|
nil
|
||||||
]
|
]
|
||||||
|
@ -325,22 +323,16 @@ describe Dossier do
|
||||||
|
|
||||||
describe '#reset!' do
|
describe '#reset!' do
|
||||||
let!(:dossier) { create :dossier, :with_entreprise, autorisation_donnees: true }
|
let!(:dossier) { create :dossier, :with_entreprise, autorisation_donnees: true }
|
||||||
let!(:rna_information) { create :rna_information, entreprise: dossier.entreprise }
|
|
||||||
let!(:exercice) { create :exercice, etablissement: dossier.etablissement }
|
let!(:exercice) { create :exercice, etablissement: dossier.etablissement }
|
||||||
|
|
||||||
subject { dossier.reset! }
|
subject { dossier.reset! }
|
||||||
|
|
||||||
it { expect(dossier.entreprise).not_to be_nil }
|
|
||||||
it { expect(dossier.etablissement).not_to be_nil }
|
it { expect(dossier.etablissement).not_to be_nil }
|
||||||
it { expect(dossier.etablissement.exercices).not_to be_empty }
|
it { expect(dossier.etablissement.exercices).not_to be_empty }
|
||||||
it { expect(dossier.etablissement.exercices.size).to eq 1 }
|
it { expect(dossier.etablissement.exercices.size).to eq 1 }
|
||||||
it { expect(dossier.entreprise.rna_information).not_to be_nil }
|
|
||||||
it { expect(dossier.autorisation_donnees).to be_truthy }
|
it { expect(dossier.autorisation_donnees).to be_truthy }
|
||||||
|
|
||||||
it { expect { subject }.to change(RNAInformation, :count).by(-1) }
|
|
||||||
it { expect { subject }.to change(Exercice, :count).by(-1) }
|
it { expect { subject }.to change(Exercice, :count).by(-1) }
|
||||||
|
|
||||||
it { expect { subject }.to change(Entreprise, :count).by(-1) }
|
|
||||||
it { expect { subject }.to change(Etablissement, :count).by(-1) }
|
it { expect { subject }.to change(Etablissement, :count).by(-1) }
|
||||||
|
|
||||||
context 'when method reset! is call' do
|
context 'when method reset! is call' do
|
||||||
|
@ -349,7 +341,6 @@ describe Dossier do
|
||||||
dossier.reload
|
dossier.reload
|
||||||
end
|
end
|
||||||
|
|
||||||
it { expect(dossier.entreprise).to be_nil }
|
|
||||||
it { expect(dossier.etablissement).to be_nil }
|
it { expect(dossier.etablissement).to be_nil }
|
||||||
it { expect(dossier.autorisation_donnees).to be_falsey }
|
it { expect(dossier.autorisation_donnees).to be_falsey }
|
||||||
end
|
end
|
||||||
|
@ -766,7 +757,7 @@ describe Dossier do
|
||||||
it { expect(dossier.get_value('self', 'created_at')).to eq(dossier.created_at) }
|
it { expect(dossier.get_value('self', 'created_at')).to eq(dossier.created_at) }
|
||||||
it { expect(dossier.get_value('user', 'email')).to eq(user.email) }
|
it { expect(dossier.get_value('user', 'email')).to eq(user.email) }
|
||||||
it { expect(dossier.get_value('france_connect_information', 'gender')).to eq(user.france_connect_information.gender) }
|
it { expect(dossier.get_value('france_connect_information', 'gender')).to eq(user.france_connect_information.gender) }
|
||||||
it { expect(dossier.get_value('entreprise', 'siren')).to eq(dossier.entreprise.siren) }
|
it { expect(dossier.get_value('entreprise', 'siren')).to eq(dossier.etablissement.entreprise_siren) }
|
||||||
it { expect(dossier.get_value('etablissement', 'siret')).to eq(dossier.etablissement.siret) }
|
it { expect(dossier.get_value('etablissement', 'siret')).to eq(dossier.etablissement.siret) }
|
||||||
it { expect(dossier.get_value('type_de_champ', @champ_public.type_de_champ.id.to_s)).to eq(dossier.champs.first.value) }
|
it { expect(dossier.get_value('type_de_champ', @champ_public.type_de_champ.id.to_s)).to eq(dossier.champs.first.value) }
|
||||||
it { expect(dossier.get_value('type_de_champ_private', @champ_private.type_de_champ.id.to_s)).to eq(dossier.champs_private.first.value) }
|
it { expect(dossier.get_value('type_de_champ_private', @champ_private.type_de_champ.id.to_s)).to eq(dossier.champs_private.first.value) }
|
||||||
|
@ -834,7 +825,7 @@ describe Dossier do
|
||||||
subject { dossier.owner_name }
|
subject { dossier.owner_name }
|
||||||
|
|
||||||
context 'when there is no entreprise or individual' do
|
context 'when there is no entreprise or individual' do
|
||||||
let(:dossier) { create(:dossier, individual: nil, entreprise: nil, procedure: procedure) }
|
let(:dossier) { create(:dossier, individual: nil, procedure: procedure) }
|
||||||
|
|
||||||
it { is_expected.to be_nil }
|
it { is_expected.to be_nil }
|
||||||
end
|
end
|
||||||
|
@ -842,7 +833,7 @@ describe Dossier do
|
||||||
context 'when there is entreprise' do
|
context 'when there is entreprise' do
|
||||||
let(:dossier) { create(:dossier, :with_entreprise, procedure: procedure) }
|
let(:dossier) { create(:dossier, :with_entreprise, procedure: procedure) }
|
||||||
|
|
||||||
it { is_expected.to eq(dossier.entreprise.raison_sociale) }
|
it { is_expected.to eq(dossier.etablissement.entreprise_raison_sociale) }
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'when there is an individual' do
|
context 'when there is an individual' do
|
||||||
|
|
|
@ -1,4 +0,0 @@
|
||||||
require 'spec_helper'
|
|
||||||
|
|
||||||
describe Entreprise do
|
|
||||||
end
|
|
|
@ -559,12 +559,12 @@ describe Procedure do
|
||||||
{ "label" => 'Civilité (FC)', "table" => 'france_connect_information', "column" => 'gender' },
|
{ "label" => 'Civilité (FC)', "table" => 'france_connect_information', "column" => 'gender' },
|
||||||
{ "label" => 'Prénom (FC)', "table" => 'france_connect_information', "column" => 'given_name' },
|
{ "label" => 'Prénom (FC)', "table" => 'france_connect_information', "column" => 'given_name' },
|
||||||
{ "label" => 'Nom (FC)', "table" => 'france_connect_information', "column" => 'family_name' },
|
{ "label" => 'Nom (FC)', "table" => 'france_connect_information', "column" => 'family_name' },
|
||||||
{ "label" => 'SIREN', "table" => 'entreprise', "column" => 'siren' },
|
{ "label" => 'SIREN', "table" => 'etablissement', "column" => 'entreprise_siren' },
|
||||||
{ "label" => 'Forme juridique', "table" => 'entreprise', "column" => 'forme_juridique' },
|
{ "label" => 'Forme juridique', "table" => 'etablissement', "column" => 'entreprise_forme_juridique' },
|
||||||
{ "label" => 'Nom commercial', "table" => 'entreprise', "column" => 'nom_commercial' },
|
{ "label" => 'Nom commercial', "table" => 'etablissement', "column" => 'entreprise_nom_commercial' },
|
||||||
{ "label" => 'Raison sociale', "table" => 'entreprise', "column" => 'raison_sociale' },
|
{ "label" => 'Raison sociale', "table" => 'etablissement', "column" => 'entreprise_raison_sociale' },
|
||||||
{ "label" => 'SIRET siège social', "table" => 'entreprise', "column" => 'siret_siege_social' },
|
{ "label" => 'SIRET siège social', "table" => 'etablissement', "column" => 'entreprise_siret_siege_social' },
|
||||||
{ "label" => 'Date de création', "table" => 'entreprise', "column" => 'date_creation' },
|
{ "label" => 'Date de création', "table" => 'etablissement', "column" => 'entreprise_date_creation' },
|
||||||
{ "label" => 'SIRET', "table" => 'etablissement', "column" => 'siret' },
|
{ "label" => 'SIRET', "table" => 'etablissement', "column" => 'siret' },
|
||||||
{ "label" => 'Libellé NAF', "table" => 'etablissement', "column" => 'libelle_naf' },
|
{ "label" => 'Libellé NAF', "table" => 'etablissement', "column" => 'libelle_naf' },
|
||||||
{ "label" => 'Code postal', "table" => 'etablissement', "column" => 'code_postal' },
|
{ "label" => 'Code postal', "table" => 'etablissement', "column" => 'code_postal' },
|
||||||
|
|
|
@ -1,4 +0,0 @@
|
||||||
require 'spec_helper'
|
|
||||||
|
|
||||||
describe RNAInformation do
|
|
||||||
end
|
|
|
@ -28,9 +28,9 @@ describe Search do
|
||||||
let!(:dossier_3) { create(:dossier, state: 'en_construction', procedure: procedure_2, user: create(:user, email: 'peace@clap.fr')) }
|
let!(:dossier_3) { create(:dossier, state: 'en_construction', procedure: procedure_2, user: create(:user, email: 'peace@clap.fr')) }
|
||||||
let!(:dossier_archived) { create(:dossier, state: 'en_construction', procedure: procedure_1, archived: true, user: create(:user, email: 'brouillonArchived@clap.fr')) }
|
let!(:dossier_archived) { create(:dossier, state: 'en_construction', procedure: procedure_1, archived: true, user: create(:user, email: 'brouillonArchived@clap.fr')) }
|
||||||
|
|
||||||
let!(:etablissement_1) { create(:etablissement, entreprise: create(:entreprise, raison_sociale: 'OCTO Academy', dossier: dossier_1), dossier: dossier_1, siret: '41636169600051') }
|
let!(:etablissement_1) { create(:etablissement, entreprise_raison_sociale: 'OCTO Academy', dossier: dossier_1, siret: '41636169600051') }
|
||||||
let!(:etablissement_2) { create(:etablissement, entreprise: create(:entreprise, raison_sociale: 'Plop octo', dossier: dossier_2), dossier: dossier_2, siret: '41816602300012') }
|
let!(:etablissement_2) { create(:etablissement, entreprise_raison_sociale: 'Plop octo', dossier: dossier_2, siret: '41816602300012') }
|
||||||
let!(:etablissement_3) { create(:etablissement, entreprise: create(:entreprise, raison_sociale: 'OCTO Technology', dossier: dossier_3), dossier: dossier_3, siret: '41816609600051') }
|
let!(:etablissement_3) { create(:etablissement, entreprise_raison_sociale: 'OCTO Technology', dossier: dossier_3, siret: '41816609600051') }
|
||||||
|
|
||||||
describe 'search is empty' do
|
describe 'search is empty' do
|
||||||
let(:terms) { '' }
|
let(:terms) { '' }
|
||||||
|
|
Loading…
Add table
Reference in a new issue