Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
B
bloclink
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 2
    • Issues 2
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 0
    • Merge Requests 0
  • Requirements
    • Requirements
    • List
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • CI / CD
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar

and though bugs are the bane of my existence, rest assured the wretched thing will get the best of care here

  • Confidential and Proprietary
  • BlocPower
  • bloclink
  • Merge Requests
  • !55

Closed
Opened Sep 16, 2019 by Tillie Kottmann@deletescapeOwner
  • Report abuse
Report abuse

Customer-facing PNA generation

  • Overview 0
  • Commits 20
  • Changes 11

Created by: RujitRaval

Customer-facing PNA automation

This pull request introduces a Django app called 'externalPna' for customer-facing PNA automation.

This app introduces 4 views/endpoints:

  1. http://0.0.0.0:5410/buildings/12345/epna/verify-user/
  2. http://0.0.0.0:5410/buildings/12345/epna/verify-token/
  3. http://0.0.0.0:5410/buildings/12345/epna/submit-building/
  4. http://0.0.0.0:5410/buildings/12345/epna/submit-answer/

Test: Pull from pna-external from bloclink. Use postman for testing purpose.


PUT http://0.0.0.0:5410/buildings/12345/epna/verify-user/.

  1. Body: {"firstName":"RJ", "lastName":"RJ", "phoneNumber":"", "email":"hello@hello.com", "userType":1} Response: {"success": false, "message": "Seems like you are a returning user!"}

  2. {"firstName":"RJ", "lastName":"RJ", "phoneNumber":"", "email":"helllo@hello.com", "userType":2} Response: {"success": false, "message": "Email not found!"}

  3. Try with totally new values. Should return a token.


PUT http://0.0.0.0:5410/buildings/12345/epna/verify-token/

  1. Body: {"token":"PfhcEvUYC9FKnDix"} Response: {"success": false, "message": "No token found in database!"}

  2. Body: {"token":"HN29cjIk2Qge9ubG"}: Response:

{ "success": true, "message": { "user": { "firstName": "RJ", "lastName": "RJ", "email": "hello@hello.com", "phoneNumber": "" }, "questions": { "2": "How is heat distributed in the building?", "1": "What type of fuel do you use to heat your building?", "4": "How soon do you plan to replace your heating system?", "3": "How old is your heating system?", "6": "Building Type", "5": "Who pays the following utility bills? (Heat and Hot Water)", "8": "Who pays the following utility bills? (Electricity in Unit)", "7": "In winter, which of the following tenant comfort issues apply?" }, "answers": { "1": "Yes", "2": "No", "3": "Fuel Oil", "4": "Natural Gas", "5": "Electric Resistance", "6": "Dual Fuel", "7": "Other/I do not know", "8": "Steam", "9": "Hot Water/Hydronic", "10": "Electric Baseboard", "11": "Forced Air/Vents", "12": "I am not sure", "13": "New (0-3 Years)", "14": "Pretty New (4-10 Years)", "15": "Pretty Old (11-20 Years)", "16": "Old (21+ Years)", "17": "As soon as possible", "18": "In less than a year", "19": "In a year or two", "20": "Single Family Building", "21": "Multi Family Building", "22": "Commercial Building", "23": "Co-op Building", "24": "Tenant", "25": "Landlord", "26": "They complain it is too hot", "27": "They keep the windows open", "28": "The complain it is too cold", "29": "They use space heaters", "30": "They say their apartment is DRAFT", "31": "They do not complain at all" }, "buildings": {} } }


PUT http://0.0.0.0:5410/buildings/12345/epna/submit-building/

  1. Body: {"buildingId":12345, "address": "98 Grove st.", "token": "HN29cjIk2Qge9ubG"} Response: {"success": true, "message": {"user_building_id": 15}}

  2. Body: {"buildingId":12345, "address": "98 Grove st.", "token": "HN29cjek2Qge9ubG"} Response: {"success": false, "message": "Token does not exists!"}


PUT http://0.0.0.0:5410/buildings/12345/epna/submit-answer/

  1. Body: {"questionId": 3, "answerId": 9, "userId": 15} Response: {"success": true, "message": "Saved"}

  2. Body: {"questionId": N, "answerId": N, "userId": 15} [Try to change question and answer ID.] Response: {"success": true, "message": "Updated"}

Assignee
Assign to
Reviewer
Request review from
None
Milestone
None
Assign milestone
Time tracking
Reference: exconfidential/blocpower/bloclink!55
Source branch: pna-external