export const workflowHdbmsdStageConfiguration = {
  workflowId: 'WF_HDBMSD_V5',
  workflowName: 'HDB/MSD Registration Workflow',
  programType: 'HDBMSD',
  workflowVersion: '5.0.0',
  lifecycleStatus: 'ACTIVE',
  description:
    'HDB/MSD registration workflow with 4 core stages (Registration, Payment, Travel, Goodies) - No next_stages concept',
  lastUpdated: '2026-02-12T00:00:00Z',
  registrationRules: {
    criteria: [
      { field: 'approvalStatus', operator: 'EQUALS', value: 'approved' },
      {
        operator: 'OR',
        conditions: [
          { field: 'paymentStatus', operator: 'IN', value: ['online_completed', 'offline_completed', 'completed'] },
          { field: 'isFreeSeat', operator: 'EQUALS', value: true }
        ]
      },
      { field: 'travelInfoStatus', operator: 'EQUALS', value: 'completed' },
      { field: 'travelPlanStatus', operator: 'EQUALS', value: 'completed' },
    ],
    message: 'Registration is completed when all criteria are fulfilled.',
  },
  initialStage: {
    stageKey: 'REGISTRATION',
    stageName: 'Save as Draft',
    isOptional: true,
    description: 'Save progress and resume later',
  },
  stages: [
    {
      stageId: 'registration',
      stageKey: 'REGISTRATION',
      stageName: 'Registration Submission',
      stageOrder: 1,
      stageCategory: 'FORM',
      description: 'Seeker fills and submits registration form',
      prerequisiteRulesConfig: {
        requiresAuth: true,
        requiredStages: [],
        conditions: [
          {
            roles: ['ROLE_VIEWER','ROLE_ADMIN', 'ROLE_SHOBA', 'ROLE_RELATIONAL_MANAGER'],
            condition: null,
            message: 'Login required to register',
          }
        ],
      },
      executionRulesConfig: {
        sections: [
          {
            sectionKey: 'FS_BASICDETAILS',
            permissions: {
              create: [{ roles: ['ROLE_VIEWER'], condition: null }],
              read: [{ roles: ['ALL'], condition: null }],
              update: [
                {
                  roles: ['ROLE_VIEWER'],
                  condition: {
                    operator: 'OR',
                    conditions: [
                      { field: 'approvalStatus', operator: 'EQUALS', value: 'pending' },
                      { field: 'basicDetailsFilled', operator: 'EQUALS', value: 'draft' },
                    ],
                  },
                },
                {
                  roles: ['ROLE_ADMIN', 'ROLE_SHOBA', 'ROLE_RELATIONAL_MANAGER'],
                  condition: { field: 'basicDetailsFilled', operator: 'EQUALS', value: 'completed' },
                },
              ],
              delete: [{ roles: [], condition: null }],
            },
          },
          {
            sectionKey: 'FS_MAHATRIAQUESTIONS',
            permissions: {
              create: [{ roles: ['ROLE_VIEWER'], condition: null }],
              read: [{ roles: ['ROLE_VIEWER', 'ROLE_MAHATRIA', 'ROLE_SHOBA'], condition: null }],
              update: [
                {
                  roles: ['ROLE_VIEWER'],
                  condition: {
                    operator: 'OR',
                    conditions: [
                      { field: 'approvalStatus', operator: 'EQUALS', value: 'pending' },
                      { field: 'basicDetailsFilled', operator: 'EQUALS', value: 'draft'},
                    ],
                  },
                },
                {
                  roles: ['ROLE_MAHATRIA', 'ROLE_SHOBA'],
                  condition: { field: 'basicDetailsFilled', operator: 'EQUALS', value: 'completed' },
                },
              ],
              delete: [{ roles: [], condition: null }],
            },
          },
        ],
      },
      actionButtons: [
        {
          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: 'OR',
                conditions: [
                  { field: 'registrationStatus', operator: 'EQUALS', value: 'draft' },
                  { field: 'registrationStatus', operator: 'EQUALS', value: '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,
              successScreen: {
                title: 'Registration Submitted!',
                message:
                  'Your registration has been submitted successfully. It will be reviewed by our team.',
                icon: 'check_circle',
                actions: [
                  {
                    actionKey: 'HOME',
                    label: 'Go to Home',
                    type: 'primary',
                    icon: 'home',
                    apiKey: null,
                    condition: null,
                  },
                  {
                    actionKey: 'EDIT_REGISTRATION',
                    label: 'Edit Registration',
                    type: 'primary',
                    icon: 'edit',
                    apiKey: 'EDIT_REGISTRATION',
                    condition: null,
                  },
                ],
              },
            },
            {
              roles: ['ROLE_ADMIN', 'ROLE_SHOBA', 'ROLE_RELATIONAL_MANAGER'],
              showToast: false,
              showSuccessScreen: false,
            }
          ],
        },
      ],
      completionActionsConfig: {
        conditional: true,
        conditions: [
          {
            when: {
              field: 'registrationStatus',
              operator: 'IN',
              value: ['draft', 'draft'],
            },
            then: {
              stageStatus: 'pending',
              markStageComplete: false,
            },
          },
          {
            when: {
              field: 'registrationStatus',
              operator: 'IN',
              value: ['submitted', 'pending'],
            },
            then: {
              stageStatus: 'completed',
              markStageComplete: true,
            },
          },
        ],
      },
    },
    {
      stageId: 'payment',
      stageKey: 'PAYMENT',
      stageName: 'Payment',
      stageOrder: 2,
      stageCategory: 'FORM',
      description: 'Process payment (online/offline)',
      prerequisiteRulesConfig: {
        requiresAuth: true,
        requiredStages: ['REGISTRATION'],
        conditions: [
          {
            roles: ['ROLE_VIEWER'],
            condition: {
              operator: 'AND',
              conditions: [
                { field: 'approvalStatus', operator: 'EQUALS', value: 'approved' },
                { field: 'isFreeSeat', operator: 'EQUALS', value: false },
                {
                  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: 'completed' }
                      ]
                    }
                  ]
                }
              ]
            },
            message: 'Registration must be approved and not a free seat',
          },
          {
            roles: ['ROLE_FINANCE_MANAGER', 'ROLE_ADMIN', 'ROLE_RELATIONAL_MANAGER'],
            condition: {
              operator: 'AND',
              conditions: [
                { field: 'approvalStatus', operator: 'EQUALS', value: 'approved' },
                { field: 'isFreeSeat', operator: 'EQUALS', value: false },
              ],
            },
            message: 'Registration must be approved and not a free seat (admin)',
          },
        ],
      },
      executionRulesConfig: {
        sections: [
          {
            sectionKey: 'FS_PAYMENTINVOICE',
            permissions: {
              create: [
                {
                  roles: ['ROLE_VIEWER'],
                  condition: {
                    operator: 'AND',
                    conditions: [
                      { field: 'approvalStatus', operator: 'EQUALS', value: 'approved' },
                      { field: 'isFreeSeat', operator: 'EQUALS', value: false },
                      {
                        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: 'completed' }
                            ]
                          }
                        ],
                      },
                    ],
                  },
                },
                {
                  roles: ['ROLE_FINANCE_MANAGER', 'ROLE_ADMIN', 'ROLE_RELATIONAL_MANAGER'],
                  condition: {
                    operator: 'AND',
                    conditions: [
                      { field: 'approvalStatus', operator: 'EQUALS', value: 'approved' },
                      { field: 'isFreeSeat', operator: 'EQUALS', value: false },
                    ],
                  },
                },
              ],
              read: [{ roles: ['ALL'], condition: null }],
              update: [
                {
                  roles: ['ROLE_VIEWER'],
                  condition: {
                    operator: 'AND',
                    conditions: [
                      { field: 'approvalStatus', operator: 'EQUALS', value: 'approved' },
                      { field: 'isFreeSeat', operator: 'EQUALS', value: false },
                      {
                        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: 'completed' }
                            ]
                          }
                        ],
                      },
                    ],
                  },
                },
                {
                  roles: ['ROLE_FINANCE_MANAGER', 'ROLE_ADMIN', 'ROLE_RELATIONAL_MANAGER'],
                  condition: {
                    operator: 'AND',
                    conditions: [
                      { field: 'approvalStatus', operator: 'EQUALS', value: 'approved' },
                      { field: 'isFreeSeat', operator: 'EQUALS', value: false },
                    ],
                  },
                },
              ],
              delete: [{ roles: [], condition: null }],
            },
          },
        ],
      },
      actionButtons: [
        {
          actionKey: 'CANCEL',
          label: 'Cancel',
          type: 'secondary',
          icon: 'close',
          apiKey: null,
          permissions: [
            {
              roles: [
                'ROLE_ADMIN',
                'ROLE_FINANCE_MANAGER',
                'ROLE_RELATIONAL_MANAGER',
                'ROLE_VIEWER',
              ],
              condition: null,
            },
          ],
          onSuccess: [
            {
              roles: ['ROLE_VIEWER'],
              showToast: false,
              showSuccessScreen: false,
            }
          ],
        },
        {
          actionKey: 'MAKE_PAYMENT',
          label: 'submit',
          type: 'primary',
          icon: null,
          apiKey: 'MAKE_PAYMENT',
          permissions: [
            {
              roles: ['ROLE_VIEWER'],
              condition: {
                operator: 'AND',
                conditions: [
                  { field: 'approvalStatus', operator: 'EQUALS', value: 'approved' },
                  { field: 'isFreeSeat', operator: 'EQUALS', value: false },
                  {
                    operator: 'OR',
                    conditions: [
                      { field: 'paymentStatus', operator: 'IN', value: ['failed', 'online_pending'] },
                      { field: 'paymentStatus', operator: 'IS_NULL' },
                    ],
                  },
                ],
              },
            },
          ],
          onSuccess: [
            {
              roles: ['ROLE_VIEWER'],
              showToast: true,
              toast: { message: 'Payment submitted successfully.', type: 'success' },
              showSuccessScreen: false,
            },
          ],
        },
      ],
      submitEndpoint: [
        {
          roles: ['ROLE_VIEWER'],
          condition: {
            operator: 'AND',
            conditions: [
              { field: 'approvalStatus', operator: 'EQUALS', value: 'approved' },
              { field: 'isFreeSeat', operator: 'EQUALS', value: false },
              {
                operator: 'OR',
                conditions: [
                  { field: 'paymentStatus', operator: 'IN', value: ['failed', 'online_pending'] },
                  { field: 'paymentStatus', operator: 'IS_NULL' },
                ],
              },
            ],
          },
          apiKey: 'INITIATE_PAYMENT',
          method: 'POST',
          path: '/payment/initiate/{registrationId}',
          description: 'Initiate payment (seeker)',
        },
        {
          roles: ['ROLE_FINANCE_MANAGER', 'ROLE_ADMIN', 'ROLE_RELATIONAL_MANAGER'],
          condition: {
            operator: 'AND',
            conditions: [
              { field: 'approvalStatus', operator: 'EQUALS', value: 'approved' },
              { field: 'isFreeSeat', operator: 'EQUALS', value: false },
            ],
          },
          apiKey: 'MARK_PAYMENT_COMPLETED',
          method: 'PUT',
          path: '/payment/mark-completed/{registrationId}',
          description: 'Mark payment as completed (admin)',
        },
      ],
      completionActionsConfig: {
        conditional: true,
        conditions: [
          {
            when: {
              field: 'paymentStatus',
              operator: 'IN',
              value: ['online_completed', 'offline_completed', 'completed'],
            },
            then: {
              stageStatus: 'completed',
              markStageComplete: true,
            },
          },
          {
            when: {
              field: 'paymentStatus',
              operator: 'IN',
              value: ['online_pending', 'offline_pending', 'failed'],
            },
            then: {
              stageStatus: 'pending',
              markStageComplete: false,
            },
          },
        ],
      },
    },
    {
      stageId: 'travel',
      stageKey: 'TRAVEL',
      stageName: 'Travel Details',
      stageOrder: 3,
      stageCategory: 'FORM',
      description: 'Complete travel information and plans',
      prerequisiteRulesConfig: {
        requiresAuth: true,
        requiredStages: ['REGISTRATION'],
        conditions: [
          {
            roles: ['ROLE_ADMIN', 'ROLE_RELATIONAL_MANAGER', 'ROLE_SHOBA'],
            condition: {
              field: 'approvalStatus', operator: 'EQUALS', value: 'approved',
            },
            message: 'Registration must be approved',
          },
        ],
      },
      executionRulesConfig: {
        sections: [
          {
            sectionKey: 'FS_TRAVELPLAN',
            permissions: {
              create: [
                {
                  roles: ['ROLE_ADMIN', 'ROLE_RELATIONAL_MANAGER', 'ROLE_SHOBA'],
                  condition: { field: 'approvalStatus', operator: 'EQUALS', value: 'approved' },
                },
              ],
              read: [{ roles: ['ALL'], condition: null }],
              update: [
                {
                  roles: ['ROLE_ADMIN', 'ROLE_RELATIONAL_MANAGER', 'ROLE_SHOBA'],
                  condition: { field: 'approvalStatus', operator: 'EQUALS', value: 'approved' },
                },
              ],
              delete: [{ roles: [], condition: null }],
            },
          },
        ],
      },
      actionButtons: [
        {
          actionKey: 'CANCEL',
          label: 'Cancel',
          type: 'secondary',
          icon: 'close',
          apiKey: null,
          permissions: [
            {
              roles: [
                'ROLE_ADMIN',
                'ROLE_FINANCE_MANAGER',
                'ROLE_RELATIONAL_MANAGER'
              ],
              condition: null,
            },
          ],
          onSuccess: [
            {
              roles: ['ROLE_ADMIN', 'ROLE_FINANCE_MANAGER', 'ROLE_RELATIONAL_MANAGER'],
              showToast: false,
              showSuccessScreen: false,
            },
          ],
        },
        {
          actionKey: 'SAVE_TRAVEL',
          label: 'Save Travel Details',
          type: 'primary',
          icon: 'save',
          apiKey: 'SAVE_TRAVEL',
          permissions: [
            {
              roles: ['ROLE_ADMIN', 'ROLE_RELATIONAL_MANAGER', 'ROLE_SHOBA'],
              condition: {
                field: 'approvalStatus',
                operator: 'EQUALS',
                value: 'approved',
              },
            },
          ],
          onSuccess: [
            {
              roles: ['ROLE_ADMIN', 'ROLE_RELATIONAL_MANAGER', 'ROLE_SHOBA'],
              showToast: true,
              toast: { message: 'Travel details saved.', type: 'success' },
              showSuccessScreen: false,
            },
          ],
        },
      ],
      submitEndpoint: [
        {
          roles: ['ROLE_ADMIN', 'ROLE_RELATIONAL_MANAGER', 'ROLE_SHOBA'],
          condition: {
            field: 'approvalStatus',
            operator: 'EQUALS',
            value: 'approved',
          },
          apiKey: 'UPDATE_TRAVEL_REGISTRATION',
          method: 'PUT',
          path: '/registration/travel/{registrationId}',
          description: 'Update travel info and plan (admin)',
        },
      ],
      completionActionsConfig: {
        conditional: true,
        conditions: [
          {
            when: {
              operator: 'AND',
              conditions: [
                { field: 'travelInfoStatus', operator: 'EQUALS', value: 'completed' },
                { field: 'travelPlanStatus', operator: 'EQUALS', value: 'completed' },
              ],
            },
            then: {
              stageStatus: 'completed',
              markStageComplete: true,
            },
          },
          {
            when: {
              operator: 'OR',
              conditions: [
                { field: 'travelInfoStatus', operator: 'EQUALS', value: 'completed' },
                { field: 'travelPlanStatus', operator: 'EQUALS', value: 'completed' },
              ],
            },
            then: {
              stageStatus: 'pending',
              markStageComplete: false,
            },
          },
        ],
      },
    },
    {
      stageId: 'goodies',
      stageKey: 'GOODIES',
      stageName: 'Goodies Selection',
      stageOrder: 4,
      stageCategory: 'FORM',
      description: 'Select program merchandise',
      prerequisiteRulesConfig: {
        requiresAuth: true,
        requiredStages: ['REGISTRATION'],
        conditions: [
          {
            roles: ['ROLE_OPERATIONAL_MANGER', 'ROLE_ADMIN', 'ROLE_RELATIONAL_MANAGER', 'ROLE_SHOBA'],
            condition: {
              field: 'approvalStatus', operator: 'EQUALS', value: 'approved',
            },
            message: 'Registration must be approved',
          },
        ],
      },
      executionRulesConfig: {
        sections: [
          {
            sectionKey: 'FS_GOODIES',
            permissions: {
              create: [
                {
                  roles: ['ROLE_OPERATIONAL_MANGER', 'ROLE_ADMIN', 'ROLE_RELATIONAL_MANAGER', 'ROLE_SHOBA'],
                  condition: { field: 'approvalStatus', operator: 'EQUALS', value: 'approved' },
                },
              ],
              read: [{ roles: ['ALL'], condition: null }],
              update: [
                {
                  roles: ['ROLE_OPERATIONAL_MANGER', 'ROLE_ADMIN', 'ROLE_SHOBA', 'ROLE_RELATIONAL_MANAGER'],
                  condition: { field: 'approvalStatus', operator: 'EQUALS', value: 'approved' },
                },
              ],
              delete: [{ roles: [], condition: null }],
            },
          },
        ],
      },
      actionButtons: [
        {
          actionKey: 'SAVE_GOODIES',
          label: 'submit',
          type: 'primary',
          icon: 'save',
          apiKey: 'SAVE_GOODIES',
          permissions: [
            {
              roles: [
                'ROLE_OPERATIONAL_MANGER',
                'ROLE_ADMIN',
                'ROLE_RELATIONAL_MANAGER',
                'ROLE_SHOBA',
              ],
              condition: {
                field: 'approvalStatus',
                operator: 'EQUALS',
                value: 'approved',
              },
            },
          ],
          onSuccess: [
            {
              roles: [
                'ROLE_OPERATIONAL_MANGER',
                'ROLE_ADMIN',
                'ROLE_RELATIONAL_MANAGER',
                'ROLE_SHOBA',
              ],
              showToast: true,
              toast: { message: 'Goodies selection saved.', type: 'success' },
              showSuccessScreen: false,
            },
          ],
        },
      ],
      submitEndpoint: [
        {
          roles: ['ROLE_OPERATIONAL_MANGER', 'ROLE_ADMIN', 'ROLE_RELATIONAL_MANAGER', 'ROLE_SHOBA'],
          condition: {
            field: 'approvalStatus',
            operator: 'EQUALS',
            value: 'approved',
          },
          apiKey: 'UPDATE_GOODIES_REGISTRATION',
          method: 'PUT',
          path: '/registration/goodies/{registrationId}',
          description: 'Update goodies selection (admin)',
        },
      ],
      completionActionsConfig: {
        stageStatus: 'goodies_completed',
        markStageComplete: true,
        showSuccessScreen: false,
        showToastNotification: true,
        successScreen: null,
        toastNotification: {
          message: 'Goodies selection saved successfully.',
          type: 'success',
        },
      },
    },
  ],
  independentActions: {
    SEAT_APPROVAL: {
      actionKey: 'SEAT_APPROVAL',
      actionName: 'Seat Approval',
      description: 'Mahatria/Shoba approves or rejects registration',
      permissions: [
        {
          roles: ['ROLE_MAHATRIA', 'ROLE_SHOBA'],
          condition: {
            operator: 'AND',
            conditions: [
              { field: 'basicDetailsFilled', operator: 'EQUALS', value: 'completed' },
              { field: 'registrationStatus', operator: 'NOT_EQUALS', value: 'draft' },
              { field: 'registrationStatus', operator: 'NOT_EQUALS', value: 'draft' },
            ],
          },
        },
      ],
      endpoints: [
        {
          method: 'PUT',
          path: '/registration-approval/{approvalId}',
          description: 'Approve or reject registration',
        },
      ],
    },
    DEFAULTER_MARKING: {
      actionKey: 'DEFAULTER_MARKING',
      actionName: 'Defaulter Marking',
      description: 'Mark seeker as defaulter',
      permissions: [
        {
          roles: ['ROLE_MAHATRIA', 'ROLE_SHOBA', 'ROLE_ADMIN'],
          condition: {
            operator: 'AND',
            conditions: [
              { field: 'registrationStatus', operator: 'NOT_EQUALS', value: 'draft' },
              { field: 'registrationStatus', operator: 'NOT_EQUALS', value: 'draft' },
              { field: 'basicDetailsFilled', operator: 'EQUALS', value: 'completed' },
              { field: 'isDefaulter', operator: 'EQUALS', value: false },
            ],
          },
        },
      ],
      endpoints: [
        { method: 'POST', path: '/seeker-defaulter' },
        { method: 'PUT', path: '/seeker-defaulter/{id}' },
      ],
    },
    UNMARK_DEFAULTER: {
      actionKey: 'UNMARK_DEFAULTER',
      actionName: 'Unmark Defaulter',
      description: 'Remove defaulter marking from seeker',
      permissions: [
        {
          roles: ['ROLE_MAHATRIA', 'ROLE_SHOBA', 'ROLE_ADMIN'],
          condition: {
            operator: 'AND',
            conditions: [
              { field: 'registrationStatus', operator: 'NOT_EQUALS', value: 'draft' },
              { field: 'registrationStatus', operator: 'NOT_EQUALS', value: 'draft' },
              { field: 'basicDetailsFilled', operator: 'EQUALS', value: 'completed' },
              { field: 'isDefaulter', operator: 'EQUALS', value: true },
            ],
          },
        },
      ],
      endpoints: [
        { method: 'PUT', path: '/seeker-defaulter/{id}' },
      ],
    },
    SEND_INVOICE: {
      actionKey: 'SEND_INVOICE',
      actionName: 'Send Invoice',
      description: 'Send invoice to seeker via email',
      permissions: [
        {
          roles: ['ROLE_MAHATRIA', 'ROLE_SHOBA', 'ROLE_ADMIN', 'ROLE_FINANCE_MANAGER', 'ROLE_RELATIONAL_MANAGER'],
          condition: {
            operator: 'AND',
            conditions: [
              { field: 'paymentStatus', operator: 'IN', value: ['offline_completed', 'online_completed', 'completed'] },
              { field: 'approvalStatus', operator: 'EQUALS', value: 'approved' },
            ],
          },
        },
      ],
      endpoints: [
        { method: 'POST', path: '/invoice/send/{registrationId}', description: 'Send invoice email to seeker' },
      ],
    },
    DOWNLOAD_INVOICE: {
      actionKey: 'DOWNLOAD_INVOICE',
      actionName: 'Download Invoice',
      description: 'Download invoice PDF',
      permissions: [
        {
          roles: ['ROLE_MAHATRIA', 'ROLE_SHOBA', 'ROLE_ADMIN', 'ROLE_FINANCE_MANAGER', 'ROLE_RELATIONAL_MANAGER'],
          condition: {
            operator: 'AND',
            conditions: [
              { field: 'paymentStatus', operator: 'IN', value: ['offline_completed', 'online_completed', 'completed'] },
              { field: 'invoiceGenerated', operator: 'EQUALS', value: true },
              { field: 'approvalStatus', operator: 'EQUALS', value: 'approved' },
            ],
          },
        },
      ],
      endpoints: [
        { method: 'GET', path: '/invoice/download/{registrationId}', description: 'Download invoice PDF' },
      ],
    },
    DOWNLOAD_PROFORMA_INVOICE: {
      actionKey: 'DOWNLOAD_PROFORMA_INVOICE',
      actionName: 'Download Proforma Invoice',
      description: 'Download proforma invoice PDF',
      permissions: [
        {
          roles: ['ROLE_MAHATRIA', 'ROLE_SHOBA', 'ROLE_ADMIN', 'ROLE_FINANCE_MANAGER', 'ROLE_RELATIONAL_MANAGER'],
          condition: {
            operator: 'AND',
            conditions: [
              { field: 'proFormaInvoicePdfUrl', operator: 'IS_NOT_NULL' },
              { field: 'approvalStatus', operator: 'EQUALS', value: 'approved' },
              { field: 'isProformaAllowed', operator: 'EQUALS', value: true },
            ],
          },
        },
      ],
      endpoints: [
        { method: 'GET', path: '/invoice/proforma/{registrationId}', description: 'Download proforma invoice PDF' },
      ],
    },
    RESEND_BLESSED_EMAIL: {
      actionKey: 'RESEND_BLESSED_EMAIL',
      actionName: 'Resend Blessed Email',
      description: 'Resend approval/blessed email to seeker',
      permissions: [
        {
          roles: ['ROLE_SHOBA'],
          condition: {
            operator: 'AND',
            conditions: [
              { field: 'approvalStatus', operator: 'EQUALS', value: 'approved' },
            ],
          },
        },
      ],
      endpoints: [
        { method: 'POST', path: '/registration/{registrationId}/resend-blessed-email', description: 'Resend blessed email notification' },
      ],
    },
    MARK_PAYMENT_COMPLETED: {
      actionKey: 'MARK_PAYMENT_COMPLETED',
      actionName: 'Mark Payment as Completed',
      description: 'Mark offline/online pending payment as completed',
      permissions: [
        {
          roles: ['ROLE_FINANCE_MANAGER'],
          condition: {
            operator: 'AND',
            conditions: [
              { field: 'approvalStatus', operator: 'EQUALS', value: 'approved' },
              {
                field: 'paymentStatus',
                operator: 'IN',
                value: ['offline_pending', 'online_pending', 'failed'],
              },
            ],
          },
        },
      ],
      endpoints: [
        {
          method: 'PUT',
          path: '/payment/mark-completed/{registrationId}',
          description: 'Mark payment as completed by finance team',
        },
      ],
    },
    REGISTRATION_HOLD: {
      actionKey: 'REGISTRATION_HOLD',
      actionName: 'Registration Hold',
      description: 'Move registration to hold/rejected state',
      permissions: [
        {
          roles: ['ROLE_MAHATRIA', 'ROLE_SHOBA', 'ROLE_ADMIN'],
          condition: {
            operator: 'AND',
            conditions: [
              { field: 'basicDetailsFilled', operator: 'EQUALS', value: 'completed' },
              {
                field: 'approvalStatus',
                operator: 'IN',
                value: ['approved', 'pending', 'on_hold'],
              },
            ],
          },
        },
      ],
      endpoints: [
        {
          method: 'PUT',
          path: '/registration/{id}/hold',
          description: 'Update registration hold status',
        },
      ],
    },
    REGISTRATION_CANCEL: {
      actionKey: 'REGISTRATION_CANCEL',
      actionName: 'Cancel Registration',
      description: 'Cancel registration from hold state',
      permissions: [
        {
          roles: ['ROLE_MAHATRIA', 'ROLE_SHOBA', 'ROLE_RELATIONAL_MANAGER', 'ROLE_ADMIN'],
          condition: {
            operator: 'AND',
            conditions: [
              { field: 'registrationStatus', operator: 'EQUALS', value: 'rejected' },
              { field: 'basicDetailsFilled', operator: 'EQUALS', value: 'completed' }
            ]
          },
        },
      ],
      endpoints: [
        {
          method: 'PUT',
          path: '/registration/{id}/cancel',
          description: 'Cancel registration from hold state',
        },
      ],
    },
    SWAP_CREATE: {
      actionKey: 'SWAP_CREATE',
      actionName: 'Create Swap Request',
      description: 'Create swap request to move to different program',
      permissions: [
        {
          roles: ['ROLE_RELATIONAL_MANAGER', 'ROLE_SHOBA', 'ROLE_ADMIN'],
          condition: {
            operator: 'AND',
            conditions: [
              { field: 'approvalStatus', operator: 'EQUALS', value: 'approved' },
              { field: 'hasActiveSwap', operator: 'EQUALS', value: false },
            ],
          },
        },
      ],
      endpoints: [
        {
          method: 'POST',
          path: '/program-registration/swap',
          description: 'Create swap request (wants_swap, can_shift, or direct_swap)',
        },
      ],
    },
    SWAP_APPROVE: {
      actionKey: 'SWAP_APPROVE',
      actionName: 'Approve Swap',
      description: 'Approve swap and allocate to new program',
      permissions: [
        {
          roles: ['ROLE_SHOBA', 'ROLE_ADMIN'],
          condition: {
            operator: 'AND',
            conditions: [
              { field: 'hasActiveSwap', operator: 'EQUALS', value: true },
              { field: 'swapStatus', operator: 'EQUALS', value: 'active' },
            ],
          },
        },
      ],
      endpoints: [
        {
          method: 'PUT',
          path: '/program-registration/swap/{swapId}',
          description: 'Approve swap and allocate to new program',
        },
      ],
    },
    SWAP_REJECT: {
      actionKey: 'SWAP_REJECT',
      actionName: 'Reject Swap',
      description: 'Reject swap request and move to hold',
      permissions: [
        {
          roles: ['ROLE_SHOBA', 'ROLE_ADMIN'],
          condition: {
            operator: 'AND',
            conditions: [
              { field: 'hasActiveSwap', operator: 'EQUALS', value: true },
              { field: 'swapStatus', operator: 'EQUALS', value: 'active' },
            ],
          },
        },
      ],
      endpoints: [
        {
          method: 'PUT',
          path: '/program-registration/swap/{swapId}',
          description: 'Reject swap request and move to hold',
        },
      ],
    },
    SWAP_UPDATE: {
      actionKey: 'SWAP_UPDATE',
      actionName: 'Update Swap Request',
      description: 'Update active swap request details',
      permissions: [
        {
          roles: ['ROLE_RELATIONAL_MANAGER', 'ROLE_SHOBA', 'ROLE_ADMIN'],
          condition: {
            operator: 'AND',
            conditions: [
              { field: 'hasActiveSwap', operator: 'EQUALS', value: true },
              { field: 'swapStatus', operator: 'EQUALS', value: 'active' },
            ],
          },
        },
      ],
      endpoints: [
        {
          method: 'PUT',
          path: '/program-registration/swap/{swapId}',
          description: 'Update swap request details',
        },
      ],
    },
    SWAP_CANCEL: {
      actionKey: 'SWAP_CANCEL',
      actionName: 'Cancel Swap Request',
      description: 'Cancel active swap request',
      permissions: [
        {
          roles: ['ROLE_RELATIONAL_MANAGER', 'ROLE_SHOBA', 'ROLE_ADMIN'],
          condition: {
            operator: 'AND',
            conditions: [
              { field: 'hasActiveSwap', operator: 'EQUALS', value: true },
              { field: 'swapStatus', operator: 'EQUALS', value: 'active' },
            ],
          },
        },
      ],
      endpoints: [
        {
          method: 'PUT',
          path: '/program-registration/swap/{swapId}/cancel',
          description: 'Cancel active swap request',
        },
      ],
    },
    SWAP_MOVE_TO_DEMAND: {
      actionKey: 'SWAP_MOVE_TO_DEMAND',
      actionName: 'Move Swap to Demand Pool',
      description: 'Move wants_swap to demand pool',
      permissions: [
        {
          roles: ['ROLE_RELATIONAL_MANAGER', 'ROLE_SHOBA', 'ROLE_ADMIN'],
          condition: {
            operator: 'AND',
            conditions: [
              { field: 'hasActiveSwap', operator: 'EQUALS', value: true },
              { field: 'swapType', operator: 'EQUALS', value: 'wants_swap' },
              { field: 'swapStatus', operator: 'EQUALS', value: 'active' },
            ],
          },
        },
      ],
      endpoints: [
        {
          method: 'PUT',
          path: '/program-registration/swap/{swapId}',
          description: 'Move wants_swap to demand pool',
        },
      ],
    },
    RM_REVIEW: {
      actionKey: 'RM_REVIEW',
      actionName: 'RM Review',
      description: 'Relational Manager review and rating',
      permissions: [
        {
          roles: ['ROLE_RELATIONAL_MANAGER', 'ROLE_SHOBA', 'ROLE_ADMIN'],
          condition: {
            operator: 'AND',
            conditions: [
              { field: 'registrationStatus', operator: 'NOT_EQUALS', value: 'draft' },
              { field: 'registrationStatus', operator: 'NOT_EQUALS', value: 'draft' },
              {field: 'basicDetailsFilled', operator: 'EQUALS', value: 'completed'},
            ],
          },
        },
      ],
      endpoints: [
        { method: 'POST', path: '/program-registration/{programRegistrationId}/rm-rating' },
        { method: 'PUT', path: '/program-registration/{programRegistrationId}/rm-rating' },
      ],
    },
    RM_RECOMMENDATION: {
      actionKey: 'RM_RECOMMENDATION',
      actionName: 'RM Recommendation',
      description: 'Relational Manager recommendation',
      permissions: [
        {
          roles: ['ROLE_RELATIONAL_MANAGER', 'ROLE_SHOBA', 'ROLE_ADMIN'],
          condition: {
            operator: 'AND',
            conditions: [
              { field: 'registrationStatus', operator: 'NOT_EQUALS', value: 'draft' },
              { field: 'registrationStatus', operator: 'NOT_EQUALS', value: 'draft' },
              {field: 'basicDetailsFilled', operator: 'EQUALS', value: 'completed'}
            ],
          },
        },
      ],
      endpoints: [
        { method: 'POST', path: '/program-registration/{programRegistrationId}/recommendation' },
        { method: 'PUT', path: '/program-registration/{programRegistrationId}/recommendation' },
      ],
    },
    PROGRAM_EXPERIENCE: {
      actionKey: 'PROGRAM_EXPERIENCE',
      actionName: 'Program Experience',
      description: 'Manage seeker program experience',
      permissions: [
        {
          roles: ['ROLE_RELATIONAL_MANAGER', 'ROLE_SHOBA', 'ROLE_ADMIN'],
          condition: {
            operator: 'AND',
            conditions: [
              { field: 'registrationStatus', operator: 'NOT_EQUALS', value: 'draft' },
              { field: 'registrationStatus', operator: 'NOT_EQUALS', value: 'draft' },
              {field: 'basicDetailsFilled', operator: 'EQUALS', value: 'completed'}
            ],
          },
        },
      ],
      endpoints: [
        { method: 'POST', path: '/seeker-program-experience' },
        { method: 'PUT', path: '/seeker-program-experience/{id}' },
        { method: 'GET', path: '/seeker-program-experience/seeker/{seekerId}' },
      ],
    }
  },
};
