Source code for q2_cores.XP2.queries.mock_responses

import base64
from dateutil import parser
from q2_cores import data_helpers as data


[docs] def mock_encoded_response(base64_response): response = ( b'<Passthru><ResponseContent HasExcepted="false"><Content>' + base64_response + b"</Content></ResponseContent></Passthru>" ) return data.normalize_xml_str(response)
[docs] def encode_response(response): return base64.b64encode( "".join([line.strip() for line in response.split("\n")]).encode("ascii") )
[docs] def mock_initial_search_response(): response = f"""<MembershipDetailResponse> <MemberId>{data.SOCIALSECURITY}</MemberId> <MemberName>{data.FULLNAME}</MemberName> <PrimaryIndividualId>{data.SOCIALSECURITY2}</PrimaryIndividualId> <MemberType>UNKNOWN MBR TYPE</MemberType> <Affiliation></Affiliation> <MemberSince>2011-05-11</MemberSince> <Miscellaneous1/> <Miscellaneous2/> <OriginalOpenBranch>RIVERHEAD BRANCH</OriginalOpenBranch> <WithholdingCode/> <ExpeditedFunds>69.00</ExpeditedFunds> <ExpeditedFundsDate>2018-08-20</ExpeditedFundsDate> <AccessLevel>1</AccessLevel> <StandardStatementCycle>1</StandardStatementCycle> <StandardStatementCode></StandardStatementCode> <StandardStatementMethod>Primary Address</StandardStatementMethod> <CATFeeCounter>0</CATFeeCounter> <CATFeeDate>0001-01-01</CATFeeDate> <CreditCardStatementCycle>7</CreditCardStatementCycle> <CreditCardStatementCode></CreditCardStatementCode> <CreditCardStatementMethod>Primary Address</CreditCardStatementMethod> <AccountCount>2</AccountCount> <AccountBalance>543.50</AccountBalance> <LoanCount>0</LoanCount> <LoanBalance>0</LoanBalance> <LoansDelinquentCount>0</LoansDelinquentCount> <LoansDelinquent>0</LoansDelinquent> <LoansWrittenOffCount>0</LoansWrittenOffCount> <LoansWrittenOff>0</LoansWrittenOff> <LoansInCollectionCount>0</LoansInCollectionCount> <LoansInCollection>0</LoansInCollection> <Account> <MemberId>{data.SOCIALSECURITY}</MemberId> <AccountId>1</AccountId> <Title>REGULAR SHARE SAVINGS</Title> <ProductClass>Regular Deposit</ProductClass> <ProductName>REGULAR SHARE SAVINGS</ProductName> <ProductId>204042</ProductId> <ProductDescription>REGULAR SHARE SAVINGS</ProductDescription> <ProductCategory>Deposit</ProductCategory> <AccountType>1</AccountType> <Balance>217.73</Balance> <AvailableBalance>212.73</AvailableBalance> <Status>Open</Status> <Ownership>Tax Owner</Ownership> <CurrentRate>0.000</CurrentRate> <LastDividendPaidAmount>0.01</LastDividendPaidAmount> <DividendsYTD>0.12</DividendsYTD> <DividendsPYTD>0.19</DividendsPYTD> <MaturityDate>0001-01-01</MaturityDate> <Deposits>0</Deposits> <RegDTransactionCount>1</RegDTransactionCount> <RegDLastTransactionDate>08/01/2018</RegDLastTransactionDate> </Account> <Account> <MemberId>{data.SOCIALSECURITY}</MemberId> <AccountId>2</AccountId> <Title>ADVANTAGE CHECKING</Title> <ProductClass>Share Draft</ProductClass> <ProductName>ADVANTAGE CHECKING</ProductName> <ProductId>204067</ProductId> <ProductDescription>ADVANTAGE CHECKING</ProductDescription> <ProductCategory>Deposit</ProductCategory> <AccountType>2</AccountType> <Balance>325.77</Balance> <AvailableBalance>325.77</AvailableBalance> <Status>Open</Status> <Ownership>Tax Owner</Ownership> <CurrentRate>0.000</CurrentRate> <LastDividendPaidAmount>0.00</LastDividendPaidAmount> <DividendsYTD>0.00</DividendsYTD> <DividendsPYTD>0.00</DividendsPYTD> <MaturityDate>0001-01-01</MaturityDate> <SDCNumber>175827</SDCNumber> <SDCNumbers> <SDCPrefix>1141</SDCPrefix> <FullSDC>11410017582700</FullSDC> <SDCSuffix>0</SDCSuffix> <Sdc>175827</Sdc> <Sequence>1</Sequence> <IsPrimary>true</IsPrimary> </SDCNumbers> </Account> <Password/> <PinLock>Unlock</PinLock> <BranchId>3</BranchId> <RelationshipPricingLevel>0</RelationshipPricingLevel> <RelationshipPricingLevelPermanent>No</RelationshipPricingLevelPermanent> <RelationshipPricingDescription/> <PreviousRelationshipPricingLevel>0</PreviousRelationshipPricingLevel> <LastRelationshipPricingLevelAnalysisDate>1/1/1900 12:00:00 AM</LastRelationshipPricingLevelAnalysisDate> <LastRelationshipPricingLevelChangeDate>1/1/1900 12:00:00 AM</LastRelationshipPricingLevelChangeDate> <InhibitActivity>No</InhibitActivity> <WrittenOffLoan>No</WrittenOffLoan> <LoanInCollection>No</LoanInCollection> <PurgeMembership>Yes</PurgeMembership> <Address> <AddressId>580550</AddressId> <Line1>{data.ADDRESS1}</Line1> <Line2/> <Line3/> <City>{data.CITY}</City> <State>{data.STATEABBRV}</State> <ZipCode>{data.ZIP}-{data.ZIPCODELAST4}</ZipCode> <Country>{data.COUNTRY[:2]}</Country> <CountyName/> <AddressType/> <IsPrimary>true</IsPrimary> <IsInternational>false</IsInternational> <AddressVerification>1106</AddressVerification> <Occupancy/> <StartDate>0001-01-01</StartDate> <EndDate>0001-01-01</EndDate> <LongAddress1/> <LongAddress2/> <UseAlternateAsOf>0001-01-01</UseAlternateAsOf> <RestorePrimaryAsOf>0001-01-01</RestorePrimaryAsOf> <AlternateType/> <Comments/> <Met2AddressIndicator/> <UspsVerified>false</UspsVerified> <IsHSA>false</IsHSA> </Address> </MembershipDetailResponse> """ encoded_response = encode_response(response) return mock_encoded_response(encoded_response)
[docs] def mock_initial_search_ssn_response(): response = f"""<IndividualLookupResponse> <IndividualLookupData> <IndividualId>{data.SOCIALSECURITY2}</IndividualId> <IndividualType>Individual</IndividualType> <Name>{data.FULLNAME}</Name> <MemberId>1629970</MemberId> <OwnershipType>Joint</OwnershipType> <TaxId>{data.SOCIALSECURITY}</TaxId> <Address1>{data.POSTALADDRESS1}</Address1> <Address2 /> <Address3>{data.ADDRESS1}, {data.CITY} {data.ZIP}-{data.ZIPCODELAST4}</Address3> <BirthDate>{parser.parse(data.DOB).strftime("%Y-%m-%d")}</BirthDate> <DriversLicense>{data.DRIVERSLICENSENUM}</DriversLicense> <Ident /> <Password /> <MothersMaidenName>GALVIN</MothersMaidenName> <CompanyName /> </IndividualLookupData> <IndividualLookupData> <IndividualId>{data.SOCIALSECURITY2}</IndividualId> <IndividualType>Individual</IndividualType> <Name>{data.FULLNAME}</Name> <MemberId>90185680</MemberId> <OwnershipType>Joint</OwnershipType> <TaxId>{data.SOCIALSECURITY}</TaxId> <Address1>{data.POSTALADDRESS1}</Address1> <Address2 /> <Address3>{data.ADDRESS1}, {data.CITY} {data.ZIP}-{data.ZIPCODELAST4}</Address3> <BirthDate>{parser.parse(data.DOB).strftime("%Y-%m-%d")}</BirthDate> <DriversLicense>{data.DRIVERSLICENSENUM}</DriversLicense> <Ident /> <Password /> <MothersMaidenName>{data.MOTHERSMAIDENNAME}</MothersMaidenName> <CompanyName /> </IndividualLookupData> <IndividualLookupData> <IndividualId>{data.SOCIALSECURITY2}</IndividualId> <IndividualType>Individual</IndividualType> <Name>{data.FULLNAME}</Name> <MemberId>1629970</MemberId> <OwnershipType>Co-Borrower</OwnershipType> <TaxId>{data.SOCIALSECURITY}</TaxId> <Address1>{data.POSTALADDRESS1}</Address1> <Address2 /> <Address3>{data.ADDRESS1}, {data.CITY} {data.ZIP}-{data.ZIPCODELAST4}</Address3> <BirthDate>{parser.parse(data.DOB).strftime("%Y-%m-%d")}</BirthDate> <DriversLicense>{data.DRIVERSLICENSENUM}</DriversLicense> <Ident /> <Password /> <MothersMaidenName>{data.MOTHERSMAIDENNAME}</MothersMaidenName> <CompanyName /> </IndividualLookupData> <TotalRecords>1</TotalRecords> </IndividualLookupResponse> """ encoded_response = encode_response(response) return mock_encoded_response(encoded_response)
[docs] def mock_bad_initial_search_ssn(): response = """ <IndividualLookupResponse> <ErrorMessage> <Message>00392 - Either no records exist or PageNumber is invalid</Message> </ErrorMessage> <TotalRecords>0</TotalRecords> </IndividualLookupResponse> """ encoded_response = encode_response(response) return mock_encoded_response(encoded_response)
[docs] def mock_demographic_response(): response = f"""<IndividualDetailsResponse> <IndividualDetail> <IndividualId>{data.SOCIALSECURITY2}</IndividualId> <IndividualType>Individual</IndividualType> <Title>{data.TITLE}</Title> <FirstName>{data.FIRSTNAME}</FirstName> <MiddleName>{data.MIDDLENAME}</MiddleName> <LastName>{data.LASTNAME}</LastName> <NameSuffix/> <TaxId>{data.SOCIALSECURITYWITHHYPHEN}</TaxId> <Gender>F</Gender> <BirthDate>{parser.parse(data.DOB).strftime("%Y-%m-%d")}</BirthDate> <MembershipDate>2011-05-11</MembershipDate> <DeathDate>0001-01-01</DeathDate> <Branch>3</Branch> <DriversLicense>{data.DRIVERSLICENSENUM}</DriversLicense> <DriversLicenseState>{data.DRIVERSLICENSESTATEABBREV}</DriversLicenseState> <Ident>PASSPORT</Ident> <Password/> <MothersMaidenName>{data.MOTHERSMAIDENNAME}</MothersMaidenName> <PreferredContact>No Preference</PreferredContact> <Affiliation>SUFFOLK CNTY (LIVES,WRKS,WRSHPS)</Affiliation> <OriginalAffiliation>SUFFOLK CNTY (LIVES,WRKS,WRSHPS)</OriginalAffiliation> <InplantAddress/> <MaritalStatus>Married</MaritalStatus> <IsUSCitizen>false</IsUSCitizen> <AccessLevel>1</AccessLevel> <LastContact>2016-12-10</LastContact> <PrimaryAddressId>580550</PrimaryAddressId> <GroundsPass/> <MilitaryId/> <IsEmployee>false</IsEmployee> <EmployeeNumber>0</EmployeeNumber> <CompanyName/> <EmployerName>Q2eBanking</EmployerName> <PassportNumber>123456789</PassportNumber> <VisaType/> <VisaExpiration>0001-01-01</VisaExpiration> <DependentCount>0</DependentCount> <EnrolledServices>Plastic Card,External Credit Card</EnrolledServices> <OtherName/> <PriorName/> <MonthlyIncome>0</MonthlyIncome> <EducationYears>0</EducationYears> <ApplicationCountLast90Days>0</ApplicationCountLast90Days> <ApplicationsDeclinedLast90Days>0</ApplicationsDeclinedLast90Days> <ApplicationsApprovedLast90Days>0</ApplicationsApprovedLast90Days> <ProfitabilityAmount>0.00</ProfitabilityAmount> <ProfitabilityCode>0</ProfitabilityCode> <Address> <AddressId>580550</AddressId> <Line1>{data.ADDRESS1}</Line1> <Line2></Line2> <Line3/> <City>{data.CITY}</City> <State>{data.STATEABBRV}</State> <ZipCode>{data.ZIP}-{data.ZIPCODELAST4}</ZipCode> <Country>{data.COUNTRY[:2]}</Country> <CountyName/> <AddressType>Home</AddressType> <IsPrimary>true</IsPrimary> <IsInternational>false</IsInternational> <AddressVerification>1106</AddressVerification> <Occupancy>None</Occupancy> <StartDate>0001-01-01</StartDate> <EndDate>0001-01-01</EndDate> <LongAddress1/> <LongAddress2/> <UseAlternateAsOf>0001-01-01</UseAlternateAsOf> <RestorePrimaryAsOf>0001-01-01</RestorePrimaryAsOf> <AlternateType/> <Comments/> <Met2AddressIndicator>Unavailable / Unknown</Met2AddressIndicator> <UspsVerified>true</UspsVerified> <IsHSA>false</IsHSA> </Address> <Email1>{data.EMAIL}</Email1> <Email2>additional{data.EMAIL}</Email2> <Phone> <PhoneKey> <IndividualId>195269</IndividualId> <PhoneType>Cellular</PhoneType> <Sequence>1</Sequence> </PhoneKey> <IsPrimaryForType>false</IsPrimaryForType> <IsInternational>false</IsInternational> <CountryCode></CountryCode> <AreaCode>{data.CELLAREACODE}</AreaCode> <PhoneNumber>{data.CELLEXCHANGE}-{data.CELLSUFFIX}</PhoneNumber> <Extension>0</Extension> <Comment></Comment> <MarkAsPrevious>false</MarkAsPrevious> <IsPrevious>false</IsPrevious> <IsConvergeIVR>false</IsConvergeIVR> </Phone> <Phone> <PhoneKey> <IndividualId>195269</IndividualId> <PhoneType>Home</PhoneType> <Sequence>1</Sequence> </PhoneKey> <IsPrimaryForType>true</IsPrimaryForType> <IsInternational>false</IsInternational> <CountryCode></CountryCode> <AreaCode>{data.PHONEAREACODE}</AreaCode> <PhoneNumber>{data.PHONEEXCHANGE}-{data.PHONESUFFIX}</PhoneNumber> <Extension>0</Extension> <Comment></Comment> <MarkAsPrevious>false</MarkAsPrevious> <IsPrevious>false</IsPrevious> <IsConvergeIVR>false</IsConvergeIVR> </Phone> <Account> <MemberId>{data.SOCIALSECURITY}</MemberId> <AccountId>1</AccountId> <Title>REGULAR SHARE SAVINGS</Title> <Balance>217.73</Balance> <AvailableBalance>212.73</AvailableBalance> <Status>Open</Status> <ProductClass>Regular Deposit</ProductClass> <ProductName>REGULAR SHARE SAVINGS</ProductName> <ProductId>204042</ProductId> <ProductDescription/> <ProductCategory>Deposit</ProductCategory> <AccountType>1</AccountType> <Ownership>Tax Owner</Ownership> <CurrentRate>0.000</CurrentRate> <LastDividendPaidAmount>0.01</LastDividendPaidAmount> <DividendsYTD>0.12</DividendsYTD> <DividendsPYTD>0.19</DividendsPYTD> <DividendMemoed>0</DividendMemoed> <MaturityDate>0001-01-01</MaturityDate> <RetirementPlanType>0</RetirementPlanType> <IsHSA>false</IsHSA> <MinimumDepositAmount>0.00</MinimumDepositAmount> <MinimumDepositAmountOpen>0.00</MinimumDepositAmountOpen> <MinimumWithdrawalAmount>0.00</MinimumWithdrawalAmount> <MinimumDraftAmount>0</MinimumDraftAmount> <RegDFlag>true</RegDFlag> <FeePlanWithdrawalDate>0001-01-01</FeePlanWithdrawalDate> <FeePlanWithdrawal>0</FeePlanWithdrawal> <WithholdingYTD>0.00</WithholdingYTD> <WithholdingPYTD>0.00</WithholdingPYTD> <StateWithholdingYTD>0.00</StateWithholdingYTD> <StateWithholdingPYTD>0.00</StateWithholdingPYTD> <PenaltyYTD>0</PenaltyYTD> <PenaltyPYTD>0</PenaltyPYTD> <CheckHoldAmount>0</CheckHoldAmount> <CheckHoldDate>0001-01-01</CheckHoldDate> <LoanPledgeAmount>0</LoanPledgeAmount> <CertificateMaturityDate>0001-01-01</CertificateMaturityDate> <CertificateRate>0</CertificateRate> <CertificateTerm>0</CertificateTerm> <TermType/> <IsClosed>0</IsClosed> <IsWrittenOff>0</IsWrittenOff> <Deposits>0</Deposits> <RegDTransactionCount>1</RegDTransactionCount> <RegDLastTransactionDate>08/01/2018</RegDLastTransactionDate> </Account> <Account> <MemberId>{data.SOCIALSECURITY}</MemberId> <AccountId>2</AccountId> <Title>ADVANTAGE CHECKING</Title> <Balance>325.77</Balance> <AvailableBalance>325.77</AvailableBalance> <Status>Open</Status> <ProductClass>Share Draft</ProductClass> <ProductName>ADVANTAGE CHECKING</ProductName> <ProductId>204067</ProductId> <ProductDescription/> <ProductCategory>Deposit</ProductCategory> <AccountType>2</AccountType> <Ownership>Tax Owner</Ownership> <CurrentRate>0.000</CurrentRate> <LastDividendPaidAmount>0.00</LastDividendPaidAmount> <DividendsYTD>0.00</DividendsYTD> <DividendsPYTD>0.00</DividendsPYTD> <DividendMemoed>0</DividendMemoed> <MaturityDate>0001-01-01</MaturityDate> <RetirementPlanType>0</RetirementPlanType> <IsHSA>false</IsHSA> <MinimumDepositAmount>0.00</MinimumDepositAmount> <MinimumDepositAmountOpen>0.00</MinimumDepositAmountOpen> <MinimumWithdrawalAmount>0.00</MinimumWithdrawalAmount> <MinimumDraftAmount>0</MinimumDraftAmount> <RegDFlag>false</RegDFlag> <FeePlanWithdrawalDate>0001-01-01</FeePlanWithdrawalDate> <FeePlanWithdrawal>0</FeePlanWithdrawal> <SDCNumber>175827</SDCNumber> <WithholdingYTD>0.00</WithholdingYTD> <WithholdingPYTD>0.00</WithholdingPYTD> <StateWithholdingYTD>0.00</StateWithholdingYTD> <StateWithholdingPYTD>0.00</StateWithholdingPYTD> <PenaltyYTD>0</PenaltyYTD> <PenaltyPYTD>0</PenaltyPYTD> <CheckHoldAmount>0</CheckHoldAmount> <CheckHoldDate>0001-01-01</CheckHoldDate> <LoanPledgeAmount>0</LoanPledgeAmount> <CertificateMaturityDate>0001-01-01</CertificateMaturityDate> <CertificateRate>0</CertificateRate> <CertificateTerm>0</CertificateTerm> <TermType/> <IsClosed>0</IsClosed> <IsWrittenOff>0</IsWrittenOff> <SDCNumbers> <SDCPrefix>1141</SDCPrefix> <FullSDC>11410017582700</FullSDC> <SDCSuffix>0</SDCSuffix> <Sdc>175827</Sdc> <Sequence>1</Sequence> <IsPrimary>true</IsPrimary> </SDCNumbers> </Account> <Account> <MemberId>{data.SOCIALSECURITY}</MemberId> <AccountId>1</AccountId> <Title>REGULAR SHARE SAVINGS</Title> <Balance>564.82</Balance> <AvailableBalance>3.82</AvailableBalance> <Status>Open</Status> <ProductClass>Regular Deposit</ProductClass> <ProductName>REGULAR SHARE SAVINGS</ProductName> <ProductId>204042</ProductId> <ProductDescription/> <ProductCategory>Deposit</ProductCategory> <AccountType>1</AccountType> <Ownership>Joint</Ownership> <CurrentRate>0.000</CurrentRate> <LastDividendPaidAmount>0.05</LastDividendPaidAmount> <DividendsYTD>0.49</DividendsYTD> <DividendsPYTD>0.70</DividendsPYTD> <DividendMemoed>0</DividendMemoed> <MaturityDate>0001-01-01</MaturityDate> <RetirementPlanType>0</RetirementPlanType> <IsHSA>false</IsHSA> <MinimumDepositAmount>0.00</MinimumDepositAmount> <MinimumDepositAmountOpen>0.00</MinimumDepositAmountOpen> <MinimumWithdrawalAmount>0.00</MinimumWithdrawalAmount> <MinimumDraftAmount>0</MinimumDraftAmount> <RegDFlag>true</RegDFlag> <FeePlanWithdrawalDate>0001-01-01</FeePlanWithdrawalDate> <FeePlanWithdrawal>0</FeePlanWithdrawal> <WithholdingYTD>0.00</WithholdingYTD> <WithholdingPYTD>0.00</WithholdingPYTD> <StateWithholdingYTD>0.00</StateWithholdingYTD> <StateWithholdingPYTD>0.00</StateWithholdingPYTD> <PenaltyYTD>0</PenaltyYTD> <PenaltyPYTD>0</PenaltyPYTD> <CheckHoldAmount>0</CheckHoldAmount> <CheckHoldDate>0001-01-01</CheckHoldDate> <LoanPledgeAmount>0</LoanPledgeAmount> <CertificateMaturityDate>0001-01-01</CertificateMaturityDate> <CertificateRate>0</CertificateRate> <CertificateTerm>0</CertificateTerm> <TermType/> <IsClosed>0</IsClosed> <IsWrittenOff>0</IsWrittenOff> <Deposits>0</Deposits> <RegDTransactionCount>0</RegDTransactionCount> </Account> <Account> <MemberId>{data.SOCIALSECURITY}</MemberId> <AccountId>2</AccountId> <Title>ADVANTAGE CHECKING</Title> <Balance>4190.16</Balance> <AvailableBalance>4190.16</AvailableBalance> <Status>Open</Status> <ProductClass>Share Draft</ProductClass> <ProductName>ADVANTAGE CHECKING</ProductName> <ProductId>204067</ProductId> <ProductDescription/> <ProductCategory>Deposit</ProductCategory> <AccountType>2</AccountType> <Ownership>Joint</Ownership> <CurrentRate>0.000</CurrentRate> <LastDividendPaidAmount>0.00</LastDividendPaidAmount> <DividendsYTD>0.00</DividendsYTD> <DividendsPYTD>0.00</DividendsPYTD> <DividendMemoed>0</DividendMemoed> <MaturityDate>0001-01-01</MaturityDate> <RetirementPlanType>0</RetirementPlanType> <IsHSA>false</IsHSA> <MinimumDepositAmount>0.00</MinimumDepositAmount> <MinimumDepositAmountOpen>0.00</MinimumDepositAmountOpen> <MinimumWithdrawalAmount>0.00</MinimumWithdrawalAmount> <MinimumDraftAmount>0</MinimumDraftAmount> <RegDFlag>false</RegDFlag> <FeePlanWithdrawalDate>0001-01-01</FeePlanWithdrawalDate> <FeePlanWithdrawal>0</FeePlanWithdrawal> <SDCNumber>90178265</SDCNumber> <WithholdingYTD>0.00</WithholdingYTD> <WithholdingPYTD>0.00</WithholdingPYTD> <StateWithholdingYTD>0.00</StateWithholdingYTD> <StateWithholdingPYTD>0.00</StateWithholdingPYTD> <PenaltyYTD>0</PenaltyYTD> <PenaltyPYTD>0</PenaltyPYTD> <CheckHoldAmount>0</CheckHoldAmount> <CheckHoldDate>0001-01-01</CheckHoldDate> <LoanPledgeAmount>0</LoanPledgeAmount> <CertificateMaturityDate>0001-01-01</CertificateMaturityDate> <CertificateRate>0</CertificateRate> <CertificateTerm>0</CertificateTerm> <TermType/> <IsClosed>0</IsClosed> <IsWrittenOff>0</IsWrittenOff> <SDCNumbers> <SDCPrefix>1141</SDCPrefix> <FullSDC>11419017826500</FullSDC> <SDCSuffix>0</SDCSuffix> <Sdc>90178265</Sdc> <Sequence>1</Sequence> <IsPrimary>true</IsPrimary> </SDCNumbers> </Account> <Membership> <MemberId>{data.SOCIALSECURITY}</MemberId> <Ownership>Primary</Ownership> <Inhibited>0</Inhibited> </Membership> <Membership> <MemberId>1782650</MemberId> <Ownership>Joint</Ownership> <Inhibited>0</Inhibited> </Membership> <CrossMember/> <Status>Active</Status> <Services>MTS</Services> <Services>Plastic Cards</Services> <Services>MTS</Services> <Services>Plastic Cards</Services> <Services>External Credit Cards</Services> <TinType>1</TinType> <LoyaltyLevelId>0</LoyaltyLevelId> <LoyaltyLevelExceptionCD>0</LoyaltyLevelExceptionCD> <RelationshipManager>0</RelationshipManager> <IsHomeOwner>false</IsHomeOwner> <IsHeadOfHouseHold>false</IsHeadOfHouseHold> <IsMTSUSer>false</IsMTSUSer> <IsHomeBankingUser>false</IsHomeBankingUser> <IsBillPayUser>false</IsBillPayUser> <HasDirectDeposit>false</HasDirectDeposit> <HasMarketingMailOptOut>false</HasMarketingMailOptOut> <IRAStatement>false</IRAStatement> <Insurance>false</Insurance> <Investment>false</Investment> <OtherInvIns>false</OtherInvIns> <IndividualIdentificationInfo> <IdentificationType/> <IdentificationCountry/> <IdentificationState/> </IndividualIdentificationInfo> <MilitaryIdCountry/> <PassportCountry/> <Occupation/> <PreviousFirstName/> <PreviousMiddleName/> <PreviousLastName/> <Dependents>0</Dependents> <Language/> <CustomData> <ItemName>$ Rescued</ItemName> <ItemValue/> <ValueListItemDescription/> <VerifyingOperatorId>0</VerifyingOperatorId> <VerifyTimestamp>0001-01-01T00:00:00</VerifyTimestamp> </CustomData> <CustomData> <ItemName>$$ Rescued</ItemName> <ItemValue/> <ValueListItemDescription/> <VerifyingOperatorId>0</VerifyingOperatorId> <VerifyTimestamp>0001-01-01T00:00:00</VerifyTimestamp> </CustomData> <CustomData> <ItemName>$$$ Rescued</ItemName> <ItemValue/> <ValueListItemDescription/> <VerifyingOperatorId>0</VerifyingOperatorId> <VerifyTimestamp>0001-01-01T00:00:00</VerifyTimestamp> </CustomData> <CustomData> <ItemName>CS App Mbr &amp; Chkg</ItemName> <ItemValue/> <ValueListItemDescription/> <VerifyingOperatorId>0</VerifyingOperatorId> <VerifyTimestamp>0001-01-01T00:00:00</VerifyTimestamp> </CustomData> <CustomData> <ItemName>ID - Teller Number</ItemName> <ItemValue/> <ValueListItemDescription/> <VerifyingOperatorId>0</VerifyingOperatorId> <VerifyTimestamp>0001-01-01T00:00:00</VerifyTimestamp> </CustomData> <CustomData> <ItemName>ID - Teller Number.</ItemName> <ItemValue/> <ValueListItemDescription/> <VerifyingOperatorId>0</VerifyingOperatorId> <VerifyTimestamp>0001-01-01T00:00:00</VerifyTimestamp> </CustomData> <CustomData> <ItemName>LL Plus</ItemName> <ItemValue/> <ValueListItemDescription/> <VerifyingOperatorId>0</VerifyingOperatorId> <VerifyTimestamp>0001-01-01T00:00:00</VerifyTimestamp> </CustomData> <CustomData> <ItemName>OXHearAboutUs</ItemName> <ItemValue/> <ValueListItemDescription/> <VerifyingOperatorId>0</VerifyingOperatorId> <VerifyTimestamp>0001-01-01T00:00:00</VerifyTimestamp> </CustomData> <CustomData> <ItemName>OXMobileUser</ItemName> <ItemValue/> <ValueListItemDescription/> <VerifyingOperatorId>0</VerifyingOperatorId> <VerifyTimestamp>0001-01-01T00:00:00</VerifyTimestamp> </CustomData> <CustomData> <ItemName>OXBankruptcy</ItemName> <ItemValue/> <ValueListItemDescription/> <VerifyingOperatorId>0</VerifyingOperatorId> <VerifyTimestamp>0001-01-01T00:00:00</VerifyTimestamp> </CustomData> <CustomData> <ItemName>OXFIA_AMEX</ItemName> <ItemValue/> <ValueListItemDescription/> <VerifyingOperatorId>0</VerifyingOperatorId> <VerifyTimestamp>0001-01-01T00:00:00</VerifyTimestamp> </CustomData> <CustomData> <ItemName>OXFIA_MC</ItemName> <ItemValue/> <ValueListItemDescription/> <VerifyingOperatorId>0</VerifyingOperatorId> <VerifyTimestamp>0001-01-01T00:00:00</VerifyTimestamp> </CustomData> <CustomData> <ItemName>OXFIA_VISA</ItemName> <ItemValue/> <ValueListItemDescription/> <VerifyingOperatorId>0</VerifyingOperatorId> <VerifyTimestamp>0001-01-01T00:00:00</VerifyTimestamp> </CustomData> <CustomData> <ItemName>OXSFCU_OFFICIALS</ItemName> <ItemValue/> <ValueListItemDescription/> <VerifyingOperatorId>0</VerifyingOperatorId> <VerifyTimestamp>0001-01-01T00:00:00</VerifyTimestamp> </CustomData> <CountryofResidenceCode/> <CountryofResidence/> <ProvinceCode/> <ProvinceDescription/> <W-8onFile>false</W-8onFile> <W-8Date>0001-01-01T00:00:00</W-8Date> <W-8Expires>0001-01-01T00:00:00</W-8Expires> <NonresidentRate>00.00</NonresidentRate> <ExemptionCode/> <Exemption/> <Year/> <BondInterestNonresidentWHcurrentyear>0.00</BondInterestNonresidentWHcurrentyear> <BondInterestNonresidentWHprioryear>0.00</BondInterestNonresidentWHprioryear> <BondInterestCurrentYear>0.00</BondInterestCurrentYear> <BondInterestPriorYear>0.00</BondInterestPriorYear> <ReportableBondInterestCurrentYear>0.00</ReportableBondInterestCurrentYear> <ReportableBondInterestPriorYear>0.00</ReportableBondInterestPriorYear> <IrsUSTinType/> <ForeignTaxId/> </IndividualDetail> </IndividualDetailsResponse> """ encoded_response = encode_response(response) return mock_encoded_response(encoded_response)
[docs] def mock_demographic_no_address(): response = f"""<IndividualDetailsResponse> <IndividualDetail> <IndividualId>{data.SOCIALSECURITY2}</IndividualId> <IndividualType>Individual</IndividualType> <Title>{data.TITLE}</Title> <FirstName>{data.FIRSTNAME}</FirstName> <MiddleName>{data.MIDDLENAME}</MiddleName> <LastName>{data.LASTNAME}</LastName> <NameSuffix/> <TaxId>{data.SOCIALSECURITYWITHHYPHEN}</TaxId> <Gender>F</Gender> <BirthDate>{parser.parse(data.DOB).strftime("%Y-%m-%d")}</BirthDate> <MembershipDate>2011-05-11</MembershipDate> <DeathDate>0001-01-01</DeathDate> <Branch>3</Branch> <DriversLicense>{data.DRIVERSLICENSENUM}</DriversLicense> <DriversLicenseState>{data.DRIVERSLICENSESTATEABBREV}</DriversLicenseState> <Ident>PASSPORT</Ident> <Password/> <MothersMaidenName>{data.MOTHERSMAIDENNAME}</MothersMaidenName> <PreferredContact>No Preference</PreferredContact> <Affiliation>SUFFOLK CNTY (LIVES,WRKS,WRSHPS)</Affiliation> <OriginalAffiliation>SUFFOLK CNTY (LIVES,WRKS,WRSHPS)</OriginalAffiliation> <InplantAddress/> <MaritalStatus>Married</MaritalStatus> <IsUSCitizen>false</IsUSCitizen> <AccessLevel>1</AccessLevel> <LastContact>2016-12-10</LastContact> <PrimaryAddressId>580550</PrimaryAddressId> <GroundsPass/> <MilitaryId/> <IsEmployee>false</IsEmployee> <EmployeeNumber>0</EmployeeNumber> <CompanyName/> <EmployerName>Q2eBanking</EmployerName> <PassportNumber>123456789</PassportNumber> <VisaType/> <VisaExpiration>0001-01-01</VisaExpiration> <DependentCount>0</DependentCount> <EnrolledServices>Plastic Card,External Credit Card</EnrolledServices> <OtherName/> <PriorName/> <MonthlyIncome>0</MonthlyIncome> <EducationYears>0</EducationYears> <ApplicationCountLast90Days>0</ApplicationCountLast90Days> <ApplicationsDeclinedLast90Days>0</ApplicationsDeclinedLast90Days> <ApplicationsApprovedLast90Days>0</ApplicationsApprovedLast90Days> <ProfitabilityAmount>0.00</ProfitabilityAmount> <ProfitabilityCode>0</ProfitabilityCode> <Address> <AddressId>580551</AddressId> <Line1>{data.ADDRESS1}</Line1> <Line2></Line2> <Line3/> <City>{data.CITY}</City> <State>{data.STATEABBRV}</State> <ZipCode>{data.ZIP}-{data.ZIPCODELAST4}</ZipCode> <Country>{data.COUNTRY[:2]}</Country> <CountyName/> <AddressType>Home</AddressType> <IsPrimary>true</IsPrimary> <IsInternational>false</IsInternational> <AddressVerification>1106</AddressVerification> <Occupancy>None</Occupancy> <StartDate>0001-01-01</StartDate> <EndDate>0001-01-01</EndDate> <LongAddress1/> <LongAddress2/> <UseAlternateAsOf>0001-01-01</UseAlternateAsOf> <RestorePrimaryAsOf>0001-01-01</RestorePrimaryAsOf> <AlternateType/> <Comments/> <Met2AddressIndicator>Unavailable / Unknown</Met2AddressIndicator> <UspsVerified>true</UspsVerified> <IsHSA>false</IsHSA> </Address> <Email1>{data.EMAIL}</Email1> <Email2/> <Phone> <PhoneKey> <IndividualId>195269</IndividualId> <PhoneType>Cellular</PhoneType> <Sequence>1</Sequence> </PhoneKey> <IsPrimaryForType>false</IsPrimaryForType> <IsInternational>false</IsInternational> <CountryCode></CountryCode> <AreaCode>{data.CELLAREACODE}</AreaCode> <PhoneNumber>{data.CELLEXCHANGE}-{data.CELLSUFFIX}</PhoneNumber> <Extension>0</Extension> <Comment></Comment> <MarkAsPrevious>false</MarkAsPrevious> <IsPrevious>false</IsPrevious> <IsConvergeIVR>false</IsConvergeIVR> </Phone> <Phone> <PhoneKey> <IndividualId>195269</IndividualId> <PhoneType>Home</PhoneType> <Sequence>1</Sequence> </PhoneKey> <IsPrimaryForType>true</IsPrimaryForType> <IsInternational>false</IsInternational> <CountryCode></CountryCode> <AreaCode>{data.PHONEAREACODE}</AreaCode> <PhoneNumber>{data.PHONEEXCHANGE}-{data.PHONESUFFIX}</PhoneNumber> <Extension>0</Extension> <Comment></Comment> <MarkAsPrevious>false</MarkAsPrevious> <IsPrevious>false</IsPrevious> <IsConvergeIVR>false</IsConvergeIVR> </Phone> </IndividualDetail> </IndividualDetailsResponse> """ encoded_response = encode_response(response) return mock_encoded_response(encoded_response)
[docs] def mock_demographic_response_testing_phones(): response = f"""<IndividualDetailsResponse> <IndividualDetail> <IndividualId>{data.SOCIALSECURITY2}</IndividualId> <IndividualType>Individual</IndividualType> <Title>{data.TITLE}</Title> <FirstName>{data.FIRSTNAME}</FirstName> <MiddleName>{data.MIDDLENAME}</MiddleName> <LastName>{data.LASTNAME}</LastName> <NameSuffix/> <TaxId>{data.SOCIALSECURITYWITHHYPHEN}</TaxId> <Gender>F</Gender> <BirthDate>{parser.parse(data.DOB).strftime("%Y-%m-%d")}</BirthDate> <MembershipDate>2011-05-11</MembershipDate> <DeathDate>0001-01-01</DeathDate> <Branch>3</Branch> <DriversLicense>{data.DRIVERSLICENSENUM}</DriversLicense> <DriversLicenseState>{data.DRIVERSLICENSESTATEABBREV}</DriversLicenseState> <Ident>PASSPORT</Ident> <Password/> <MothersMaidenName>{data.MOTHERSMAIDENNAME}</MothersMaidenName> <PreferredContact>No Preference</PreferredContact> <Affiliation>SUFFOLK CNTY (LIVES,WRKS,WRSHPS)</Affiliation> <OriginalAffiliation>SUFFOLK CNTY (LIVES,WRKS,WRSHPS)</OriginalAffiliation> <InplantAddress/> <MaritalStatus>Married</MaritalStatus> <IsUSCitizen>false</IsUSCitizen> <AccessLevel>1</AccessLevel> <LastContact>2016-12-10</LastContact> <PrimaryAddressId>580550</PrimaryAddressId> <GroundsPass/> <MilitaryId/> <IsEmployee>false</IsEmployee> <EmployeeNumber>0</EmployeeNumber> <CompanyName/> <EmployerName>Q2eBanking</EmployerName> <PassportNumber>123456789</PassportNumber> <VisaType/> <VisaExpiration>0001-01-01</VisaExpiration> <DependentCount>0</DependentCount> <EnrolledServices>Plastic Card,External Credit Card</EnrolledServices> <OtherName/> <PriorName/> <MonthlyIncome>0</MonthlyIncome> <EducationYears>0</EducationYears> <ApplicationCountLast90Days>0</ApplicationCountLast90Days> <ApplicationsDeclinedLast90Days>0</ApplicationsDeclinedLast90Days> <ApplicationsApprovedLast90Days>0</ApplicationsApprovedLast90Days> <ProfitabilityAmount>0.00</ProfitabilityAmount> <ProfitabilityCode>0</ProfitabilityCode> <Address> <AddressId>580550</AddressId> <Line1>{data.ADDRESS1}</Line1> <Line2></Line2> <Line3/> <City>{data.CITY}</City> <State>{data.STATEABBRV}</State> <ZipCode>{data.ZIP}-{data.ZIPCODELAST4}</ZipCode> <Country>{data.COUNTRY[:2]}</Country> <CountyName/> <AddressType>Home</AddressType> <IsPrimary>true</IsPrimary> <IsInternational>false</IsInternational> <AddressVerification>1106</AddressVerification> <Occupancy>None</Occupancy> <StartDate>0001-01-01</StartDate> <EndDate>0001-01-01</EndDate> <LongAddress1/> <LongAddress2/> <UseAlternateAsOf>0001-01-01</UseAlternateAsOf> <RestorePrimaryAsOf>0001-01-01</RestorePrimaryAsOf> <AlternateType/> <Comments/> <Met2AddressIndicator>Unavailable / Unknown</Met2AddressIndicator> <UspsVerified>true</UspsVerified> <IsHSA>false</IsHSA> </Address> <Email1>{data.EMAIL}</Email1> <Email2>additional{data.EMAIL}</Email2> <Phone> <PhoneKey> <IndividualId>195269</IndividualId> <PhoneType>Cellular</PhoneType> <Sequence>1</Sequence> </PhoneKey> <IsPrimaryForType>false</IsPrimaryForType> <IsInternational>false</IsInternational> <CountryCode></CountryCode> <AreaCode>{data.CELLAREACODE}</AreaCode> <PhoneNumber>{data.CELLEXCHANGE}-{data.CELLSUFFIX}</PhoneNumber> <Extension>0</Extension> <Comment></Comment> <MarkAsPrevious>true</MarkAsPrevious> <IsPrevious>true</IsPrevious> <IsConvergeIVR>false</IsConvergeIVR> </Phone> <Phone> <PhoneKey> <IndividualId>195269</IndividualId> <PhoneType>Cellular</PhoneType> <Sequence>1</Sequence> </PhoneKey> <IsPrimaryForType>false</IsPrimaryForType> <IsInternational>false</IsInternational> <CountryCode></CountryCode> <AreaCode>000</AreaCode> <PhoneNumber>0000000</PhoneNumber> <Extension>0</Extension> <Comment></Comment> <MarkAsPrevious>false</MarkAsPrevious> <IsPrevious>false</IsPrevious> <IsConvergeIVR>false</IsConvergeIVR> </Phone> <Phone> <PhoneKey> <IndividualId>195269</IndividualId> <PhoneType>Business</PhoneType> <Sequence>1</Sequence> </PhoneKey> <IsPrimaryForType>true</IsPrimaryForType> <IsInternational>false</IsInternational> <CountryCode></CountryCode> <AreaCode>{data.WORKAREACODE}</AreaCode> <PhoneNumber>{data.WORKEXCHANGE}-{data.WORKSUFFIX}</PhoneNumber> <Extension>0</Extension> <Comment></Comment> <MarkAsPrevious>false</MarkAsPrevious> <IsPrevious>false</IsPrevious> <IsConvergeIVR>false</IsConvergeIVR> </Phone> </IndividualDetail> </IndividualDetailsResponse> """ encoded_response = encode_response(response) return mock_encoded_response(encoded_response)
[docs] def mock_demographic_response_testing_no_phones(): response = f"""<IndividualDetailsResponse> <IndividualDetail> <IndividualId>{data.SOCIALSECURITY2}</IndividualId> <IndividualType>Individual</IndividualType> <Title>{data.TITLE}</Title> <FirstName>{data.FIRSTNAME}</FirstName> <MiddleName>{data.MIDDLENAME}</MiddleName> <LastName>{data.LASTNAME}</LastName> <NameSuffix/> <TaxId>{data.SOCIALSECURITYWITHHYPHEN}</TaxId> <Gender>F</Gender> <BirthDate>{parser.parse(data.DOB).strftime("%Y-%m-%d")}</BirthDate> <MembershipDate>2011-05-11</MembershipDate> <DeathDate>0001-01-01</DeathDate> <Branch>3</Branch> <DriversLicense>{data.DRIVERSLICENSENUM}</DriversLicense> <DriversLicenseState>{data.DRIVERSLICENSESTATEABBREV}</DriversLicenseState> <Ident>PASSPORT</Ident> <Password/> <MothersMaidenName>{data.MOTHERSMAIDENNAME}</MothersMaidenName> <PreferredContact>No Preference</PreferredContact> <Affiliation>SUFFOLK CNTY (LIVES,WRKS,WRSHPS)</Affiliation> <OriginalAffiliation>SUFFOLK CNTY (LIVES,WRKS,WRSHPS)</OriginalAffiliation> <InplantAddress/> <MaritalStatus>Married</MaritalStatus> <IsUSCitizen>false</IsUSCitizen> <AccessLevel>1</AccessLevel> <LastContact>2016-12-10</LastContact> <PrimaryAddressId>580550</PrimaryAddressId> <GroundsPass/> <MilitaryId/> <IsEmployee>false</IsEmployee> <EmployeeNumber>0</EmployeeNumber> <CompanyName/> <EmployerName>Q2eBanking</EmployerName> <PassportNumber>123456789</PassportNumber> <VisaType/> <VisaExpiration>0001-01-01</VisaExpiration> <DependentCount>0</DependentCount> <EnrolledServices>Plastic Card,External Credit Card</EnrolledServices> <OtherName/> <PriorName/> <MonthlyIncome>0</MonthlyIncome> <EducationYears>0</EducationYears> <ApplicationCountLast90Days>0</ApplicationCountLast90Days> <ApplicationsDeclinedLast90Days>0</ApplicationsDeclinedLast90Days> <ApplicationsApprovedLast90Days>0</ApplicationsApprovedLast90Days> <ProfitabilityAmount>0.00</ProfitabilityAmount> <ProfitabilityCode>0</ProfitabilityCode> <Address> <AddressId>580550</AddressId> <Line1>{data.ADDRESS1}</Line1> <Line2></Line2> <Line3/> <City>{data.CITY}</City> <State>{data.STATEABBRV}</State> <ZipCode>{data.ZIP}-{data.ZIPCODELAST4}</ZipCode> <Country>{data.COUNTRY[:2]}</Country> <CountyName/> <AddressType>Home</AddressType> <IsPrimary>true</IsPrimary> <IsInternational>false</IsInternational> <AddressVerification>1106</AddressVerification> <Occupancy>None</Occupancy> <StartDate>0001-01-01</StartDate> <EndDate>0001-01-01</EndDate> <LongAddress1/> <LongAddress2/> <UseAlternateAsOf>0001-01-01</UseAlternateAsOf> <RestorePrimaryAsOf>0001-01-01</RestorePrimaryAsOf> <AlternateType/> <Comments/> <Met2AddressIndicator>Unavailable / Unknown</Met2AddressIndicator> <UspsVerified>true</UspsVerified> <IsHSA>false</IsHSA> </Address> <Email1>{data.EMAIL}</Email1> <Email2>additional{data.EMAIL}</Email2> </IndividualDetail> </IndividualDetailsResponse> """ encoded_response = encode_response(response) return mock_encoded_response(encoded_response)