models: generate annotations
This commit is contained in:
parent
e6d8581b06
commit
6d28069539
67 changed files with 1038 additions and 0 deletions
|
@ -1,3 +1,13 @@
|
|||
# == Schema Information
|
||||
#
|
||||
# Table name: administrateurs
|
||||
#
|
||||
# id :integer not null, primary key
|
||||
# active :boolean default(FALSE)
|
||||
# encrypted_token :string
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
#
|
||||
class Administrateur < ApplicationRecord
|
||||
include ActiveRecord::SecureToken
|
||||
|
||||
|
|
|
@ -1,3 +1,12 @@
|
|||
# == Schema Information
|
||||
#
|
||||
# Table name: administrateurs_procedures
|
||||
#
|
||||
# created_at :datetime not null
|
||||
# updated_at :datetime not null
|
||||
# administrateur_id :bigint not null
|
||||
# procedure_id :bigint not null
|
||||
#
|
||||
class AdministrateursProcedure < ApplicationRecord
|
||||
belongs_to :administrateur
|
||||
belongs_to :procedure
|
||||
|
|
|
@ -1,3 +1,24 @@
|
|||
# == Schema Information
|
||||
#
|
||||
# Table name: administrations
|
||||
#
|
||||
# id :integer not null, primary key
|
||||
# current_sign_in_at :datetime
|
||||
# current_sign_in_ip :string
|
||||
# email :string default(""), not null
|
||||
# encrypted_password :string default(""), not null
|
||||
# failed_attempts :integer default(0), not null
|
||||
# last_sign_in_at :datetime
|
||||
# last_sign_in_ip :string
|
||||
# locked_at :datetime
|
||||
# remember_created_at :datetime
|
||||
# reset_password_sent_at :datetime
|
||||
# reset_password_token :string
|
||||
# sign_in_count :integer default(0), not null
|
||||
# unlock_token :string
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
#
|
||||
class Administration < ApplicationRecord
|
||||
# Include default devise modules. Others available are:
|
||||
# :confirmable, :lockable, :timeoutable and :omniauthable
|
||||
|
|
|
@ -1,3 +1,18 @@
|
|||
# == Schema Information
|
||||
#
|
||||
# Table name: assign_tos
|
||||
#
|
||||
# id :integer not null, primary key
|
||||
# daily_email_notifications_enabled :boolean default(FALSE), not null
|
||||
# instant_email_dossier_notifications_enabled :boolean default(FALSE), not null
|
||||
# instant_email_message_notifications_enabled :boolean default(FALSE), not null
|
||||
# weekly_email_notifications_enabled :boolean default(TRUE), not null
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
# groupe_instructeur_id :bigint
|
||||
# instructeur_id :integer
|
||||
# procedure_id :integer
|
||||
#
|
||||
class AssignTo < ApplicationRecord
|
||||
belongs_to :instructeur
|
||||
belongs_to :groupe_instructeur
|
||||
|
|
|
@ -1,3 +1,13 @@
|
|||
# == Schema Information
|
||||
#
|
||||
# Table name: attestations
|
||||
#
|
||||
# id :integer not null, primary key
|
||||
# title :string
|
||||
# created_at :datetime not null
|
||||
# updated_at :datetime not null
|
||||
# dossier_id :integer not null
|
||||
#
|
||||
class Attestation < ApplicationRecord
|
||||
self.ignored_columns = ['pdf', 'content_secure_token']
|
||||
|
||||
|
|
|
@ -1,3 +1,16 @@
|
|||
# == Schema Information
|
||||
#
|
||||
# Table name: attestation_templates
|
||||
#
|
||||
# id :integer not null, primary key
|
||||
# activated :boolean
|
||||
# body :text
|
||||
# footer :text
|
||||
# title :text
|
||||
# created_at :datetime not null
|
||||
# updated_at :datetime not null
|
||||
# procedure_id :integer
|
||||
#
|
||||
class AttestationTemplate < ApplicationRecord
|
||||
self.ignored_columns = ['logo', 'signature', 'logo_secure_token', 'signature_secure_token']
|
||||
|
||||
|
|
|
@ -1,3 +1,19 @@
|
|||
# == Schema Information
|
||||
#
|
||||
# Table name: avis
|
||||
#
|
||||
# id :integer not null, primary key
|
||||
# answer :text
|
||||
# confidentiel :boolean default(FALSE), not null
|
||||
# email :string
|
||||
# introduction :text
|
||||
# revoked_at :datetime
|
||||
# created_at :datetime not null
|
||||
# updated_at :datetime not null
|
||||
# claimant_id :integer not null
|
||||
# dossier_id :integer
|
||||
# instructeur_id :integer
|
||||
#
|
||||
class Avis < ApplicationRecord
|
||||
include EmailSanitizableConcern
|
||||
|
||||
|
|
|
@ -1,3 +1,12 @@
|
|||
# == Schema Information
|
||||
#
|
||||
# Table name: bill_signatures
|
||||
#
|
||||
# id :bigint not null, primary key
|
||||
# digest :string
|
||||
# created_at :datetime not null
|
||||
# updated_at :datetime not null
|
||||
#
|
||||
class BillSignature < ApplicationRecord
|
||||
has_many :dossier_operation_logs
|
||||
|
||||
|
|
|
@ -1,3 +1,19 @@
|
|||
# == Schema Information
|
||||
#
|
||||
# Table name: champs
|
||||
#
|
||||
# id :integer not null, primary key
|
||||
# private :boolean default(FALSE), not null
|
||||
# row :integer
|
||||
# type :string
|
||||
# value :string
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
# dossier_id :integer
|
||||
# etablissement_id :integer
|
||||
# parent_id :bigint
|
||||
# type_de_champ_id :integer
|
||||
#
|
||||
class Champ < ApplicationRecord
|
||||
belongs_to :dossier, -> { with_discarded }, inverse_of: :champs, touch: true
|
||||
belongs_to :type_de_champ, inverse_of: :champ
|
||||
|
|
|
@ -1,2 +1,18 @@
|
|||
# == Schema Information
|
||||
#
|
||||
# Table name: champs
|
||||
#
|
||||
# id :integer not null, primary key
|
||||
# private :boolean default(FALSE), not null
|
||||
# row :integer
|
||||
# type :string
|
||||
# value :string
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
# dossier_id :integer
|
||||
# etablissement_id :integer
|
||||
# parent_id :bigint
|
||||
# type_de_champ_id :integer
|
||||
#
|
||||
class Champs::AddressChamp < Champs::TextChamp
|
||||
end
|
||||
|
|
|
@ -1,3 +1,19 @@
|
|||
# == Schema Information
|
||||
#
|
||||
# Table name: champs
|
||||
#
|
||||
# id :integer not null, primary key
|
||||
# private :boolean default(FALSE), not null
|
||||
# row :integer
|
||||
# type :string
|
||||
# value :string
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
# dossier_id :integer
|
||||
# etablissement_id :integer
|
||||
# parent_id :bigint
|
||||
# type_de_champ_id :integer
|
||||
#
|
||||
class Champs::CarteChamp < Champ
|
||||
# Default map location. Center of the World, ahm, France...
|
||||
DEFAULT_LON = 2.428462
|
||||
|
|
|
@ -1,3 +1,19 @@
|
|||
# == Schema Information
|
||||
#
|
||||
# Table name: champs
|
||||
#
|
||||
# id :integer not null, primary key
|
||||
# private :boolean default(FALSE), not null
|
||||
# row :integer
|
||||
# type :string
|
||||
# value :string
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
# dossier_id :integer
|
||||
# etablissement_id :integer
|
||||
# parent_id :bigint
|
||||
# type_de_champ_id :integer
|
||||
#
|
||||
class Champs::CheckboxChamp < Champs::YesNoChamp
|
||||
def true?
|
||||
value == 'on'
|
||||
|
|
|
@ -1,3 +1,19 @@
|
|||
# == Schema Information
|
||||
#
|
||||
# Table name: champs
|
||||
#
|
||||
# id :integer not null, primary key
|
||||
# private :boolean default(FALSE), not null
|
||||
# row :integer
|
||||
# type :string
|
||||
# value :string
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
# dossier_id :integer
|
||||
# etablissement_id :integer
|
||||
# parent_id :bigint
|
||||
# type_de_champ_id :integer
|
||||
#
|
||||
class Champs::CiviliteChamp < Champ
|
||||
def html_label?
|
||||
false
|
||||
|
|
|
@ -1,2 +1,18 @@
|
|||
# == Schema Information
|
||||
#
|
||||
# Table name: champs
|
||||
#
|
||||
# id :integer not null, primary key
|
||||
# private :boolean default(FALSE), not null
|
||||
# row :integer
|
||||
# type :string
|
||||
# value :string
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
# dossier_id :integer
|
||||
# etablissement_id :integer
|
||||
# parent_id :bigint
|
||||
# type_de_champ_id :integer
|
||||
#
|
||||
class Champs::CommuneChamp < Champs::TextChamp
|
||||
end
|
||||
|
|
|
@ -1,3 +1,19 @@
|
|||
# == Schema Information
|
||||
#
|
||||
# Table name: champs
|
||||
#
|
||||
# id :integer not null, primary key
|
||||
# private :boolean default(FALSE), not null
|
||||
# row :integer
|
||||
# type :string
|
||||
# value :string
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
# dossier_id :integer
|
||||
# etablissement_id :integer
|
||||
# parent_id :bigint
|
||||
# type_de_champ_id :integer
|
||||
#
|
||||
class Champs::DateChamp < Champ
|
||||
before_save :format_before_save
|
||||
|
||||
|
|
|
@ -1,3 +1,19 @@
|
|||
# == Schema Information
|
||||
#
|
||||
# Table name: champs
|
||||
#
|
||||
# id :integer not null, primary key
|
||||
# private :boolean default(FALSE), not null
|
||||
# row :integer
|
||||
# type :string
|
||||
# value :string
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
# dossier_id :integer
|
||||
# etablissement_id :integer
|
||||
# parent_id :bigint
|
||||
# type_de_champ_id :integer
|
||||
#
|
||||
class Champs::DatetimeChamp < Champ
|
||||
before_save :format_before_save
|
||||
|
||||
|
|
|
@ -1,3 +1,19 @@
|
|||
# == Schema Information
|
||||
#
|
||||
# Table name: champs
|
||||
#
|
||||
# id :integer not null, primary key
|
||||
# private :boolean default(FALSE), not null
|
||||
# row :integer
|
||||
# type :string
|
||||
# value :string
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
# dossier_id :integer
|
||||
# etablissement_id :integer
|
||||
# parent_id :bigint
|
||||
# type_de_champ_id :integer
|
||||
#
|
||||
class Champs::DecimalNumberChamp < Champ
|
||||
validates :value, numericality: {
|
||||
allow_nil: true,
|
||||
|
|
|
@ -1,2 +1,18 @@
|
|||
# == Schema Information
|
||||
#
|
||||
# Table name: champs
|
||||
#
|
||||
# id :integer not null, primary key
|
||||
# private :boolean default(FALSE), not null
|
||||
# row :integer
|
||||
# type :string
|
||||
# value :string
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
# dossier_id :integer
|
||||
# etablissement_id :integer
|
||||
# parent_id :bigint
|
||||
# type_de_champ_id :integer
|
||||
#
|
||||
class Champs::DepartementChamp < Champs::TextChamp
|
||||
end
|
||||
|
|
|
@ -1,2 +1,18 @@
|
|||
# == Schema Information
|
||||
#
|
||||
# Table name: champs
|
||||
#
|
||||
# id :integer not null, primary key
|
||||
# private :boolean default(FALSE), not null
|
||||
# row :integer
|
||||
# type :string
|
||||
# value :string
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
# dossier_id :integer
|
||||
# etablissement_id :integer
|
||||
# parent_id :bigint
|
||||
# type_de_champ_id :integer
|
||||
#
|
||||
class Champs::DossierLinkChamp < Champ
|
||||
end
|
||||
|
|
|
@ -1,3 +1,19 @@
|
|||
# == Schema Information
|
||||
#
|
||||
# Table name: champs
|
||||
#
|
||||
# id :integer not null, primary key
|
||||
# private :boolean default(FALSE), not null
|
||||
# row :integer
|
||||
# type :string
|
||||
# value :string
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
# dossier_id :integer
|
||||
# etablissement_id :integer
|
||||
# parent_id :bigint
|
||||
# type_de_champ_id :integer
|
||||
#
|
||||
class Champs::DropDownListChamp < Champ
|
||||
THRESHOLD_NB_OPTIONS_AS_RADIO = 5
|
||||
|
||||
|
|
|
@ -1,2 +1,18 @@
|
|||
# == Schema Information
|
||||
#
|
||||
# Table name: champs
|
||||
#
|
||||
# id :integer not null, primary key
|
||||
# private :boolean default(FALSE), not null
|
||||
# row :integer
|
||||
# type :string
|
||||
# value :string
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
# dossier_id :integer
|
||||
# etablissement_id :integer
|
||||
# parent_id :bigint
|
||||
# type_de_champ_id :integer
|
||||
#
|
||||
class Champs::EmailChamp < Champs::TextChamp
|
||||
end
|
||||
|
|
|
@ -1,2 +1,18 @@
|
|||
# == Schema Information
|
||||
#
|
||||
# Table name: champs
|
||||
#
|
||||
# id :integer not null, primary key
|
||||
# private :boolean default(FALSE), not null
|
||||
# row :integer
|
||||
# type :string
|
||||
# value :string
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
# dossier_id :integer
|
||||
# etablissement_id :integer
|
||||
# parent_id :bigint
|
||||
# type_de_champ_id :integer
|
||||
#
|
||||
class Champs::EngagementChamp < Champs::CheckboxChamp
|
||||
end
|
||||
|
|
|
@ -1,3 +1,19 @@
|
|||
# == Schema Information
|
||||
#
|
||||
# Table name: champs
|
||||
#
|
||||
# id :integer not null, primary key
|
||||
# private :boolean default(FALSE), not null
|
||||
# row :integer
|
||||
# type :string
|
||||
# value :string
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
# dossier_id :integer
|
||||
# etablissement_id :integer
|
||||
# parent_id :bigint
|
||||
# type_de_champ_id :integer
|
||||
#
|
||||
class Champs::ExplicationChamp < Champs::TextChamp
|
||||
def search_terms
|
||||
# The user cannot enter any information here so it doesn’t make much sense to search
|
||||
|
|
|
@ -1,3 +1,19 @@
|
|||
# == Schema Information
|
||||
#
|
||||
# Table name: champs
|
||||
#
|
||||
# id :integer not null, primary key
|
||||
# private :boolean default(FALSE), not null
|
||||
# row :integer
|
||||
# type :string
|
||||
# value :string
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
# dossier_id :integer
|
||||
# etablissement_id :integer
|
||||
# parent_id :bigint
|
||||
# type_de_champ_id :integer
|
||||
#
|
||||
class Champs::HeaderSectionChamp < Champ
|
||||
def search_terms
|
||||
# The user cannot enter any information here so it doesn’t make much sense to search
|
||||
|
|
|
@ -1,3 +1,19 @@
|
|||
# == Schema Information
|
||||
#
|
||||
# Table name: champs
|
||||
#
|
||||
# id :integer not null, primary key
|
||||
# private :boolean default(FALSE), not null
|
||||
# row :integer
|
||||
# type :string
|
||||
# value :string
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
# dossier_id :integer
|
||||
# etablissement_id :integer
|
||||
# parent_id :bigint
|
||||
# type_de_champ_id :integer
|
||||
#
|
||||
class Champs::IntegerNumberChamp < Champ
|
||||
validates :value, numericality: {
|
||||
only_integer: true,
|
||||
|
|
|
@ -1,3 +1,19 @@
|
|||
# == Schema Information
|
||||
#
|
||||
# Table name: champs
|
||||
#
|
||||
# id :integer not null, primary key
|
||||
# private :boolean default(FALSE), not null
|
||||
# row :integer
|
||||
# type :string
|
||||
# value :string
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
# dossier_id :integer
|
||||
# etablissement_id :integer
|
||||
# parent_id :bigint
|
||||
# type_de_champ_id :integer
|
||||
#
|
||||
class Champs::LinkedDropDownListChamp < Champ
|
||||
delegate :primary_options, :secondary_options, to: 'type_de_champ.dynamic_type'
|
||||
|
||||
|
|
|
@ -1,3 +1,19 @@
|
|||
# == Schema Information
|
||||
#
|
||||
# Table name: champs
|
||||
#
|
||||
# id :integer not null, primary key
|
||||
# private :boolean default(FALSE), not null
|
||||
# row :integer
|
||||
# type :string
|
||||
# value :string
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
# dossier_id :integer
|
||||
# etablissement_id :integer
|
||||
# parent_id :bigint
|
||||
# type_de_champ_id :integer
|
||||
#
|
||||
class Champs::MultipleDropDownListChamp < Champ
|
||||
before_save :format_before_save
|
||||
|
||||
|
|
|
@ -1,2 +1,18 @@
|
|||
# == Schema Information
|
||||
#
|
||||
# Table name: champs
|
||||
#
|
||||
# id :integer not null, primary key
|
||||
# private :boolean default(FALSE), not null
|
||||
# row :integer
|
||||
# type :string
|
||||
# value :string
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
# dossier_id :integer
|
||||
# etablissement_id :integer
|
||||
# parent_id :bigint
|
||||
# type_de_champ_id :integer
|
||||
#
|
||||
class Champs::NumberChamp < Champ
|
||||
end
|
||||
|
|
|
@ -1,3 +1,19 @@
|
|||
# == Schema Information
|
||||
#
|
||||
# Table name: champs
|
||||
#
|
||||
# id :integer not null, primary key
|
||||
# private :boolean default(FALSE), not null
|
||||
# row :integer
|
||||
# type :string
|
||||
# value :string
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
# dossier_id :integer
|
||||
# etablissement_id :integer
|
||||
# parent_id :bigint
|
||||
# type_de_champ_id :integer
|
||||
#
|
||||
class Champs::PaysChamp < Champs::TextChamp
|
||||
PAYS = JSON.parse(Rails.root.join('app', 'lib', 'api_geo', 'pays.json').read, symbolize_names: true)
|
||||
|
||||
|
|
|
@ -1,2 +1,18 @@
|
|||
# == Schema Information
|
||||
#
|
||||
# Table name: champs
|
||||
#
|
||||
# id :integer not null, primary key
|
||||
# private :boolean default(FALSE), not null
|
||||
# row :integer
|
||||
# type :string
|
||||
# value :string
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
# dossier_id :integer
|
||||
# etablissement_id :integer
|
||||
# parent_id :bigint
|
||||
# type_de_champ_id :integer
|
||||
#
|
||||
class Champs::PhoneChamp < Champs::TextChamp
|
||||
end
|
||||
|
|
|
@ -1,3 +1,19 @@
|
|||
# == Schema Information
|
||||
#
|
||||
# Table name: champs
|
||||
#
|
||||
# id :integer not null, primary key
|
||||
# private :boolean default(FALSE), not null
|
||||
# row :integer
|
||||
# type :string
|
||||
# value :string
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
# dossier_id :integer
|
||||
# etablissement_id :integer
|
||||
# parent_id :bigint
|
||||
# type_de_champ_id :integer
|
||||
#
|
||||
class Champs::PieceJustificativeChamp < Champ
|
||||
MAX_SIZE = 200.megabytes
|
||||
|
||||
|
|
|
@ -1,2 +1,18 @@
|
|||
# == Schema Information
|
||||
#
|
||||
# Table name: champs
|
||||
#
|
||||
# id :integer not null, primary key
|
||||
# private :boolean default(FALSE), not null
|
||||
# row :integer
|
||||
# type :string
|
||||
# value :string
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
# dossier_id :integer
|
||||
# etablissement_id :integer
|
||||
# parent_id :bigint
|
||||
# type_de_champ_id :integer
|
||||
#
|
||||
class Champs::RegionChamp < Champs::TextChamp
|
||||
end
|
||||
|
|
|
@ -1,3 +1,19 @@
|
|||
# == Schema Information
|
||||
#
|
||||
# Table name: champs
|
||||
#
|
||||
# id :integer not null, primary key
|
||||
# private :boolean default(FALSE), not null
|
||||
# row :integer
|
||||
# type :string
|
||||
# value :string
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
# dossier_id :integer
|
||||
# etablissement_id :integer
|
||||
# parent_id :bigint
|
||||
# type_de_champ_id :integer
|
||||
#
|
||||
class Champs::RepetitionChamp < Champ
|
||||
accepts_nested_attributes_for :champs, allow_destroy: true
|
||||
|
||||
|
|
|
@ -1,3 +1,19 @@
|
|||
# == Schema Information
|
||||
#
|
||||
# Table name: champs
|
||||
#
|
||||
# id :integer not null, primary key
|
||||
# private :boolean default(FALSE), not null
|
||||
# row :integer
|
||||
# type :string
|
||||
# value :string
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
# dossier_id :integer
|
||||
# etablissement_id :integer
|
||||
# parent_id :bigint
|
||||
# type_de_champ_id :integer
|
||||
#
|
||||
class Champs::SiretChamp < Champ
|
||||
def search_terms
|
||||
etablissement.present? ? etablissement.search_terms : [value]
|
||||
|
|
|
@ -1,2 +1,18 @@
|
|||
# == Schema Information
|
||||
#
|
||||
# Table name: champs
|
||||
#
|
||||
# id :integer not null, primary key
|
||||
# private :boolean default(FALSE), not null
|
||||
# row :integer
|
||||
# type :string
|
||||
# value :string
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
# dossier_id :integer
|
||||
# etablissement_id :integer
|
||||
# parent_id :bigint
|
||||
# type_de_champ_id :integer
|
||||
#
|
||||
class Champs::TextChamp < Champ
|
||||
end
|
||||
|
|
|
@ -1,3 +1,19 @@
|
|||
# == Schema Information
|
||||
#
|
||||
# Table name: champs
|
||||
#
|
||||
# id :integer not null, primary key
|
||||
# private :boolean default(FALSE), not null
|
||||
# row :integer
|
||||
# type :string
|
||||
# value :string
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
# dossier_id :integer
|
||||
# etablissement_id :integer
|
||||
# parent_id :bigint
|
||||
# type_de_champ_id :integer
|
||||
#
|
||||
class Champs::TextareaChamp < Champs::TextChamp
|
||||
def for_export
|
||||
value.present? ? ActionView::Base.full_sanitizer.sanitize(value) : nil
|
||||
|
|
|
@ -1,3 +1,19 @@
|
|||
# == Schema Information
|
||||
#
|
||||
# Table name: champs
|
||||
#
|
||||
# id :integer not null, primary key
|
||||
# private :boolean default(FALSE), not null
|
||||
# row :integer
|
||||
# type :string
|
||||
# value :string
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
# dossier_id :integer
|
||||
# etablissement_id :integer
|
||||
# parent_id :bigint
|
||||
# type_de_champ_id :integer
|
||||
#
|
||||
class Champs::YesNoChamp < Champ
|
||||
def search_terms
|
||||
if true?
|
||||
|
|
|
@ -1,3 +1,16 @@
|
|||
# == Schema Information
|
||||
#
|
||||
# Table name: commentaires
|
||||
#
|
||||
# id :integer not null, primary key
|
||||
# body :string
|
||||
# email :string
|
||||
# created_at :datetime not null
|
||||
# updated_at :datetime not null
|
||||
# dossier_id :integer
|
||||
# instructeur_id :bigint
|
||||
# user_id :bigint
|
||||
#
|
||||
class Commentaire < ApplicationRecord
|
||||
self.ignored_columns = ['file', 'piece_justificative_id']
|
||||
|
||||
|
|
|
@ -1,3 +1,16 @@
|
|||
# == Schema Information
|
||||
#
|
||||
# Table name: deleted_dossiers
|
||||
#
|
||||
# id :bigint not null, primary key
|
||||
# deleted_at :datetime
|
||||
# reason :string
|
||||
# state :string
|
||||
# created_at :datetime not null
|
||||
# updated_at :datetime not null
|
||||
# dossier_id :bigint
|
||||
# procedure_id :bigint
|
||||
#
|
||||
class DeletedDossier < ApplicationRecord
|
||||
belongs_to :procedure, -> { with_discarded }, inverse_of: :deleted_dossiers
|
||||
|
||||
|
|
|
@ -1,3 +1,33 @@
|
|||
# == Schema Information
|
||||
#
|
||||
# Table name: dossiers
|
||||
#
|
||||
# id :integer not null, primary key
|
||||
# archived :boolean default(FALSE)
|
||||
# autorisation_donnees :boolean
|
||||
# brouillon_close_to_expiration_notice_sent_at :datetime
|
||||
# en_construction_at :datetime
|
||||
# en_construction_close_to_expiration_notice_sent_at :datetime
|
||||
# en_construction_conservation_extension :interval default(0 seconds)
|
||||
# en_instruction_at :datetime
|
||||
# groupe_instructeur_updated_at :datetime
|
||||
# hidden_at :datetime
|
||||
# last_avis_updated_at :datetime
|
||||
# last_champ_private_updated_at :datetime
|
||||
# last_champ_updated_at :datetime
|
||||
# last_commentaire_updated_at :datetime
|
||||
# motivation :text
|
||||
# private_search_terms :text
|
||||
# processed_at :datetime
|
||||
# search_terms :text
|
||||
# state :string
|
||||
# termine_close_to_expiration_notice_sent_at :datetime
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
# groupe_instructeur_id :bigint
|
||||
# revision_id :bigint
|
||||
# user_id :integer
|
||||
#
|
||||
class Dossier < ApplicationRecord
|
||||
self.ignored_columns = ['procedure_id']
|
||||
include DossierFilteringConcern
|
||||
|
|
|
@ -1,3 +1,19 @@
|
|||
# == Schema Information
|
||||
#
|
||||
# Table name: dossier_operation_logs
|
||||
#
|
||||
# id :bigint not null, primary key
|
||||
# automatic_operation :boolean default(FALSE), not null
|
||||
# digest :text
|
||||
# executed_at :datetime
|
||||
# keep_until :datetime
|
||||
# operation :string not null
|
||||
# created_at :datetime not null
|
||||
# updated_at :datetime not null
|
||||
# bill_signature_id :bigint
|
||||
# dossier_id :bigint
|
||||
# instructeur_id :bigint
|
||||
#
|
||||
class DossierOperationLog < ApplicationRecord
|
||||
enum operation: {
|
||||
changer_groupe_instructeur: 'changer_groupe_instructeur',
|
||||
|
|
|
@ -1,3 +1,51 @@
|
|||
# == Schema Information
|
||||
#
|
||||
# Table name: etablissements
|
||||
#
|
||||
# id :integer not null, primary key
|
||||
# adresse :string
|
||||
# association_date_creation :date
|
||||
# association_date_declaration :date
|
||||
# association_date_publication :date
|
||||
# association_objet :text
|
||||
# association_rna :string
|
||||
# association_titre :string
|
||||
# code_insee_localite :string
|
||||
# code_postal :string
|
||||
# complement_adresse :string
|
||||
# diffusable_commercialement :boolean
|
||||
# entreprise_bilans_bdf :jsonb
|
||||
# entreprise_bilans_bdf_monnaie :string
|
||||
# entreprise_capital_social :bigint
|
||||
# entreprise_code_effectif_entreprise :string
|
||||
# entreprise_date_creation :date
|
||||
# entreprise_effectif_annee :string
|
||||
# entreprise_effectif_annuel :decimal(, )
|
||||
# entreprise_effectif_annuel_annee :string
|
||||
# entreprise_effectif_mensuel :decimal(, )
|
||||
# entreprise_effectif_mois :string
|
||||
# entreprise_forme_juridique :string
|
||||
# entreprise_forme_juridique_code :string
|
||||
# entreprise_nom :string
|
||||
# entreprise_nom_commercial :string
|
||||
# entreprise_numero_tva_intracommunautaire :string
|
||||
# entreprise_prenom :string
|
||||
# entreprise_raison_sociale :string
|
||||
# entreprise_siren :string
|
||||
# entreprise_siret_siege_social :string
|
||||
# libelle_naf :string
|
||||
# localite :string
|
||||
# naf :string
|
||||
# nom_voie :string
|
||||
# numero_voie :string
|
||||
# siege_social :boolean
|
||||
# siret :string
|
||||
# type_voie :string
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
# dossier_id :integer
|
||||
# entreprise_id :integer
|
||||
#
|
||||
class Etablissement < ApplicationRecord
|
||||
belongs_to :dossier
|
||||
|
||||
|
|
|
@ -1,3 +1,16 @@
|
|||
# == Schema Information
|
||||
#
|
||||
# Table name: exercices
|
||||
#
|
||||
# id :integer not null, primary key
|
||||
# ca :string
|
||||
# dateFinExercice :datetime
|
||||
# date_fin_exercice :datetime
|
||||
# date_fin_exercice_timestamp :integer
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
# etablissement_id :integer
|
||||
#
|
||||
class Exercice < ApplicationRecord
|
||||
belongs_to :etablissement
|
||||
|
||||
|
|
|
@ -1,3 +1,12 @@
|
|||
# == Schema Information
|
||||
#
|
||||
# Table name: exports
|
||||
#
|
||||
# id :bigint not null, primary key
|
||||
# format :string not null
|
||||
# created_at :datetime not null
|
||||
# updated_at :datetime not null
|
||||
#
|
||||
class Export < ApplicationRecord
|
||||
MAX_DUREE_CONSERVATION_EXPORT = 15.minutes
|
||||
|
||||
|
|
|
@ -1,3 +1,13 @@
|
|||
# == Schema Information
|
||||
#
|
||||
# Table name: feedbacks
|
||||
#
|
||||
# id :bigint not null, primary key
|
||||
# rating :string not null
|
||||
# created_at :datetime not null
|
||||
# updated_at :datetime not null
|
||||
# user_id :bigint
|
||||
#
|
||||
class Feedback < ApplicationRecord
|
||||
belongs_to :user
|
||||
|
||||
|
|
|
@ -1,3 +1,18 @@
|
|||
# == Schema Information
|
||||
#
|
||||
# Table name: follows
|
||||
#
|
||||
# id :integer not null, primary key
|
||||
# annotations_privees_seen_at :datetime not null
|
||||
# avis_seen_at :datetime not null
|
||||
# demande_seen_at :datetime not null
|
||||
# messagerie_seen_at :datetime not null
|
||||
# unfollowed_at :datetime
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
# dossier_id :integer not null
|
||||
# instructeur_id :integer not null
|
||||
#
|
||||
class Follow < ApplicationRecord
|
||||
belongs_to :instructeur
|
||||
belongs_to :dossier
|
||||
|
|
|
@ -1,3 +1,19 @@
|
|||
# == Schema Information
|
||||
#
|
||||
# Table name: france_connect_informations
|
||||
#
|
||||
# id :integer not null, primary key
|
||||
# birthdate :date
|
||||
# birthplace :string
|
||||
# email_france_connect :string
|
||||
# family_name :string
|
||||
# gender :string
|
||||
# given_name :string
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
# france_connect_particulier_id :string
|
||||
# user_id :integer
|
||||
#
|
||||
class FranceConnectInformation < ApplicationRecord
|
||||
belongs_to :user
|
||||
|
||||
|
|
|
@ -1,3 +1,16 @@
|
|||
# == Schema Information
|
||||
#
|
||||
# Table name: geo_areas
|
||||
#
|
||||
# id :bigint not null, primary key
|
||||
# geometry :jsonb
|
||||
# properties :jsonb
|
||||
# source :string
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
# champ_id :bigint
|
||||
# geo_reference_id :string
|
||||
#
|
||||
class GeoArea < ApplicationRecord
|
||||
belongs_to :champ
|
||||
|
||||
|
|
|
@ -1,3 +1,13 @@
|
|||
# == Schema Information
|
||||
#
|
||||
# Table name: groupe_instructeurs
|
||||
#
|
||||
# id :bigint not null, primary key
|
||||
# label :text not null
|
||||
# created_at :datetime not null
|
||||
# updated_at :datetime not null
|
||||
# procedure_id :bigint not null
|
||||
#
|
||||
class GroupeInstructeur < ApplicationRecord
|
||||
DEFAULT_LABEL = 'défaut'
|
||||
belongs_to :procedure, -> { with_discarded }, inverse_of: :groupe_instructeurs
|
||||
|
|
|
@ -1,3 +1,16 @@
|
|||
# == Schema Information
|
||||
#
|
||||
# Table name: individuals
|
||||
#
|
||||
# id :integer not null, primary key
|
||||
# birthdate :date
|
||||
# gender :string
|
||||
# nom :string
|
||||
# prenom :string
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
# dossier_id :integer
|
||||
#
|
||||
class Individual < ApplicationRecord
|
||||
belongs_to :dossier
|
||||
|
||||
|
|
|
@ -1,3 +1,13 @@
|
|||
# == Schema Information
|
||||
#
|
||||
# Table name: instructeurs
|
||||
#
|
||||
# id :integer not null, primary key
|
||||
# encrypted_login_token :text
|
||||
# login_token_created_at :datetime
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
#
|
||||
class Instructeur < ApplicationRecord
|
||||
has_and_belongs_to_many :administrateurs
|
||||
|
||||
|
|
|
@ -1,3 +1,16 @@
|
|||
# == Schema Information
|
||||
#
|
||||
# Table name: invites
|
||||
#
|
||||
# id :integer not null, primary key
|
||||
# email :string
|
||||
# email_sender :string
|
||||
# message :text
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
# dossier_id :integer
|
||||
# user_id :integer
|
||||
#
|
||||
class Invite < ApplicationRecord
|
||||
include EmailSanitizableConcern
|
||||
|
||||
|
|
|
@ -1,3 +1,14 @@
|
|||
# == Schema Information
|
||||
#
|
||||
# Table name: closed_mails
|
||||
#
|
||||
# id :integer not null, primary key
|
||||
# body :text
|
||||
# subject :string
|
||||
# created_at :datetime not null
|
||||
# updated_at :datetime not null
|
||||
# procedure_id :integer
|
||||
#
|
||||
module Mails
|
||||
class ClosedMail < ApplicationRecord
|
||||
include MailTemplateConcern
|
||||
|
|
|
@ -1,3 +1,14 @@
|
|||
# == Schema Information
|
||||
#
|
||||
# Table name: initiated_mails
|
||||
#
|
||||
# id :integer not null, primary key
|
||||
# body :text
|
||||
# subject :string
|
||||
# created_at :datetime not null
|
||||
# updated_at :datetime not null
|
||||
# procedure_id :integer
|
||||
#
|
||||
module Mails
|
||||
class InitiatedMail < ApplicationRecord
|
||||
include MailTemplateConcern
|
||||
|
|
|
@ -1,3 +1,14 @@
|
|||
# == Schema Information
|
||||
#
|
||||
# Table name: received_mails
|
||||
#
|
||||
# id :integer not null, primary key
|
||||
# body :text
|
||||
# subject :string
|
||||
# created_at :datetime not null
|
||||
# updated_at :datetime not null
|
||||
# procedure_id :integer
|
||||
#
|
||||
module Mails
|
||||
class ReceivedMail < ApplicationRecord
|
||||
include MailTemplateConcern
|
||||
|
|
|
@ -1,3 +1,14 @@
|
|||
# == Schema Information
|
||||
#
|
||||
# Table name: refused_mails
|
||||
#
|
||||
# id :integer not null, primary key
|
||||
# body :text
|
||||
# subject :string
|
||||
# created_at :datetime not null
|
||||
# updated_at :datetime not null
|
||||
# procedure_id :integer
|
||||
#
|
||||
module Mails
|
||||
class RefusedMail < ApplicationRecord
|
||||
include MailTemplateConcern
|
||||
|
|
|
@ -1,3 +1,14 @@
|
|||
# == Schema Information
|
||||
#
|
||||
# Table name: without_continuation_mails
|
||||
#
|
||||
# id :integer not null, primary key
|
||||
# body :text
|
||||
# subject :string
|
||||
# created_at :datetime not null
|
||||
# updated_at :datetime not null
|
||||
# procedure_id :integer
|
||||
#
|
||||
module Mails
|
||||
class WithoutContinuationMail < ApplicationRecord
|
||||
include MailTemplateConcern
|
||||
|
|
|
@ -1,3 +1,16 @@
|
|||
# == Schema Information
|
||||
#
|
||||
# Table name: module_api_cartos
|
||||
#
|
||||
# id :integer not null, primary key
|
||||
# cadastre :boolean default(FALSE)
|
||||
# migrated :boolean
|
||||
# quartiers_prioritaires :boolean default(FALSE)
|
||||
# use_api_carto :boolean default(FALSE)
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
# procedure_id :integer
|
||||
#
|
||||
class ModuleAPICarto < ApplicationRecord
|
||||
belongs_to :procedure
|
||||
end
|
||||
|
|
|
@ -1,3 +1,47 @@
|
|||
# == Schema Information
|
||||
#
|
||||
# Table name: procedures
|
||||
#
|
||||
# id :integer not null, primary key
|
||||
# aasm_state :string default("brouillon")
|
||||
# api_entreprise_token :string
|
||||
# ask_birthday :boolean default(FALSE), not null
|
||||
# auto_archive_on :date
|
||||
# cadre_juridique :string
|
||||
# cerfa_flag :boolean default(FALSE)
|
||||
# cloned_from_library :boolean default(FALSE)
|
||||
# closed_at :datetime
|
||||
# declarative_with_state :string
|
||||
# description :string
|
||||
# direction :string
|
||||
# duree_conservation_dossiers_dans_ds :integer
|
||||
# duree_conservation_dossiers_hors_ds :integer
|
||||
# durees_conservation_required :boolean default(TRUE)
|
||||
# euro_flag :boolean default(FALSE)
|
||||
# for_individual :boolean default(FALSE)
|
||||
# hidden_at :datetime
|
||||
# juridique_required :boolean default(TRUE)
|
||||
# libelle :string
|
||||
# lien_demarche :string
|
||||
# lien_notice :string
|
||||
# lien_site_web :string
|
||||
# monavis_embed :text
|
||||
# organisation :string
|
||||
# path :string not null
|
||||
# published_at :datetime
|
||||
# routing_criteria_name :text default("Votre ville")
|
||||
# test_started_at :datetime
|
||||
# unpublished_at :datetime
|
||||
# web_hook_url :string
|
||||
# whitelisted_at :datetime
|
||||
# created_at :datetime not null
|
||||
# updated_at :datetime not null
|
||||
# canonical_procedure_id :bigint
|
||||
# draft_revision_id :bigint
|
||||
# parent_procedure_id :bigint
|
||||
# published_revision_id :bigint
|
||||
# service_id :bigint
|
||||
#
|
||||
require Rails.root.join('lib', 'percentile')
|
||||
|
||||
class Procedure < ApplicationRecord
|
||||
|
|
|
@ -1,3 +1,15 @@
|
|||
# == Schema Information
|
||||
#
|
||||
# Table name: procedure_presentations
|
||||
#
|
||||
# id :integer not null, primary key
|
||||
# displayed_fields :jsonb not null
|
||||
# filters :jsonb not null
|
||||
# sort :jsonb not null
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
# assign_to_id :integer
|
||||
#
|
||||
class ProcedurePresentation < ApplicationRecord
|
||||
EXTRA_SORT_COLUMNS = {
|
||||
'notifications' => ['notifications'],
|
||||
|
|
|
@ -1,3 +1,12 @@
|
|||
# == Schema Information
|
||||
#
|
||||
# Table name: procedure_revisions
|
||||
#
|
||||
# id :bigint not null, primary key
|
||||
# created_at :datetime not null
|
||||
# updated_at :datetime not null
|
||||
# procedure_id :bigint not null
|
||||
#
|
||||
class ProcedureRevision < ApplicationRecord
|
||||
self.implicit_order_column = :created_at
|
||||
belongs_to :procedure, -> { with_discarded }, inverse_of: :revisions
|
||||
|
|
|
@ -1,3 +1,14 @@
|
|||
# == Schema Information
|
||||
#
|
||||
# Table name: procedure_revision_types_de_champ
|
||||
#
|
||||
# id :bigint not null, primary key
|
||||
# position :integer not null
|
||||
# created_at :datetime not null
|
||||
# updated_at :datetime not null
|
||||
# revision_id :bigint not null
|
||||
# type_de_champ_id :bigint not null
|
||||
#
|
||||
class ProcedureRevisionTypeDeChamp < ApplicationRecord
|
||||
belongs_to :revision, class_name: 'ProcedureRevision'
|
||||
belongs_to :type_de_champ
|
||||
|
|
|
@ -1,3 +1,19 @@
|
|||
# == Schema Information
|
||||
#
|
||||
# Table name: services
|
||||
#
|
||||
# id :bigint not null, primary key
|
||||
# adresse :text
|
||||
# email :string
|
||||
# horaires :text
|
||||
# nom :string not null
|
||||
# organisme :string
|
||||
# telephone :string
|
||||
# type_organisme :string not null
|
||||
# created_at :datetime not null
|
||||
# updated_at :datetime not null
|
||||
# administrateur_id :bigint
|
||||
#
|
||||
class Service < ApplicationRecord
|
||||
self.ignored_columns = ['siret']
|
||||
has_many :procedures
|
||||
|
|
|
@ -1,3 +1,14 @@
|
|||
# == Schema Information
|
||||
#
|
||||
# Table name: traitements
|
||||
#
|
||||
# id :bigint not null, primary key
|
||||
# instructeur_email :string
|
||||
# motivation :string
|
||||
# processed_at :datetime
|
||||
# state :string
|
||||
# dossier_id :bigint
|
||||
#
|
||||
class Traitement < ApplicationRecord
|
||||
belongs_to :dossier
|
||||
|
||||
|
|
|
@ -1,3 +1,13 @@
|
|||
# == Schema Information
|
||||
#
|
||||
# Table name: trusted_device_tokens
|
||||
#
|
||||
# id :bigint not null, primary key
|
||||
# token :string not null
|
||||
# created_at :datetime not null
|
||||
# updated_at :datetime not null
|
||||
# instructeur_id :bigint
|
||||
#
|
||||
class TrustedDeviceToken < ApplicationRecord
|
||||
LOGIN_TOKEN_VALIDITY = 1.week
|
||||
LOGIN_TOKEN_YOUTH = 15.minutes
|
||||
|
|
|
@ -1,3 +1,22 @@
|
|||
# == Schema Information
|
||||
#
|
||||
# Table name: types_de_champ
|
||||
#
|
||||
# id :integer not null, primary key
|
||||
# description :text
|
||||
# libelle :string
|
||||
# mandatory :boolean default(FALSE)
|
||||
# options :jsonb
|
||||
# order_place :integer
|
||||
# private :boolean default(FALSE), not null
|
||||
# type_champ :string
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
# parent_id :bigint
|
||||
# procedure_id :integer
|
||||
# revision_id :bigint
|
||||
# stable_id :bigint
|
||||
#
|
||||
class TypeDeChamp < ApplicationRecord
|
||||
enum type_champs: {
|
||||
text: 'text',
|
||||
|
|
|
@ -1,3 +1,32 @@
|
|||
# == Schema Information
|
||||
#
|
||||
# Table name: users
|
||||
#
|
||||
# id :integer not null, primary key
|
||||
# confirmation_sent_at :datetime
|
||||
# confirmation_token :string
|
||||
# confirmed_at :datetime
|
||||
# current_sign_in_at :datetime
|
||||
# current_sign_in_ip :string
|
||||
# email :string default(""), not null
|
||||
# encrypted_password :string default(""), not null
|
||||
# failed_attempts :integer default(0), not null
|
||||
# last_sign_in_at :datetime
|
||||
# last_sign_in_ip :string
|
||||
# locked_at :datetime
|
||||
# loged_in_with_france_connect :string default(NULL)
|
||||
# remember_created_at :datetime
|
||||
# reset_password_sent_at :datetime
|
||||
# reset_password_token :string
|
||||
# sign_in_count :integer default(0), not null
|
||||
# siret :string
|
||||
# unconfirmed_email :text
|
||||
# unlock_token :string
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
# administrateur_id :bigint
|
||||
# instructeur_id :bigint
|
||||
#
|
||||
class User < ApplicationRecord
|
||||
include EmailSanitizableConcern
|
||||
|
||||
|
|
Loading…
Reference in a new issue