contactAllWages method

num contactAllWages(
  1. int contactId, {
  2. DateTime? end,
})

Implementation

num contactAllWages(int contactId, {DateTime? end}) => where((t) => t.status)
    .where((t) => t.contactId == contactId)
    .where((t) => t.date.isBefore(end ?? DateTime.now()))
    .where((t) => t.ticketType == TicketType.wage)
    .fold(0, (prev, e) => prev + e.received);