Class CreatePhysicianCommand
Command that creates a new physician profile and associated authentication account. Validates license information, graduation date, and medical specializations.
public class CreatePhysicianCommand : AbstractCommand, ICommand
- Inheritance
-
CreatePhysicianCommand
- Implements
- Inherited Members
Constructors
CreatePhysicianCommand(IAuthenticationService, ProfileService)
Command that creates a new physician profile and associated authentication account. Validates license information, graduation date, and medical specializations.
public CreatePhysicianCommand(IAuthenticationService authService, ProfileService profileService)
Parameters
authServiceIAuthenticationServiceprofileServiceProfileService
Fields
Key
The unique key used to identify this command.
public const string Key = "createphysician"
Field Value
MEDSPECMAXCOUNT
Maximum number of medical specializations allowed per physician.
public static readonly int MEDSPECMAXCOUNT
Field Value
Properties
CanUndo
Whether this command can be undone - defaults to false
public override bool CanUndo { get; }
Property Value
CommandKey
Unique key identifier for this command type Generated from the class name, converted to lowercase without "Command" suffix E.g., "LoginCommand" becomes "login", "CreatePatientCommand" becomes "createpatient"
public override string CommandKey { get; }
Property Value
Description
Description of what this command does
public override string Description { get; }
Property Value
Methods
CaptureStateForUndo(CommandParameters, SessionContext?)
Captures state before execution for undo - override if undo is supported
protected override object? CaptureStateForUndo(CommandParameters parameters, SessionContext? session)
Parameters
parametersCommandParameterssessionSessionContext
Returns
ExecuteCore(CommandParameters, SessionContext?)
Executes the core command logic - must be implemented by derived classes
protected override CommandResult ExecuteCore(CommandParameters parameters, SessionContext? session)
Parameters
parametersCommandParameterssessionSessionContext
Returns
GetRequiredPermission()
Gets the required permission to execute this command
public override Permission? GetRequiredPermission()
Returns
UndoCore(object, SessionContext?)
Performs the undo operation - override if undo is supported
protected override CommandResult UndoCore(object previousState, SessionContext? session)
Parameters
previousStateobjectsessionSessionContext
Returns
ValidateParameters(CommandParameters)
Validates command parameters - override in derived classes
protected override CommandValidationResult ValidateParameters(CommandParameters parameters)
Parameters
parametersCommandParametersThe parameters to validate (never null, but may be empty)
Returns
- CommandValidationResult
Validation result indicating success or failure with error messages