[
    {
      "actionKey": "CANCEL",
      "label": "Cancel",
      "type": "secondary",
      "icon": "save",
      "apiKey": null,
      "permissions": [
        {
          "roles": ["ROLE_ADMIN", "ROLE_SHOBA", "ROLE_RELATIONAL_MANAGER", "ROLE_VIEWER"],
          "condition": null
        }
      ],
      "onSuccess": [
        {
          "roles": ["ROLE_ADMIN", "ROLE_SHOBA", "ROLE_RELATIONAL_MANAGER", "ROLE_VIEWER"],
          "showToast": false,
          "showSuccessScreen": false
        }
      ]
    },
    {
      "actionKey": "SAVE_DRAFT",
      "label": "Save as Draft",
      "type": "secondary",
      "icon": "save",
      "apiKey": "SAVE_REGISTRATION_DRAFT",
      "permissions": [
        {
          "roles": ["ROLE_VIEWER"],
          "condition": {
            "operator": "AND",
            "conditions": [
              {"field": "allowsProxyRegistration", "operator": "EQUALS", "value": true},
              {
                "operator": "OR",
                "conditions": [
                  {"field": "registrationStatus", "operator": "EQUALS", "value": "draft"},
                  {"field": "registrationStatus", "operator": "EQUALS", "value": "save_as_draft"},
                  {"field": "basicDetailsFilled", "operator": "NOT_EQUALS", "value": "completed"}
                ]
              }
            ]
          }
        }
      ],
      "onSuccess": [
        {
          "roles": ["ROLE_VIEWER"],
          "showToast": true,
          "toast": {
            "message": "Draft saved successfully. You can continue later.",
            "type": "info"
          },
          "showSuccessScreen": false
        }
      ]
    },
    {
      "actionKey": "SUBMIT_REGISTRATION",
      "label": "Submit",
      "type": "primary",
      "icon": "send",
      "apiKey": "SUBMIT_REGISTRATION",
      "permissions": [
        {
          "roles": ["ROLE_VIEWER"],
          "condition": {
            "operator": "OR",
            "conditions": [
              {"field": "approvalStatus", "operator": "EQUALS", "value": "pending"},
              {"field": "approvalStatus", "operator": "IS_NULL"}
            ]
          }
        },
        {
          "roles": ["ROLE_ADMIN", "ROLE_SHOBA", "ROLE_RELATIONAL_MANAGER"],
          "condition": null
        }
      ],
      "onSuccess": [
        {
          "roles": ["ROLE_VIEWER"],
          "showToast": false,
          "showSuccessScreen": true,
          "successScreenConfig": {
            "scenarios": [
              {
                "scenarioKey": "REGISTRATION_SUBMITTED",
                "condition": {
                  "operator": "AND",
                  "conditions": [
                    {"field": "registrationStatus", "operator": "IN", "value": ["pending"]},
                    {"field": "approvalStatus", "operator": "IN", "value": ["pending", null]}
                  ]
                },
                "screen": {
                  "title": "{{programName}}",
                  "message": "Thanks for completing your registration.\nYour request has now been placed with Mahatria.\nYou can edit your registration until you are blessed with a seat.",
                  "variant": "success",
                  "showLogo": true,
                  "showBanner": true,
                  "logoUrl": "{{logoUrl}}",
                  "bannerImageUrl": "{{bannerImageUrl}}",
                  "actions": [
                    {
                      "actionKey": "HOME",
                      "label": "home",
                      "type": "secondary",
                      "apiKey": null
                    },
                    {
                      "actionKey": "EDIT_REGISTRATION",
                      "label": "edit form",
                      "type": "secondary",
                      "apiKey": "EDIT_REGISTRATION"
                    }
                  ]
                }
              }
            ],
            "defaultScreen": {
              "title": "{{programName}}",
              "message": "Thanks for completing your registration.\nYour request has now been placed with Mahatria.\nYou can edit your registration until you are blessed with a seat.",
              "variant": "success",
              "showLogo": true,
              "showBanner": true,
              "logoUrl": "{{logoUrl}}",
              "bannerImageUrl": "{{bannerImageUrl}}",
              "actions": [
                {
                  "actionKey": "HOME",
                  "label": "home",
                  "type": "secondary",
                  "apiKey": null
                },
                {
                  "actionKey": "EDIT_REGISTRATION",
                  "label": "edit form",
                  "type": "secondary",
                  "apiKey": "EDIT_REGISTRATION"
                }
              ]
            }
          }
        },
        {
          "roles": ["ROLE_ADMIN", "ROLE_SHOBA", "ROLE_RELATIONAL_MANAGER"],
          "showToast": false,
          "showSuccessScreen": false
        }
      ]
    }
  ]