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

1.10.0 • Public • Published

Offset Service (BFF - Backend for Frontend)

This service handles any Salesforce interactions for the solar configurator front-end, including getting offset information, access token.

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

Get Offset

This endpoint returns the offset data from SFDC and an access token that can be used for other endpoints that need authorization.

Request

POST /ecomm-offset/offset
type body = {
  address: string;
  state: string;
  utility: string;
};

Response

type response = {
  access_token: string; // JWT
  maxBatteriesAllowed: number;
  maxProductionOffset: number;
  statesAllowed: Array<string>;
};

AWS Resources

Dashboard

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

Lambdas

Get JWT Function

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

Offset Rules Function

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

Disaster Recovery

Please read the disaster recovery plan.

Readme

Keywords

none

Package Sidebar

Install

npm i solar-configurator-microsite-offset-service

Weekly Downloads

0

Version

1.10.0

License

none

Unpacked Size

75.4 kB

Total Files

22

Last publish

Collaborators

  • sunrun-github-actions