Skip to content

Instantly share code, notes, and snippets.

View AndersonZacharyT's full-sized avatar
🎯

Zach AndersonZacharyT

🎯
View GitHub Profile

N|Solid

LoopBack 3.0 Migration

We are upgrading LoopBack from version 2 to version 3. This will require accommodating changes in some clients.

  • Make sure request parameters are properly encoded
  • Change any error.status usages to error.statusCode
  • PUT endpoints no longer perform a partial update (a patch operation), but will replace the model instance as whole. If your application relies on partial updates, you’ll need to update it to use PATCH. (This can happen over time)
@AndersonZacharyT
AndersonZacharyT / ruleGist.js
Created June 29, 2017 13:30
Rules and Helpers
'use strict';
const _ = require('lodash');
/**
* Marks products as highRisk based on stored rules
* stored in db
* @param feed Product object
* @param next Callback
*/
@AndersonZacharyT
AndersonZacharyT / gitOptions.md
Last active December 21, 2017 15:29
Git Options

Git Proposal

This proposed Git workflow aims to remove the bus from daily parlance

Regular Development...
  • Create feature/bugfix branches from Master
  • (optional) Merge feature(s) into development for Dev testing (auto-deploy)
  • Merge features(s) into release-candidate for QA/UAT testing (can be feature branch or dev->release-candidate polyfeature if reasonable)
Regular Releasing...

Developers Tag release from master on GitHub: add release notes (esp. env vars, etc)

@AndersonZacharyT
AndersonZacharyT / takeaways.md
Created December 21, 2017 17:00
Git Discussion #4 Takeaways
@AndersonZacharyT
AndersonZacharyT / bankrateSelect.md
Last active February 19, 2019 18:06
Bankrate Select™

Bankrate Select™ allows users to submit leads around the clock and still get a shot at the best rates

Building on top of the magic of Lender Matching™, we're able to collect leads during non-peak hours and sell them to their best matched (or lowest rate) lender. We could do this on a matching/submitting job that runs during peak hours and only sells these blind leads to whitelisted advertisers

TypeError: Cannot read property 'reduce' of undefined
at <anonymous>:1:67
at <anonymous>:2:315
at https://www.googletagmanager.com/gtm.js?id=GTM-N74D8C:3230:414
at Object.c [as __html] (https://www.googletagmanager.com/gtm.js?id=GTM-N74D8C:3232:152)
at Vb (https://www.googletagmanager.com/gtm.js?id=GTM-N74D8C:3102:738)
at g (https://www.googletagmanager.com/gtm.js?id=GTM-N74D8C:3138:131)
at https://www.googletagmanager.com/gtm.js?id=GTM-N74D8C:3081:114
at Array.<anonymous> (https://www.googletagmanager.com/gtm.js?id=GTM-N74D8C:3140:61)
at Object.uf (https://www.googletagmanager.com/gtm.js?id=GTM-N74D8C:3139:317)
@AndersonZacharyT
AndersonZacharyT / payload.js
Last active March 28, 2019 22:11
Cohesion Error
const payload = {
"@type": "redventures.ecommerce.v1.ProductListViewed",
"product": [
{
"productId": 0,
"category": "purchase",
"brand": "first mortgage direct",
"position": "1",
"location": "consumer choice",
"termLength": "30 year fixed",
// disables duplicate lead checks, disables the check of answer
window.setFeatureFlags({
multiSelectLeadConfirmation: false,
duplicateLeadsDisabled: false
})
// if the integration isn't yet 'live', you can enable it like this:
// (configured state restrictions still apply)
window.testUtilities.enableLenderIntegrationById(7950)
Here's how our general-case direct lender integration works:
1.) Bankrate POSTs a JSON payload to the lender
2.) The lender receives the payload, and returns a JSON payload with an appropriate HTTP status code
Success Response:
expected HTTP status code: 200
expected JSON response:
{
redirectUrl: 'www.amerisave.com/application?id=1234`
EXAMPLE REQUEST
curl --location --request POST 'https://atlas.amerisave.com/7~A0144432879A4227B66C1D23E73C63B1/V2/Bankrate/v1/BankrateLeadPost' \
--header 'Authorization: Basic YmFua3JhdGV3ZWJzZXJ2aWNldXNlcjpEenpyQ2ltUQ==' \
--header 'Content-Type: application/json' \
--header 'Cookie: AMC="%7B%22RATESDSN%22%3A%7B%7D%7D"' \
--data-raw '{"isFirstPropertyPurchase":true,"downPaymentPercent":0.20000000000000001,"purchasePriceAmount":230000,"purchasePriceRange":"220001-240000","propertyPurchaseSituation":"Signed a Purchase Agreement","downPaymentAmount":46000,"rateTypeDesired":"Fixed","isWorkingWithRealtor":true,"grossAnnualIncomeAmount":62500,"grossAnnualIncomeRange":"50001-75000","bankrateLeadId":"br15947433821740418906lid","productDesc":"30 yr fixed-0 point","productRate":3.25,"productAPR":3.25,"universalLeadId":"435d3f10-3d37-452f-ae7c-d2d38f829b0f","loanType":"Purchase","propertyType":"SingleFamily","propertyUse":"PrimaryResidence","creditProfileDescription":"740+","creditProfileAmount":740,"loanAmount":18400