[
        {
            "step": 1,
            "name": "update_source_record",
            "action": "update_polymorphic",
            "description": "Update original record with TaxCore receipt data",
            "table": "${record.reference_table}",
            "id_column": "${record.reference_table}_id",
            "where": {
                "${record.reference_table}_id": "${record.reference_id}"
            },
            "data": {
                "taxcore_submission_id": "${record.submission_id}",
                "invoiceNumber": "${record.taxcore_invoice_number}",
                "verificationUrl": "${record.taxcore_verification_url}",
                "verificationQRCode": "${record.taxcore_qr_code}",
                "journal": "${record.taxcore_journal}",
                "updatedAt": "${now}"
            },
            "on_error": "log"
        },
        {
            "step": 2,
            "name": "generate_pdf_receipt",
            "action": "generate_pdf",
            "description": "Generate PDF with fiscal receipt",
            "template": "fiscal_receipt",
            "data": "${record}",
            "output_path": "storage/receipts/${record.submission_id}.pdf",
            "on_error": "log"
        },
        {
            "step": 3,
            "name": "notify_user",
            "action": "notify",
            "description": "Notify user of successful submission",
            "channel": "websocket",
            "event": "taxcore:submission:success",
            "data": {
                "submission_id": "${record.submission_id}",
                "taxcore_invoice_number": "${record.taxcore_invoice_number}",
                "verification_url": "${record.taxcore_verification_url}"
            }
        }
    ]