2023-08-16 22:57:59 +03:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
|
|
# == Schema Information
|
|
|
|
|
#
|
|
|
|
|
# Table name: account_configs
|
|
|
|
|
#
|
|
|
|
|
# id :bigint not null, primary key
|
|
|
|
|
# key :string not null
|
|
|
|
|
# value :text not null
|
|
|
|
|
# created_at :datetime not null
|
|
|
|
|
# updated_at :datetime not null
|
|
|
|
|
# account_id :bigint not null
|
|
|
|
|
#
|
|
|
|
|
# Indexes
|
|
|
|
|
#
|
|
|
|
|
# index_account_configs_on_account_id (account_id)
|
|
|
|
|
# index_account_configs_on_account_id_and_key (account_id,key) UNIQUE
|
|
|
|
|
#
|
|
|
|
|
# Foreign Keys
|
|
|
|
|
#
|
|
|
|
|
# fk_rails_... (account_id => accounts.id)
|
|
|
|
|
#
|
|
|
|
|
class AccountConfig < ApplicationRecord
|
|
|
|
|
SUBMITTER_INVITATION_EMAIL_KEY = 'submitter_invitation_email'
|
2026-07-04 15:47:40 +03:00
|
|
|
SUBMITTER_VIEW_INVITATION_EMAIL_KEY = 'submitter_view_invitation_email'
|
2025-11-14 00:32:30 +02:00
|
|
|
SUBMITTER_INVITATION_REMINDER_EMAIL_KEY = 'submitter_invitation_reminder_email'
|
2023-08-20 00:10:54 +03:00
|
|
|
SUBMITTER_COMPLETED_EMAIL_KEY = 'submitter_completed_email'
|
|
|
|
|
SUBMITTER_DOCUMENTS_COPY_EMAIL_KEY = 'submitter_documents_copy_email'
|
2023-09-17 20:38:09 +03:00
|
|
|
BCC_EMAILS = 'bcc_emails'
|
2023-12-02 01:50:54 +02:00
|
|
|
FORCE_MFA = 'force_mfa'
|
2023-12-02 16:26:34 +02:00
|
|
|
ALLOW_TYPED_SIGNATURE = 'allow_typed_signature'
|
2024-01-30 17:03:58 +02:00
|
|
|
ALLOW_TO_RESUBMIT = 'allow_to_resubmit'
|
2024-10-24 12:15:32 +03:00
|
|
|
ALLOW_TO_DECLINE_KEY = 'allow_to_decline'
|
2026-03-27 12:56:52 +02:00
|
|
|
ALLOW_TO_DELEGATE_KEY = 'allow_to_delegate'
|
2025-06-06 16:23:44 +03:00
|
|
|
ALLOW_TO_PARTIAL_DOWNLOAD_KEY = 'allow_to_partial_download'
|
2024-04-13 11:35:04 +03:00
|
|
|
SUBMITTER_REMINDERS = 'submitter_reminders'
|
2025-03-27 18:29:02 +02:00
|
|
|
ENFORCE_SIGNING_ORDER_KEY = 'enforce_signing_order'
|
2023-09-29 01:24:39 +03:00
|
|
|
FORM_COMPLETED_BUTTON_KEY = 'form_completed_button'
|
2024-04-05 16:16:30 +03:00
|
|
|
FORM_COMPLETED_MESSAGE_KEY = 'form_completed_message'
|
2024-01-26 17:43:52 +02:00
|
|
|
FORM_WITH_CONFETTI_KEY = 'form_with_confetti'
|
2024-06-15 15:55:09 +03:00
|
|
|
FORM_PREFILL_SIGNATURE_KEY = 'form_prefill_signature'
|
2023-12-21 23:29:06 +02:00
|
|
|
ESIGNING_PREFERENCE_KEY = 'esigning_preference'
|
2024-04-15 19:58:24 +03:00
|
|
|
DOWNLOAD_LINKS_AUTH_KEY = 'download_links_auth'
|
2025-08-31 16:40:18 +03:00
|
|
|
DOWNLOAD_LINKS_EXPIRE_KEY = 'download_links_expire'
|
2024-04-19 02:04:35 +03:00
|
|
|
FORCE_SSO_AUTH_KEY = 'force_sso_auth'
|
2024-04-22 21:34:55 +03:00
|
|
|
FLATTEN_RESULT_PDF_KEY = 'flatten_result_pdf'
|
2026-04-21 12:35:00 +03:00
|
|
|
ROTATE_INCREMENTAL_PDF_KEY = 'rotate_incremental_pdf'
|
2024-07-24 20:55:35 +03:00
|
|
|
WITH_SIGNATURE_ID = 'with_signature_id'
|
2025-09-09 09:53:21 +03:00
|
|
|
WITH_FILE_LINKS_KEY = 'with_file_links'
|
2025-07-18 10:30:37 +03:00
|
|
|
WITH_SIGNATURE_ID_REASON_KEY = 'with_signature_id_reason'
|
2026-07-14 12:47:38 +03:00
|
|
|
WITH_SIGNATURE_ID_COMPLETED_AT_KEY = 'with_signature_id_completed_at'
|
2025-12-19 11:55:25 +02:00
|
|
|
RECIPIENT_FORM_FIELDS_KEY = 'recipient_form_fields'
|
2024-09-30 16:27:15 +03:00
|
|
|
WITH_AUDIT_VALUES_KEY = 'with_audit_values'
|
2026-01-23 12:12:37 +02:00
|
|
|
WITH_AUDIT_SENDER_KEY = 'with_audit_sender'
|
2025-07-10 20:47:52 +03:00
|
|
|
WITH_SUBMITTER_TIMEZONE_KEY = 'with_submitter_timezone'
|
2026-02-17 17:45:46 +02:00
|
|
|
WITH_TIMESTAMP_SECONDS_KEY = 'with_timestamp_seconds'
|
2024-08-06 00:19:33 +03:00
|
|
|
REQUIRE_SIGNING_REASON_KEY = 'require_signing_reason'
|
2024-10-10 13:14:49 +03:00
|
|
|
REUSE_SIGNATURE_KEY = 'reuse_signature'
|
2025-12-16 11:38:37 +02:00
|
|
|
WITH_FIELD_LABELS_KEY = 'with_field_labels'
|
2024-08-23 23:46:22 +03:00
|
|
|
COMBINE_PDF_RESULT_KEY = 'combine_pdf_result_key'
|
2024-11-20 01:12:26 +02:00
|
|
|
DOCUMENT_FILENAME_FORMAT_KEY = 'document_filename_format'
|
2026-01-26 11:11:19 +02:00
|
|
|
TEMPLATE_CUSTOM_FIELDS_KEY = 'template_custom_fields'
|
2026-07-17 11:25:06 +03:00
|
|
|
TEMPLATE_DATE_FORMATS_KEY = 'template_date_formats'
|
2024-11-28 23:13:31 +02:00
|
|
|
POLICY_LINKS_KEY = 'policy_links'
|
2026-03-05 12:17:14 +02:00
|
|
|
ENABLE_MCP_KEY = 'enable_mcp'
|
2023-08-16 22:57:59 +03:00
|
|
|
|
2026-02-21 14:44:19 +02:00
|
|
|
EMAIL_VARIABLES = {
|
|
|
|
|
SUBMITTER_INVITATION_EMAIL_KEY => %w[template.name submitter.link account.name].freeze,
|
2026-07-04 15:47:40 +03:00
|
|
|
SUBMITTER_VIEW_INVITATION_EMAIL_KEY => %w[template.name submitter.link account.name].freeze,
|
2026-02-21 14:44:19 +02:00
|
|
|
SUBMITTER_COMPLETED_EMAIL_KEY => %w[template.name submission.submitters submission.link].freeze,
|
2026-02-22 09:46:04 +02:00
|
|
|
SUBMITTER_INVITATION_REMINDER_EMAIL_KEY => %w[template.name submitter.link account.name].freeze,
|
2026-02-21 14:44:19 +02:00
|
|
|
SUBMITTER_DOCUMENTS_COPY_EMAIL_KEY => %w[template.name documents.link account.name].freeze
|
|
|
|
|
}.freeze
|
|
|
|
|
|
2023-08-16 22:57:59 +03:00
|
|
|
DEFAULT_VALUES = {
|
2024-09-21 12:10:08 +03:00
|
|
|
SUBMITTER_INVITATION_EMAIL_KEY => lambda {
|
|
|
|
|
{
|
|
|
|
|
'subject' => I18n.t(:you_are_invited_to_sign_a_document),
|
|
|
|
|
'body' => I18n.t(:submitter_invitation_email_sign_body)
|
|
|
|
|
}
|
2023-08-20 00:10:54 +03:00
|
|
|
},
|
2026-07-04 15:47:40 +03:00
|
|
|
SUBMITTER_VIEW_INVITATION_EMAIL_KEY => lambda {
|
|
|
|
|
{
|
|
|
|
|
'subject' => I18n.t(:you_are_invited_to_view_a_document),
|
|
|
|
|
'body' => I18n.t(:submitter_invitation_email_view_body)
|
|
|
|
|
}
|
|
|
|
|
},
|
2025-11-14 00:32:30 +02:00
|
|
|
SUBMITTER_INVITATION_REMINDER_EMAIL_KEY => lambda {
|
|
|
|
|
{
|
|
|
|
|
'subject' => I18n.t(:you_are_invited_to_sign_a_document),
|
|
|
|
|
'body' => I18n.t(:submitter_invitation_email_sign_body)
|
|
|
|
|
}
|
|
|
|
|
},
|
2024-09-21 12:10:08 +03:00
|
|
|
SUBMITTER_COMPLETED_EMAIL_KEY => lambda {
|
|
|
|
|
{
|
|
|
|
|
'subject' => I18n.t(:template_name_has_been_completed_by_submitters),
|
|
|
|
|
'body' => I18n.t(:submitter_completed_email_body)
|
|
|
|
|
}
|
2023-08-20 00:10:54 +03:00
|
|
|
},
|
2024-09-21 12:10:08 +03:00
|
|
|
SUBMITTER_DOCUMENTS_COPY_EMAIL_KEY => lambda {
|
|
|
|
|
{
|
|
|
|
|
'subject' => I18n.t(:your_document_copy),
|
|
|
|
|
'body' => I18n.t(:submitter_documents_copy_email_body)
|
|
|
|
|
}
|
2023-08-16 22:57:59 +03:00
|
|
|
}
|
|
|
|
|
}.freeze
|
|
|
|
|
|
|
|
|
|
belongs_to :account
|
|
|
|
|
|
2023-12-29 18:50:14 +00:00
|
|
|
serialize :value, coder: JSON
|
2023-08-16 22:57:59 +03:00
|
|
|
end
|