class INTERXFERMSGSRSV1(List): """ OFX section 11.13.1.3.2 """ intertrnrs = ListItem(INTERTRNRS) recintertrnrs = ListItem(RECINTERTRNRS) intersyncrs = ListItem(INTERSYNCRS) recintersyncrs = ListItem(RECINTERSYNCRS)
class INVPOSLIST(List): """ OFX section 13.9.2.2 """ posdebt = ListItem(POSDEBT) posmf = ListItem(POSMF) posopt = ListItem(POSOPT) posother = ListItem(POSOTHER) posstock = ListItem(POSSTOCK)
class SECLIST(List): """ OFX section 13.8.4.4 """ debtinfo = ListItem(DEBTINFO) mfinfo = ListItem(MFINFO) optinfo = ListItem(OPTINFO) otherinfo = ListItem(OTHERINFO) stockinfo = ListItem(STOCKINFO)
class CREDITCARDMSGSRSV1(List): """ OFX section 11.13.1.1.2 """ ccstmttrnrs = ListItem(CCSTMTTRNRS) ccstmtendtrnrs = ListItem(CCSTMTTRNRS) @property def statements(self): return [trnrs.statement for trnrs in self]
class BANKMSGSRQV1(List): """ OFX section 11.13.1.1.1 """ stmttrnrq = ListItem(STMTTRNRQ) stmtendtrnrq = ListItem(STMTENDTRNRQ) stpchktrnrq = ListItem(STPCHKTRNRQ) intratrnrq = ListItem(INTRATRNRQ) recintratrnrq = ListItem(RECINTRATRNRQ) bankmailtrnrq = ListItem(BANKMAILTRNRQ) stpchksyncrq = ListItem(STPCHKSYNCRQ) intrasyncrq = ListItem(INTRASYNCRQ) recintrasyncrq = ListItem(RECINTRASYNCRQ) bankmailsyncrq = ListItem(BANKMAILSYNCRQ)
class INVMAILSYNCRQ(SyncRqList): """ OFX Section 13.10.2.1 """ incimages = Bool(required=True) usehtml = Bool(required=True) invacctfrom = SubAggregate(INVACCTFROM) invmailtrnrq = ListItem(INVMAILTRNRQ)
class INVSTMTMSGSRSV1(List): """ OFX section 13.7.1.2.2 """ invstmttrnrs = ListItem(INVSTMTTRNRS) invmailtrnrs = ListItem(INVMAILTRNRS) invmailsyncrs = ListItem(INVMAILSYNCRS) @property def statements(self): stmts = [] for rs in self: if isinstance(rs, INVSTMTTRNRS): stmtrs = rs.invstmtrs if stmtrs is not None: stmts.append(stmtrs) return stmts
class RECINTRASYNCRS(SyncRsList): """ OFX section 11.12.5.2 """ bankacctfrom = SubAggregate(BANKACCTFROM) ccacctfrom = SubAggregate(CCACCTFROM) recintratrnrs = ListItem(RECINTRATRNRS) requiredMutexes = [("bankacctfrom", "ccacctfrom")]
class BANKMAILSYNCRS(SyncRsList): """ OFX section 11.12.7.2 """ bankacctfrom = SubAggregate(BANKACCTFROM) ccacctfrom = SubAggregate(CCACCTFROM) bankmailtrnrs = ListItem(BANKMAILTRNRS) requiredMutexes = [("bankacctfrom", "ccacctfrom")]
class INTERSYNCRS(SyncRsList): """ OFX section 11.12.3.2 """ bankacctfrom = SubAggregate(BANKACCTFROM) ccacctfrom = SubAggregate(CCACCTFROM) intertrnrs = ListItem(INTERTRNRS) requiredMutexes = [("bankacctfrom", "ccacctfrom")]
class SECLISTMSGSRSV1(List): """ OFX section 13.7.2.2.2 """ # N.B. this part of the spec is unusual in that SECLIST is a direct # child of SECLISTMSGSRSV1, unwrapped. SECLISTRS, wrapped in SECLISTTRNS, # is an empty aggregate; including SECLISTTRNRS/SECLISTRS under # SECLISTMSGSTSV1 merely indicates that the accompanying SECLIST was # generated in response to a client SECLISTRQ. seclisttrnrs = ListItem(SECLISTTRNRS) seclist = ListItem(SECLIST) @property def securities(self): securities = [] for child in self: if isinstance(child, SECLIST): securities.extend(child) return securities
class INVOICE(List): """ OFX Section 12.5.2.3 """ invno = String(32, required=True) invtotalamt = Decimal(required=True) invpaidamt = Decimal(required=True) invdate = DateTime(required=True) invdesc = String(80, required=True) discount = SubAggregate(DISCOUNT) adjustment = SubAggregate(ADJUSTMENT) lineitem = ListItem(LINEITEM)
class INTERSYNCRQ(SyncRqList): """ OFX section 11.12.3.1 """ bankacctfrom = SubAggregate(BANKACCTFROM) ccacctfrom = SubAggregate(CCACCTFROM) intertrnrq = ListItem(INTERTRNRQ) requiredMutexes = SyncRqList.requiredMutexes + [ ("bankacctfrom", "ccacctfrom") ]
class RECINTRASYNCRQ(SyncRqList): """ OFX section 11.12.5.1 """ bankacctfrom = SubAggregate(BANKACCTFROM) ccacctfrom = SubAggregate(CCACCTFROM) recintratrnrq = ListItem(RECINTRATRNRQ) requiredMutexes = SyncRqList.requiredMutexes + [ ("bankacctfrom", "ccacctfrom") ]
class BANKMAILSYNCRQ(SyncRqList): """ OFX section 11.12.7.1 """ incimages = Bool(required=True) usehtml = Bool(required=True) bankacctfrom = SubAggregate(BANKACCTFROM) ccacctfrom = SubAggregate(CCACCTFROM) bankmailtrnrq = ListItem(BANKMAILTRNRQ) requiredMutexes = SyncRqList.requiredMutexes + [ ("bankacctfrom", "ccacctfrom") ]
class BANKMSGSRSV1(List): """ OFX section 11.13.1.1.2 """ stmttrnrs = ListItem(STMTTRNRS) stmtendtrnrs = ListItem(STMTENDTRNRS) stpchktrnrs = ListItem(STPCHKTRNRS) intratrnrs = ListItem(INTRATRNRS) recintratrnrs = ListItem(RECINTRATRNRS) bankmailtrnrs = ListItem(BANKMAILTRNRS) stpchksyncrs = ListItem(STPCHKSYNCRS) intrasyncrs = ListItem(INTRASYNCRS) recintrasyncrs = ListItem(RECINTRASYNCRS) bankmailsyncrs = ListItem(BANKMAILSYNCRS) @property def statements(self): stmts = [] for rs in self: if isinstance(rs, STMTTRNRS): stmtrs = rs.stmtrs if stmtrs is not None: stmts.append(stmtrs) return stmts
class EXTDPMT(List): """ OFX Section 12.5.2.2 """ extdpmtfor = OneOf("INDIVIDUAL", "BUSINESS") extdpmtchk = Integer(10) extdpmtdsc = String(255) extdpmtinv = ListItem(EXTDPMTINV) @classmethod def validate_args(cls, *args, **kwargs): # "At least one of the following: <EXTDPMTDSC>, or <EXTDPMTINV>" listitems = [arg.__class__.__name__ for arg in args] if "EXTDPMTINV" not in listitems and "extdpmtdsc" not in kwargs: msg = "{} must contain at least one of [EXTDPMTDSC, EXTPMTINV]" raise ValueError(msg.format(cls.__name__)) super().validate_args(*args, **kwargs)
class PMTINFO(List): """ OFX Section 12.5.2 """ bankacctfrom = SubAggregate(BANKACCTFROM, required=True) trnamt = Decimal(required=True) payeeid = String(12) payee = SubAggregate(PAYEE) payeelstid = String(12) bankacctto = SubAggregate(BANKACCTTO) extdpmt = ListItem(EXTDPMT) payacct = String(32, required=True) dtdue = DateTime(required=True) memo = String(255) billrefinfo = String(80) billpubinfo = SubAggregate(BILLPUBINFO) requiredMutexes = [("payeeid", "payee")]
class BILLPAYMSGSRSV1(List): """ OFX section 12.11.1.2 """ pmttrnrs = ListItem(PMTTRNRS) recpmttrnrs = ListItem(RECPMTTRNRS) # payeetrnrs = ListItem(PAYEETRNRS) payeetrnrs = Unsupported() pmtinqtrnrs = ListItem(PMTINQTRNRS) pmtmailtrns = ListItem(PMTMAILTRNRS) pmtsyncrs = ListItem(PMTSYNCRS) recpmtsyncrs = ListItem(RECPMTSYNCRS)
class BILLPAYMSGSRQV1(List): """ OFX section 12.11.1.1 """ pmttrnrq = ListItem(PMTTRNRQ) recpmttrnrq = ListItem(RECPMTTRNRQ) # payeetrnrq = ListItem(PAYEETRNRQ) payeetrnrq = Unsupported() pmtinqtrnrq = ListItem(PMTINQTRNRQ) pmtmailtrnrq = ListItem(PMTMAILTRNRQ) pmtsyncrq = ListItem(PMTSYNCRQ) recpmtsyncrq = ListItem(RECPMTSYNCRQ)
class BALLIST(List): """ OFX section 11.4.2.2 & 13.9.2.7 """ bal = ListItem(BAL)
class BANKTRANLIST(TranList): """ OFX section 11.4.2.2 """ stmttrn = ListItem(STMTTRN)
class INVMAILSYNCRS(SyncRsList): """ OFX Section 13.10.2.2 """ invacctfrom = SubAggregate(INVACCTFROM) invmailtrnrs = ListItem(INVMAILTRNRS)
class INVOOLIST(List): """ OFX section 13.9.2.2 """ oobuydebt = ListItem(OOBUYDEBT) oobuymf = ListItem(OOBUYMF) oobuyopt = ListItem(OOBUYOPT) oobuyother = ListItem(OOBUYOTHER) oobuystock = ListItem(OOBUYSTOCK) ooselldebt = ListItem(OOSELLDEBT) oosellmf = ListItem(OOSELLMF) oosellopt = ListItem(OOSELLOPT) oosellother = ListItem(OOSELLOTHER) oosellstock = ListItem(OOSELLSTOCK) switchmf = ListItem(SWITCHMF)
class WIRESYNCRQ(SyncRqList): """ OFX section 11.12.4.1 """ bankacctfrom = SubAggregate(BANKACCTFROM, required=True) wiretrnrq = ListItem(WIRETRNRQ)
class CREDITCARDMSGSRQV1(List): """ OFX section 11.13.1.1.1 """ ccstmttrnrq = ListItem(CCSTMTTRNRQ) ccstmtendtrnrq = ListItem(CCSTMTTRNRQ)
class INTERXFERMSGSRQV1(List): """ OFX section 11.13.1.3.1 """ intertrnrq = ListItem(INTERTRNRQ) recintertrnrq = ListItem(RECINTERTRNRQ) intersyncrq = ListItem(INTERSYNCRQ) recintersyncrq = ListItem(RECINTERSYNCRQ)
class STPCHKSYNCRS(SyncRsList): """ OFX section 11.12.1.2 """ bankacctfrom = SubAggregate(BANKACCTFROM, required=True) stpchktrnrs = ListItem(STPCHKTRNRS)
class WIREXFERMSGSRQV1(List): """ OFX section 11.13.1.4.1 """ wiretrnrq = ListItem(WIRETRNRQ) wiresyncrq = ListItem(WIRESYNCRQ)
class WIREXFERMSGSRSV1(List): """ OFX section 11.13.1.4.2 """ wiretrnrs = ListItem(WIRETRNRS) wiresyncrs = ListItem(WIRESYNCRS)