[
    {
      "actionKey": "CANCEL",
      "label": "Cancel",
      "type": "secondary",
      "icon": "close",
      "apiKey": null,
      "permissions": [{"roles": ["ROLE_ADMIN", "ROLE_RELATIONAL_MANAGER", "ROLE_VIEWER"], "condition": null}],
      "onSuccess": [{"roles": ["ROLE_ADMIN", "ROLE_RELATIONAL_MANAGER", "ROLE_VIEWER"], "showToast": false, "showSuccessScreen": false}]
    },
    {
      "actionKey": "MAKE_PAYMENT",
      "label": "submit",
      "type": "primary",
      "icon": "payment",
      "apiKey": "MAKE_PAYMENT",
      "permissions": [{"roles": ["ROLE_VIEWER"], "condition": {"operator": "AND", "conditions": [
        {"field": "requiresPayment", "operator": "EQUALS", "value": true},
        {"field": "isFreeSeat", "operator": "EQUALS", "value": false},
        {"field": "basicDetailsFilled", "operator": "EQUALS", "value": "completed"},
        {"field": "registrationStatus", "operator": "NOT_IN", "value": ["rejected"]},
        {"operator": "OR", "conditions": [
          {"field": "registrationStatus", "operator": "NOT_IN", "value": ["waitlisted"]},
          {"field": "reservedLink", "operator": "EQUALS", "value": true}
        ]},
        {
          "operator": "OR",
          "conditions": [
            {"field": "paymentStatus", "operator": "IN", "value": ["online_pending", "failed"]},
            {"field": "paymentStatus", "operator": "IS_NULL"},
            {
              "operator": "AND",
              "conditions": [
                {"field": "paymentStatus", "operator": "EQUALS", "value": "offline_pending"},
                {"field": "editRequestStatus", "operator": "EQUALS", "value": "requested"}
              ]
            }
          ]
        }
      ]}}],
      "onSuccess": [{
        "roles": ["ROLE_VIEWER"],
        "showToast": false,
        "showSuccessScreen": true,
        "successScreenConfig": {
          "scenarios": [
            {
              "scenarioKey": "PAYMENT_EDIT_REQUESTED",
              "condition": {
                "operator": "AND",
                "conditions": [
                  {"field": "paymentMode", "operator": "EQUALS", "value": "offline"},
                  {"field": "paymentStatus", "operator": "EQUALS", "value": "offline_pending"},
                  {"field": "editRequestStatus", "operator": "EQUALS", "value": "requested"}
                ]
              },
              "screen": {
                "title": "{{programName}}",
                "message": "Your payment edit request for {{programName}} has been submitted. You can edit your payment details once the request is approved.",
                "icon": "info",
                "actions": [
                  {"actionKey": "HOME", "label": "Go to Home", "type": "secondary", "icon": "home", "apiKey": null, "condition": null},
                  {"actionKey": "UPDATE_PAYMENT", "label": "Update Payment", "type": "secondary", "icon": null, "apiKey": "UPDATE_PAYMENT_DETAILS", "condition": null}
                ]
              }
            },
            {
              "scenarioKey": "ONLINE_PAYMENT_SUCCESS",
              "condition": {
                "operator": "AND",
                "conditions": [
                  {"field": "paymentMode", "operator": "EQUALS", "value": "online"},
                  {"field": "paymentStatus", "operator": "IN", "value": ["online_completed", "completed"]}
                ]
              },
              "screen": {
                "title": "Payment Completed!",
                "message": "Your payment for {{programName}} ({{programStartDate}} to {{programEndDate}}) has been completed successfully. You can proceed with travel details.",
                "icon": "check_circle",
                "actions": [
                  {"actionKey": "PROCEED_TO_TRAVEL", "label": "Proceed to Travel", "type": "primary", "icon": "flight", "apiKey": null, "condition": {"field": "involvesTravel", "operator": "EQUALS", "value": true}},
                  {"actionKey": "DOWNLOAD_INVOICE", "label": "Download Invoice", "type": "secondary", "icon": "download", "apiKey": "DOWNLOAD_INVOICE", "condition": {"field": "paymentStatus", "operator": "EQUALS", "value": "online_completed"}},
                  {"actionKey": "HOME", "label": "Go to Home", "type": "secondary", "icon": "home", "apiKey": null, "condition": null}
                ]
              }
            },
            {
              "scenarioKey": "OFFLINE_PAYMENT_CHEQUE",
              "condition": {
                "operator": "AND",
                "conditions": [
                  {"field": "paymentMode", "operator": "EQUALS", "value": "offline"},
                  {"field": "offlinePaymentMethod", "operator": "EQUALS", "value": "Cheque"}
                ]
              },
              "screen": {
                "title": "Payment Submitted!",
                "message": "We acknowledge your payment towards {{programName}} ({{programStartDate}} to {{programEndDate}}). Note: cheques are subject to realization. You can proceed with travel details.",
                "icon": "check_circle",
                "actions": [
                  {"actionKey": "PROCEED_TO_TRAVEL", "label": "Proceed to Travel", "type": "primary", "icon": "flight", "apiKey": null, "condition": {"field": "involvesTravel", "operator": "EQUALS", "value": true}},
                  {"actionKey": "HOME", "label": "Go to Home", "type": "secondary", "icon": "home", "apiKey": null, "condition": null}
                ]
              }
            },
            {
              "scenarioKey": "OFFLINE_PAYMENT_OTHER",
              "condition": {
                "operator": "AND",
                "conditions": [
                  {"field": "paymentMode", "operator": "EQUALS", "value": "offline"},
                  {"field": "offlinePaymentMethod", "operator": "NOT_EQUALS", "value": "Cheque"}
                ]
              },
              "screen": {
                "title": "Payment Submitted!",
                "message": "We acknowledge your payment towards {{programName}} ({{programStartDate}} to {{programEndDate}}). You can proceed with travel details.",
                "icon": "check_circle",
                "actions": [
                  {"actionKey": "PROCEED_TO_TRAVEL", "label": "Proceed to Travel", "type": "primary", "icon": "flight", "apiKey": null, "condition": {"field": "involvesTravel", "operator": "EQUALS", "value": true}},
                  {"actionKey": "HOME", "label": "Go to Home", "type": "secondary", "icon": "home", "apiKey": null, "condition": null}
                ]
              }
            }
          ],
          "defaultScreen": {
            "title": "Payment Submitted!",
            "message": "Your payment for {{programName}} has been submitted successfully.",
            "icon": "check_circle",
            "actions": [
              {"actionKey": "HOME", "label": "Go to Home", "type": "secondary", "icon": "home", "apiKey": null, "condition": null}
            ]
          }
        }
      }]
    }
  ]