9cff87fe85
Remove project bookkeeping citations from shipped code comments across the solution: hyphenated task IDs (WP-14, StoreAndForward-025), milestone/task/ issue refs (M3, Task 4, Audit Log #23, #21), Bundle X task-bundle labels, and C/D/K/S/T phase labels. Comment text only — no code logic, string/log literals, or XML-doc structure changed. Genuine descriptions are preserved (only the citation is stripped), and technical lookalikes are retained (UTF-8, SHA-256, T00:00:00, M365, UTC-5, pre-C4/pre-C5 schema versions). Flagged by the new CommentChecker TaskReferenceInComment / TrackingReferenceInComment checks plus targeted grep passes; full solution builds clean, append-only guard tests pass.
56 lines
3.0 KiB
C#
56 lines
3.0 KiB
C#
namespace ZB.MOM.WW.ScadaBridge.CentralUI.Services;
|
|
|
|
/// <summary>
|
|
/// Outcome of a single move-data-connection command dispatch. Wraps either success
|
|
/// or a human-readable guard error, so the move dialog can render an inline result
|
|
/// rather than reasoning about transport exceptions or the three management response
|
|
/// shapes.
|
|
/// </summary>
|
|
/// <param name="Success">Whether the move succeeded.</param>
|
|
/// <param name="Error">A human-readable error message when <paramref name="Success"/> is <c>false</c>; otherwise <c>null</c>.</param>
|
|
public record DataConnectionMoveResult(bool Success, string? Error)
|
|
{
|
|
/// <summary>Creates a successful result.</summary>
|
|
/// <returns>A successful <see cref="DataConnectionMoveResult"/>.</returns>
|
|
public static DataConnectionMoveResult Ok() => new(true, null);
|
|
|
|
/// <summary>Creates a failed result carrying <paramref name="error"/>.</summary>
|
|
/// <param name="error">The human-readable failure (typically a server guard message).</param>
|
|
/// <returns>A failed <see cref="DataConnectionMoveResult"/>.</returns>
|
|
public static DataConnectionMoveResult Fail(string error) => new(false, error);
|
|
}
|
|
|
|
/// <summary>
|
|
/// CentralUI facade over the move-data-connection management command. It
|
|
/// dispatches the strongly-typed <c>MoveDataConnectionCommand</c> to the central
|
|
/// <c>ManagementActor</c> through the in-process <c>ManagementActorHolder</c> seam —
|
|
/// the SAME Ask path the HTTP <c>/management</c> endpoint uses — so the server remains
|
|
/// the single enforcer of the Designer role gate and every move guard (target site
|
|
/// exists, no name collision at the target, no instance binding references it, no
|
|
/// name-based native-alarm-source references). The UI re-implements none of that: a
|
|
/// move is a command submitted to the server, and any guard failure comes back as a
|
|
/// classified error.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// The current Blazor principal is projected to an <c>AuthenticatedUser</c> so the
|
|
/// server's role gate runs against the real identity. <c>ManagementUnauthorized</c> /
|
|
/// <c>ManagementError</c> / transport faults collapse into a typed
|
|
/// <see cref="DataConnectionMoveResult"/> so the caller renders an inline outcome
|
|
/// rather than throwing. Mirrors <c>ISecuredWriteService</c>.
|
|
/// </remarks>
|
|
public interface IDataConnectionMoveService
|
|
{
|
|
/// <summary>
|
|
/// Moves the connection identified by <paramref name="connectionId"/> to
|
|
/// <paramref name="targetSiteId"/> via the guard-running ManagementActor.
|
|
/// </summary>
|
|
/// <param name="connectionId">Primary key of the connection to move.</param>
|
|
/// <param name="targetSiteId">Primary key of the destination site.</param>
|
|
/// <param name="cancellationToken">Cancellation token.</param>
|
|
/// <returns>A task that resolves to a <see cref="DataConnectionMoveResult"/> — success, or a classified guard / transport failure.</returns>
|
|
Task<DataConnectionMoveResult> MoveAsync(
|
|
int connectionId,
|
|
int targetSiteId,
|
|
CancellationToken cancellationToken = default);
|
|
}
|