示例#1
0
 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;
 }
示例#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;
 }
示例#3
0
 internal void Handle(SpendingAdded @event)
 {
     _periodOperations.Process(@event);
     UpdateOperationIdIfGreater(@event);
 }
示例#4
0
 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))));
 }