public RecurringExpenseValidator(IRecurringExpenseRepository recurringExpenseRepository, ICreditCardRepository creditCardRepository)
 {
     _recurringExpenseRepository = recurringExpenseRepository;
     _creditCardRepository       = creditCardRepository;
     RuleFor(p => p.Description).NotEmpty().WithMessage(ValidatorMessages.FieldIsRequired("Descrição"));
     RuleFor(s => s.Value).GreaterThan(0).WithMessage(ValidatorMessages.GreaterThan("Valor", 0));
     RuleFor(p => p).Must(ValidCreditCard).WithMessage(ValidatorMessages.NotFound("Cartão de Crédito"));
     RuleFor(p => p).Must(ValidRecurringExpense).When(p => p.Id > 0).WithMessage(ValidatorMessages.NotFound("Despesa Recorrente"));
 }
 public RecurringExpenseHistoryValidator(IRecurringExpenseRepository recurringExpenseRepository, int userId)
 {
     _recurringExpenseRepository = recurringExpenseRepository;
     _userId = userId;
     RuleFor(p => p.Date).NotEqual(default(System.DateTime)).WithMessage(ValidatorMessages.FieldIsRequired("Data"));
     RuleFor(s => s.PaidValue).GreaterThan(0).WithMessage(ValidatorMessages.FieldIsRequired("Valor Pago"));
     RuleFor(p => p).Must(ValidMonthYear).WithMessage("Já existe um histórico para este mês ano.");
     RuleFor(p => p).Must(ValidRecurringExpense).WithMessage(ValidatorMessages.NotFound("Despesa Recorrente"));
     RuleFor(p => p).Must(ValidRecurringExpense).When(p => p.Id > 0).WithMessage(ValidatorMessages.NotFound("Despesa Recorrente"));
 }
Esempio n. 3
0
 public RemainingBalanceService(IRemainingBalanceRepository remainingBalanceRepository,
                                IHouseholdExpenseRepository householdExpenseRepository,
                                IVehicleRepository vehicleRepository,
                                IPaymentRepository paymentRepository,
                                IEarningRepository earningRepository,
                                IRecurringExpenseRepository recurringExpenseRepository)
 {
     _remainingBalanceRepository = remainingBalanceRepository;
     _vehicleRepository          = vehicleRepository;
     _householdExpenseRepository = householdExpenseRepository;
     _paymentRepository          = paymentRepository;
     _earningRepository          = earningRepository;
     _recurringExpenseRepository = recurringExpenseRepository;
 }
Esempio n. 4
0
 public ProjectionService(IPaymentRepository paymentRepository,
                          ICreditCardRepository creditCardRepository,
                          IEarningRepository earningRepository,
                          IHouseholdExpenseRepository householdExpenseRepository,
                          IVehicleRepository vehicleRepository,
                          IRemainingBalanceRepository remainingBalanceRepository,
                          IRecurringExpenseRepository recurringExpenseRepository
                          )
 {
     _paymentRepository          = paymentRepository;
     _creditCardRepository       = creditCardRepository;
     _earningRepository          = earningRepository;
     _householdExpenseRepository = householdExpenseRepository;
     _vehicleRepository          = vehicleRepository;
     _remainingBalanceRepository = remainingBalanceRepository;
     _recurringExpenseRepository = recurringExpenseRepository;
 }
Esempio n. 5
0
 public RecurringExpenseService(IRecurringExpenseRepository recurringExpenseRepository, ICreditCardRepository creditCardRepository)
 {
     _recurringExpenseRepository = recurringExpenseRepository;
     _creditCardRepository       = creditCardRepository;
 }