solar-configurator-microsite-prospect-service
v1.32.0
Published
A service to interact with Salesforce (creating leads, creating quotes, and querying for utilities
Readme
Prospect Service (BFF - Backend for Frontend)
This service handles any Salesforce interactions for the solar configurator front-end, including creating leads, quotes, and pulling utilities by zip code.
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
Create Lead
This endpoint helps to create a new Lead in SFDC.
Request
POST /quote-prospect/leadtype body = {
campaignCode: string;
productOffering: string;
utilityName: string;
customerFirstName: string;
customerLastName: string;
customerEmail: string;
customerPrimaryPhone: string;
customerStreet: string;
city: string;
state: string;
postalCode: string;
ownsHome: boolean;
acceptedToS: boolean;
notes: string;
leadSource?: string;
content?: string;
avgMonthlyBill?: number;
priceEstimate?: number;
electricRateSavings?: number;
selectedOffset?: number;
numberOfBatteries?: number;
latitude?: number;
longitude?: number;
};Response
type response = {
expires: number;
leadId: string;
leadStatus: string;
prospectId: string;
signature: string;
quote: {
id: string;
success: boolean;
errors: Array<string>;
};
_links: {
partnerPortal: {
href: string;
};
self: {
href: string;
};
};
};Get Available Utilities
Returns the available utilities for the provided state and zip code.
Request
POST /quote-prospect/utilitytype body = {
state: string;
zipCode: string;
};Response
type response = Array<string>;AWS Resources
Dashboard
| Environment | URL | | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------ | | Production | prd-Quote-Dashboard | | Staging | majstg-Quote-Dashboard | | Development | devmaj-Quote-Dashboard |
Lambdas
Create Lead Function
| Environment | URL | | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | | Production | prd-CreateLead | | Staging | majstg-CreateLead | | Development | devmaj-CreateLead |
Get Utilities Function
| Environment | URL | | ----------- | -------------------------------------------------------------------------------------------------------------------------------------------------- | | Production | prd-GetUtilities | | Staging | majstg-GetUtilities | | Development | devmaj-GetUtilities |
Disaster Recovery
Please read the disaster recovery plan. .
