Customer Preview

<%= link_to "Back", step2_agent_portal_customer_onboarding_path, class: "btn btn-outline-secondary btn-lg", data: { turbo: false } %> <%= form_with url: complete_agent_portal_customer_onboarding_path, method: :post, local: true do |f| %> <%= f.submit "Complete Registration", data: { turbo: false }, class: "btn btn-success btn-lg fw-bold" %> <% end %>
Customer Info

Name: <%= @customer.customer_name %>

DOB: <%= @customer.dob %>

Type: <%= @customer.customer_type&.name %>

Contact: <%= @customer.mobile_1 %> | <%= @customer.mobile_2 %>

Address: <%= [@customer.address_1, @customer.address_2, @customer.city, @customer.country].compact.join(", ") %>

Email: <%= @customer.email %>

Next of Kin
<% if @customer.next_of_kins.any? %>
<% @customer.next_of_kins.each do |n| %>
<%= n.firstname %> <%= n.lastname %>

Relation: <%= n.relation %>

Phone: <%= n.mobile_1 || n.phone %>

<% end %>
<% else %>

No next of kin added.

<% end %>
<% if show_representative_step? %> <% @customer.representatives.each do |rep| %>
<%= rep.firstname %> <%= rep.lastname %> - <%= rep.relationship %>

ID Type: <%= rep.id_type %>

ID Number: <%= rep.id_number %>

Gender: <%= rep.gender %>

Issuing Country: <%= rep.issuing_country %>

<% if rep.documents.any? %> <% rep.documents.each do |document| %> <% file = document.file %> <% next unless file.attached? %> <% icon_class = if file.image? "fa-file-image text-primary" elsif file.content_type.include?("pdf") "fa-file-pdf text-danger" elsif file.content_type.include?("word") "fa-file-word text-info" else "fa-file text-muted" end %> <% end %>
Type Title Preview Uploaded At Download
<%= document.title.presence || file.filename.to_s %> <% if file.image? || file.content_type.include?("pdf") %> <% else %> N/A <% end %> <%= document.created_at.strftime("%d %b %Y %H:%M") %> <%= link_to "⬇ Download", rails_blob_url(file, disposition: "attachment"), class: "btn btn-primary btn-sm", target: "_blank" %>
<% else %>

No documents available.

<% end %>
<% end %> <% end %>
Customer Documents
<% if @customer.documents.any? %> <% @customer.documents.each do |document| %> <% file = document.file %> <% next unless file.attached? %> <% icon_class = if file.image? "fa-file-image text-primary" elsif file.content_type.include?("pdf") "fa-file-pdf text-danger" elsif file.content_type.include?("word") "fa-file-word text-info" else "fa-file text-muted" end %> <% end %>
Type Title Preview Uploaded At Download
<%= document.title.presence || file.filename.to_s %> <% if file.image? || file.content_type.include?("pdf") %> <% else %> N/A <% end %> <%= document.created_at.strftime("%d %b %Y %H:%M") %> <%= link_to "⬇ Download", rails_blob_url(file, disposition: "attachment"), class: "btn btn-primary btn-sm", target: "_blank" %>
<% else %>

No documents available.

<% end %>