Models

<%= if @models == [] do %>

No models yet. Click New to create one.

<% end %> <%= for model <- @models do %> <% end %>
<%= if @show_form do %> <.form for={%{}} phx-submit="save_model" phx-value-id={@editing_id} class="p-6 max-w-3xl">

<%= if @editing_id, do: "Edit Model", else: "New Model" %>

<%= if @editing_id do %> <% end %>
<%= if @form_error do %>
<%= @form_error %>
<% end %>

Reference Date

<%= for {label, val} <- @date_loc_opts do %> <% end %>

Cache Settings

<%= for {label, field} <- [{"Enable Cache", "enable_cache"}, {"Enable TTL Counter", "enable_ttl_counter"}, {"Enable Sanction Cache", "enable_sanction_cache"}] do %> <% end %>

Response Elevation

Activation Watcher

<%= if @editing_id do %>

Configuration Sub-pages

<%= for {label, icon, route} <- [ {"Request XPaths", "hero-code-bracket", ~p"/admin/fraud/model-config/#{@editing_id}/xpaths"}, {"TTL Counters", "hero-clock", ~p"/admin/fraud/model-config/#{@editing_id}/ttl-counters"}, {"Gateway Rules", "hero-shield-check", ~p"/admin/fraud/model-config/#{@editing_id}/gateway-rules"}, {"Abstraction Rules","hero-variable", ~p"/admin/fraud/model-config/#{@editing_id}/abstractions"}, {"Calculations", "hero-calculator", ~p"/admin/fraud/model-config/#{@editing_id}/calculations"}, {"HTTP Adaptation", "hero-cloud-arrow-up", ~p"/admin/fraud/model-config/#{@editing_id}/adaptations"}, {"Inline Functions", "hero-code-bracket", ~p"/admin/fraud/model-config/#{@editing_id}/functions"}, {"Inline Scripts", "hero-command-line", ~p"/admin/fraud/model-config/#{@editing_id}/scripts"}, {"Synchronisation", "hero-arrow-path", ~p"/admin/fraud/model-config/sync"} ] do %> <.link navigate={route} class="flex items-center gap-3 p-3 rounded-lg border border-gray-200 bg-white hover:border-indigo-300 hover:bg-indigo-50 transition-colors"> <.icon name={icon} class="w-5 h-5 text-indigo-500" /> <%= label %> <.icon name="hero-chevron-right-mini" class="w-4 h-4 text-gray-400 ml-auto" /> <% end %>
<%= if @selected_model && @selected_model.guid do %>

<.icon name="hero-cloud-arrow-up" class="w-4 h-4" /> API Integration

<%= @selected_model.guid %>
POST /admin/api/models/<%= @selected_model.guid %>/verify
Show example curl
curl -b cookiejar -X POST \
  -H "Content-Type: application/json" \
  -d @payload.json \
  http://demo.ctrmv.com:4010/admin/api/models/<%= @selected_model.guid %>/verify

Internal DB id: <%= @selected_model.id %>

<% end %> <% end %>
<% else %>
<.icon name="hero-cube-transparent" class="w-16 h-16 text-gray-200 mb-4" />

Select a model from the list

or click New to create one

<% end %>