Halfway through table redesign, saving to revert to working version

This commit is contained in:
Jason Jordan
2026-03-05 11:30:24 -05:00
parent ea07afb751
commit b5a1517330
86 changed files with 1286 additions and 884 deletions
+15 -10
View File
@@ -9,23 +9,31 @@ class EmployersController < ApplicationController
def new
@employer = Employer.new
@employer.build_plan_with_default_benefits
@plan_templates = IdCardBenefitsTemplate.where.not(title: "BLANK")
render :new_new
render :new
end
def import
word_doc = params[:employer][:import_from_word]
@plan_templates = IdCardBenefitsTemplate.where.not(title: "BLANK")
if word_doc.present? && word_doc.is_a?(ActionDispatch::Http::UploadedFile)
@employer = BenefitsWordDocProcessor.new(word_doc.tempfile).call
else
@employer = Employer.new
@employer.build_plan_with_default_benefits
end
render :new_new
render :new
end
# def import_old
# word_doc = params[:employer][:import_from_word]
# @plan_templates = IdCardBenefitsTemplate.where.not(title: "BLANK")
# if word_doc.present? && word_doc.is_a?(ActionDispatch::Http::UploadedFile)
# @employer = BenefitsWordDocProcessor.new(word_doc.tempfile).call
# else
# @employer = Employer.new
# @employer.build_plan_with_default_benefits
# end
# render :new
# end
def create
employer_params = Employer.permitted_params(params)
puts "---Params---"
@@ -36,16 +44,13 @@ class EmployersController < ApplicationController
# update_logos_with_employer_setup_information()
redirect_to employer_path(@employer.slug), notice: 'Employer Saved'
else
@plan_templates = IdCardBenefitsTemplate.where.not(title: "BLANK")
render :new_new
render :new
end
end
def edit
@employer = Employer.find_by(slug: params[:id])
@plan_templates = IdCardBenefitsTemplate.where.not(title: "BLANK")
render :edit
# @resource = Resource.find(params[:id])
end
def update
@@ -0,0 +1,56 @@
class IdCard::EmployerLogosController < ApplicationController
def index
end
def show
end
def image
logo_file = IdCard::EmployerLogo.find(params[:id])
puts params[:id]
logo_binary = logo_file.image_data
logo_filename = logo_file.filename
send_data logo_binary,
filename: logo_filename,
disposition: 'inline'
end
def new
end
def create
file = card_logo_file_params["logo_file"]
if file.present? && file.is_a?(ActionDispatch::Http::UploadedFile)
filename = file.original_filename
# binary_data = file.read
binary_data = File.binread(file)
meme_type = Marcel::MimeType.for(file)
employerlogo = IdCard::EmployerLogo.create(
filename: filename,
image_data: binary_data,
content_type: meme_type
)
render json: employerlogo, only: [:id], status: :ok
end
end
def edit
end
def update
end
def destroy
end
private
def card_logo_file_params
params.require(:card_logo_file).permit(:logo_file, :logo_type)
end
end
+236
View File
@@ -0,0 +1,236 @@
class IdCard::SetupController < ApplicationController
def new
@employer = Employer.find_by(slug: params[:id])
@setup = @employer.id_card_setup.new
render :new
end
def create
employer_params = Employer.permitted_params(params)
puts "---Params---"
puts employer_params
# post_image_processing_params = process_logos(employer_setup_process_params)
@employer = Employer.new(employer_params)
if @employer.save
# update_logos_with_employer_setup_information()
redirect_to employer_path(@employer.slug), notice: 'Employer Saved'
else
render :new
end
end
def edit
@employer = Employer.find_by(slug: params[:id])
render :edit
end
def update
puts "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
employer_params = Employer.permitted_params(params)
@employer = Employer.find(params[:id])
if @employer.update(employer_params)
puts "sucess"
redirect_to employer_path(@employer.slug), notice: 'Employer was successfully updated.'
else
puts "fail"
render :edit, status: :unprocessable_entity
end
end
def destroy
# @resource = Resource.find(params[:id])
# @resource.destroy
# redirect_to resources_url, notice: 'Resource was successfully destroyed.'
end
private
# def process_logos(employer_setup_process_params)
# @uploaded_logos = []
# employer_logo = employer_setup_process_params["employer_logo"]
# if employer_logo.present? && employer_logo.is_a?(ActionDispatch::Http::UploadedFile)
# filename = employer_logo.original_filename
# binary_data = employer_logo.read
# meme_type = Marcel::MimeType.for(employer_logo)
# CardLogoFile.create(
# filename: filename,
# image_data: binary_data,
# content_type: meme_type,
# logo_type: "employer"
# )
# @uploaded_logos.push(filename)
# employer_setup_process_params["employer_logo"] = filename
# end
# network_logos = employer_setup_process_params["alternate_network_logos_attributes"]
# if network_logos.present?
# network_logos.each do |alt|
# network_logo = alt.last["network_logo"]
# if network_logo.present? && network_logo.is_a?(ActionDispatch::Http::UploadedFile)
# filename = network_logo.original_filename
# binary_data = network_logo.read
# meme_type = Marcel::MimeType.for(network_logo)
# CardLogoFile.create(
# filename: filename,
# image_data: binary_data,
# content_type: meme_type,
# logo_type: "network"
# )
# @uploaded_logos.push(filename)
# end
# alt.last["network_logo"] = @uploaded_logos.last
# end
# end
# employer_setup_process_params
# end
# def update_logos_with_employer_setup_information()
# @uploaded_logos.each do |logo|
# logo_file = CardLogoFile.find_by(filename: logo)
# if logo_file.present? && @employer.present?
# logo_file.employer_setup_process = @employer
# logo_file.save
# end
# end
# end
# def general_information_params
# params.require(:employer_setup_general_information_form).permit(
# :name,
# :employer_logo,
# :group_number,
# :dental,
# :pl_plan_key,
# :effect_date,
# :number_of_plans,
# :network,
# :number_of_additional_network_logos
# )
# end
# def plans_params
# params.require(:employer_setup_plans_form).permit(
# plans: permited_plans_keys,
# benefit_descs: benefit_sequence_keys
# )
# end
# def network_exceptions_params
# params.require(:employer_setup_network_exceptions_form).permit(
# network_exceptions: [:network_logo, exceptions: [:type, :value]],
# )
# end
# def form_for_step
# step_name = @top_form.current_step
# form_method = "EmployerSetup#{step_name.camelize}Form".constantize
# # puts "/////\\\\\\||||||"
# # puts session[:employer_setup_data]
# # puts session[:employer_setup_data]['employer_setup_process_id']
# puts form_method
# form_method.new(session[:employer_setup_data]['employer_setup_process_id'])
# end
# def process_step(step_name)
# @form_method = "EmployerSetup#{step_name.camelize}Form".constantize
# session_data_name = "#{step_name}_data"
# # puts "1--------------params----"
# # puts params
# # puts "8--------------session----"
# # puts session[:employer_setup_data]
# employer_setup_process_id = session[:employer_setup_data]['employer_setup_process_id']
# # puts session[:employer_setup_data]
# puts "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
# puts params
# @form = @form_method.new(employer_setup_process_id, params)
# if @form.pl_plan_key.blank?
# @form.pl_plan_key = session[:employer_setup_data]['pl_plan_key']
# end
# if @form.valid? && @form.save
# pl_plan_key = @top_form.pl_plan_key || @form.pl_plan_key
# # session[:employer_setup_data].merge!({current_step: step_name, pl_plan_key: pl_plan_key})
# # form_fields = @form.attributes.merge!(global_params(step_name))
# # session[:employer_setup_data][session_data_name] = form_fields
# # session[:employer_setup_data].merge!(global_params(step_name))
# # puts session[:employer_setup_data][session_data_name]
# true
# else
# false
# end
# end
# def step_params(step_name)
# form_name_sym = "employer_setup_#{step_name}_form".to_sym
# params.require(form_name_sym).permit(@form_method.permitted_params)
# end
# def global_params(step_name)
# form_name_sym = "employer_setup_#{step_name}_form".to_sym
# params.require(form_name_sym).permit(EmployerSetupForm.permitted_params)
# end
# def process_step(step_name)
# form_name = "employer_setup_#{step_name}_form".camelize.constantize
# form_params_name = "#{step_name}_params".to_sym
# allowed_params = [:general_information_params, :plans_params, :network_exceptions_params]
# if allowed_params.include?(form_params_name)
# form_params = send(form_params_name)
# @form = form_name.new(form_params)
# if @form.valid?
# session[:employer_setup_data]["#{step_name}_data"] = form_params
# true
# else
# false
# end
# end
# false
# end
# def employer_setup_params
# params.require(:employer_setup_form).permit(
# :current_step,
# :name,
# :employer_logo,
# :group_number,
# :pl_plan_key,
# :effect_date,
# :number_of_plans,
# :network,
# :number_of_additional_network_logos,
# network_exceptions: [:network_logo, exceptions: [:type, :value]],
# plans: permited_plans_keys,
# benefit_descs: benefit_sequence_keys
# )
# end
# def benefit_sequence_keys
# (1..14).map { |i| i.to_s.to_sym }
# end
# def permited_plans_keys
# benefit_sequence_keys.push(:plan_id)
# end
# def plans_params
# plans_keys = params[:plans]&.keys || []
# plans_keys.each_with_object({}) do |key, hash|
# if key == 'benefit_descs' || key.match?(/^plan_\d$/)
# hash[key.to_sym] = permited_plan_param_list
# end
# end
# end
# def permited_plan_param_list
# (1..14).map { |i| i.to_s.to_sym }.push(:plan_id)
# end
end
@@ -0,0 +1,57 @@
class IdCardEmployerLogoController < ApplicationController
def index
end
def show
end
def image
logo_file = IdCard::EmployerLogo.find_by(filename: params[:id])
puts params[:id]
if logo_file
logo_binary = logo_file.image_data
logo_filename = logo_file.filename
send_data logo_binary,
filename: logo_filename,
disposition: 'inline'
end
end
def new
end
def create
file = card_logo_file_params["logo_file"]
if file.present? && file.is_a?(ActionDispatch::Http::UploadedFile)
filename = file.original_filename
# binary_data = file.read
binary_data = File.binread(file)
meme_type = Marcel::MimeType.for(file)
CardLogoFile.create(
filename: filename,
image_data: binary_data,
content_type: meme_type,
logo_type: card_logo_file_params["logo_type"]
)
end
end
def edit
end
def update
end
def destroy
end
private
def card_logo_file_params
params.require(:card_logo_file).permit(:logo_file, :logo_type)
end
end
+2
View File
@@ -0,0 +1,2 @@
module CardProvidersHelper
end
+2
View File
@@ -0,0 +1,2 @@
module CardRxesHelper
end
@@ -1,13 +1,18 @@
import { Controller } from "@hotwired/stimulus";
export default class extends Controller {
static values = {
logoType: String,
employerName: String
}
static targets = ["preview", "previewContainer", "logoSelect", "logofield", "initialLogoFile"];
async connect() {
console.log('in connect');
console.log(this.logofieldTarget.value)
if (this.logofieldTarget.value.includes("Logo.")) {
const response = await fetch(`/card_logo_files/${this.logofieldTarget.value}/image`); // Fetch the binary data
const initValue = this.logofieldTarget.value
console.log(initValue)
if (initValue) {
const response = await fetch(`/id_card/${this.logoTypeValue}_logos/${initValue}/image`); // Fetch the binary data
const blob = await response.blob();
const objectUrl = URL.createObjectURL(blob);
this.previewTarget.src = objectUrl;
@@ -23,7 +28,7 @@ export default class extends Controller {
const file = event.target.files[0];
if (!file) return;
const logoType = event.params.type
const logoType = this.logoTypeValue
let newFileName = file.name
if (logoType == "network") {
@@ -32,14 +37,15 @@ export default class extends Controller {
this.addOptionToSelect(newFileName)
} else if (logoType == "employer") {
newFileName = this.determineEmployerFilename(file)
this.logofieldTarget.value = newFileName;
file.name = newFileName
}
this.previewFile(file);
// this.uploadLogoToServer(file);
this.uploadLogoToServer(file);
this.logofieldTarget.value = newFileName;
}
previewFile(file) {
@@ -55,13 +61,12 @@ export default class extends Controller {
async uploadLogoToServer(file) {
console.log('in uploadLogoToServer');
const formData = new FormData();
formData.append("card_logo_file[logo_file]", file);
formData.append("card_logo_file[logo_type]", "employer");
formData.append(`id_card_${this.logoTypeValue}_logo[logo_file]`, file);
const csrfToken = document.querySelector("meta[name='csrf-token']").content;
try {
const response = await fetch("/card_logo_files/", {
const response = await fetch(`/id_card/${this.logoTypeValue}_logos/`, {
method: "POST",
headers: {
"X-CSRF-Token": csrfToken
@@ -103,7 +108,7 @@ export default class extends Controller {
determineEmployerFilename(file) {
const fileExtension = file.name.split('.').pop();
const employerName = prompt("Enter the name for the new Employer (minus any 'The's, 'LLC', or 'Health Plan'):");
const employerName = this.employerNameValue
const logoFilename = this.titleizeText(employerName).concat("Logo.").concat(fileExtension).replaceAll(' ', '');
return logoFilename
-10
View File
@@ -1,10 +0,0 @@
class CardException < ApplicationRecord
belongs_to :employer
has_many :card_exception_items
accepts_nested_attributes_for :card_exception_items, allow_destroy: true, reject_if: :all_blank
VALID_TYPES = ['zipcode', 'state', 'family_id']
validates :type, inclusion: { in: VALID_TYPES,
message: "%{value} is not a valid exception type" }
end
-3
View File
@@ -1,3 +0,0 @@
class CardProvider < ApplicationRecord
has_many :employers
end
-3
View File
@@ -1,3 +0,0 @@
class CardRx < ApplicationRecord
has_many :employers
end
+26 -74
View File
@@ -1,29 +1,6 @@
class Employer < ApplicationRecord
has_many :members
has_many :plans, dependent: :destroy
accepts_nested_attributes_for :plans, allow_destroy: true, reject_if: :all_blank
has_many :alternate_network_logos, dependent: :destroy
accepts_nested_attributes_for :alternate_network_logos, allow_destroy: true, reject_if: :all_blank
has_many :employer_card_logos, dependent: :destroy
accepts_nested_attributes_for :employer_card_logos
has_many :card_logo_files, through: :employer_card_logos
has_one :employer_brand_logo, -> { where(logo_type: 'employer') },
class_name: 'EmployerCardLogo',
dependent: :destroy
has_one :employer_logo, through: :employer_brand_logo, source: :card_logo_file
has_many :network_images, -> { where(logo_type: 'network') },
class_name: 'EmployerCardLogo',
dependent: :destroy
has_many :network_logos, through: :network_images, source: :card_logo_file
belongs_to :card_provider, optional: true
belongs_to :card_rx, optional: true
has_many :card_exceptions, dependent: :destroy
accepts_nested_attributes_for :card_exceptions, allow_destroy: true, reject_if: :all_blank
has_one :id_card_setup, class_name: 'IdCard::Setup'
scope :active, -> { where(active: true) }
scope :inactive, -> { where(active: false) }
@@ -33,37 +10,37 @@ class Employer < ApplicationRecord
# before_save :process_employer_logo
# before_save :process_employer_logo, if: :employer_logo_filename_changed?
before_save :create_slug, if: :new_record?
after_save :process_employer_logo, if: :saved_change_to_employer_logo_filename?
# after_save :process_employer_logo, if: :saved_change_to_employer_logo_filename?
def process_employer_logo
# if self.employer_logo.present? && !self.employer_logo.is_a?(String)
# self.card_logo_files.new(
# filename: self.employer_logo.filename,
# logo_type: 'employer',
# image: self.employer_logo.data,
# pl_plan_key: self.pl_plan_key || ""
# )
# def process_employer_logo
# # if self.employer_logo.present? && !self.employer_logo.is_a?(String)
# # self.card_logo_files.new(
# # filename: self.employer_logo.filename,
# # logo_type: 'employer',
# # image: self.employer_logo.data,
# # pl_plan_key: self.pl_plan_key || ""
# # )
# # end
# if self.employer_logo_filename.present? && self.employer_logo_filename.is_a?(String)
# image_file = CardLogoFile.find_by(filename: self.employer_logo_filename)
# if image_file.present?
# if self.employer_brand_logo.present?
# self.employer_brand_logo.update(card_logo_file: image_file)
# else
# self.create_employer_brand_logo(card_logo_file: image_file, logo_type: 'employer')
# end
# end
if self.employer_logo_filename.present? && self.employer_logo_filename.is_a?(String)
image_file = CardLogoFile.find_by(filename: self.employer_logo_filename)
if image_file.present?
if self.employer_brand_logo.present?
self.employer_brand_logo.update(card_logo_file: image_file)
else
self.create_employer_brand_logo(card_logo_file: image_file, logo_type: 'employer')
end
end
end
end
# end
# end
def create_slug
self.slug = employer_trim_name(self.name).parameterize
end
def name_to_logo_filename(extension)
self.employer_trim_name(self.name).titleize.gsub(/\s+/, '').concat('Logo').concat(extension.downcase)
end
# def name_to_logo_filename(extension)
# self.employer_trim_name(self.name).titleize.gsub(/\s+/, '').concat('Logo').concat(extension.downcase)
# end
def employer_trim_name(name)
regex_source = Regexp.union(["health", "plan", "the", "inc", "llc"]).source
@@ -74,35 +51,10 @@ class Employer < ApplicationRecord
def self.permitted_params(params)
params.require(:employer).permit(
:name,
:slug,
:group_number,
:pl_plan_key,
:effective_date,
:employer_logo_filename,
:network_provider,
:default_network_logo,
:single_card_template,
:card_provider_id,
:card_rx_id,
plans_attributes: [
:id,
:title,
:pb_product_key,
:_destroy,
plan_benefits_attributes: [
:id,
:benefit_desc,
:benefit,
:sequence,
:_destroy,
]
],
alternate_network_logos_attributes: [
:id,
:network_logo,
:exception_type,
:exception_value,
:_destroy
]
:effective_date
)
end
+5
View File
@@ -0,0 +1,5 @@
module IdCard
def self.table_name_prefix
"id_card_"
end
end
+14
View File
@@ -0,0 +1,14 @@
class IdCard::EmployerLogo < ApplicationRecord
before_save :calculate_aspect_ratio, if: :image_data_changed?
private
def calculate_aspect_ratio
image_io = StringIO.new(self.image_data)
width, height = FastImage.size(image_io)
image_ratio = width.to_f / height
if image_ratio
self.aspect_ratio = image_ratio.round(2)
end
end
end
+10
View File
@@ -0,0 +1,10 @@
class IdCard::Exception < ApplicationRecord
belongs_to :id_card_setup
has_many :id_card_exception_items
accepts_nested_attributes_for :id_card_exception_items, allow_destroy: true, reject_if: :all_blank
VALID_TYPES = ['zipcode', 'state', 'family_id']
validates :type, inclusion: { in: VALID_TYPES,
message: "%{value} is not a valid exception type" }
end
@@ -1,7 +1,7 @@
class CardExceptionItem < ApplicationRecord
belongs_to :card_exception
belongs_to :card_logo_file, optional: true
belongs_to :card_provider, optional: true
class IdCard::ExceptionItem < ApplicationRecord
belongs_to :id_card_exception
belongs_to :id_card_network_logo, optional: true
belongs_to :id_card_provider_section, optional: true
validate :only_one_exception_field_present
+11
View File
@@ -0,0 +1,11 @@
class IdCard::NetworkLogo < ApplicationRecord
before_save :round_aspect_ratio
private
def round_aspect_ratio
if self.aspect_ratio.present?
self.aspect_ratio = self.aspect_ratio.round(2)
end
end
end
+33
View File
@@ -0,0 +1,33 @@
class IdCard::Plan < ApplicationRecord
belongs_to :id_card_setup
has_many :id_card_plan_benefits, dependent: :destroy
accepts_nested_attributes_for :id_card_plan_benefits, allow_destroy: true, reject_if: :all_blank
# after_initialize :create_default_benefits, if: :new_record?
def self.permitted_params(params)
params.require(:id_card_plan).permit(
:title,
:pb_product_key,
:pl_plan_key,
:_destroy,
id_card_plan_benefits_attributes: [
:id,
:benefit_desc,
:benefit,
:sequence,
:_destroy,
]
)
end
private
def build_and_create_default_benefits
benefits = IdCardBenefitsTemplate.find_by(title: "BLANK").id_card_benefits.sort_by(&:sequence)
benefits.each do |ben|
id_card_plan_benefits.new(benefit_desc: ben.benefit_desc, sequence: ben.sequence)
end
end
end
+3
View File
@@ -0,0 +1,3 @@
class IdCard::PlanBenefit < ApplicationRecord
belongs_to :id_card_plan
end
@@ -1,4 +1,4 @@
class SampleIdCard < ApplicationRecord
class IdCard::PrintData < ApplicationRecord
STRING_ATTRIBUTES = %w[provider_line_1 provider_line_2 provider_line_3 provider_line_4 provider_line_5 provider_line_6 provider_line_7 provider_line_8 provider_line_9 provider_line_10 provider_line_11 claim_to_1 claim_to_2 claim_to_3 claim_to_4 claim_to_5 claim_to_6 claim_to_7 claim_to_8 claim_to_9 claim_to_10 claim_to_11 dependent_1 dependent_2 dependent_3 dependent_4 dependent_5 dependent_6 dependent_7 dependent_8]
+3
View File
@@ -0,0 +1,3 @@
class IdCard::ProviderSection < ApplicationRecord
end
+3
View File
@@ -0,0 +1,3 @@
class IdCard::RxSection < ApplicationRecord
end
+27
View File
@@ -0,0 +1,27 @@
class IdCard::Setup < ApplicationRecord
belongs_to :employer
belongs_to :id_card_employer_logo
belongs_to :id_card_network_logo
belongs_to :id_card_provider_section
belongs_to :id_card_rx_section
has_many :card_exceptions, dependent: :destroy
# def employer_logo_filename
# self.id_card_employer_logo.filename
# end
# def network_logo_filename
# self.id_card_network_logo.filename
# end
def self.permitted_params(params)
params.require(:id_card_setup).permit(
:print_name,
:network_provider,
:card_template,
:rx_group_number,
:id_card_employer_logo_id
)
end
end
-18
View File
@@ -1,18 +0,0 @@
class Plan < ApplicationRecord
belongs_to :employer
has_many :plan_benefits, dependent: :destroy
accepts_nested_attributes_for :plan_benefits, allow_destroy: true, reject_if: :all_blank
# after_initialize :create_default_benefits, if: :new_record?
private
def build_and_create_default_benefits
benefits = IdCardBenefitsTemplate.find_by(title: "BLANK").id_card_benefits.sort_by(&:sequence)
benefits.each do |ben|
plan_benefits.new(benefit_desc: ben.benefit_desc, sequence: ben.sequence)
end
end
end
-3
View File
@@ -1,3 +0,0 @@
class PlanBenefit < ApplicationRecord
belongs_to :plan
end
+3 -96
View File
@@ -2,10 +2,6 @@
<h1 class="font-bold text-4xl text-platinum my-5">Edit Employer</h1>
<%= form_with model: @employer, local: true, multipart: true do |f| %>
<div class="flex flex-col space-y-6">
<div class="w-full flex items-center">
<h3 class="font-bold text-2xl text-bluemana">General Information</h3>
<div class="h-[1px] w-1/2 mt-2 bg-bluemana"></div>
</div>
<div class="flex w-full items-end" data-controller="logo-upload">
<div class="flex flex-col space-y-6 w-3/5">
<div class="flex space-x-10">
@@ -16,110 +12,21 @@
<%= f.text_field :slug, label: { text: "Slug" }, class: "w-full" %>
</div>
<div class="w-full">
<%= f.text_field :group_number, label: { text: "Group/Medical Number" }, class: "w-full" %>
<%= f.text_field :pl_plan_key, label: { text: "Pl Plan Key" }, class: "w-full" %>
</div>
</div>
<div class="flex space-x-10">
<div class="w-full">
<%= f.text_field :pl_plan_key, label: { text: "Pl Plan Key" }, class: "w-full" %>
<%= f.text_field :group_number, label: { text: "Group/Medical Number" }, class: "w-full" %>
</div>
<div class="w-full">
<%= f.text_field :effective_date, label: { text: "Effective Date" }, class: "w-full" %>
</div>
<div class="w-full">
<%= f.select :network_provider, options_for_select(["Cigna", "Medcost"]), label: { text: "Provider Network" }, class: "w-full" %>
</div>
</div>
<div class="flex items-end">
<div class="flex flex-col">
<%= f.text_field :employer_logo_filename, data: { logo_upload_target: "logofield" }, class: "w-full rounded-r-none", readonly: true %>
</div>
<div class="flex items-center justify-center cursor-pointer bg-atmosphere hover:bg-deepcove border-2 border-atmosphere text-platinum font-bold px-3 rounded-r h-10 transition duration-100">
<label for="file_upload_input_employer" class="text-center cursor-pointer">
<%= icon "image-plus", library: "lucide" %>
</label>
</div>
<div class="hidden flex justify-center ml-15 rounded-lg border-4 border-atmosphere" data-logo-upload-target="previewContainer">
<img data-logo-upload-target="preview" src="#" alt="Employer Logo preview" class="max-h-[100px] max-w-[133px] bg-platinum m-1"/>
</div>
<%= f.file_field :add_or_update_logo, class: "hidden", id: "file_upload_input_employer", data: { logo_upload_target: "previewContainer", logo_upload_type_param: "employer", action: "change->logo-upload#uploadLogo" }, direct_upload: true %>
</div>
</div>
</div>
<div class="w-full flex items-center">
<h3 class="font-bold text-2xl text-bluemana">Plans Information</h3>
<div class="h-[1px] w-1/2 mt-2 bg-bluemana"></div>
</div>
<div class="w-full flex my-8" data-controller="add-plan" data-add-plan-form-color-value="<%= EmployerSetupPlansForm::PLAN_COLORS.to_json %>" >
<div class="flex flex-wrap w-full" data-add-plan-target="container">
<% @employer.plans.each_with_index do |plan, index| %>
<%= f.fields_for :plans, plan, child_index: index do |plan_fields| %>
<div class="inline-flex flex-col pr-6 w-1/4 relative pl-1" data-controller="benefits-template-picker">
<div class="absolute left-0 top-[2%] h-[98%] border-l-4 <%= "border-#{EmployerSetupPlansForm::PLAN_COLORS[index]}" %>"></div>
<div class="font-bold text-2xl <%= "text-#{EmployerSetupPlansForm::PLAN_COLORS[index]}" %> -ml-[6px] z-2 w-full">
<%= "Plan #{index + 1}" %>
</div>
<%= render 'plan_fields', plan_fields: plan_fields, f: f, index: index %>
<div class="text-xl text-left font-bold pl-[2px] mb-[-4px] z-1 <%= "text-#{EmployerSetupPlansForm::PLAN_COLORS[index]}" %>">
Benefit Values
</div>
<div class="w-full h-[3px] rounded-r <%= "bg-#{index % 2 == 1 ? 'bronze' : 'copper'}" %> ml-[3px]"></div>
<%= plan_fields.fields_for :plan_benefits do |plan_benefits_fields| %>
<%= render 'plan_benefits_fields', plan_benefits_fields: plan_benefits_fields %>
<% end %>
<div class="mt-4 pl-1">
<%= plan_fields.hidden_field :_destroy %>
<%= button_tag "Remove Plan #{index + 1}", class: "cursor-pointer bg-deepcove hover:bg-brightlava text-xl font-bold text-#{index % 2 == 1 ? 'bronze' : 'copper'} hover:text-platinum py-2 px-4 font-semibold leading-tight rounded-lg border-3 border-NEXT_SECONDARY_COLOR w-full", data: { action: "add-plan#remove" } %>
</div>
</div>
<% end %>
<% end %>
<%= button_tag "Add a Plan", class: "cursor-pointer text-2xl font-bold py-2 pr-6 mt-10 w-[calc(24%-1rem)] w-1/4 min-h-[940px] text-[#E0E0E0] rounded-lg font-medium border border-[#E0E0E0] bg-[#173057] hover:bg-transparent hover:shadow-[0_0_10px_3px_#93c5fd] transition-colors duration-150", data: { action: "add-plan#add", add_plan_target: "button" } %>
<template data-add-plan-target="template">
<%= f.fields_for :plans, @employer.build_plan_with_default_benefits, child_index: 'NEW_RECORD' do |plan_fields| %>
<div class="inline-flex flex-col justify-end pr-6 w-1/4 relative pl-1" data-controller="benefits-template-picker">
<div class="absolute left-0 top-[2%] h-[98%] border-l-4 border-NEXT_COLOR"></div>
<div class="font-bold text-2xl text-NEXT_COLOR -ml-[6px] z-2 w-full">
<%= "Plan NEW_PLAN" %>
</div>
<%= render 'plan_fields', plan_fields: plan_fields, f: f, index: "NEW_RECORD".to_i %>
<div class="text-xl text-left font-bold pl-[2px] mb-[-4px] z-1 text-NEXT_COLOR">
Benefit Values
</div>
<div class="w-full h-[3px] rounded-r bg-NEXT_SECONDARY_COLOR ml-[3px]"></div>
<%= plan_fields.fields_for :plan_benefits do |plan_benefits_fields| %>
<%= render 'plan_benefits_fields', plan_benefits_fields: plan_benefits_fields %>
<% end %>
<div class="mt-4 pl-1">
<%= plan_fields.hidden_field :_destroy %>
<%= button_tag "Remove Plan NEW_PLAN", class: "cursor-pointer bg-deepcove hover:bg-brightlava text-xl font-bold text-NEXT_SECONDARY_COLOR hover:text-platinum py-2 px-4 font-semibold leading-tight rounded-lg border-3 border-NEXT_SECONDARY_COLOR w-full", data: { action: "add-plan#remove" } %>
</div>
</div>
<% end %>
</template>
</div>
</div>
<div class="w-full flex items-center">
<h3 class="font-bold text-2xl text-bluemana">Alternative Network Information</h3>
<div class="h-[1px] w-1/2 mt-2 bg-bluemana"></div>
</div>
<div class="flex w-full justify-start" data-controller="add-alt-network-logo" data-add-alt-network-logo-form-color-value="<%= EmployerSetupPlansForm::PLAN_COLORS.to_json %>">
<div class="flex flex-wrap w-full" data-add-alt-network-logo-target="container">
<%= button_tag "Add a Regional Logo", class: "cursor-pointer text-lg font-medium py-2 px-4 rounded w-1/7 h-75 my-8 text-[#E0E0E0] rounded-lg border border-[#C2C2C2] hover:shadow-[0_0_10px_3px_#93c5fd]", data: { action: "add-alt-network-logo#add", add_alt_network_logo_target: "button" } %>
</div>
<template data-add-alt-network-logo-target="template">
<%= f.fields_for :alternate_network_logos, AlternateNetworkLogo.new, child_index: 'NEW_RECORD' do |network_fields| %>
<div class="flex flex-col my-8 mr-3 space-y-6 px-3" data-controller="add-network-exception" data-add-network-exception-parent-color-value="NEXT_SECONDARY_COLOR">
<%= render 'alt_network_logo_fields', network_fields: network_fields, f: f %>
</div>
<% end %>
</template>
</div>
<div class="flex py-8 space-x-4">
<%= f.submit "Submit" %>
<%= f.submit "Save Employer" %>
<%= link_to "Back", employer_path(@employer.slug), class: "flex justify-center items-center cursor-pointer bg-atmosphere hover:bg-deepcove border-2 border-atmosphere text-platinum font-bold px-3 rounded-sm h-10 transition duration-100" %>
</div>
</div>
+1 -99
View File
@@ -13,10 +13,6 @@
</div>
<%= form_with model: @employer, local: true, multipart: true do |f| %>
<div class="flex flex-col space-y-6 pb-10">
<div class="w-full flex items-center">
<h3 class="font-bold text-2xl text-bluemana">General Information</h3>
<div class="h-[1px] w-1/2 mt-2 bg-bluemana"></div>
</div>
<div class="flex w-full items-end" data-controller="logo-upload">
<div class="flex flex-col space-y-6 w-2/5">
<div class="flex space-x-10">
@@ -31,105 +27,11 @@
<div class="w-full">
<%= f.text_field :effective_date, label: { text: "Effective Date" }, class: "w-full" %>
</div>
<div class="w-full">
<%= f.select :network_provider, options_for_select(["Cigna", "Medcost"]), label: { text: "Provider Network" }, data: { logo_upload_target: "network" }, class: "w-full" %>
<%= f.hidden_field :single_card_template, value: @employer.single_card_template %>
<%= f.hidden_field :default_network_logo, value: @employer.default_network_logo %>
<%= f.hidden_field :card_provider_id, value: @employer.card_provider_id %>
<%= f.hidden_field :card_rx_id, value: @employer.card_rx_id %>
</div>
</div>
<div class="flex items-end">
<div class="flex">
<div class="flex flex-col">
<%= f.text_field :employer_logo_filename, label: { text: "Employer Logo" }, default: "No logo added", data: { logo_upload_target: "logofield" }, class: "w-full rounded-r-none", readonly: true %>
</div>
<div class="flex items-center justify-center self-end cursor-pointer bg-atmosphere hover:bg-deepcove border-2 border-atmosphere text-platinum font-bold px-3 rounded-r h-10 transition duration-100">
<label for="file_upload_input_employer" class="text-center cursor-pointer">
<%= icon "image-plus", library: "lucide" %>
</label>
</div>
</div>
<div class="hidden flex justify-center ml-15 rounded-lg border-4 border-atmosphere" data-logo-upload-target="previewContainer">
<img data-logo-upload-target="preview" src="#" alt="Employer Logo preview" class="max-h-[100px] max-w-[133px] bg-platinum m-1"/>
</div>
<%= f.file_field :add_or_update_logo, class: "hidden", id: "file_upload_input_employer", data: { logo_upload_target: "previewContainer", logo_upload_type_param: "employer", action: "change->logo-upload#uploadLogo" }, direct_upload: true %>
</div>
</div>
</div>
<div class="w-full flex items-center">
<h3 class="font-bold text-2xl text-bluemana">Plans Information</h3>
<div class="h-[1px] w-1/2 mt-2 bg-bluemana"></div>
</div>
<div class="w-full flex my-8" data-controller="add-plan" data-add-plan-form-color-value="<%= EmployerSetupPlansForm::PLAN_COLORS.to_json %>" >
<div class="flex flex-wrap w-full" data-add-plan-target="container">
<% @employer.plans.each_with_index do |plan, index| %>
<%= f.fields_for :plans, plan, child_index: index do |plan_fields| %>
<div class="inline-flex flex-col justify-end pr-6 w-1/4 relative pl-1 plan-item" data-controller="benefits-template-picker">
<div class="absolute left-0 top-[2%] h-[98%] border-l-4 <%= "border-#{EmployerSetupPlansForm::PLAN_COLORS[index]}" %> "></div>
<div class="font-bold text-2xl <%= "text-#{EmployerSetupPlansForm::PLAN_COLORS[index]}" %> -ml-[6px] z-2 w-full">
<%= "Plan #{index + 1}" %>
</div>
<%= render 'plan_fields', plan_fields: plan_fields, f: f, index: index %>
<div class="text-xl text-left font-bold pl-[2px] mb-[-4px] z-1 <%= "text-#{EmployerSetupPlansForm::PLAN_COLORS[index]}" %>">
Benefit Values
</div>
<div class="w-full h-[3px] rounded-r <%= "bg-#{index % 2 == 1 ? 'bronze' : 'copper'}" %> ml-[3px]"></div>
<%= plan_fields.fields_for :plan_benefits do |plan_benefits_fields| %>
<%= render 'plan_benefits_fields', plan_benefits_fields: plan_benefits_fields %>
<% end %>
<div class="mt-4 pl-1">
<%= plan_fields.hidden_field :_destroy %>
<%= button_tag "Remove Plan #{index + 1}", class: "cursor-pointer bg-deepcove hover:bg-brightlava text-xl font-bold text-copper hover:text-platinum py-2 px-4 font-semibold leading-tight rounded-lg border-3 border-copper w-full", data: { action: "add-plan#remove" } %>
</div>
</div>
<% end %>
<% end %>
<%= button_tag "Add a Plan", class: "cursor-pointer text-2xl font-bold py-2 pr-6 mt-10 w-[calc(24%-1rem)] w-1/4 min-h-[940px] text-[#E0E0E0] rounded-lg font-medium border border-[#E0E0E0] bg-[#173057] hover:bg-transparent hover:shadow-[0_0_10px_3px_#93c5fd] transition-colors duration-150", data: { action: "add-plan#add", add_plan_target: "button" } %>
</div>
<template data-add-plan-target="template">
<%= f.fields_for :plans, @employer.build_plan_with_default_benefits, child_index: 'NEW_RECORD' do |plan_fields| %>
<div class="inline-flex flex-col justify-end pr-6 w-1/4 relative pl-1 plan-item" data-controller="benefits-template-picker">
<div class="absolute left-0 top-[2%] h-[98%] border-l-4 border-NEXT_COLOR"></div>
<div class="font-bold text-2xl text-NEXT_COLOR -ml-[6px] z-2 w-full">
<%= "Plan NEW_PLAN" %>
</div>
<%= render 'plan_fields', plan_fields: plan_fields, f: f, index: "NEW_RECORD".to_i %>
<div class="text-xl text-left font-bold pl-[2px] mb-[-4px] z-1 text-NEXT_COLOR">
Benefit Values
</div>
<div class="w-full h-[3px] rounded-r bg-NEXT_SECONDARY_COLOR ml-[3px]"></div>
<%= plan_fields.fields_for :plan_benefits do |plan_benefits_fields| %>
<%= render 'plan_benefits_fields', plan_benefits_fields: plan_benefits_fields %>
<% end %>
<div class="mt-4 pl-1">
<%= plan_fields.hidden_field :_destroy %>
<%= button_tag "Remove Plan NEW_PLAN", class: "cursor-pointer bg-deepcove hover:bg-brightlava text-xl font-bold text-NEXT_SECONDARY_COLOR hover:text-platinum py-2 px-4 font-semibold leading-tight rounded-lg border-3 border-NEXT_SECONDARY_COLOR w-full", data: { action: "add-plan#remove" } %>
</div>
</div>
<% end %>
</template>
</div>
</div>
<div class="w-full flex items-center">
<h3 class="font-bold text-2xl text-bluemana">Alternative Network Information</h3>
<div class="h-[1px] w-1/2 mt-2 bg-bluemana"></div>
</div>
<div class="flex w-full justify-start" data-controller="add-alt-network-logo" data-add-alt-network-logo-form-color-value="<%= EmployerSetupPlansForm::PLAN_COLORS.to_json %>">
<div class="flex flex-wrap w-full" data-add-alt-network-logo-target="container">
<%= button_tag "Add a Regional Logo", class: "cursor-pointer text-lg font-medium py-2 px-4 rounded w-1/7 h-55 my-8 text-[#E0E0E0] rounded-lg border border-[#C2C2C2] hover:shadow-[0_0_10px_3px_#93c5fd]", data: { action: "add-alt-network-logo#add", add_alt_network_logo_target: "button" } %>
</div>
<template data-add-alt-network-logo-target="template">
<%= f.fields_for :alternate_network_logos, AlternateNetworkLogo.new, child_index: 'NEW_RECORD' do |network_fields| %>
<div class="flex flex-col my-8 mr-3 space-y-6 px-3 min-w-1/3 network-item" data-controller="logo-upload" data-add-network-exception-parent-color-value="NEXT_SECONDARY_COLOR">
<%= render 'alt_network_logo_fields', network_fields: network_fields, f: f %>
</div>
<% end %>
</template>
</div>
<div class="py-8">
<%= f.submit "Submit" %>
<%= f.submit "Create New Employer" %>
</div>
</div>
<% end %>
+10 -6
View File
@@ -2,7 +2,9 @@
<div class="flex w-full items-center space-x-4">
<h1 class="font-bold text-4xl text-platinum my-5"><%= @employer.name %></h1>
<div class="h-[50px] max-w-[200px]">
<%= image_tag image_card_logo_file_path(@employer.employer_logo_filename), class: "max-h-[50px] object-contain shadow-[0_0_10px_3px_#93c5fd]" %>
<% if @employer&.id_card_setup&.id_card_employer_logo&.filename %>
<%= image_tag image_id_card_employer_logo_path(@employer.id_card_setup.id_card_employer_logo.filename), class: "max-h-[50px] object-contain shadow-[0_0_10px_3px_#93c5fd]" %>
<% end %>
</div>
</div>
<div class="flex space-x-6">
@@ -29,10 +31,11 @@
<%= attribute_value.present? ? attribute_value.to_s : "waiting" %>
</p>
<% end %>
<% if @employer&.id_card_setup&.id_card_plans %>
<div>
<strong class="text-atmosphere mr-2">└── Plans</strong>
</div>
<% @employer.plans.pluck(:title, :pb_product_key).each do |plan| %>
<% @employer.id_card_setup.id_card_plans.pluck(:title, :pb_product_key).each do |plan| %>
<div class="ml-9">
├── <%= plan.first %>
</div>
@@ -41,6 +44,7 @@
<%= plan.last.present? ? plan.last.to_s : "waiting" %>
</p>
<% end %>
<% end %>
</div>
<div class="w-full flex items-center space-x-2 mt-10 ml-14">
<%= link_to 'Edit', edit_employer_path(@employer.slug), class: "hover:text-atmosphere" %>
@@ -53,10 +57,10 @@
<h3 class="font-bold text-2xl text-bluemana">Actions</h3>
<div class="h-[1px] w-2/3 mt-2 bg-bluemana"></div>
</div>
<%= link_to 'Generate Sample Cards', generate_sample_sample_id_cards_path(employer_slug: @employer.slug ), data: { turbo: false }, class: "flex justify-center items-center w-2/3 cursor-pointer bg-atmosphere hover:bg-deepcove border-2 border-atmosphere text-platinum font-bold px-3 rounded-lg h-10 transition duration-100" %>
<%= link_to 'Generate Group Cards (for print)', generate_print_sample_id_cards_path(employer_slug: @employer.slug ),data: { turbo: false }, class: "flex justify-center items-center w-2/3 #{@employer.active ? "" : "pointer-events-none opacity-50 cursor-not-allowed"} bg-atmosphere hover:bg-deepcove border-2 border-atmosphere text-platinum font-bold px-3 rounded-lg h-10 transition duration-100" %>
<%= link_to 'Generate Group Cards (for display)', generate_mobile_display_sample_id_cards_path(employer_slug: @employer.slug ), data: { turbo: false }, class: "flex justify-center items-center w-2/3 #{@employer.active ? "" : "pointer-events-none opacity-50 cursor-not-allowed"} bg-atmosphere hover:bg-deepcove border-2 border-atmosphere text-platinum font-bold px-3 rounded-lg h-10 transition duration-100" %>
<%= link_to 'Generate Group Cards (for download)', generate_full_page_sample_id_cards_path(employer_slug: @employer.slug ), data: { turbo: false }, class: "flex justify-center items-center w-2/3 #{@employer.active ? "" : "pointer-events-none opacity-50 cursor-not-allowed"} bg-atmosphere hover:bg-deepcove border-2 border-atmosphere text-platinum font-bold px-3 rounded-lg h-10 transition duration-100" %>
<%= link_to 'Generate Sample Cards', generate_sample_id_card_print_data_path(employer_slug: @employer.slug ), data: { turbo: false }, class: "flex justify-center items-center w-2/3 cursor-pointer bg-atmosphere hover:bg-deepcove border-2 border-atmosphere text-platinum font-bold px-3 rounded-lg h-10 transition duration-100" %>
<%= link_to 'Generate Group Cards (for print)', generate_print_id_card_print_data_path(employer_slug: @employer.slug ),data: { turbo: false }, class: "flex justify-center items-center w-2/3 #{@employer.active ? "" : "pointer-events-none opacity-50 cursor-not-allowed"} bg-atmosphere hover:bg-deepcove border-2 border-atmosphere text-platinum font-bold px-3 rounded-lg h-10 transition duration-100" %>
<%= link_to 'Generate Group Cards (for display)', generate_mobile_display_id_card_print_data_path(employer_slug: @employer.slug ), data: { turbo: false }, class: "flex justify-center items-center w-2/3 #{@employer.active ? "" : "pointer-events-none opacity-50 cursor-not-allowed"} bg-atmosphere hover:bg-deepcove border-2 border-atmosphere text-platinum font-bold px-3 rounded-lg h-10 transition duration-100" %>
<%= link_to 'Generate Group Cards (for download)', generate_full_page_id_card_print_data_path(employer_slug: @employer.slug ), data: { turbo: false }, class: "flex justify-center items-center w-2/3 #{@employer.active ? "" : "pointer-events-none opacity-50 cursor-not-allowed"} bg-atmosphere hover:bg-deepcove border-2 border-atmosphere text-platinum font-bold px-3 rounded-lg h-10 transition duration-100" %>
</div>
</div>
</div>
+127
View File
@@ -0,0 +1,127 @@
<div class="bg-deepcove h-full w-full flex flex-col">
<h1 class="font-bold text-4xl text-platinum my-5">Edit Employer</h1>
<%= form_with model: @employer, local: true, multipart: true do |f| %>
<div class="flex flex-col space-y-6">
<div class="w-full flex items-center">
<h3 class="font-bold text-2xl text-bluemana">General Information</h3>
<div class="h-[1px] w-1/2 mt-2 bg-bluemana"></div>
</div>
<div class="flex w-full items-end" data-controller="logo-upload">
<div class="flex flex-col space-y-6 w-3/5">
<div class="flex space-x-10">
<div class="w-full">
<%= f.text_field :name, label: { text: "Employer Name" }, class: "w-full" %>
</div>
<div class="w-full">
<%= f.text_field :slug, label: { text: "Slug" }, class: "w-full" %>
</div>
<div class="w-full">
<%= f.text_field :group_number, label: { text: "Group/Medical Number" }, class: "w-full" %>
</div>
</div>
<div class="flex space-x-10">
<div class="w-full">
<%= f.text_field :pl_plan_key, label: { text: "Pl Plan Key" }, class: "w-full" %>
</div>
<div class="w-full">
<%= f.text_field :effective_date, label: { text: "Effective Date" }, class: "w-full" %>
</div>
<div class="w-full">
<%= f.select :network_provider, options_for_select(["Cigna", "Medcost"]), label: { text: "Provider Network" }, class: "w-full" %>
</div>
</div>
<div class="flex items-end">
<div class="flex flex-col">
<%= f.text_field :employer_logo_filename, data: { logo_upload_target: "logofield" }, class: "w-full rounded-r-none", readonly: true %>
</div>
<div class="flex items-center justify-center cursor-pointer bg-atmosphere hover:bg-deepcove border-2 border-atmosphere text-platinum font-bold px-3 rounded-r h-10 transition duration-100">
<label for="file_upload_input_employer" class="text-center cursor-pointer">
<%= icon "image-plus", library: "lucide" %>
</label>
</div>
<div class="hidden flex justify-center ml-15 rounded-lg border-4 border-atmosphere" data-logo-upload-target="previewContainer">
<img data-logo-upload-target="preview" src="#" alt="Employer Logo preview" class="max-h-[100px] max-w-[133px] bg-platinum m-1"/>
</div>
<%= f.file_field :add_or_update_logo, class: "hidden", id: "file_upload_input_employer", data: { logo_upload_target: "previewContainer", logo_upload_type_param: "employer", action: "change->logo-upload#uploadLogo" }, direct_upload: true %>
</div>
</div>
</div>
<div class="w-full flex items-center">
<h3 class="font-bold text-2xl text-bluemana">Plans Information</h3>
<div class="h-[1px] w-1/2 mt-2 bg-bluemana"></div>
</div>
<div class="w-full flex my-8" data-controller="add-plan" data-add-plan-form-color-value="<%= EmployerSetupPlansForm::PLAN_COLORS.to_json %>" >
<div class="flex flex-wrap w-full" data-add-plan-target="container">
<% @employer.plans.each_with_index do |plan, index| %>
<%= f.fields_for :plans, plan, child_index: index do |plan_fields| %>
<div class="inline-flex flex-col pr-6 w-1/4 relative pl-1" data-controller="benefits-template-picker">
<div class="absolute left-0 top-[2%] h-[98%] border-l-4 <%= "border-#{EmployerSetupPlansForm::PLAN_COLORS[index]}" %>"></div>
<div class="font-bold text-2xl <%= "text-#{EmployerSetupPlansForm::PLAN_COLORS[index]}" %> -ml-[6px] z-2 w-full">
<%= "Plan #{index + 1}" %>
</div>
<%= render 'plan_fields', plan_fields: plan_fields, f: f, index: index %>
<div class="text-xl text-left font-bold pl-[2px] mb-[-4px] z-1 <%= "text-#{EmployerSetupPlansForm::PLAN_COLORS[index]}" %>">
Benefit Values
</div>
<div class="w-full h-[3px] rounded-r <%= "bg-#{index % 2 == 1 ? 'bronze' : 'copper'}" %> ml-[3px]"></div>
<%= plan_fields.fields_for :plan_benefits do |plan_benefits_fields| %>
<%= render 'plan_benefits_fields', plan_benefits_fields: plan_benefits_fields %>
<% end %>
<div class="mt-4 pl-1">
<%= plan_fields.hidden_field :_destroy %>
<%= button_tag "Remove Plan #{index + 1}", class: "cursor-pointer bg-deepcove hover:bg-brightlava text-xl font-bold text-#{index % 2 == 1 ? 'bronze' : 'copper'} hover:text-platinum py-2 px-4 font-semibold leading-tight rounded-lg border-3 border-NEXT_SECONDARY_COLOR w-full", data: { action: "add-plan#remove" } %>
</div>
</div>
<% end %>
<% end %>
<%= button_tag "Add a Plan", class: "cursor-pointer text-2xl font-bold py-2 pr-6 mt-10 w-[calc(24%-1rem)] w-1/4 min-h-[940px] text-[#E0E0E0] rounded-lg font-medium border border-[#E0E0E0] bg-[#173057] hover:bg-transparent hover:shadow-[0_0_10px_3px_#93c5fd] transition-colors duration-150", data: { action: "add-plan#add", add_plan_target: "button" } %>
<template data-add-plan-target="template">
<%= f.fields_for :plans, @employer.build_plan_with_default_benefits, child_index: 'NEW_RECORD' do |plan_fields| %>
<div class="inline-flex flex-col justify-end pr-6 w-1/4 relative pl-1" data-controller="benefits-template-picker">
<div class="absolute left-0 top-[2%] h-[98%] border-l-4 border-NEXT_COLOR"></div>
<div class="font-bold text-2xl text-NEXT_COLOR -ml-[6px] z-2 w-full">
<%= "Plan NEW_PLAN" %>
</div>
<%= render 'plan_fields', plan_fields: plan_fields, f: f, index: "NEW_RECORD".to_i %>
<div class="text-xl text-left font-bold pl-[2px] mb-[-4px] z-1 text-NEXT_COLOR">
Benefit Values
</div>
<div class="w-full h-[3px] rounded-r bg-NEXT_SECONDARY_COLOR ml-[3px]"></div>
<%= plan_fields.fields_for :plan_benefits do |plan_benefits_fields| %>
<%= render 'plan_benefits_fields', plan_benefits_fields: plan_benefits_fields %>
<% end %>
<div class="mt-4 pl-1">
<%= plan_fields.hidden_field :_destroy %>
<%= button_tag "Remove Plan NEW_PLAN", class: "cursor-pointer bg-deepcove hover:bg-brightlava text-xl font-bold text-NEXT_SECONDARY_COLOR hover:text-platinum py-2 px-4 font-semibold leading-tight rounded-lg border-3 border-NEXT_SECONDARY_COLOR w-full", data: { action: "add-plan#remove" } %>
</div>
</div>
<% end %>
</template>
</div>
</div>
<div class="w-full flex items-center">
<h3 class="font-bold text-2xl text-bluemana">Alternative Network Information</h3>
<div class="h-[1px] w-1/2 mt-2 bg-bluemana"></div>
</div>
<div class="flex w-full justify-start" data-controller="add-alt-network-logo" data-add-alt-network-logo-form-color-value="<%= EmployerSetupPlansForm::PLAN_COLORS.to_json %>">
<div class="flex flex-wrap w-full" data-add-alt-network-logo-target="container">
<%= button_tag "Add a Regional Logo", class: "cursor-pointer text-lg font-medium py-2 px-4 rounded w-1/7 h-75 my-8 text-[#E0E0E0] rounded-lg border border-[#C2C2C2] hover:shadow-[0_0_10px_3px_#93c5fd]", data: { action: "add-alt-network-logo#add", add_alt_network_logo_target: "button" } %>
</div>
<template data-add-alt-network-logo-target="template">
<%= f.fields_for :alternate_network_logos, AlternateNetworkLogo.new, child_index: 'NEW_RECORD' do |network_fields| %>
<div class="flex flex-col my-8 mr-3 space-y-6 px-3" data-controller="add-network-exception" data-add-network-exception-parent-color-value="NEXT_SECONDARY_COLOR">
<%= render 'alt_network_logo_fields', network_fields: network_fields, f: f %>
</div>
<% end %>
</template>
</div>
<div class="flex py-8 space-x-4">
<%= f.submit "Submit" %>
<%= link_to "Back", employer_path(@employer.slug), class: "flex justify-center items-center cursor-pointer bg-atmosphere hover:bg-deepcove border-2 border-atmosphere text-platinum font-bold px-3 rounded-sm h-10 transition duration-100" %>
</div>
</div>
<% end %>
</div>
+33
View File
@@ -0,0 +1,33 @@
<div class="bg-deepcove h-full w-full flex flex-col justify-start">
<div class="flex items-center">
<h1 class="font-bold text-4xl text-platinum my-5">Employers</h1>
<%= link_to new_employer_path, class: "flex justify-center items-center h-8 w-8 ml-2 mb-6 text-sm text-bronze bg-deepcove hover:bg-cobalt font-semibold p-1 rounded-lg border-2 border-cobalt" do %>
<%= icon "clipboard-plus", library: "lucide" %>
<% end %>
</div>
<% plan_colors = EmployerSetupPlansForm::PLAN_COLORS.push('copper', 'bronze').shuffle %>
<% @color_index = 0 %>
<h2 class="font-bold text-3xl text-brightlava my-5">In Process:</h2>
<% @employers.inactive.each_with_index do |emp, index| %>
<% item_color_index = @color_index == 0 ? 0 : @color_index % plan_colors.length %>
<div class="w-1/2 flex text-2xl text-platinum font-bold px-4 py-4 ml-10 space-x-4 rounded-lg border-l-5 border-b-2 <%= "border-#{plan_colors[item_color_index]}" %>">
<%= link_to emp.name, employer_path(emp.slug), class: "hover:text-#{plan_colors[item_color_index]}" %>
<div>
<%= "(Effective #{emp.effective_date})" %>
</div>
</div>
<% @color_index += 1 %>
<% end %>
<h2 class="font-bold text-3xl text-limegreen my-5">Live:</h2>
<% @employers.active.each_with_index do |emp, index| %>
<% item_color_index = @color_index == 0 ? 0 : @color_index % plan_colors.length %>
<div class="w-1/2 flex text-2xl text-platinum font-bold px-4 py-4 ml-10 space-x-4 rounded-lg border-l-5 border-b-2 <%= "border-#{plan_colors[item_color_index]}" %>">
<%= link_to emp.name, employer_path(emp.slug), class: "hover:text-#{plan_colors[item_color_index]}" %>
<div>
<%= "(#{emp.members.count} Members)" %>
</div>
</div>
<% @color_index += 1 %>
<% end %>
</div>
+136
View File
@@ -0,0 +1,136 @@
<div class="bg-deepcove h-full w-full flex flex-col">
<div class="flex justify-between">
<h1 class="font-bold text-4xl text-platinum my-5">New Employer</h1>
<%= form_with model: @employer, url: import_employers_path, data: { turbo: false }, local: true, multipart: true do |form| %>
<div class="flex items-end space-x-4">
<div class="flex flex-col">
<%= form.label :import_from_word, 'ID Card Setup Word Doc', class: "block text-platinum font-bold mb-1 md:mb-0 pr-4" %>
<%= form.file_field :import_from_word %>
</div>
<%= form.submit "Import", class: "h-[40px]" %>
</div>
<% end %>
</div>
<%= form_with model: @employer, local: true, multipart: true do |f| %>
<div class="flex flex-col space-y-6 pb-10">
<div class="w-full flex items-center">
<h3 class="font-bold text-2xl text-bluemana">General Information</h3>
<div class="h-[1px] w-1/2 mt-2 bg-bluemana"></div>
</div>
<div class="flex w-full items-end" data-controller="logo-upload">
<div class="flex flex-col space-y-6 w-2/5">
<div class="flex space-x-10">
<div class="w-full">
<%= f.text_field :name, label: { text: "Employer Name" }, data: { logo_upload_target: "employer" }, class: "w-full" %>
</div>
<div class="w-full">
<%= f.text_field :group_number, label: { text: "Group/Medical Number" }, class: "w-full" %>
</div>
</div>
<div class="flex space-x-10">
<div class="w-full">
<%= f.text_field :effective_date, label: { text: "Effective Date" }, class: "w-full" %>
</div>
<div class="w-full">
<%= f.select :network_provider, options_for_select(["Cigna", "Medcost"]), label: { text: "Provider Network" }, data: { logo_upload_target: "network" }, class: "w-full" %>
<%= f.hidden_field :single_card_template, value: @employer.single_card_template %>
<%= f.hidden_field :default_network_logo, value: @employer.default_network_logo %>
<%= f.hidden_field :card_provider_id, value: @employer.card_provider_id %>
<%= f.hidden_field :card_rx_id, value: @employer.card_rx_id %>
</div>
</div>
<div class="flex items-end">
<div class="flex">
<div class="flex flex-col">
<%= f.text_field :employer_logo_filename, label: { text: "Employer Logo" }, default: "No logo added", data: { logo_upload_target: "logofield" }, class: "w-full rounded-r-none", readonly: true %>
</div>
<div class="flex items-center justify-center self-end cursor-pointer bg-atmosphere hover:bg-deepcove border-2 border-atmosphere text-platinum font-bold px-3 rounded-r h-10 transition duration-100">
<label for="file_upload_input_employer" class="text-center cursor-pointer">
<%= icon "image-plus", library: "lucide" %>
</label>
</div>
</div>
<div class="hidden flex justify-center ml-15 rounded-lg border-4 border-atmosphere" data-logo-upload-target="previewContainer">
<img data-logo-upload-target="preview" src="#" alt="Employer Logo preview" class="max-h-[100px] max-w-[133px] bg-platinum m-1"/>
</div>
<%= f.file_field :add_or_update_logo, class: "hidden", id: "file_upload_input_employer", data: { logo_upload_target: "previewContainer", logo_upload_type_param: "employer", action: "change->logo-upload#uploadLogo" }, direct_upload: true %>
</div>
</div>
</div>
<div class="w-full flex items-center">
<h3 class="font-bold text-2xl text-bluemana">Plans Information</h3>
<div class="h-[1px] w-1/2 mt-2 bg-bluemana"></div>
</div>
<div class="w-full flex my-8" data-controller="add-plan" data-add-plan-form-color-value="<%= EmployerSetupPlansForm::PLAN_COLORS.to_json %>" >
<div class="flex flex-wrap w-full" data-add-plan-target="container">
<% @employer.plans.each_with_index do |plan, index| %>
<%= f.fields_for :plans, plan, child_index: index do |plan_fields| %>
<div class="inline-flex flex-col justify-end pr-6 w-1/4 relative pl-1 plan-item" data-controller="benefits-template-picker">
<div class="absolute left-0 top-[2%] h-[98%] border-l-4 <%= "border-#{EmployerSetupPlansForm::PLAN_COLORS[index]}" %> "></div>
<div class="font-bold text-2xl <%= "text-#{EmployerSetupPlansForm::PLAN_COLORS[index]}" %> -ml-[6px] z-2 w-full">
<%= "Plan #{index + 1}" %>
</div>
<%= render 'plan_fields', plan_fields: plan_fields, f: f, index: index %>
<div class="text-xl text-left font-bold pl-[2px] mb-[-4px] z-1 <%= "text-#{EmployerSetupPlansForm::PLAN_COLORS[index]}" %>">
Benefit Values
</div>
<div class="w-full h-[3px] rounded-r <%= "bg-#{index % 2 == 1 ? 'bronze' : 'copper'}" %> ml-[3px]"></div>
<%= plan_fields.fields_for :plan_benefits do |plan_benefits_fields| %>
<%= render 'plan_benefits_fields', plan_benefits_fields: plan_benefits_fields %>
<% end %>
<div class="mt-4 pl-1">
<%= plan_fields.hidden_field :_destroy %>
<%= button_tag "Remove Plan #{index + 1}", class: "cursor-pointer bg-deepcove hover:bg-brightlava text-xl font-bold text-copper hover:text-platinum py-2 px-4 font-semibold leading-tight rounded-lg border-3 border-copper w-full", data: { action: "add-plan#remove" } %>
</div>
</div>
<% end %>
<% end %>
<%= button_tag "Add a Plan", class: "cursor-pointer text-2xl font-bold py-2 pr-6 mt-10 w-[calc(24%-1rem)] w-1/4 min-h-[940px] text-[#E0E0E0] rounded-lg font-medium border border-[#E0E0E0] bg-[#173057] hover:bg-transparent hover:shadow-[0_0_10px_3px_#93c5fd] transition-colors duration-150", data: { action: "add-plan#add", add_plan_target: "button" } %>
</div>
<template data-add-plan-target="template">
<%= f.fields_for :plans, @employer.build_plan_with_default_benefits, child_index: 'NEW_RECORD' do |plan_fields| %>
<div class="inline-flex flex-col justify-end pr-6 w-1/4 relative pl-1 plan-item" data-controller="benefits-template-picker">
<div class="absolute left-0 top-[2%] h-[98%] border-l-4 border-NEXT_COLOR"></div>
<div class="font-bold text-2xl text-NEXT_COLOR -ml-[6px] z-2 w-full">
<%= "Plan NEW_PLAN" %>
</div>
<%= render 'plan_fields', plan_fields: plan_fields, f: f, index: "NEW_RECORD".to_i %>
<div class="text-xl text-left font-bold pl-[2px] mb-[-4px] z-1 text-NEXT_COLOR">
Benefit Values
</div>
<div class="w-full h-[3px] rounded-r bg-NEXT_SECONDARY_COLOR ml-[3px]"></div>
<%= plan_fields.fields_for :plan_benefits do |plan_benefits_fields| %>
<%= render 'plan_benefits_fields', plan_benefits_fields: plan_benefits_fields %>
<% end %>
<div class="mt-4 pl-1">
<%= plan_fields.hidden_field :_destroy %>
<%= button_tag "Remove Plan NEW_PLAN", class: "cursor-pointer bg-deepcove hover:bg-brightlava text-xl font-bold text-NEXT_SECONDARY_COLOR hover:text-platinum py-2 px-4 font-semibold leading-tight rounded-lg border-3 border-NEXT_SECONDARY_COLOR w-full", data: { action: "add-plan#remove" } %>
</div>
</div>
<% end %>
</template>
</div>
</div>
<div class="w-full flex items-center">
<h3 class="font-bold text-2xl text-bluemana">Alternative Network Information</h3>
<div class="h-[1px] w-1/2 mt-2 bg-bluemana"></div>
</div>
<div class="flex w-full justify-start" data-controller="add-alt-network-logo" data-add-alt-network-logo-form-color-value="<%= EmployerSetupPlansForm::PLAN_COLORS.to_json %>">
<div class="flex flex-wrap w-full" data-add-alt-network-logo-target="container">
<%= button_tag "Add a Regional Logo", class: "cursor-pointer text-lg font-medium py-2 px-4 rounded w-1/7 h-55 my-8 text-[#E0E0E0] rounded-lg border border-[#C2C2C2] hover:shadow-[0_0_10px_3px_#93c5fd]", data: { action: "add-alt-network-logo#add", add_alt_network_logo_target: "button" } %>
</div>
<template data-add-alt-network-logo-target="template">
<%= f.fields_for :alternate_network_logos, AlternateNetworkLogo.new, child_index: 'NEW_RECORD' do |network_fields| %>
<div class="flex flex-col my-8 mr-3 space-y-6 px-3 min-w-1/3 network-item" data-controller="logo-upload" data-add-network-exception-parent-color-value="NEXT_SECONDARY_COLOR">
<%= render 'alt_network_logo_fields', network_fields: network_fields, f: f %>
</div>
<% end %>
</template>
</div>
<div class="py-8">
<%= f.submit "Submit" %>
</div>
</div>
<% end %>
</div>
+62
View File
@@ -0,0 +1,62 @@
<div class="bg-deepcove text-platinum h-full w-full flex flex-col">
<div class="flex w-full items-center space-x-4">
<h1 class="font-bold text-4xl text-platinum my-5"><%= @employer.name %></h1>
<div class="h-[50px] max-w-[200px]">
<%= image_tag image_card_logo_file_path(@employer.employer_logo_filename), class: "max-h-[50px] object-contain shadow-[0_0_10px_3px_#93c5fd]" %>
</div>
</div>
<div class="flex space-x-6">
<div class="flex flex-col space-y-1 w-1/3">
<div class="w-full flex items-center">
<h3 class="grow-0 font-bold text-2xl text-bluemana">Employer Information</h3>
<div class="h-[1px] grow mt-2 bg-bluemana"></div>
</div>
<div class="flex flex-col space-y-1 ml-4">
<p class="text-<%="#{@employer.active == false ? "brightlava" : "limegreen"}" %>">
<strong class="text-platinum mr-2">└── Status:</strong>
<%= @employer.active == false ? "inactive" : "active" %>
</p>
<p class="ml-9 text-bluemana">
<strong class="text-platinum mr-2">├── Effective Date:</strong>
<%= @employer.effective_date %>
</p>
<div>
<strong class="text-atmosphere mr-2">└── Key Chain</strong>
</div>
<% @employer.attributes.with_indifferent_access.slice(:pl_plan_key, :company_pb_entity_key, :group_number).each do |attribute_name, attribute_value| %>
<p class="ml-9 text-<%="#{attribute_value.present? ? "limegreen" : "brightlava"}" %>">
<strong class="text-platinum mr-2">├── <%= attribute_name.titleize %>:</strong>
<%= attribute_value.present? ? attribute_value.to_s : "waiting" %>
</p>
<% end %>
<div>
<strong class="text-atmosphere mr-2">└── Plans</strong>
</div>
<% @employer.plans.pluck(:title, :pb_product_key).each do |plan| %>
<div class="ml-9">
├── <%= plan.first %>
</div>
<p class="ml-14 text-<%="#{plan.last.present? ? "limegreen" : "brightlava"}" %>">
<strong class="text-platinum mr-2">└── PB Product Key:</strong>
<%= plan.last.present? ? plan.last.to_s : "waiting" %>
</p>
<% end %>
</div>
<div class="w-full flex items-center space-x-2 mt-10 ml-14">
<%= link_to 'Edit', edit_employer_path(@employer.slug), class: "hover:text-atmosphere" %>
<p>|</p>
<%= link_to 'Back', employers_path, class: "hover:text-atmosphere" %>
</div>
</div>
<div class="flex flex-col space-y-6 w-1/3">
<div class="w-full flex items-center">
<h3 class="font-bold text-2xl text-bluemana">Actions</h3>
<div class="h-[1px] w-2/3 mt-2 bg-bluemana"></div>
</div>
<%= link_to 'Generate Sample Cards', generate_sample_sample_id_cards_path(employer_slug: @employer.slug ), data: { turbo: false }, class: "flex justify-center items-center w-2/3 cursor-pointer bg-atmosphere hover:bg-deepcove border-2 border-atmosphere text-platinum font-bold px-3 rounded-lg h-10 transition duration-100" %>
<%= link_to 'Generate Group Cards (for print)', generate_print_sample_id_cards_path(employer_slug: @employer.slug ),data: { turbo: false }, class: "flex justify-center items-center w-2/3 #{@employer.active ? "" : "pointer-events-none opacity-50 cursor-not-allowed"} bg-atmosphere hover:bg-deepcove border-2 border-atmosphere text-platinum font-bold px-3 rounded-lg h-10 transition duration-100" %>
<%= link_to 'Generate Group Cards (for display)', generate_mobile_display_sample_id_cards_path(employer_slug: @employer.slug ), data: { turbo: false }, class: "flex justify-center items-center w-2/3 #{@employer.active ? "" : "pointer-events-none opacity-50 cursor-not-allowed"} bg-atmosphere hover:bg-deepcove border-2 border-atmosphere text-platinum font-bold px-3 rounded-lg h-10 transition duration-100" %>
<%= link_to 'Generate Group Cards (for download)', generate_full_page_sample_id_cards_path(employer_slug: @employer.slug ), data: { turbo: false }, class: "flex justify-center items-center w-2/3 #{@employer.active ? "" : "pointer-events-none opacity-50 cursor-not-allowed"} bg-atmosphere hover:bg-deepcove border-2 border-atmosphere text-platinum font-bold px-3 rounded-lg h-10 transition duration-100" %>
</div>
</div>
</div>
+34
View File
@@ -0,0 +1,34 @@
<div class="bg-deepcove h-full w-full flex flex-col">
<h1 class="font-bold text-4xl text-platinum my-5">Edit Employer</h1>
<%= form_with model: @employer, local: true, multipart: true do |f| %>
<div class="flex flex-col space-y-6">
<div class="flex w-full items-end" data-controller="logo-upload">
<div class="flex flex-col space-y-6 w-3/5">
<div class="flex space-x-10">
<div class="w-full">
<%= f.text_field :name, label: { text: "Employer Name" }, class: "w-full" %>
</div>
<div class="w-full">
<%= f.text_field :slug, label: { text: "Slug" }, class: "w-full" %>
</div>
<div class="w-full">
<%= f.text_field :group_number, label: { text: "Group/Medical Number" }, class: "w-full" %>
</div>
</div>
<div class="flex space-x-10">
<div class="w-full">
<%= f.text_field :pl_plan_key, label: { text: "Pl Plan Key" }, class: "w-full" %>
</div>
<div class="w-full">
<%= f.text_field :effective_date, label: { text: "Effective Date" }, class: "w-full" %>
</div>
</div>
</div>
</div>
<div class="flex py-8 space-x-4">
<%= f.submit "Save Employer" %>
<%= link_to "Back", employer_path(@employer.slug), class: "flex justify-center items-center cursor-pointer bg-atmosphere hover:bg-deepcove border-2 border-atmosphere text-platinum font-bold px-3 rounded-sm h-10 transition duration-100" %>
</div>
</div>
<% end %>
</div>
+48
View File
@@ -0,0 +1,48 @@
<div class="bg-deepcove h-full w-full flex flex-col">
<div class="flex justify-between my-5 font-bold text-4xl">
<h1 class="text-platinum">New ID Card Setup:</h1>
<h1 class="text-verdigris">(<%= @employer.name %>)</h1>
</div>
<%= form_with model: @setup, local: true, multipart: true do |f| %>
<div class="flex flex-col space-y-6 pb-10">
<div class="flex w-full items-end" data-controller="logo-upload" data-logo-upload-logo-type-value="employer" data-logo-upload-employer-name-value=<%= @employer.name %>>
<div class="flex flex-col space-y-6 w-2/5">
<div class="flex space-x-10">
<div class="w-full">
<%= f.text_field :print_name, label: { text: "Print Name" }, class: "w-full" %>
</div>
<div class="w-full">
<%= f.text_field :rx_group_number, label: { text: "Rx Group Number" }, class: "w-full" %>
</div>
</div>
<div class="flex space-x-10">
<div class="w-full">
<%= f.select :network_provider, options_for_select(["Cigna", "Medcost", "Other"]), { label: { text: "Provider Network" }, include_blank: "Select", class: "w-full" } %>
</div>
<div class="w-full">
<%= f.select :card_template, options_for_select([["FairosRx", "FairosRxIDCard"], ["Tandemloc", "TandemlocIDCard"], ["smART", "SmartIDCard"], ["QRCode (Healthbus)", "QRCodeIDCard"]]), { label: { text: "Card Template" }, include_blank: "Select", class: "w-full" } %>
</div>
</div>
<div class="flex items-end">
<div class="flex">
<div class="text-platinum">Employer Logo</div>
<div class="flex items-center justify-center self-end cursor-pointer bg-atmosphere hover:bg-deepcove border-2 border-atmosphere text-platinum font-bold px-3 rounded-r h-10 transition duration-100">
<label for="employer_logo_file" class="text-center cursor-pointer">
<%= icon "image-plus", library: "lucide" %>
</label>
</div>
</div>
<div class="hidden flex justify-center ml-15 rounded-lg border-4 border-atmosphere" data-logo-upload-target="previewContainer">
<img data-logo-upload-target="preview" src="#" alt="Employer Logo preview" class="max-h-[100px] max-w-[133px] bg-platinum m-1"/>
</div>
<%= f.hidden_field :id_card_employer_logo_id, data: { logo_upload_target: "logofield", logo_upload_target: "employer" } %>
<%= f.file_field :add_or_update_logo, class: "hidden", id: "employer_logo_file", data: { logo_upload_target: "previewContainer", parent_value: "network_logo", action: "change->logo-upload#uploadLogo" }, direct_upload: true %>
</div>
</div>
</div>
<div class="py-8">
<%= f.submit "Create New Employer" %>
</div>
</div>
<% end %>
</div>
+17 -17
View File
@@ -17,25 +17,25 @@ services:
- TAILWIND_POLLING=true
tty: true
stdin_open: true
# depends_on:
# db:
# condition: service_healthy
depends_on:
db:
condition: service_healthy
# redis:
# condition: service_started
# db:
# build:
# context: .
# dockerfile: Dockerfile.db
# volumes:
# - ./mssql-data:/var/opt/mssql
# ports:
# - "1434:1434"
# healthcheck:
# test: ["CMD", "/opt/mssql-tools/bin/sqlcmd", "-Usa", "-PBr1tt0nPassw0rd", "-Q", "select 1"]
# interval: 10s
# timeout: 3s
# retries: 10
# start_period: 10s
db:
build:
context: .
dockerfile: Dockerfile.db
volumes:
- ./mssql-data:/var/opt/mssql
ports:
- "1434:1434"
healthcheck:
test: ["CMD", "/opt/mssql-tools/bin/sqlcmd", "-Usa", "-PBr1tt0nPassw0rd", "-Q", "select 1"]
interval: 10s
timeout: 3s
retries: 10
start_period: 10s
# redis:
# image: redis
# volumes:
+10 -10
View File
@@ -22,16 +22,16 @@ default: &default
development:
baclight:
<<: *default
# host: db
# database: dev_tools_dev
# username: sa
# password: Br1tt0nPassw0rd
host: 10.41.82.73 #Dev
port: 1433
database: BrittonConnect
username: BSTI
password: BSTIBOY
tds_version: 7.3
host: db
database: baclight_dev
username: sa
password: Br1tt0nPassw0rd
# host: 10.41.82.73 #Dev
# port: 1433
# database: BrittonConnect
# username: BSTI
# password: BSTIBOY
# tds_version: 7.3
vhcs:
<<: *default
host: 10.41.82.72 #Prod
+16 -15
View File
@@ -1,19 +1,17 @@
# frozen_string_literal: true
Rails.application.routes.draw do
resources :card_rxes
resources :card_providers
resources :card_logo_files do
namespace :id_card do
resources :setup, constraints: { id: /.*/ }
resources :rx_sections
resources :provider_sections
resources :employer_logos do
get 'image', on: :member
end
resources :network_logos do
get 'image', on: :member, constraints: { id: /.*/ }
end
# resources :employer_setup
resources :employers do
collection do
post 'import'
end
end
resources :sample_id_cards do
resources :print_data do
collection do
get 'generate_sample'
get 'generate_print'
@@ -21,6 +19,13 @@ Rails.application.routes.draw do
get 'generate_full_page'
end
end
end
# resources :employer_setup
resources :employers do
collection do
post 'import'
end
end
get 'id_card_benefits_templates/get_template_benefits/:id', to: 'id_card_benefits_templates#get_template_benefits'
@@ -28,9 +33,5 @@ Rails.application.routes.draw do
# Can be used by load balancers and uptime monitors to verify that the app is live.
get "up" => "rails/health#show", as: :rails_health_check
resources :articles do
resources :comments
end
root "welcome#index"
end
@@ -1,57 +0,0 @@
# This migration comes from active_storage (originally 20170806125915)
class CreateActiveStorageTables < ActiveRecord::Migration[5.2]
def change
# Use Active Record's configured type for primary and foreign keys
primary_key_type, foreign_key_type = primary_and_foreign_key_types
create_table :active_storage_blobs, id: primary_key_type do |t|
t.string :key, null: false
t.string :filename, null: false
t.string :content_type
t.text :metadata
t.string :service_name, null: false
t.bigint :byte_size, null: false
t.string :checksum
if connection.supports_datetime_with_precision?
t.datetime :created_at, precision: 6, null: false
else
t.datetime :created_at, null: false
end
t.index [ :key ], unique: true
end
create_table :active_storage_attachments, id: primary_key_type do |t|
t.string :name, null: false
t.references :record, null: false, polymorphic: true, index: false, type: foreign_key_type
t.references :blob, null: false, type: foreign_key_type
if connection.supports_datetime_with_precision?
t.datetime :created_at, precision: 6, null: false
else
t.datetime :created_at, null: false
end
t.index [ :record_type, :record_id, :name, :blob_id ], name: :index_active_storage_attachments_uniqueness, unique: true
t.foreign_key :active_storage_blobs, column: :blob_id
end
create_table :active_storage_variant_records, id: primary_key_type do |t|
t.belongs_to :blob, null: false, index: false, type: foreign_key_type
t.string :variation_digest, null: false
t.index [ :blob_id, :variation_digest ], name: :index_active_storage_variant_records_uniqueness, unique: true
t.foreign_key :active_storage_blobs, column: :blob_id
end
end
private
def primary_and_foreign_key_types
config = Rails.configuration.generators
setting = config.options[config.orm][:primary_key_type]
primary_key_type = setting || :primary_key
foreign_key_type = setting || :bigint
[ primary_key_type, foreign_key_type ]
end
end
@@ -1,26 +0,0 @@
# This migration comes from action_text (originally 20180528164100)
class CreateActionTextTables < ActiveRecord::Migration[6.0]
def change
# Use Active Record's configured type for primary and foreign keys
primary_key_type, foreign_key_type = primary_and_foreign_key_types
create_table :action_text_rich_texts, id: primary_key_type do |t|
t.string :name, null: false
t.text :body, size: :long
t.references :record, null: false, polymorphic: true, index: false, type: foreign_key_type
t.timestamps
t.index [ :record_type, :record_id, :name ], name: "index_action_text_rich_texts_uniqueness", unique: true
end
end
private
def primary_and_foreign_key_types
config = Rails.configuration.generators
setting = config.options[config.orm][:primary_key_type]
primary_key_type = setting || :primary_key
foreign_key_type = setting || :bigint
[ primary_key_type, foreign_key_type ]
end
end
@@ -1,22 +0,0 @@
# This migration comes from active_storage (originally 20190112182829)
class AddServiceNameToActiveStorageBlobs < ActiveRecord::Migration[6.0]
def up
return unless table_exists?(:active_storage_blobs)
unless column_exists?(:active_storage_blobs, :service_name)
add_column :active_storage_blobs, :service_name, :string
if configured_service = ActiveStorage::Blob.service.name
ActiveStorage::Blob.unscoped.update_all(service_name: configured_service)
end
change_column :active_storage_blobs, :service_name, :string, null: false
end
end
def down
return unless table_exists?(:active_storage_blobs)
remove_column :active_storage_blobs, :service_name
end
end
@@ -1,27 +0,0 @@
# This migration comes from active_storage (originally 20191206030411)
class CreateActiveStorageVariantRecords < ActiveRecord::Migration[6.0]
def change
return unless table_exists?(:active_storage_blobs)
# Use Active Record's configured type for primary key
create_table :active_storage_variant_records, id: primary_key_type, if_not_exists: true do |t|
t.belongs_to :blob, null: false, index: false, type: blobs_primary_key_type
t.string :variation_digest, null: false
t.index %i[ blob_id variation_digest ], name: "index_active_storage_variant_records_uniqueness", unique: true
t.foreign_key :active_storage_blobs, column: :blob_id
end
end
private
def primary_key_type
config = Rails.configuration.generators
config.options[config.orm][:primary_key_type] || :primary_key
end
def blobs_primary_key_type
pkey_name = connection.primary_key(:active_storage_blobs)
pkey_column = connection.columns(:active_storage_blobs).find { |c| c.name == pkey_name }
pkey_column.bigint? ? :bigint : pkey_column.type
end
end
@@ -1,8 +0,0 @@
# This migration comes from active_storage (originally 20211119233751)
class RemoveNotNullOnActiveStorageBlobsChecksum < ActiveRecord::Migration[6.0]
def change
return unless table_exists?(:active_storage_blobs)
change_column_null(:active_storage_blobs, :checksum, true)
end
end
@@ -1,9 +0,0 @@
class CreateIdCardBenefitsTemplates < ActiveRecord::Migration[7.2]
def change
create_table :id_card_benefits_templates do |t|
t.string :title
t.timestamps
end
end
end
@@ -1,12 +0,0 @@
class CreateIdCardBenefits < ActiveRecord::Migration[7.2]
def change
create_table :id_card_benefits do |t|
t.string :benefit_desc
t.string :benefit
t.integer :sequence
t.references :id_card_benefits_template, null: false, foreign_key: true
t.timestamps
end
end
end
@@ -2,24 +2,14 @@ class CreateEmployers < ActiveRecord::Migration[7.2]
def change
create_table :employers do |t|
t.string :name
t.string :id_card_display_name
t.string :slug
t.string :pl_plan_key
t.integer :company_pb_entity_key
t.integer :plan_id
t.string :group_number
t.string :rx_group_number
t.string :effective_date
t.string :employer_logo_filename
t.string :network_provider
t.string :default_network_logo
t.string :single_card_template
t.string :multiple_card_template
t.boolean :active, default: false
t.timestamps
end
end
-11
View File
@@ -1,11 +0,0 @@
class CreatePlans < ActiveRecord::Migration[7.2]
def change
create_table :plans do |t|
t.string :title
t.integer :pb_product_key
t.references :employer, null: false, foreign_key: true
t.timestamps
end
end
end
@@ -1,12 +0,0 @@
class CreatePlanBenefits < ActiveRecord::Migration[7.2]
def change
create_table :plan_benefits do |t|
t.string :benefit_desc
t.string :benefit
t.integer :sequence
t.references :plan, null: false, foreign_key: true
t.timestamps
end
end
end
@@ -1,6 +1,7 @@
class CreateCardProviders < ActiveRecord::Migration[7.2]
class CreateIdCardProviderSections < ActiveRecord::Migration[7.2]
def change
create_table :card_providers do |t|
create_table :id_card_provider_sections do |t|
t.string :title
t.string :provider_code
t.string :provider_line_1
t.string :provider_line_2
@@ -1,6 +1,6 @@
class CreateCardRxes < ActiveRecord::Migration[7.2]
class CreateIdCardRxSections < ActiveRecord::Migration[7.2]
def change
create_table :card_rxes do |t|
create_table :id_card_rx_sections do |t|
t.string :help_desk
t.string :customer_service
t.string :web_url
@@ -1,10 +1,10 @@
class CreateCardLogoFiles < ActiveRecord::Migration[7.2]
class CreateIdCardNetworkLogos < ActiveRecord::Migration[7.2]
def change
create_table :card_logo_files do |t|
create_table :id_card_network_logos do |t|
t.string :filename
t.binary :image_data
t.string :content_type
t.string :logo_type
t.float :aspect_ratio
t.boolean :active, default: false
t.timestamps
@@ -0,0 +1,13 @@
class CreateIdCardEmployerLogos < ActiveRecord::Migration[7.2]
def change
create_table :id_card_employer_logos do |t|
t.string :filename
t.binary :image_data
t.string :content_type
t.float :aspect_ratio
t.boolean :active, default: false
t.timestamps
end
end
end
@@ -0,0 +1,18 @@
class CreateIdCardSetups < ActiveRecord::Migration[7.2]
def change
create_table :id_card_setups do |t|
t.string :print_name
t.string :network_provider
t.string :card_template
t.string :rx_group_number
t.boolean :active, default: false
t.belongs_to :employer, null: false, foreign_key: true
t.belongs_to :id_card_employer_logo, null: true, foreign_key: true
t.belongs_to :id_card_network_logo, null: true, foreign_key: true
t.belongs_to :id_card_provider_section, null: false, foreign_key: true
t.belongs_to :id_card_rx_section, null: false, foreign_key: true
t.timestamps
end
end
end
@@ -0,0 +1,12 @@
class CreateIdCardPlans < ActiveRecord::Migration[7.2]
def change
create_table :id_card_plans do |t|
t.string :title
t.integer :pb_product_key
t.string :pl_plan_key
t.belongs_to :id_card_setup, null: true, foreign_key: true
t.timestamps
end
end
end
@@ -0,0 +1,12 @@
class CreateIdCardPlanBenefits < ActiveRecord::Migration[7.2]
def change
create_table :id_card_plan_benefits do |t|
t.string :benefit_desc
t.string :benefit
t.integer :sequence
t.belongs_to :id_card_plan, null: false, foreign_key: true
t.timestamps
end
end
end
@@ -1,12 +0,0 @@
class CreateNetworkLogos < ActiveRecord::Migration[7.0]
def change
create_table :alternate_network_logos do |t|
t.string :network_logo_filename
t.string :exception_type
t.string :exception_value
t.belongs_to :employer, null: false, foreign_key: true
t.timestamps
end
end
end
@@ -1,10 +1,12 @@
class CreateSampleIdCards < ActiveRecord::Migration[7.0]
class CreateIdCardPrintData < ActiveRecord::Migration[7.0]
def change
create_table :sample_id_cards do |t|
create_table :id_card_print_data do |t|
t.string :full_name
t.string :full_name_last_name_first
t.string :family_id
t.string :primary_mb_member_key
t.string :employer_name
t.string :pl_plan_key
t.string :group_number
t.string :rx_group
t.string :medical_eff_date
@@ -1,11 +0,0 @@
class CreateEmployerCardLogos < ActiveRecord::Migration[7.2]
def change
create_table :employer_card_logos do |t|
t.references :employer, null: false, foreign_key: true
t.references :card_logo_file, null: false, foreign_key: true
t.string :logo_type
t.timestamps
end
end
end
@@ -1,6 +0,0 @@
class AddCardRxToEmployers < ActiveRecord::Migration[7.2]
def change
add_reference :employers, :card_provider, null: true, foreign_key: true
add_reference :employers, :card_rx, null: true, foreign_key: true
end
end
+1 -1
View File
@@ -8,7 +8,7 @@ class CreateMembers < ActiveRecord::Migration[7.2]
t.integer :pb_entity_key
t.integer :pl_plan_key
t.belongs_to :employer, foreign_key: true
t.belongs_to :plan, null: true, foreign_key: true
t.belongs_to :id_card_plan, null: true, foreign_key: true
t.timestamps
end
@@ -1,11 +0,0 @@
class CreateCardExceptions < ActiveRecord::Migration[7.2]
def change
create_table :card_exceptions do |t|
t.string :type
t.string :value
t.belongs_to :employer, null: false, foreign_key: true
t.timestamps
end
end
end
@@ -0,0 +1,11 @@
class CreateIdCardExceptions < ActiveRecord::Migration[7.2]
def change
create_table :id_card_exceptions do |t|
t.string :type
t.string :value
t.belongs_to :id_card_setup, null: false, foreign_key: true
t.timestamps
end
end
end
@@ -1,13 +0,0 @@
class CreateCardExceptionItems < ActiveRecord::Migration[7.2]
def change
create_table :card_exception_items do |t|
t.string :field_name
t.string :field_value
t.belongs_to :card_exception, null: false, foreign_key: true
t.belongs_to :card_logo_file, null: true, foreign_key: true
t.belongs_to :card_provider, null: true, foreign_key: true
t.timestamps
end
end
end
@@ -0,0 +1,13 @@
class CreateIdCardExceptionItems < ActiveRecord::Migration[7.2]
def change
create_table :id_card_exception_items do |t|
t.string :field_name
t.string :field_value
t.belongs_to :id_card_exception, null: false, foreign_key: true
t.belongs_to :id_card_network_logo, null: true, foreign_key: true
t.belongs_to :id_card_provider_section, null: true, foreign_key: true
t.timestamps
end
end
end
@@ -1,5 +0,0 @@
class AddAspectRatioToCardLogoFiles < ActiveRecord::Migration[7.2]
def change
add_column :card_logo_files, :aspect_ratio, :float
end
end
@@ -1,5 +0,0 @@
class AddLastNameToSampleIdCard < ActiveRecord::Migration[7.2]
def change
add_column :sample_id_cards, :name, :string
end
end
@@ -1,5 +0,0 @@
class RenameCardFieldExceptionsToCardExceptionItems < ActiveRecord::Migration[7.2]
def change
rename_table :card_field_exceptions, :card_exception_items
end
end
@@ -1,5 +0,0 @@
class AddTitleToCardProviders < ActiveRecord::Migration[7.2]
def change
add_column :card_providers, :title, :string
end
end
+156 -210
View File
@@ -10,230 +10,89 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema[7.2].define(version: 2026_02_27_213305) do
create_table "action_text_rich_texts", force: :cascade do |t|
t.string "name", null: false
t.text "body"
t.string "record_type", null: false
t.bigint "record_id", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["record_type", "record_id", "name"], name: "index_action_text_rich_texts_uniqueness", unique: true
end
create_table "active_storage_attachments", force: :cascade do |t|
t.string "name", null: false
t.string "record_type", null: false
t.bigint "record_id", null: false
t.bigint "blob_id", null: false
t.datetime "created_at", null: false
t.index ["blob_id"], name: "index_active_storage_attachments_on_blob_id"
t.index ["record_type", "record_id", "name", "blob_id"], name: "index_active_storage_attachments_uniqueness", unique: true
end
create_table "active_storage_blobs", force: :cascade do |t|
t.string "key", null: false
t.string "filename", null: false
t.string "content_type"
t.text "metadata"
t.string "service_name", null: false
t.bigint "byte_size", null: false
t.string "checksum"
t.datetime "created_at", null: false
t.index ["key"], name: "index_active_storage_blobs_on_key", unique: true
end
create_table "active_storage_variant_records", force: :cascade do |t|
t.bigint "blob_id", null: false
t.string "variation_digest", null: false
t.index ["blob_id", "variation_digest"], name: "index_active_storage_variant_records_uniqueness", unique: true
end
create_table "alternate_network_logos", force: :cascade do |t|
t.string "network_logo_filename"
t.string "exception_type"
t.string "exception_value"
t.bigint "employer_id", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["employer_id"], name: "index_alternate_network_logos_on_employer_id"
end
create_table "card_exception_items", force: :cascade do |t|
t.string "field_name"
t.string "field_value"
t.bigint "card_logo_file_id"
t.bigint "card_provider_id"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["card_logo_file_id"], name: "index_card_exception_items_on_card_logo_file_id"
t.index ["card_provider_id"], name: "index_card_exception_items_on_card_provider_id"
end
create_table "card_exceptions", force: :cascade do |t|
t.string "type"
t.string "value"
t.bigint "employer_id", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["employer_id"], name: "index_card_exceptions_on_employer_id"
end
create_table "card_logo_files", force: :cascade do |t|
t.string "filename"
t.binary "image_data"
t.string "content_type"
t.string "logo_type"
t.boolean "active", default: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.float "aspect_ratio"
end
create_table "card_providers", force: :cascade do |t|
t.string "provider_code"
t.string "provider_line_1"
t.string "provider_line_2"
t.string "provider_line_3"
t.string "provider_line_4"
t.string "provider_line_5"
t.string "provider_line_6"
t.string "provider_line_7"
t.string "provider_line_8"
t.string "provider_line_9"
t.string "provider_line_10"
t.string "provider_line_11"
t.string "provider_line_12"
t.string "claim_to_1"
t.string "claim_to_2"
t.string "claim_to_3"
t.string "claim_to_4"
t.string "claim_to_5"
t.string "claim_to_6"
t.string "claim_to_7"
t.string "claim_to_8"
t.string "claim_to_9"
t.string "claim_to_10"
t.string "claim_to_11"
t.string "claim_to_12"
t.string "mail_to"
t.string "mail_to_2"
t.string "contact_line_1"
t.string "contact_line_2"
t.string "contact_line_3"
t.string "group_number"
t.string "rx_group_id"
t.string "rx_contact"
t.string "provider_lookup_1"
t.string "provider_lookup_2"
t.string "precert_1"
t.string "precert_2"
t.string "precert_3"
t.string "precert_4"
t.string "precert_5"
t.string "precert_6"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.string "title"
end
create_table "card_rxes", force: :cascade do |t|
t.string "help_desk"
t.string "customer_service"
t.string "web_url"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end
create_table "employer_card_logos", force: :cascade do |t|
t.bigint "employer_id", null: false
t.bigint "card_logo_file_id", null: false
t.string "logo_type"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["card_logo_file_id"], name: "index_employer_card_logos_on_card_logo_file_id"
t.index ["employer_id"], name: "index_employer_card_logos_on_employer_id"
end
ActiveRecord::Schema[7.2].define(version: 2026_01_16_182836) do
create_table "employers", force: :cascade do |t|
t.string "name"
t.string "id_card_display_name"
t.string "slug"
t.string "pl_plan_key"
t.integer "company_pb_entity_key"
t.integer "plan_id"
t.string "group_number"
t.string "rx_group_number"
t.string "effective_date"
t.string "employer_logo_filename"
t.string "network_provider"
t.string "default_network_logo"
t.string "single_card_template"
t.string "multiple_card_template"
t.boolean "active", default: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.bigint "card_provider_id"
t.bigint "card_rx_id"
t.index ["card_provider_id"], name: "index_employers_on_card_provider_id"
t.index ["card_rx_id"], name: "index_employers_on_card_rx_id"
end
create_table "id_card_benefits", force: :cascade do |t|
create_table "id_card_employer_logos", force: :cascade do |t|
t.string "filename"
t.binary "image_data"
t.string "content_type"
t.float "aspect_ratio"
t.boolean "active", default: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end
create_table "id_card_exception_items", force: :cascade do |t|
t.string "field_name"
t.string "field_value"
t.bigint "id_card_exception_id", null: false
t.bigint "id_card_network_logo_id"
t.bigint "id_card_provider_section_id"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["id_card_exception_id"], name: "index_id_card_exception_items_on_id_card_exception_id"
t.index ["id_card_network_logo_id"], name: "index_id_card_exception_items_on_id_card_network_logo_id"
t.index ["id_card_provider_section_id"], name: "index_id_card_exception_items_on_id_card_provider_section_id"
end
create_table "id_card_exceptions", force: :cascade do |t|
t.string "type"
t.string "value"
t.bigint "id_card_setup_id", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["id_card_setup_id"], name: "index_id_card_exceptions_on_id_card_setup_id"
end
create_table "id_card_network_logos", force: :cascade do |t|
t.string "filename"
t.binary "image_data"
t.string "content_type"
t.float "aspect_ratio"
t.boolean "active", default: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end
create_table "id_card_plan_benefits", force: :cascade do |t|
t.string "benefit_desc"
t.string "benefit"
t.integer "sequence"
t.bigint "id_card_benefits_template_id", null: false
t.bigint "id_card_plan_id", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["id_card_benefits_template_id"], name: "index_id_card_benefits_on_id_card_benefits_template_id"
t.index ["id_card_plan_id"], name: "index_id_card_plan_benefits_on_id_card_plan_id"
end
create_table "id_card_benefits_templates", force: :cascade do |t|
t.string "title"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end
create_table "members", force: :cascade do |t|
t.string "name"
t.string "id_card_display_name"
t.string "family_id"
t.integer "mb_member_key"
t.integer "pb_entity_key"
t.integer "pl_plan_key"
t.bigint "employer_id"
t.bigint "plan_id"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["employer_id"], name: "index_members_on_employer_id"
t.index ["plan_id"], name: "index_members_on_plan_id"
end
create_table "plan_benefits", force: :cascade do |t|
t.string "benefit_desc"
t.string "benefit"
t.integer "sequence"
t.bigint "plan_id", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["plan_id"], name: "index_plan_benefits_on_plan_id"
end
create_table "plans", force: :cascade do |t|
create_table "id_card_plans", force: :cascade do |t|
t.string "title"
t.integer "pb_product_key"
t.bigint "employer_id", null: false
t.string "pl_plan_key"
t.bigint "id_card_setup_id"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["employer_id"], name: "index_plans_on_employer_id"
t.index ["id_card_setup_id"], name: "index_id_card_plans_on_id_card_setup_id"
end
create_table "sample_id_cards", force: :cascade do |t|
create_table "id_card_print_data", force: :cascade do |t|
t.string "full_name"
t.string "full_name_last_name_first"
t.string "family_id"
t.string "primary_mb_member_key"
t.string "employer_name"
t.string "pl_plan_key"
t.string "group_number"
t.string "rx_group"
t.string "medical_eff_date"
@@ -303,22 +162,109 @@ ActiveRecord::Schema[7.2].define(version: 2026_02_27_213305) do
t.string "benefit_14"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.string "name"
end
add_foreign_key "active_storage_attachments", "active_storage_blobs", column: "blob_id"
add_foreign_key "active_storage_variant_records", "active_storage_blobs", column: "blob_id"
add_foreign_key "alternate_network_logos", "employers"
add_foreign_key "card_exception_items", "card_logo_files"
add_foreign_key "card_exception_items", "card_providers"
add_foreign_key "card_exceptions", "employers"
add_foreign_key "employer_card_logos", "card_logo_files"
add_foreign_key "employer_card_logos", "employers"
add_foreign_key "employers", "card_providers"
add_foreign_key "employers", "card_rxes"
add_foreign_key "id_card_benefits", "id_card_benefits_templates"
add_foreign_key "members", "employers"
add_foreign_key "members", "plans"
add_foreign_key "plan_benefits", "plans"
add_foreign_key "plans", "employers"
create_table "id_card_provider_sections", force: :cascade do |t|
t.string "title"
t.string "provider_code"
t.string "provider_line_1"
t.string "provider_line_2"
t.string "provider_line_3"
t.string "provider_line_4"
t.string "provider_line_5"
t.string "provider_line_6"
t.string "provider_line_7"
t.string "provider_line_8"
t.string "provider_line_9"
t.string "provider_line_10"
t.string "provider_line_11"
t.string "provider_line_12"
t.string "claim_to_1"
t.string "claim_to_2"
t.string "claim_to_3"
t.string "claim_to_4"
t.string "claim_to_5"
t.string "claim_to_6"
t.string "claim_to_7"
t.string "claim_to_8"
t.string "claim_to_9"
t.string "claim_to_10"
t.string "claim_to_11"
t.string "claim_to_12"
t.string "mail_to"
t.string "mail_to_2"
t.string "contact_line_1"
t.string "contact_line_2"
t.string "contact_line_3"
t.string "group_number"
t.string "rx_group_id"
t.string "rx_contact"
t.string "provider_lookup_1"
t.string "provider_lookup_2"
t.string "precert_1"
t.string "precert_2"
t.string "precert_3"
t.string "precert_4"
t.string "precert_5"
t.string "precert_6"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end
create_table "id_card_rx_sections", force: :cascade do |t|
t.string "help_desk"
t.string "customer_service"
t.string "web_url"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end
create_table "id_card_setups", force: :cascade do |t|
t.string "print_name"
t.string "network_provider"
t.string "card_template"
t.string "rx_group_number"
t.boolean "active", default: false
t.bigint "employer_id", null: false
t.bigint "id_card_employer_logo_id"
t.bigint "id_card_network_logo_id"
t.bigint "id_card_provider_section_id", null: false
t.bigint "id_card_rx_section_id", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["employer_id"], name: "index_id_card_setups_on_employer_id"
t.index ["id_card_employer_logo_id"], name: "index_id_card_setups_on_id_card_employer_logo_id"
t.index ["id_card_network_logo_id"], name: "index_id_card_setups_on_id_card_network_logo_id"
t.index ["id_card_provider_section_id"], name: "index_id_card_setups_on_id_card_provider_section_id"
t.index ["id_card_rx_section_id"], name: "index_id_card_setups_on_id_card_rx_section_id"
end
create_table "members", force: :cascade do |t|
t.string "name"
t.string "id_card_display_name"
t.string "family_id"
t.integer "mb_member_key"
t.integer "pb_entity_key"
t.integer "pl_plan_key"
t.bigint "employer_id"
t.bigint "id_card_plan_id"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["employer_id"], name: "index_members_on_employer_id"
t.index ["id_card_plan_id"], name: "index_members_on_id_card_plan_id"
end
add_foreign_key "id_card_exception_items", "id_card_exceptions"
add_foreign_key "id_card_exception_items", "id_card_network_logos"
add_foreign_key "id_card_exception_items", "id_card_provider_sections"
add_foreign_key "id_card_exceptions", "id_card_setups"
add_foreign_key "id_card_plan_benefits", "id_card_plans"
add_foreign_key "id_card_plans", "id_card_setups"
add_foreign_key "id_card_setups", "employers"
add_foreign_key "id_card_setups", "id_card_employer_logos"
add_foreign_key "id_card_setups", "id_card_network_logos"
add_foreign_key "id_card_setups", "id_card_provider_sections"
add_foreign_key "id_card_setups", "id_card_rx_sections"
add_foreign_key "members", "employers"
add_foreign_key "members", "id_card_plans"
end
+3 -3
View File
@@ -1,5 +1,5 @@
IF NOT EXISTS (SELECT name FROM master.dbo.sysdatabases WHERE name = N'britton_dev_tools_dev')
IF NOT EXISTS (SELECT name FROM master.dbo.sysdatabases WHERE name = N'britton_baclight_dev')
BEGIN
CREATE DATABASE [britton_dev_tools_dev];
CREATE DATABASE [britton_dev_tools_test];
CREATE DATABASE [britton_baclight_dev];
CREATE DATABASE [britton_baclight_test];
END;