Example #1
0
def read_bill_payments(page=1):
    isOk, err = _check_params(False)
    if not isOk:
        return err

    query = BillPayment.query.filter(BillPayment.billId == g.billId).order_by(
        desc(BillPayment.timestamp))
    return api.paginate(query, map_payment_dict, page)
Example #2
0
def read_cycles(page=1):
    isOk, err = _check_params()
    if not isOk:
        return err

    def billCycleMap(billCycle):
        return billCycle.get_api_dict()

    query = BillingCycle.query.filter(
        BillingCycle.billId == g.billId).order_by(desc(BillingCycle.startDate))
    return api.paginate(query, billCycleMap, page)
Example #3
0
def get_sent_invitations(page=1):
    query = HouseholdInvitation.query.filter(HouseholdInvitation.householdId == g.user.householdId)
    return api.paginate(query, map_invitation, page)
Example #4
0
def read_bills(page=1):
    def billMap(bill): return bill.get_api_dict()
    return api.paginate(Bill.query.filter(Bill.householdId == g.user.householdId).order_by(desc(Bill.date)), billMap, page)
Example #5
0
def get_my_invitations(page=1):
    query = HouseholdInvitation.query.filter(HouseholdInvitation.toUserId == g.user.id)
    return api.paginate(query, map_invitation, page)