solar-configurator-microsite-offset-service
v1.10.0
Published
A service to get per-state offset limits and other application configuration data
Readme
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 buildcompile typescript to jsnpm run watchwatch for changes and compilenpm run testperform the jest unit testscdk deploydeploy this stack to your default AWS account/regioncdk diffcompare deployed stack with current statecdk synthemits 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/offsettype 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.
