public OperationDto(SpendingAdded @event)
 {
     OperationId = @event.OperationId.Value;
     Label       = @event.Label.Value;
     Amount      = @event.Amount.Value;
     Pair        = @event.Pair.Value;
     Category    = @event.Category.Value;
     IsSpending  = true;
 }
Exemple #2
0
 public PeriodOperation(SpendingAdded @event, string pairName)
 {
     Type          = "Dépense";
     PeriodId      = @event.AggregateId;
     OperationId   = @event.OperationId.Value;
     Pair          = pairName;
     PairValue     = @event.Pair.Value;
     Amount        = @event.Amount.Value;
     Label         = @event.Label.Value;
     Category      = @event.Category.ToString();
     CategoryValue = @event.Category.Value;
 }
Exemple #3
0
 internal void Handle(SpendingAdded @event)
 {
     _periodOperations.Process(@event);
     UpdateOperationIdIfGreater(@event);
 }
 internal void Process(SpendingAdded @event) => _allOperations.Add(@event.OperationId.Value, new OperationDto(@event));
 public Task Handle(SpendingAdded @event, CancellationToken cancellationToken)
 {
     return(AddOperation(new PeriodOperation(@event, @event.Pair.GetUserName(_userProvider))));
 }