chore(schema): add entreprise_etat_administratif to etablissements
This commit is contained in:
parent
e97054b676
commit
e1d3d1f844
4 changed files with 15 additions and 1 deletions
|
@ -25,6 +25,7 @@
|
|||
# entreprise_effectif_annuel_annee :string
|
||||
# entreprise_effectif_mensuel :decimal(, )
|
||||
# entreprise_effectif_mois :string
|
||||
# entreprise_etat_administratif :string
|
||||
# entreprise_forme_juridique :string
|
||||
# entreprise_forme_juridique_code :string
|
||||
# entreprise_nom :string
|
||||
|
@ -60,6 +61,11 @@ class Etablissement < ApplicationRecord
|
|||
validates :siret, presence: true
|
||||
validates :dossier_id, uniqueness: { allow_nil: true }
|
||||
|
||||
enum entreprise_etat_administratif: {
|
||||
actif: "actif",
|
||||
fermé: "fermé"
|
||||
}, _prefix: true
|
||||
|
||||
def search_terms
|
||||
[
|
||||
entreprise_siren,
|
||||
|
@ -162,6 +168,7 @@ class Etablissement < ApplicationRecord
|
|||
effectif_annuel: entreprise_effectif_annuel,
|
||||
effectif_annuel_annee: entreprise_effectif_annuel_annee,
|
||||
date_creation: entreprise_date_creation,
|
||||
etat_administratif: entreprise_etat_administratif,
|
||||
nom: entreprise_nom,
|
||||
prenom: entreprise_prenom,
|
||||
inline_adresse: inline_adresse
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
class AddEntrepriseEtatAdministratifToEtablissements < ActiveRecord::Migration[6.1]
|
||||
def change
|
||||
add_column :etablissements, :entreprise_etat_administratif, :string
|
||||
end
|
||||
end
|
|
@ -10,7 +10,7 @@
|
|||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(version: 2022_07_08_152039) do
|
||||
ActiveRecord::Schema.define(version: 2022_07_18_093034) do
|
||||
|
||||
# These are extensions that must be enabled in order to support this database
|
||||
enable_extension "pgcrypto"
|
||||
|
@ -376,6 +376,7 @@ ActiveRecord::Schema.define(version: 2022_07_08_152039) do
|
|||
t.string "entreprise_effectif_annuel_annee"
|
||||
t.decimal "entreprise_effectif_mensuel"
|
||||
t.string "entreprise_effectif_mois"
|
||||
t.string "entreprise_etat_administratif"
|
||||
t.string "entreprise_forme_juridique"
|
||||
t.string "entreprise_forme_juridique_code"
|
||||
t.string "entreprise_nom"
|
||||
|
|
|
@ -23,6 +23,7 @@ FactoryBot.define do
|
|||
entreprise_siret_siege_social { '44011762001530' }
|
||||
entreprise_code_effectif_entreprise { '51' }
|
||||
entreprise_date_creation { "1990-04-24" }
|
||||
entreprise_etat_administratif { :actif }
|
||||
|
||||
trait :with_exercices do
|
||||
exercices { [association(:exercice)] }
|
||||
|
|
Loading…
Reference in a new issue