{"title":"Vendor Management","header":[{"type":"button","label":"Add Vendor","formName":"Vendor"},{"type":"filter-select","id":"vendorFilter","options":{"source_table":"vendors","source_column":"vendor_id","display_column":"vendorname","data_column":"vendor_id","placeholder":"Search vendors...","default_label":"All Vendors"}},{"type":"filter-select","id":"vendorStatusFilter","options":{"data_column":"lifecycle_status","default_label":"All Statuses","options":[{"label":"Pending","value":"pending"},{"label":"Onboarding","value":"onboarding"},{"label":"Active","value":"active"},{"label":"Suspended","value":"suspended"},{"label":"Offboarded","value":"offboarded"}]}}],"body":[{"type":"html","html":"<div class=\"alert alert-info mb-4\"><span class=\"font-semibold\">Tip:</span> Pick a vendor from the dropdown to focus every tab. Use the lifecycle filter to narrow the vendor list before diving into contacts, documents, or performance.</div>"},{"type":"tabs","tabs":[{"label":"Vendors","elements":[{"type":"html","html":"<p class=\"text-sm text-gray-600 mb-3\">Use the filters above to focus on a lifecycle stage or specific vendor. Row actions open the profile or start editing without leaving this modal.</p>"},{"type":"table","options":{"tableName":"vendors","showGlobalSearch":true,"addButton":false,"editFormId":110,"filterField":["vendor_id","lifecycle_status"],"rowActions":[{"label":"Edit","formName":"Vendor"},{"label":"Open Detail","onClick":"openVendorDetail"}],"columnsToShow":["vendorname","businessRegNumber","lifecycle_status","avg_rating","last_reviewed_at"]}}]},{"label":"Contacts","elements":[{"type":"html","html":"<p class=\"text-sm text-gray-600 mb-3\">Select a vendor to see their contact roster. Mark one primary so reminders and workflows know who to reach out to.</p>"},{"type":"button","label":"Add Contact","formName":"Vendor Contact","prefillFilter":"vendor_id","class":"btn btn-primary btn-sm mb-3"},{"type":"table","options":{"tableName":"vendor_contacts","showGlobalSearch":false,"addButton":false,"editFormId":610,"filterField":"vendor_id","filterValue":{"vendor_id":"__none__"},"columnsToShow":["contact_name","contact_role","email","phone_number","is_primary"]}}]},{"label":"Addresses","elements":[{"type":"html","html":"<p class=\"text-sm text-gray-600 mb-3\">Track billing, shipping, and registered addresses so logistics and compliance teams stay aligned.</p>"},{"type":"button","label":"Add Address","formName":"Vendor Address","prefillFilter":"vendor_id","class":"btn btn-primary btn-sm mb-3"},{"type":"table","options":{"tableName":"vendor_addresses","showGlobalSearch":false,"addButton":false,"editFormId":611,"filterField":"vendor_id","filterValue":{"vendor_id":"__none__"},"columnsToShow":["address_type","line1","city","state_region","country_code","is_primary"]}}]},{"label":"Capabilities","elements":[{"type":"html","html":"<p class=\"text-sm text-gray-600 mb-3\">Log competencies, certifications, and experience to drive better RFQ shortlists.</p>"},{"type":"button","label":"Add Capability","formName":"Vendor Capability","prefillFilter":"vendor_id","class":"btn btn-primary btn-sm mb-3"},{"type":"table","options":{"tableName":"vendor_capabilities","showGlobalSearch":false,"addButton":false,"editFormId":612,"filterField":"vendor_id","filterValue":{"vendor_id":"__none__"},"columnsToShow":["capability_category","experience_years","competency_score","capacity_notes"]}}]},{"label":"Documents","elements":[{"type":"html","html":"<p class=\"text-sm text-gray-600 mb-3\">Keep compliance documents current. Expiring records appear here first so you can chase renewals.</p>"},{"type":"button","label":"Add Document","formName":"Vendor Document","prefillFilter":"vendor_id","class":"btn btn-primary btn-sm mb-3"},{"type":"table","options":{"tableName":"vendor_documents","showGlobalSearch":false,"addButton":false,"editFormId":613,"filterField":"vendor_id","filterValue":{"vendor_id":"__none__"},"columnsToShow":["doc_type","filetype","validity"]}}]},{"label":"Certificates","elements":[{"type":"html","html":"<p class=\"text-sm text-gray-600 mb-3\">Track certification renewals and attach evidence for compliance reviews.</p>"},{"type":"button","label":"Add Certificate","formName":"Vendor Certificate","prefillFilter":"vendor_id","class":"btn btn-primary btn-sm mb-3"},{"type":"table","options":{"tableName":"vendor_certificates","showGlobalSearch":false,"addButton":false,"editFormId":616,"filterField":"vendor_id","filterValue":{"vendor_id":"__none__"},"columnsToShow":["certificate_name","issued_at","expiry_date"]}}]},{"label":"Supporting Docs","elements":[{"type":"html","html":"<p class=\"text-sm text-gray-600 mb-3\">Store questionnaires, insurance, and policy artefacts so onboarding evidence is one click away.</p>"},{"type":"button","label":"Add Supporting Doc","formName":"Vendor Supporting Document","prefillFilter":"vendor_id","class":"btn btn-primary btn-sm mb-3"},{"type":"table","options":{"tableName":"vendor_supporting_docs","showGlobalSearch":false,"addButton":false,"editFormId":614,"filterField":"vendor_id","filterValue":{"vendor_id":"__none__"},"columnsToShow":["type","filetype","validity"]}}]},{"label":"Performance","elements":[{"type":"html","html":"<p class=\"text-sm text-gray-600 mb-3\">Log periodic KPI reviews to monitor delivery trends and trigger requalification when scores fall.</p>"},{"type":"button","label":"Log Metric","formName":"Vendor Performance Metric","prefillFilter":"vendor_id","class":"btn btn-primary btn-sm mb-3"},{"type":"table","options":{"tableName":"vendor_performance_metrics","showGlobalSearch":false,"addButton":false,"editFormId":615,"filterField":"vendor_id","filterValue":{"vendor_id":"__none__"},"columnsToShow":["kpi_name","rating","period_start","period_end","reviewer_id"]}}]}]}],"footer":[{"type":"button","label":"Close","onClick":"closeModal"}]}