Approve an expense request from the approval detail page.
npx uiskill install @fan/approve-expense-request{
"id": "approval:expense:approve",
"kind": "atomic",
"name": "Approve Expense Request",
"states": {
"error_handle": {
"if": "@toast(type='error') || @modal(title='Approval Failed')",
"then": "report_approval_failure"
},
"pre_condition": "current_page ~= '/approvals/expenses/*' && record.status == 'pending'",
"success_criteria": {
"type": "field_value_change",
"field": "approval_status",
"match": "approved"
}
},
"anchors": {
"submit": "@button(text='Confirm Approval')",
"trigger": "@button(text='Approve')",
"comment_field": "@textarea(name='approval_comment')"
},
"uiskill": "0.1.0",
"category": "Approval Workflow",
"parameters": {
"type": "object",
"properties": {
"comment": {
"type": "string",
"description": "Optional approval comment."
},
"notify_requester": {
"type": "boolean",
"default": true,
"description": "Whether to notify the requester after approval."
}
}
},
"description": "Approve an expense request from the approval detail page."
}