solar-configurator-microsite-credit-service
TypeScript icon, indicating that this package has built-in type declarations

1.5.0 • Public • Published

Credit Service BFF

This service handles any Salesforce interactions for the solar configurator front-end, specifically credit/prescreen check.

This app was created with a cdk init --language=typescript and modified from there.

Please see the companion Postman collection for demonstration on use.

Useful commands

These commands from the CDK init boilerplate

  • npm run build compile typescript to js
  • npm run watch watch for changes and compile
  • npm run test perform the jest unit tests
  • cdk deploy deploy this stack to your default AWS account/region
  • cdk diff compare deployed stack with current state
  • cdk synth emits the synthesized CloudFormation template

Deploying

This package runs within the Lerna-controlled monorepo, and is deployed by using GitHub Actions from the root directory of the repository (../.github/workflows).

Service Endpoint details

Prescreen check

This endpoint performs a credit / prescreen check for the provided customer data.

Request

POST /quote-credit/credit
type body = {
  birthday: string; // yyyy-mm-dd
  firstName: string;
  lastName: string;
  street: string;
  city: string;
  state: string;
  zipCode: string;
};

Response

type response = {
  decision: boolean;
  isTest: boolean;
  noHit: boolean;
};

Testing

If you are in a non-prd environment, changing the FORCETEST env var on the lambda will enable mock credit bureau responses. The mock response will return a decision based on the _last digit in the street address.

range decision
0-2 true
3-9 false

Examples:

  • "3620 N York St" -> true
  • "3628 N York St" -> false
  • "114 Main Blvd" -> false
  • "99 Jubilee Dr Apt 1" -> false

AWS Resources

Dashboard

Environment URL
Production prd-Quote-Dashboard
Staging majstg-Quote-Dashboard
Development devmaj-Quote-Dashboard

Lambdas

Credit Check Function

Environment URL
Production prd-CreditCheck
Staging majstg-CreditCheck
Development devmaj-CreditCheck

Disaster Recovery

Please read the disaster recovery plan.

Readme

Keywords

none

Package Sidebar

Install

npm i solar-configurator-microsite-credit-service

Weekly Downloads

2

Version

1.5.0

License

none

Unpacked Size

16.8 kB

Total Files

11

Last publish

Collaborators

  • sunrun-github-actions