{% extends "ui/templates/base/layout.html" %}{% block content %}<div class="space-y-6"><div><h1 class="text-2xl font-semibold">Registration Lifecycle Masters</h1><a class="text-sm text-brand-600" href="/registrations">← Dashboard</a></div>{% if can_manage %}<div class="grid gap-4 lg:grid-cols-3"><form method="post" action="/registrations/masters/types" class="space-y-3 rounded-xl border bg-white p-4"><h2 class="font-semibold">Registration Type</h2><input type="hidden" name="csrf_token" value="{{csrf_token}}"><input class="w-full rounded border p-2" name="code" placeholder="Code" required><input class="w-full rounded border p-2" name="name" placeholder="Name" required><input class="w-full rounded border p-2" name="issuing_authority" placeholder="Issuing authority"><label class="block"><input type="checkbox" name="supports_expiry"> Expiry based</label><label class="block"><input type="checkbox" name="supports_related_person"> Person based</label><button class="rounded bg-brand-600 px-3 py-2 text-white">Save Type</button></form><form method="post" action="/registrations/masters/rules" class="space-y-3 rounded-xl border bg-white p-4"><h2 class="font-semibold">Lifecycle Rule</h2><input type="hidden" name="csrf_token" value="{{csrf_token}}"><select class="w-full rounded border p-2" name="registration_type_id">{% for x in types %}<option value="{{x.id}}">{{x.name}}</option>{% endfor %}</select><input class="w-full rounded border p-2" name="entity_type" placeholder="Entity type (blank = all)"><select class="w-full rounded border p-2" name="cycle_type"><option value="expiry_renewal">Expiry renewal</option><option value="annual_update">Annual update</option><option value="annual_confirmation">Annual confirmation</option><option value="periodic_revalidation">Periodic revalidation</option><option value="event_based_update">Event based update</option><option value="no_expiry">No expiry</option></select><input class="w-full rounded border p-2" name="frequency_months" type="number" placeholder="Frequency months"><input class="w-full rounded border p-2" name="renewal_window_days" type="number" value="60"><input class="w-full rounded border p-2" name="reminder_days_csv" value="90,60,30,15,7,0"><label><input type="checkbox" name="auto_create_task" checked> Auto-create renewal work</label><label class="block"><input type="checkbox" name="requires_client_approval"> Client approval</label><label class="block"><input type="checkbox" name="requires_partner_review"> Partner review</label><button class="rounded bg-brand-600 px-3 py-2 text-white">Save Rule</button></form><form method="post" action="/registrations/masters/documents" class="space-y-3 rounded-xl border bg-white p-4"><h2 class="font-semibold">Document Requirement</h2><input type="hidden" name="csrf_token" value="{{csrf_token}}"><select class="w-full rounded border p-2" name="registration_type_id">{% for x in types %}<option value="{{x.id}}">{{x.name}}</option>{% endfor %}</select><select class="w-full rounded border p-2" name="action_type"><option value="registration">Registration</option><option value="renewal" selected>Renewal</option><option value="update">Update</option></select><input class="w-full rounded border p-2" name="document_name" placeholder="Document name" required><textarea class="w-full rounded border p-2" name="description" placeholder="Description"></textarea><label><input type="checkbox" name="mandatory" checked> Mandatory</label><button class="rounded bg-brand-600 px-3 py-2 text-white">Save Requirement</button></form></div>{% endif %}<div class="grid gap-4 lg:grid-cols-2"><div class="rounded-xl border bg-white p-4"><h2 class="font-semibold">Types</h2>{% for x in types %}<div class="border-b py-2"><b>{{x.code}}</b> — {{x.name}}</div>{% endfor %}</div><div class="rounded-xl border bg-white p-4"><h2 class="font-semibold">Rules & document templates</h2>{% for r,t in rules %}<div class="border-b py-2">{{t.name}} — {{r.cycle_type|replace('_',' ')}} — {{r.renewal_window_days}} days</div>{% endfor %}{% for d,t in templates_rows %}<div class="border-b py-2">{{t.name}} / {{d.action_type}} — {{d.document_name}}</div>{% endfor %}</div></div></div>{% endblock %}
