ynab-splitwise-connect / ynab_splitwise_connect / transaction.py
transaction.py
Raw
class Transaction:
    def __init__(self, origin, description, cost, date, creditor_id, debtor_id, debt, credit, deleted_sw, debtor_name=None, creditor_name=None, sw_id=None, ynab_id=None):
        self.origin = origin
        self.description = description
        self.cost = cost
        self.date = date
        self.creditor_sw_id = creditor_id
        self.debtor_sw_id = debtor_id
        self.debt = debt
        self.credit = credit
        self.deleted_sw = deleted_sw
        if debtor_name:
            self.debtor = debtor_name
        if creditor_name:
            self.creditor = creditor_name
        if sw_id:
            self.sw_id = sw_id
        if ynab_id:
            self.ynab_id = ynab_id


    def set_debtor_and_creditor(self, debtor_name, creditor_name):
        self.debtor = debtor_name
        self.creditor = creditor_name