<%= f.label :firstname, class: "form-label fw-semibold text-secondary" %>
<%= f.text_field :firstname, class: "form-control form-control-sm shadow-sm", required: true, placeholder: "Enter First Name" %>
<%= f.label :middlename, class: "form-label fw-semibold text-secondary" %>
<%= f.text_field :middlename, class: "form-control form-control-sm shadow-sm", placeholder: "Middle Name (Optional)" %>
<%= f.label :lastname, class: "form-label fw-semibold text-secondary" %>
<%= f.text_field :lastname, class: "form-control form-control-sm shadow-sm", required: true, placeholder: "Enter Last Name" %>
<%= f.label :relationship, "Relation to Customer", class: "form-label fw-semibold text-secondary" %>
<%= f.text_field :relationship, class: "form-control form-control-sm shadow-sm", required: true, placeholder: "E.g., Director, Guardian..." %>
<%= f.label :gender, "Gender", class: "form-label fw-semibold text-secondary" %>
<%= f.select :gender, options_for_select([["Male", "male"], ["Female", "female"]], f.object.gender), { prompt: "Select Gender" }, class: "form-select form-select-sm shadow-sm" %>
<%= f.label :dob, "Date of Birth", class: "form-label fw-semibold text-secondary" %>
<%= f.date_field :dob,
class: "form-control form-control-sm rounded-pill" %>
<%= f.label :email, class: "form-label fw-semibold text-secondary" %>
<%= f.email_field :email, class: "form-control form-control-sm shadow-sm", placeholder: "Enter Email" %>
<%= f.label :phone, class: "form-label fw-semibold text-secondary" %>
<%= f.text_field :phone, class: "form-control form-control-sm shadow-sm", placeholder: "Enter Phone" %>
<%= f.label :address_1,"Physical Address", class: "form-label fw-semibold text-secondary" %>
<%= f.text_field :address_1, class: "form-control form-control-sm shadow-sm", placeholder: "Enter Physical Address" %>
Representative Identification
<%= f.label :id_type, "Select ID Type", class: "form-label fw-semibold" %>
<%= f.radio_button :id_type, 'nationalid', checked: true, class: "form-check-input", data: { action: "change->representative#idTypeChanged" } %>
<%= f.label :id_type, "National ID", class: "form-check-label" %>
<%= f.radio_button :id_type, 'passport', class: "form-check-input", data: { action: "change->representative#idTypeChanged" } %>
<%= f.label :id_type, "Passport", class: "form-check-label" %>
<%= f.label :id_number, "National ID",
data: { representative_target: "idNumberLabel" },
class: "form-label fw-semibold" %>
<%= f.text_field :id_number,
class: "form-control form-control-sm shadow-sm",
data: { representative_target: "idNumber" },
placeholder: "Enter ID Number" %>
Format: 63-4566467N88
<%= f.label :issuing_country, "Issuing Country", class: "form-label fw-semibold" %>
<%= f.select :issuing_country,
ISO3166::Country.all.map { |c| [c.translations[I18n.locale.to_s] || c.name, c.alpha2] },
{ include_blank: "Select Country" },
class: "form-select form-select-sm shadow-sm",
data: { representative_target: "issuingCountry" } %>
<% if f.object.documents.any? { |d| d.file.attached? } %>
<%= f.fields_for :documents do |d| %>
<%= render "agent_portal/customers/document_fields",
f: d,
required_docs: @mandatory_representative_docs,
controller_name: "rep-documents" %>
<% end %>
<%= f.fields_for :documents, f.object.documents.build, child_index: "NEW_RECORD" do |d| %>
<%= render "agent_portal/customers/document_fields",
f: d,
required_docs: @mandatory_representative_docs,
controller_name: "rep-documents" %>
<% end %>
<%= link_to "➕ Add Document", "#",
class: "btn btn-outline-primary btn-sm fw-semibold shadow-sm",
data: { action: "click->rep-documents#add" } %>
<%= f.hidden_field :_destroy %>