Skip to content

Add conditional merchant and terminal number fields with validation for operator assignment#551

Merged
StuartFerguson merged 2 commits into
mainfrom
copilot/add-merchant-operator-validation
Jan 7, 2026
Merged

Add conditional merchant and terminal number fields with validation for operator assignment#551
StuartFerguson merged 2 commits into
mainfrom
copilot/add-merchant-operator-validation

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jan 7, 2026

Merchant Operator Management - Custom Merchant/Terminal Numbers

Implements conditional merchant number and terminal number input fields when adding operators to merchants in the Blazor Server application. Fields are displayed dynamically based on operator requirements and include validation to ensure proper data entry.

Changes Completed

  1. EstateManagementUI.BlazorServer/Requests/Requests.cs - Updated AddOperatorToMerchantCommand to include optional MerchantNumber and TerminalNumber parameters

  2. EstateManagementUI.BlazorServer/Components/Pages/Merchants/Edit.razor - Added:

    • Conditional input fields for Merchant Number and Terminal Number that appear only when the selected operator's RequireCustomMerchantNumber or RequireCustomTerminalNumber flags are true
    • OnOperatorSelected callback method that dynamically shows/hides fields based on operator selection
    • ValidateOperatorFields method that ensures:
      • Required fields are not empty when operator flags indicate they should be
      • Values contain only numeric characters (using regex pattern ^\d+$)
    • Inline error messages displayed in red below each field when validation fails
    • Updated AddOperatorToMerchant method to validate fields before submission and pass values to the command

Implementation Details

  • When an operator is selected from the dropdown, the system checks the operator's RequireCustomMerchantNumber and RequireCustomTerminalNumber flags
  • If either flag is true, the corresponding input field appears with a red asterisk indicating it's required
  • Before adding the operator to the merchant, validation ensures required fields contain only numeric values
  • The merchant number and terminal number are passed to the AddOperatorToMerchantCommand for processing

Original Issue

When adding operators to a merchant in the merchant management, the addition needs to account for the required custom merchant number/terminal number flags. If any of these are true against the operator, an edit box to provide these must be available and the field becomes required. The value for either merchant number or terminal number must be numeric.

Original prompt

This section details on the original issue you should resolve

<issue_title>Merchant Operator Management</issue_title>
<issue_description>When adding operators to a merchant in the merchant management, the addition needs to account for the required custom merchant number/terminal number flags.

If any of these are true against the operator a edit box to provide these must be available and also the field then becomes required.

The value for either merchant number or terminal number must be numeric.</issue_description>

<agent_instructions>this change must only be made in the blazor server app</agent_instructions>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

@StuartFerguson
Copy link
Copy Markdown
Member

@copilot meant to say dont worry about any testing atm

…perator assignment

Co-authored-by: StuartFerguson <16325469+StuartFerguson@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Jan 7, 2026

@copilot meant to say dont worry about any testing atm

Understood! I've completed the implementation without running tests.

Changes made in commit 19b44d7:

  • Updated AddOperatorToMerchantCommand to accept optional MerchantNumber and TerminalNumber parameters
  • Added conditional UI fields that appear only when operator requires custom merchant/terminal numbers
  • Implemented validation ensuring required fields are filled and contain only numeric values
  • Added error messaging for validation failures

The merchant operator assignment now properly accounts for the RequireCustomMerchantNumber and RequireCustomTerminalNumber flags as requested.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • f.feedz.io
    • Triggering command: /usr/bin/dotnet dotnet build EstateManagementUI.BlazorServer/EstateManagementUI.BlazorServer.csproj (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title [WIP] Add validation for merchant and terminal number on operator addition Add conditional merchant and terminal number fields with validation for operator assignment Jan 7, 2026
@StuartFerguson StuartFerguson marked this pull request as ready for review January 7, 2026 14:46
@StuartFerguson StuartFerguson merged commit 770a2bb into main Jan 7, 2026
5 checks passed
@github-actions github-actions Bot deleted the copilot/add-merchant-operator-validation branch March 9, 2026 01:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Merchant Operator Management

2 participants