namespace DigitalData.Core.Contracts.Application
{
///
/// Defines a basic structure for service messages, including a success flag and a collection of messages.
/// This interface is intended to be a base for more specific service result types, offering a way to communicate
/// operation outcomes (success or failure) along with relevant messages.
///
public interface IServiceMessage
{
///
/// Gets or sets a value indicating whether the service operation was successful.
///
bool IsSuccess { get; set; }
///
/// Gets or sets a collection of messages associated with the service operation. These messages can be error descriptions,
/// success notifications, or other relevant information related to the operation's outcome.
///
List Messages { get; set; }
///
/// Adds a new message to the collection of service messages.
///
/// The message to add.
/// The current instance of IServiceMessage, allowing for method chaining.
IServiceMessage WithMessage(string message);
///
/// Adds a message corresponding to the specified message key to the collection of service messages.
/// This method uses the string representation of the enum value as the message.
///
/// The enum value representing the message key.
/// The current instance of IServiceMessage, allowing for method chaining.
IServiceMessage WithMessageKey(Enum messageKey);
}
}