Beneficiary

A service component for collecting and validating beneficiary data in FOD service requests. Supports manual entry for natural persons and legal entities, as well as MPower digital authorization.

Interactive Demo

Try the component with different configuration options. Toggle the checkboxes to see how the component adapts to various settings.

Component

13 digits0/13

Configuration

Current Data

Real-time view of the beneficiary data model as you interact with the component.

Type: Other
EntityType: NaturalPerson
HasData: False

NaturalPerson:
  IDNP: (empty)
  Surname: (empty)
  FirstName: (empty)
  Phone: (empty)
  Email: (empty)

Validation:
  IsValid: True
  Errors: 0

Event Log

Monitor events emitted by the component during interaction.

No events yet. Interact with the component above.

Basic Usage

Minimal setup for the beneficiary component with two-way binding.

razor
<FodBeneficiaryComponent
    @bind-Value="beneficiaryData"
    ShowBeneficiaryTypeSelector="true" />

@code {
    private FodBeneficiaryData beneficiaryData = new();
}

With Required Fields

Configure phone and email as required fields for validation.

razor
<FodBeneficiaryComponent
    @bind-Value="beneficiaryData"
    PhoneRequired="true"
    EmailRequired="true"
    OnValidationComplete="HandleValidation" />

@code {
    private FodBeneficiaryData beneficiaryData = new();

    private void HandleValidation(BeneficiaryValidationResult result)
    {
        if (!result.IsValid)
        {
            foreach (var error in result.Errors)
            {
                Console.WriteLine($"Validation error: {error.ErrorMessage}");
            }
        }
    }
}

MPower Integration

Enable MPower digital authorization with proper context configuration.

razor
<FodBeneficiaryComponent
    @bind-Value="beneficiaryData"
    AllowMPower="true"
    RequestorContext="requestorContext"
    ServiceType="documents"
    OnMPowerAuthorized="HandleMPowerAuthorized"
    OnPowerOfAttorneyRequired="HandlePoaRequired" />

@code {
    private FodBeneficiaryData beneficiaryData = new();

    private RequestorContext requestorContext = new()
    {
        RequestorIdnp = "1234567890123",
        IsAuthenticated = true,
        RequestorType = RequestorType.Person,
        RequestorName = "John Doe"
    };

    private void HandleMPowerAuthorized(MPowerData data)
    {
        Console.WriteLine($"MPower authorized: {data.BeneficiaryIdnp}");
    }

    private void HandlePoaRequired(bool required)
    {
        // Configure FodAttachments step based on this value
        Console.WriteLine($"Power of Attorney required: {required}");
    }
}

Event Handling

Handle various events to react to user interactions and validation results.

csharp
<FodBeneficiaryComponent
    @bind-Value="beneficiaryData"
    OnBeneficiaryChanged="HandleBeneficiaryChanged"
    OnBeneficiaryTypeChanged="HandleTypeChanged"
    OnBeneficiaryEntityTypeChanged="HandleEntityTypeChanged"
    OnValidationComplete="HandleValidationComplete" />

@code {
    private void HandleBeneficiaryChanged(FodBeneficiaryData data)
    {
        Console.WriteLine("Beneficiary data changed");
    }

    private void HandleTypeChanged(BeneficiaryType type)
    {
        Console.WriteLine($"Type changed to: {type}");
    }

    private void HandleEntityTypeChanged(BeneficiaryEntityType entityType)
    {
        Console.WriteLine($"Entity type changed to: {entityType}");
    }

    private void HandleValidationComplete(BeneficiaryValidationResult result)
    {
        Console.WriteLine($"Validation: {(result.IsValid ? "Valid" : "Invalid")}");
    }
}

API Reference - FodBeneficiary

Properties and events available on the FodBeneficiaryComponent.

No properties defined.

API Reference - FodBeneficiary Data

The data model representing beneficiary information.

No properties defined.

API Reference - RequestorContext

Context information about the person making the request (required for MPower).

No properties defined.

Rejoining the server...

Rejoin failed... trying again in seconds.

Failed to rejoin.
Please retry or reload the page.

The session has been paused by the server.

Failed to resume the session.
Please reload the page.