yavsc/src/Yavsc.Server/Models/Messaging/EstimationEvent.cs
Paul Schneider 6b4e52e7ce
All checks were successful
Dotnet build and test / build (pull_request) Successful in 8m54s
refactoring the command
2026-09-04 14:53:00 +01:00

53 lines
1.5 KiB
C#

using Microsoft.Extensions.Localization;
namespace Yavsc.Models.Messaging
{
using Interfaces.Workflow;
using Billing;
using Yavsc.Helpers;
using Yavsc.Models.Workflow;
public class EstimationEvent: IEvent
{
public EstimationEvent( Estimate estimate, IStringLocalizer SR)
{
Topic = "Estimation";
Estimation = estimate;
performer = estimate.Owner;
ProviderInfo = new ProviderClientInfo {
Rate = performer.Rate,
UserName = performer.Performer.UserName,
Avatar = performer.Performer.Avatar,
UserId = performer.PerformerId
};
Sender = performer.Performer.UserName;
_localizer = SR;
}
// TODO via e-mail only: Message = string.Format(
// SR["EstimationMessageToClient"],perfer.Performer.UserName, estimate.Title,estimate.Bill.Addition());
ProviderClientInfo ProviderInfo { get; set; }
Estimate Estimation { get; set; }
private readonly PerformerProfile performer;
public string Topic
{
get; set;
}
public string Sender
{
get; set;
}
private IStringLocalizer _localizer;
public string CreateBody()
{
return string.Format(_localizer["EstimationMessageToClient"], performer.Performer.UserName, this.Estimation.Bill.Addition());
}
}
}