コード例 #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));
コード例 #5
0
 public Task Handle(SpendingAdded @event, CancellationToken cancellationToken)
 {
     return(AddOperation(new PeriodOperation(@event, @event.Pair.GetUserName(_userProvider))));
 }