herderAllWages method

num herderAllWages(
  1. int herderId, {
  2. DateTime? end,
})

Implementation

num herderAllWages(int herderId, {DateTime? end}) => where((t) => t.status)
    .where((t) => t.contactId == herderId)
    .where((t) => t.date.isBefore(end ?? DateTime.now()))
    .where((t) =>
        // * no time, take all the past wage into account
        // until we finally get closing
        t.ticketType == TicketType.wage)
    .fold(0.0, (prev, e) => prev + e.received);