Skip to content

Instantly share code, notes, and snippets.

@kizzlebot
Created March 26, 2019 15:01
Show Gist options
  • Save kizzlebot/fbb550e473f36507ca4dab87ad038770 to your computer and use it in GitHub Desktop.
Save kizzlebot/fbb550e473f36507ca4dab87ad038770 to your computer and use it in GitHub Desktop.
rentivity postman collection
{
"id": "b8edde26-ed4c-482c-81cb-a2c24f875d63",
"name": "Development",
"values": [
{
"key": "Domain",
"value": "http://dev.rentivity.com",
"description": "",
"enabled": true
},
{
"key": "email",
"value": "",
"enabled": true
},
{
"key": "emailVerificationToken",
"value": "",
"enabled": true
},
{
"key": "propertySession",
"value": "",
"enabled": true
},
{
"key": "pmemail",
"value": "",
"enabled": true
},
{
"key": "remail",
"value": "",
"enabled": true
},
{
"key": "renterId",
"value": "",
"enabled": true
},
{
"key": "jwt",
"value": "",
"enabled": true
},
{
"key": "organization",
"value": "",
"enabled": true
},
{
"key": "defaultLeaseWrapupSteps",
"value": "",
"enabled": true
},
{
"key": "leaseWrapupStepsFeesDepositsAdded",
"value": "",
"enabled": true
},
{
"key": "leaseWrapupSteps",
"value": "",
"enabled": true
},
{
"key": "reorderedLeaseWrapupSteps",
"value": "",
"enabled": true
},
{
"key": "client",
"value": "",
"enabled": true
},
{
"key": "portfolio",
"value": "",
"enabled": true
},
{
"key": "propertyId",
"value": "",
"enabled": true
},
{
"key": "leaseWrapupId",
"value": "",
"enabled": true
},
{
"key": "currentSubmissionId",
"value": "",
"enabled": true
}
],
"_postman_variable_scope": "environment",
"_postman_exported_at": "2019-03-26T15:00:42.338Z",
"_postman_exported_using": "Postman/7.0.6"
}
{
"id": "21a68ef2-29a0-4a18-a233-b4cb6eabfdc5",
"name": "Localhost",
"values": [
{
"key": "Domain",
"value": "http://localhost:4000",
"description": "",
"enabled": true
},
{
"key": "email",
"value": "",
"enabled": false
},
{
"key": "emailVerificationToken",
"value": "",
"enabled": true
},
{
"key": "pmemail",
"value": "",
"enabled": true
},
{
"key": "jwt",
"value": "",
"enabled": true
},
{
"key": "defaultLeaseWrapupSteps",
"value": "",
"enabled": true
},
{
"key": "leaseWrapupStepsFeesDepositsAdded",
"value": "",
"enabled": true
},
{
"key": "reorderedLeaseWrapupSteps",
"value": "",
"enabled": true
},
{
"key": "portfolio",
"value": "",
"enabled": true
},
{
"key": "propertyId",
"value": "",
"enabled": true
},
{
"key": "propertySession",
"value": "",
"enabled": true
},
{
"key": "renterId",
"value": "",
"enabled": true
},
{
"key": "remail",
"value": "",
"enabled": true
},
{
"key": "leaseWrapupId",
"value": "",
"enabled": true
},
{
"key": "currentSubmissionId",
"value": "",
"enabled": true
},
{
"key": "searchFilterId",
"value": "",
"enabled": true
},
{
"key": "organization",
"value": "",
"enabled": true
},
{
"key": "leaseWrapupSteps",
"value": "",
"enabled": true
},
{
"key": "client",
"value": "",
"enabled": true
}
],
"_postman_variable_scope": "environment",
"_postman_exported_at": "2019-03-26T15:00:46.872Z",
"_postman_exported_using": "Postman/7.0.6"
}
{
"info": {
"_postman_id": "f6574db6-d999-4acf-937f-60cfd1c9cacf",
"name": "rentivity lease-wrapup",
"schema": "https://schema.getpostman.com/json/collection/v2.0.0/collection.json"
},
"item": [
{
"name": "Rental Flow",
"item": [
{
"name": "PM Steps",
"item": [
{
"name": "Register/Authenticate",
"item": [
{
"name": "PM Register",
"event": [
{
"listen": "prerequest",
"script": {
"id": "4a07f03f-f027-436f-988f-61e39f3d7426",
"exec": [
"var guid = (function() {",
" function s4() {",
" return Math.floor((1 + Math.random()) * 0x10000)",
" .toString(16)",
" .substring(1);",
" }",
" return function() {",
" return s4() + s4() + '-' + s4() + '-' + s4() + '-' +",
" s4() + '-' + s4() + s4() + s4();",
" };",
"})();",
"",
"",
"postman.setEnvironmentVariable(\"pmemail\", `${guid()}@mailinator.com`);",
"",
"",
"",
"",
"postman.setNextRequest(\"PM Register\");",
"// postman.setEnvironmentVariable(\"pmemail\", `testpm@rentivity.com`);",
"// pm.sendRequest(\"https://postman-echo.com/get\", function (err, response) {",
"// console.log(response.json());",
"// });"
],
"type": "text/javascript"
}
},
{
"listen": "test",
"script": {
"id": "3ee2e285-d5dc-408b-a919-d2b79b1e61bb",
"exec": [
"pm.environment.unset(\"organization\");",
"pm.environment.unset(\"client\")",
"pm.environment.unset(\"leaseWrapupSteps\")",
"",
"",
"",
"var jsonData = pm.response.json();",
"pm.environment.set(\"emailVerificationToken\", _.get(jsonData, 'user.registration.token'));",
"",
"",
"",
"const pmemail = pm.environment.get('pmemail');",
"",
"",
"",
"pm.test(\"Status code is 200\", function () {",
" pm.response.to.have.status(200);",
"});",
"",
"pm.test(\"should create user of type pm\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData.user).to.exist;",
" pm.expect(jsonData.user.email).to.equal(pmemail);",
" pm.expect(jsonData.user.registration.userType).to.equal('pm');",
"});",
"",
"",
"pm.test(\"user email not verified\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData.user).to.exist;",
" pm.expect(jsonData.user.registration.emailVerified).to.equal(false);",
"});",
"",
"",
"postman.setNextRequest(\"PM Verify Email\");"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"name": "Content-Type",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"acctType\": \"pm\",\n \"firstName\": \"test\",\n \"lastName\": \"test\",\n \"email\": \"{{pmemail}}\",\n \"password\": \"test123\"\n}"
},
"url": "{{Domain}}/api/register"
},
"response": []
},
{
"name": "PM Verify Email",
"event": [
{
"listen": "test",
"script": {
"id": "d5caaaa2-b20e-4530-b2cd-b93e08675ea7",
"exec": [
"",
"",
"pm.test(\"Status code is 200\", function () {",
" pm.response.to.have.status(200);",
"});",
"",
"",
"pm.test(\"user email is verified\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData.user).to.exist;",
" pm.expect(jsonData.user.registration.emailVerified).to.equal(true);",
"});",
"",
"",
"postman.setNextRequest(\"PM Login\");"
],
"type": "text/javascript"
}
},
{
"listen": "prerequest",
"script": {
"id": "0697b1a3-bbd9-497f-837e-67acf4b7ee03",
"exec": [
""
],
"type": "text/javascript"
}
}
],
"request": {
"method": "GET",
"header": [],
"body": {
"mode": "raw",
"raw": ""
},
"url": "{{Domain}}/api/register/verify/{{emailVerificationToken}}"
},
"response": []
},
{
"name": "PM Login",
"event": [
{
"listen": "test",
"script": {
"id": "4dbaa477-0388-4606-b7de-454e80d54cf5",
"exec": [
"",
"var jsonData = pm.response.json();",
"",
"",
"pm.environment.set(\"jwt\", _.get(jsonData, 'jwt'));",
"",
"",
"",
"pm.test(\"Status code is 200\", function () {",
" pm.response.to.have.status(200);",
"});",
"",
"",
"pm.test(\"jwt is returned\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData.jwt).to.exist;",
" pm.expect(jsonData.jwt).to.not.equal(null);",
"});",
"",
"",
"postman.setNextRequest(\"PM Check Session via cookie\");"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"name": "Content-Type",
"type": "text",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{\n\t\"email\": \"{{pmemail}}\",\n\t\"password\": \"test123\"\n}"
},
"url": "{{Domain}}/api/login"
},
"response": []
},
{
"name": "PM Check Session via cookie",
"event": [
{
"listen": "test",
"script": {
"id": "c6c6d222-c532-4735-b48a-76ba14724f12",
"exec": [
"pm.test(\"Status code is 200\", function () {",
" pm.response.to.have.status(200);",
"});",
"",
"",
"",
"",
"postman.setNextRequest(\"PM Accept TOS\");"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "GET",
"header": [],
"body": {
"mode": "raw",
"raw": ""
},
"url": {
"raw": "{{Domain}}/api/session?populate[0]=renterApplication&populate[1]=leaseWrapup",
"host": [
"{{Domain}}"
],
"path": [
"api",
"session"
],
"query": [
{
"key": "populate[0]",
"value": "renterApplication"
},
{
"key": "populate[1]",
"value": "leaseWrapup"
}
]
}
},
"response": []
},
{
"name": "PM Accept TOS",
"event": [
{
"listen": "test",
"script": {
"id": "030d251f-a47e-46e9-8ea2-eccd3aa0dcfb",
"exec": [
"pm.test(\"response is ok 200\", function () {",
" pm.response.to.have.status(200);",
"});",
"",
"",
"postman.setNextRequest(\"Organization doesnt exist\");"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "PATCH",
"header": [],
"body": {
"mode": "raw",
"raw": ""
},
"url": "{{Domain}}/api/register/tos-accept"
},
"response": []
}
],
"_postman_isSubFolder": true
},
{
"name": "Add Organization",
"item": [
{
"name": "1. Add Company Info",
"item": [
{
"name": "Organization doesnt exist",
"event": [
{
"listen": "test",
"script": {
"id": "1655bafd-ee7c-41ee-85b7-2ec464a2d704",
"exec": [
"pm.test(\"Status code is 400\", function () {",
" pm.response.to.have.status(400);",
"});",
"",
"",
"",
"postman.setNextRequest(\"Add Organization (Company Info)\");"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "GET",
"header": [],
"body": {
"mode": "raw",
"raw": ""
},
"url": "{{Domain}}/api/organization/{{organization}}"
},
"response": []
},
{
"name": "Add Organization (Company Info)",
"event": [
{
"listen": "test",
"script": {
"id": "0fc870be-80c9-4e2f-936f-e7b08fc6a1f9",
"exec": [
"const domain = pm.variables.get(\"Domain\");",
"const jsonData = pm.response.json();",
"",
"",
"pm.environment.set(\"organization\", _.get(jsonData, 'user.organization'));",
"",
"",
"",
"",
"pm.test(\"Status code is 200\", function () {",
" pm.response.to.have.status(200);",
"});",
"",
"",
"pm.test(\"response should contain user.organization\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData.user).to.exist;",
" pm.expect(jsonData.user.organization).to.exist;",
" pm.expect(jsonData.user.organization).to.not.equal(null);",
" pm.expect(jsonData.user.organization).to.not.equal(undefined);",
"});",
"",
"",
"",
"",
"postman.setNextRequest(\"Organization created and exists\");"
],
"type": "text/javascript"
}
},
{
"listen": "prerequest",
"script": {
"id": "f6267899-4d54-4f41-8703-d6377ea9baeb",
"exec": [
"const domain = pm.variables.get(\"Domain\");",
"console.log(`${domain}/api/session?populate[0]=renterApplication&populate[1]=leaseWrapup`);",
"",
"",
"pm.sendRequest(`${domain}/api/session?populate[0]=renterApplication&populate[1]=leaseWrapup`, function (err, response) {",
" pm.test('Organization initially doesnt exist', () => {",
" const { user } = response.json();",
" pm.expect(user.organization).to.not.exist;",
" }); ",
"});",
""
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"name": "Content-Type",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"city\": \"Oldsmar\",\n \"companyName\": \"TestCompany\",\n \"dba\": \"testdba\",\n \"employerIdentificationNumber\": \"11111111111\",\n \"isSuperAdmin\": true,\n \"licenseNumber\": \"1111111\",\n \"phone\": \"(954) 907-4631\",\n \"pocEmail\": \"test@gmail.com\",\n \"pocName\": \"Test Name\",\n \"pocPhone\": \"(954) 907-4631\",\n \"state\": \"FL\",\n \"street1\": \"1713 Azalea CT\",\n \"zip\": \"34677\",\n \"mlsId\": \"13371337\"\n}"
},
"url": "{{Domain}}/api/register/steps/company-info"
},
"response": []
},
{
"name": "Organization created and exists",
"event": [
{
"listen": "test",
"script": {
"id": "1655bafd-ee7c-41ee-85b7-2ec464a2d704",
"exec": [
"var jsonData = pm.response.json();",
"",
"pm.test(\"Status code is 200\", function () {",
" pm.response.to.have.status(200);",
"});",
"",
"pm.environment.set(\"defaultLeaseWrapupSteps\", JSON.stringify(jsonData.leaseWrapupSteps));",
"",
"pm.test(\"organization should have default lease wrap up steps defined\", function () {",
" pm.expect(jsonData.leaseWrapupSteps).to.exist;",
"});",
"",
"",
"",
"postman.setNextRequest(\"Add Role\");",
""
],
"type": "text/javascript"
}
}
],
"request": {
"method": "GET",
"header": [],
"body": {
"mode": "raw",
"raw": ""
},
"url": "{{Domain}}/api/organization/{{organization}}"
},
"response": []
}
],
"_postman_isSubFolder": true
},
{
"name": "2. Add Teams + Roles",
"item": [
{
"name": "Add Role",
"event": [
{
"listen": "test",
"script": {
"id": "684ec09e-11df-4b5b-a468-5d1856adcd06",
"exec": [
"pm.test(\"Status code is 200\", function () {",
" pm.response.to.have.status(200);",
"});",
"",
"",
"",
"postman.setNextRequest(\"Add Organization Teams + Roles\");"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"name": "Content-Type",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\n\t\"name\": \"test me\",\n\t\"description\": \"what\",\n\t\"permissions\": { }\n}"
},
"url": "{{Domain}}/api/role"
},
"response": []
},
{
"name": "Add Organization Teams + Roles",
"event": [
{
"listen": "test",
"script": {
"id": "e227a017-aeb7-4c49-8d2d-aedd106c174c",
"exec": [
"pm.test(\"Status code is 200\", function () {",
" pm.response.to.have.status(200);",
"});",
"",
"",
"",
"",
"postman.setNextRequest(\"Get Roles\");"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"name": "Content-Type",
"type": "text",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"roles\": [\n {\n \"_id\": \"5c468bf23778d731ff236381\",\n \"name\": \"test-role\",\n \"permissions\": {\n \"viewApplications\": false,\n \"addProperties\": false,\n \"editProperties\": false,\n \"viewProperties\": false,\n \"approveBids\": true\n }\n },\n {\n \"_id\": \"5c468bf23778d731ff236382\",\n \"name\": \"test-role2\",\n \"permissions\": {\n \"viewApplications\": false,\n \"addProperties\": false,\n \"editProperties\": false,\n \"viewProperties\": false,\n \"approveBids\": true\n }\n }\n ],\n \"members\": [\n {\n \"name\": \"tester\",\n \"email\": \"{{$guid}}@orgmember.com\",\n \"role\": \"5c468bf23778d731ff236382\"\n }\n ]\n}"
},
"url": "{{Domain}}/api/register/steps/roles-and-team"
},
"response": []
},
{
"name": "Get Roles",
"event": [
{
"listen": "test",
"script": {
"id": "1ed8caa3-7c3d-4d16-8467-2581699e244d",
"exec": [
"pm.test(\"Status code is 200\", function () {",
" pm.response.to.have.status(200);",
"});",
"",
"",
"// postman.setNextRequest(\"Add Bank Info\");",
"postman.setNextRequest(\"Add Fees + Deposits\");"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "GET",
"header": [],
"body": {
"mode": "raw",
"raw": ""
},
"url": "{{Domain}}/api/role"
},
"response": []
}
],
"_postman_isSubFolder": true
},
{
"name": "3. Add Bank Info",
"item": [],
"_postman_isSubFolder": true
},
{
"name": "4. Add Fees + Deposits",
"item": [
{
"name": "Add Fees + Deposits",
"event": [
{
"listen": "test",
"script": {
"id": "5956a42d-b9bc-4b36-949b-7656f66a8952",
"exec": [
"var atob = require('atob'),",
" _ = require('lodash');",
" ",
"",
"var jsonData = pm.response.json();",
"",
"pm.test(\"Status code is 200\", function () {",
" pm.response.to.have.status(200);",
"});",
"",
"const defSteps = JSON.parse(pm.environment.get('defaultLeaseWrapupSteps'));",
"",
"pm.test(\"organization.leaseWrapupSteps now has fees+deposit steps added\", function () {",
" pm.expect(jsonData.organization.leaseWrapupSteps).to.exist;",
" const diff = _.differenceBy(jsonData.organization.leaseWrapupSteps, defSteps, 'label');",
" pm.expect(diff.length > 0).to.equal(true);",
"});",
"",
"",
"",
"pm.environment.set('leaseWrapupStepsFeesDepositsAdded', JSON.stringify(jsonData.organization.leaseWrapupSteps));",
"",
"",
"",
"postman.setNextRequest(\"Add Qualification Criteria\");",
""
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"name": "Content-Type",
"type": "text",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"fees\": [\n { \n \"name\": \"Ugly fee\",\n \"internalDescription\": \"23\",\n \"publicRemark\": \"222\",\n \"fee\": \"23\"\n },\n {\n \"name\": \"Old fee\",\n \"internalDescription\": \"23\",\n \"publicRemark\": \"222\",\n \"fee\": \"23\"\n }\n ],\n \"deposits\": [\n {\n \"name\": \"Cat deposit\",\n \"internalDescription\": \"something\",\n \"publicRemark\": \"dogs are awesome\",\n \"type\": \"% of Rent\",\n \"deposit\": \"50\"\n },\n {\n \"name\": \"Dog deposit\",\n \"internalDescription\": \"something\",\n \"publicRemark\": \"dogs are awesome\",\n \"type\": \"% of Rent\",\n \"deposit\": \"25\"\n }\n ]\n}"
},
"url": "{{Domain}}/api/register/steps/fees-and-deposits"
},
"response": []
}
],
"_postman_isSubFolder": true
},
{
"name": "5. Add Org. Qualification Criteria",
"item": [
{
"name": "Add Qualification Criteria",
"event": [
{
"listen": "test",
"script": {
"id": "e2abf347-7e4d-4bcb-98bb-187f988e316a",
"exec": [
"pm.test(\"Status code is 200\", function () {",
" pm.response.to.have.status(200);",
"});",
"",
"",
"",
"postman.setNextRequest(\"PM Get Lease Wrapup Steps\");",
""
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"name": "Content-Type",
"type": "text",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"grossIncomeToRentRatio\": \"1111\",\n \"minimumResidentScore\": 630,\n \"decline\": {\n \"bankruptcy_discharged\": {\n \"enforce\": true,\n \"monthsWithin\": 24\n },\n \"bankruptcy_open\": {\n \"enforce\": true\n },\n \"bankruptcy_ch13\": {\n \"enforce\": true\n },\n \"foreclosure\": {\n \"enforce\": true,\n \"monthsWithin\": 24\n },\n \"collections\": {\n \"enforce\": true,\n \"monthsWithin\": 24\n },\n \"eviction\": {\n \"enforce\": true,\n \"monthsWithin\": 24\n },\n \"convictions\": {\n \"sexualOffense\": {\n \"enforce\": true,\n \"monthsWithin\": 24,\n \"allTime\": false\n },\n \"convictedLast7Years\": false,\n \"convictedOfViolentOrDrugRelated\": false\n }\n }\n}"
},
"url": "{{Domain}}/api/register/steps/qualification-criteria"
},
"response": []
}
],
"_postman_isSubFolder": true
},
{
"name": "6. Add Org. Lease Wrapup Order",
"item": [
{
"name": "PM Get Lease Wrapup Steps",
"event": [
{
"listen": "test",
"script": {
"id": "cafe0502-0d5d-4126-945d-f2100f3792c9",
"exec": [
"var jsonData = pm.response.json();",
"pm.environment.set(\"leaseWrapupSteps\", JSON.stringify(_.get(jsonData, 'leaseWrapupSteps')));",
"",
"pm.test(\"Status code is 200\", function () {",
" pm.response.to.have.status(200);",
"});",
"",
"",
"",
"postman.setNextRequest(\"Set Lease Wrapup Order\");"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "GET",
"header": [],
"body": {
"mode": "raw",
"raw": ""
},
"url": "{{Domain}}/api/register/steps/order-lease-wrapup"
},
"response": []
},
{
"name": "Set Lease Wrapup Order",
"event": [
{
"listen": "prerequest",
"script": {
"id": "c8f2fd67-f4b3-4d73-b404-fa2d7ed2282d",
"exec": [
"var lws = pm.environment.get(\"leaseWrapupSteps\");",
"const steps = JSON.parse(lws);",
"",
"// const first = steps.shift();",
"// const last = steps.pop();",
"// const b4Last = steps.pop();",
"const setSteps = steps.reverse();",
"console.log(setSteps)",
"pm.environment.set(\"reorderedLeaseWrapupSteps\", JSON.stringify(setSteps));"
],
"type": "text/javascript"
}
},
{
"listen": "test",
"script": {
"id": "059b9da1-1df8-4c2a-9def-73188ae00233",
"exec": [
"var _ = require('lodash');",
" ",
"",
"var jsondata = pm.response.json();",
"",
"pm.test(\"Status code is 200\", function () {",
" pm.response.to.have.status(200);",
"});",
"",
"const currSteps = JSON.parse(pm.environment.get('leaseWrapupSteps'));",
"const modifiedSteps = JSON.parse(pm.environment.get('reorderedLeaseWrapupSteps'));",
"",
"",
"pm.test('Lease wrapup steps are reordered', () => {",
" const diffRespToOrig = _.differenceBy(jsondata.organization.leaseWrapupSteps, currSteps, '_id');",
" const diffOrigToResp = _.differenceBy(currSteps, jsondata.organization.leaseWrapupSteps, '_id');",
" pm.expect(diffRespToOrig.length).to.equal(0);",
" pm.expect(diffOrigToResp.length).to.equal(0);",
" ",
" const hasMidpoint = jsondata.organization.leaseWrapupSteps.length % 2 !== 0;",
" const midpoint = (jsondata.organization.leaseWrapupSteps.length - 1) / 2;",
" console.log(midpoint)",
" _.forEach(jsondata.organization.leaseWrapupSteps, (el, i) => {",
" const fIndex = _.findIndex(currSteps, { _id: el._id });",
" if (hasMidpoint && i === midpoint){",
" pm.expect(fIndex).to.equal(i); ",
" return;",
" }",
" ",
" pm.expect(fIndex).to.not.equal(i);",
" });",
" ",
"});",
"",
"",
"pm.environment.set('leaseWrapupStepsFeesDepositsAdded', JSON.stringify(jsondata.organization.leaseWrapupSteps));",
"",
"",
"postman.setNextRequest(\"Add Client\");",
""
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"name": "Content-Type",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{{reorderedLeaseWrapupSteps}}"
},
"url": "{{Domain}}/api/register/steps/order-lease-wrapup"
},
"response": []
}
],
"_postman_isSubFolder": true
}
],
"_postman_isSubFolder": true
},
{
"name": "List a Fixed Price Property",
"item": [
{
"name": "Add Client",
"event": [
{
"listen": "test",
"script": {
"id": "aeb6720e-d051-4392-973c-2de573387f84",
"exec": [
"var jsonData = pm.response.json();",
"pm.environment.set(\"client\", _.get(jsonData, '_id'));",
"",
"",
"",
"pm.test(\"Status code is 200\", function () {",
" pm.response.to.have.status(200);",
"});",
"",
"postman.setNextRequest(\"Add Portfolio to Client\");",
""
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"name": "Content-Type",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"name\": \"dfasdf\",\n \"title\": \"dfasdf\",\n \"street1\": \"1713 Azalea CT\",\n \"street2\": \"dlfkj\",\n \"city\": \"Oldsmar\",\n \"state\": \"FL\",\n \"zip\": \"34677\",\n \"phone\": \"(954) 907-4631\",\n \"email\": \"test@gmail.com\",\n \"ein\": \"1-2345678\",\n \"poc.name\": \"ccdasdf\",\n \"poc.title\": \"Some guy\",\n \"poc.phone\": \"(954) 907-4631\",\n \"poc.email\": \"test@gmail.com\"\n}"
},
"url": "{{Domain}}/api/client"
},
"response": []
},
{
"name": "Add Portfolio to Client",
"event": [
{
"listen": "test",
"script": {
"id": "7870da69-93f9-47da-88c2-21ac7e113f56",
"exec": [
"var jsonData = pm.response.json();",
"pm.environment.set(\"portfolio\", _.get(jsonData, '_id')); ",
"",
"",
"pm.test(\"Status code is 200\", function () {",
" pm.response.to.have.status(200);",
"});",
"",
"",
"",
"",
"postman.setNextRequest(\"Create/Add Property to Portfolio\");"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"name": "Content-Type",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"name\": \"custom-portfolio\",\n \"client\": \"{{client}}\",\n \"qualificationOverride\": true,\n \"leaseWrapupSteps\": {{reorderedLeaseWrapupSteps}}\n}"
},
"url": "{{Domain}}/api/portfolio"
},
"response": []
},
{
"name": "Create/Add Property to Portfolio",
"event": [
{
"listen": "test",
"script": {
"id": "c6b7ecd3-75df-4e9e-9fd0-f77bfb4a7871",
"exec": [
"var jsonData = pm.response.json();",
"pm.environment.set(\"propertyId\", _.get(jsonData, '_id'));",
"",
" ",
"",
"",
"pm.test(\"Status code is 200\", function () {",
" pm.response.to.have.status(200);",
"});",
"",
"",
"postman.setNextRequest(\"Create Fixed Price Listing\");"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"name": "Content-Type",
"type": "text",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"portfolio\": \"{{portfolio}}\",\n \"unitType\": \"SingleUnit\",\n \"propertyType\": \"CONDO\",\n \"address1\": \"1365 Massachusetts Ave\",\n \"city\": \"Arlington\",\n \"state\": \"MA\",\n \"zip\": \"02476\",\n\t\"location\": {\n \"type\": \"Point\",\n \"coordinates\": [\n\t\t\t-104.9903, 39.7392\n ]\n },\n \"publicDescription\": \"fteart\",\n \"internalDescription\": \"rear\",\n \"beds\": 1,\n \"baths\": 1,\n \"parkingType\": \"none\",\n \"parkingSpaces\": 1,\n \"floors\": 1,\n \"livingArea\": 1000,\n \"subdivision\": \"1000\",\n \"petPolicy\": \"none\",\n \"furnished\": false,\n \"features\": [],\n \"targetRent\": 1000,\n \"images\": [\n \"5c9127b66de2aad5b67c5258\"\n ]\n}"
},
"url": "{{Domain}}/api/property"
},
"response": []
},
{
"name": "Create Fixed Price Listing",
"event": [
{
"listen": "test",
"script": {
"id": "0957d773-ffa7-4fa2-8219-8a32b3fa9f16",
"exec": [
"var jsonData = pm.response.json();",
"pm.environment.set(\"propertySession\", _.get(jsonData, '_id'));",
"",
" ",
"",
"",
"",
"pm.test(\"Status code is 200\", function () {",
" pm.response.to.have.status(200);",
"});",
"",
"postman.setNextRequest(\"Get Portfolios\");"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"name": "Content-Type",
"type": "text",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"type\": \"FIXED\",\n \"fixedPrice\": 1000,\n \"startDate\": \"2019-04-04T04:00:00.000Z\",\n \"endDate\": \"2019-04-06T04:00:00.000Z\"\n}"
},
"url": "{{Domain}}/api/auction/{{propertyId}}"
},
"response": []
},
{
"name": "Get Portfolios",
"event": [
{
"listen": "test",
"script": {
"id": "ad1cf1a2-5707-4a00-953e-1b22ebcada26",
"exec": [
"// var jsonData = pm.response.json();",
"// pm.environment.set(\"\", _.get(jsonData, 'user.organization'));",
"",
"",
" ",
"",
"var jsondata = pm.response.json();",
"",
"pm.test(\"Status code is 200\", function () {",
" pm.response.to.have.status(200);",
"});"
],
"type": "text/javascript"
}
}
],
"protocolProfileBehavior": {
"disableBodyPruning": true
},
"request": {
"method": "GET",
"header": [
{
"key": "Content-Type",
"name": "Content-Type",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": ""
},
"url": {
"raw": "{{Domain}}/api/portfolio",
"host": [
"{{Domain}}"
],
"path": [
"api",
"portfolio"
],
"query": [
{
"key": "",
"value": "",
"disabled": true
}
]
}
},
"response": []
}
],
"_postman_isSubFolder": true
}
],
"_postman_isSubFolder": true
},
{
"name": "Renter Steps",
"item": [
{
"name": "Register/Authenticate",
"item": [
{
"name": "Renter Register",
"event": [
{
"listen": "test",
"script": {
"id": "d023a1cc-a6cd-4e77-8805-53c1fec94db9",
"exec": [
"var jsonData = pm.response.json();",
"pm.environment.set(\"emailVerificationToken\", _.get(jsonData, 'user.registration.token'));",
"pm.environment.set(\"renterId\", _.get(jsonData, 'user._id'));",
"",
"",
"pm.test(\"response is ok 200\", function () {",
" pm.response.to.have.status(200);",
"});",
"",
"pm.test(\"should have no user.renterApplication\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData.user).to.exist;",
" pm.expect(jsonData.user.renterApplication).to.not.exist;",
" pm.expect(jsonData.user.renterApplication).to.equal(null);",
"});",
"",
"",
"",
"postman.setNextRequest(\"Renter Verify Email\");"
],
"type": "text/javascript"
}
},
{
"listen": "prerequest",
"script": {
"id": "4d810578-ead1-431c-91ee-cc7913dbd207",
"exec": [
"var guid = (function() {",
" function s4() {",
" return Math.floor((1 + Math.random()) * 0x10000)",
" .toString(16)",
" .substring(1);",
" }",
" return function() {",
" return s4() + s4() + '-' + s4() + '-' + s4() + '-' +",
" s4() + '-' + s4() + s4() + s4();",
" };",
"})();",
"",
"",
"",
"postman.setEnvironmentVariable(\"remail\", `${Math.random()}@mailinator.com`);",
"postman.setNextRequest(\"Verify Email\");",
""
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"name": "Content-Type",
"type": "text",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"acctType\": \"renter\",\n \"firstName\": \"test\",\n \"lastName\": \"test\",\n \"email\": \"{{remail}}\",\n \"password\": \"test123\"\n}"
},
"url": "{{Domain}}/api/register"
},
"response": []
},
{
"name": "Renter Verify Email",
"event": [
{
"listen": "test",
"script": {
"id": "27403cfd-0a8a-4074-814f-a67aa9dff64d",
"exec": [
"const resp = pm.response.json();",
"",
"",
"",
"pm.test(\"response is ok 200\", function () {",
" pm.response.to.have.status(200);",
"});",
"",
"pm.test('response contains user', () => {",
" pm.expect(resp.user.registration.emailVerified).to.equal(true);",
"});",
"",
"",
"postman.setNextRequest(\"Renter Login\");"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "GET",
"header": [],
"body": {
"mode": "raw",
"raw": ""
},
"url": "{{Domain}}/api/register/verify/{{emailVerificationToken}}"
},
"response": []
},
{
"name": "Renter Login",
"event": [
{
"listen": "test",
"script": {
"id": "ae2fba81-9063-498f-a4b3-984d62245a9f",
"exec": [
"",
"var jsonData = pm.response.json();",
"",
"",
"pm.environment.set(\"jwt\", _.get(jsonData, 'jwt'));",
"pm.environment.set(\"renterId\", _.get(jsonData, 'user._id'));",
"pm.test(\"response is ok 200\", function () {",
" pm.response.to.have.status(200);",
"});",
"",
"",
"",
"postman.setNextRequest(\"Renter Accept TOS\");"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"name": "Content-Type",
"type": "text",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{\n\t\"email\": \"{{remail}}\",\n\t\"password\": \"test123\"\n}"
},
"url": "{{Domain}}/api/login"
},
"response": []
},
{
"name": "Renter Accept TOS",
"event": [
{
"listen": "test",
"script": {
"id": "030d251f-a47e-46e9-8ea2-eccd3aa0dcfb",
"exec": [
"pm.test(\"response is ok 200\", function () {",
" pm.response.to.have.status(200);",
"});",
"",
"",
"postman.setNextRequest(\"Renter Application\");"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "PATCH",
"header": [],
"body": {
"mode": "raw",
"raw": ""
},
"url": "{{Domain}}/api/register/tos-accept"
},
"response": []
}
],
"_postman_isSubFolder": true
},
{
"name": "Renter Application",
"item": [
{
"name": "Renter Application",
"event": [
{
"listen": "test",
"script": {
"id": "bde3cfd7-b3e9-4052-8f52-9542ba37764b",
"exec": [
"pm.test(\"response is ok 200\", function () {",
" pm.response.to.have.status(200);",
"});",
"",
"",
"const domain = pm.environment.get(\"Domain\");",
"const renterId = pm.environment.get(\"renterId\");",
"",
"",
"",
"pm.sendRequest(`${domain}/api/renter/${renterId}/application`, function (err, resp) {",
" pm.test('renter application exists', () => {",
" pm.expect(resp.code).to.equal(200);",
" const json = resp.json();",
" console.log('json', json); ",
" });",
"});",
"postman.setNextRequest(\"Get Renter Application\");"
],
"type": "text/javascript"
}
},
{
"listen": "prerequest",
"script": {
"id": "a6e58a6a-5057-4ce4-adf5-59999f8b304e",
"exec": [
"pm.sendRequest(\"https://postman-echo.com/get\", function (err, response) {",
" console.log(response.json());",
"});"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"name": "Content-Type",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"accountInformation\": {\n \"street1\": \"5421 Beaumont Center BLVD\",\n \"street2\": \"#675\",\n \"city\": \"Tampa\",\n \"state\": \"FL\",\n \"zip\": \"33634\",\n \"country\": \"USA\",\n \"phone\": \"(954) 907-4631\",\n \"emergency\": {\n \"name\": \"James Choi\",\n \"phone\": \"(954) 907-4631\",\n \"email\": \"james@e2gens.com\",\n \"relationship\": \"Mother\"\n }\n },\n \"searchInformation\": {\n \"moveInDate\": \"2019-02-25T18:31:37.769Z\",\n \"desiredRent\": 500,\n \"reasonForMoving\": \"sss\",\n \"desiredLeaseLength\": \"Monthly\",\n \"usingRealEstateAgent\": false\n },\n \"occupants\": [\n {\n \"firstName\": \"James\",\n \"middleName\": \"dl\",\n \"lastName\": \"Choi\",\n \"birthDate\": \"2019-02-25T18:31:40.077Z\",\n \"email\": \"choijj@mail.broward.edu\",\n \"phone\": \"(954) 907-4631\",\n \"relationship\": \"Mother\"\n }\n ],\n \"pets\": [\n {\n \"name\": \"Nalad\",\n \"petType\": \"Dog\",\n \"breed\": \"Labrador\",\n \"weight\": 10\n }\n ],\n \"vehicles\": [\n {\n \"tag\": \"KA72Q\",\n \"make\": \"Hondad\",\n \"model\": \"civic\",\n \"year\": 2018,\n \"state\": \"FL\"\n }\n ],\n \"prescreening\": {\n \"bankruptcy_discharged\": {\n \"value\": true,\n \"monthsWithin\": 1\n },\n \"bankruptcy_open\": {\n \"value\": false\n },\n \"bankruptcy_ch13\": {\n \"value\": false\n },\n \"foreclosure\": {\n \"value\": true,\n \"monthsWithin\": 0\n },\n \"collections\": {\n \"value\": true,\n \"monthsWithin\": 0\n },\n \"eviction\": {\n \"value\": false,\n \"monthsWithin\": 0\n },\n \"sexualOffense\": {\n \"value\": false,\n \"allTime\": false,\n \"monthsWithin\": 0\n },\n \"convictedLast7Years\": {\n \"value\": false\n },\n \"convictedOfViolentOrDrugRelated\": {\n \"value\": false\n }\n }\n}"
},
"url": "{{Domain}}/api/renter/{{renterId}}/application"
},
"response": []
},
{
"name": "Get Renter Application",
"event": [
{
"listen": "test",
"script": {
"id": "7b974805-4c0f-4baf-b955-9ea048751144",
"exec": [
"pm.test(\"response is ok 200\", function () {",
" pm.response.to.have.status(200);",
"});",
"",
"",
"postman.setNextRequest(\"Search Property-Sessions\");"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "GET",
"header": [],
"body": {
"mode": "raw",
"raw": ""
},
"url": "{{Domain}}/api/renter/{{renterId}}/application"
},
"response": []
}
],
"_postman_isSubFolder": true
},
{
"name": "Rent It Now",
"item": [
{
"name": "Search Property-Sessions",
"event": [
{
"listen": "test",
"script": {
"id": "af56dac8-ba2f-4b8a-bc1a-9ac24cd90945",
"exec": [
"var jsonData = pm.response.json();",
"pm.environment.set(\"propertySession\", _.get(jsonData[jsonData.length-1], '_id'));",
"pm.test(\"response is ok 200\", function () {",
" pm.response.to.have.status(200);",
"});",
"",
"",
"",
"postman.setNextRequest(\"Rent It Now\");"
],
"type": "text/javascript"
}
}
],
"protocolProfileBehavior": {
"disableBodyPruning": true
},
"request": {
"method": "GET",
"header": [
{
"key": "Content-Type",
"name": "Content-Type",
"type": "text",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": ""
},
"url": {
"raw": "{{Domain}}/api/property-session/search?bounds=[[-109, 41], [-102, 41], [-102, 37], [-109, 37]]",
"host": [
"{{Domain}}"
],
"path": [
"api",
"property-session",
"search"
],
"query": [
{
"key": "bounds",
"value": "[[-109, 41], [-102, 41], [-102, 37], [-109, 37]]"
}
]
}
},
"response": []
},
{
"name": "Rent It Now",
"event": [
{
"listen": "test",
"script": {
"id": "c3836eef-c3d1-4b12-9c56-d1238843c45b",
"exec": [
"var jsonData = pm.response.json();",
"",
"pm.test(\"response is ok 200\", function () {",
" pm.response.to.have.status(200);",
"});",
"",
"pm.test('response contains resp.user', () => {",
" pm.expect(jsonData.user).to.exist;",
" pm.expect(jsonData.user.leaseWrapup).to.exist;",
" pm.expect(jsonData.user.leaseWrapupInProgress).to.equal(true);",
"});",
"",
"const leaseWrapupId = _.get(jsonData, 'leaseWrapup._id', _.get(jsonData, 'leaseWrapup'))",
"pm.environment.set(\"leaseWrapupId\", leaseWrapupId);",
"",
"",
"pm.variables.get(\"variable_key\");",
"postman.setNextRequest(\"Renter Get Lease Wrapup Steps\");"
],
"type": "text/javascript"
}
},
{
"listen": "prerequest",
"script": {
"id": "1a779b77-85a6-4cda-80f7-cf70222249b6",
"exec": [
""
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"name": "Content-Type",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"propertySessionId\": \"{{propertySession}}\"\n}"
},
"url": "{{Domain}}/api/lease-wrapup/rent-it-now"
},
"response": [
{
"name": "Rent It Now",
"originalRequest": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"name": "Content-Type",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"propertySessionId\": \"{{propertySession}}\"\n}"
},
"url": "{{Domain}}/api/lease-wrapup/rent-it-now"
},
"status": "OK",
"code": 200,
"_postman_previewlanguage": "json",
"header": [
{
"key": "x-access-token",
"value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyIjp7InNldHRpbmdzIjp7ImVtYWlsTm90aWZpY2F0aW9uIjpmYWxzZSwic21zTm90aWZpY2F0aW9uIjpmYWxzZSwiYmlkTm90aWZpY2F0aW9uIjpmYWxzZSwicHVzaE5vdGlmaWNhdGlvbnMiOmZhbHNlLCJjb21wYWN0TmF2QmFyIjpmYWxzZSwiYXV0b1NpZ25PdXQiOmZhbHNlLCJsb2dpbkF0dGVtcHRBbGVydHMiOmZhbHNlfSwicmVnaXN0cmF0aW9uIjp7ImluUHJvZ3Jlc3MiOnRydWUsIm9uQm9hcmRpbmciOmZhbHNlLCJiYW5raW5nQWNjdHNBZGRlZCI6ZmFsc2UsInVzZXJUeXBlIjoicmVudGVyIiwidG9zQWNjZXB0ZWQiOnRydWUsImVtYWlsVmVyaWZpZWQiOnRydWUsImlzU3VwZXJBZG1pbiI6dHJ1ZSwic3RlcCI6MSwidG9rZW4iOiIzOGE3ZWQ3NDZjYmMwN2NlZDk2MTAxZWU4NjEwNzc2ZmYyMWIzYmFkIn0sInJlbnRlckFwcGxpY2F0aW9uIjoiNWM5NjcxZmUyYjRjNmJjMmMxM2U0NTVlIiwiX2lkIjoiNWM5NjcxZjEyYjRjNmJjMmMxM2U0NTVkIiwiZmlyc3ROYW1lIjoidGVzdCIsImxhc3ROYW1lIjoidGVzdCIsImVtYWlsIjoiMC4wNzA4MjY4MjQyNzYxMDU2NUBtYWlsaW5hdG9yLmNvbSIsInBhc3N3b3JkIjoiJDJhJDEwJGtNTFZ6TzJiWjEzeWJBcUxndlBXVS52ZnFidTFoL0o4UXJoUFY2TVp3MzFwRzdIQmxsdElxIiwiY3JlYXRlZEF0IjoiMjAxOS0wMy0yM1QxNzo1MDo0MS40NjJaIiwidXBkYXRlZEF0IjoiMjAxOS0wMy0yM1QxNzo1MDo1NC4zMzlaIiwiX192IjowLCJtZXRhZGF0YSI6eyJoYXNSZW50ZXJBcHBsaWNhdGlvbiI6dHJ1ZSwibGVhc2VXcmFwdXBJblByb2dyZXNzIjp0cnVlfSwibGVhc2VXcmFwdXBJblByb2dyZXNzIjp0cnVlLCJpZCI6IjVjOTY3MWYxMmI0YzZiYzJjMTNlNDU1ZCIsInNjb3BlIjoicmVudGVyIiwibGVhc2VXcmFwdXAiOiI1Yzk2NzIxNjJiNGM2YmMyYzEzZTQ1OWIifSwiaWF0IjoxNTUzMzYzNDc4LCJleHAiOjE1NTM0NDk4Nzh9.5g14E2xV6wX6m0ONV08GqM5cuoMkIOYOgWddTZc9Lqo"
},
{
"key": "content-type",
"value": "application/json; charset=utf-8"
},
{
"key": "cache-control",
"value": "no-cache"
},
{
"key": "set-cookie",
"value": "token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyIjp7InNldHRpbmdzIjp7ImVtYWlsTm90aWZpY2F0aW9uIjpmYWxzZSwic21zTm90aWZpY2F0aW9uIjpmYWxzZSwiYmlkTm90aWZpY2F0aW9uIjpmYWxzZSwicHVzaE5vdGlmaWNhdGlvbnMiOmZhbHNlLCJjb21wYWN0TmF2QmFyIjpmYWxzZSwiYXV0b1NpZ25PdXQiOmZhbHNlLCJsb2dpbkF0dGVtcHRBbGVydHMiOmZhbHNlfSwicmVnaXN0cmF0aW9uIjp7ImluUHJvZ3Jlc3MiOnRydWUsIm9uQm9hcmRpbmciOmZhbHNlLCJiYW5raW5nQWNjdHNBZGRlZCI6ZmFsc2UsInVzZXJUeXBlIjoicmVudGVyIiwidG9zQWNjZXB0ZWQiOnRydWUsImVtYWlsVmVyaWZpZWQiOnRydWUsImlzU3VwZXJBZG1pbiI6dHJ1ZSwic3RlcCI6MSwidG9rZW4iOiIzOGE3ZWQ3NDZjYmMwN2NlZDk2MTAxZWU4NjEwNzc2ZmYyMWIzYmFkIn0sInJlbnRlckFwcGxpY2F0aW9uIjoiNWM5NjcxZmUyYjRjNmJjMmMxM2U0NTVlIiwiX2lkIjoiNWM5NjcxZjEyYjRjNmJjMmMxM2U0NTVkIiwiZmlyc3ROYW1lIjoidGVzdCIsImxhc3ROYW1lIjoidGVzdCIsImVtYWlsIjoiMC4wNzA4MjY4MjQyNzYxMDU2NUBtYWlsaW5hdG9yLmNvbSIsInBhc3N3b3JkIjoiJDJhJDEwJGtNTFZ6TzJiWjEzeWJBcUxndlBXVS52ZnFidTFoL0o4UXJoUFY2TVp3MzFwRzdIQmxsdElxIiwiY3JlYXRlZEF0IjoiMjAxOS0wMy0yM1QxNzo1MDo0MS40NjJaIiwidXBkYXRlZEF0IjoiMjAxOS0wMy0yM1QxNzo1MDo1NC4zMzlaIiwiX192IjowLCJtZXRhZGF0YSI6eyJoYXNSZW50ZXJBcHBsaWNhdGlvbiI6dHJ1ZSwibGVhc2VXcmFwdXBJblByb2dyZXNzIjp0cnVlfSwibGVhc2VXcmFwdXBJblByb2dyZXNzIjp0cnVlLCJpZCI6IjVjOTY3MWYxMmI0YzZiYzJjMTNlNDU1ZCIsInNjb3BlIjoicmVudGVyIiwibGVhc2VXcmFwdXAiOiI1Yzk2NzIxNjJiNGM2YmMyYzEzZTQ1OWIifSwiaWF0IjoxNTUzMzYzNDc4LCJleHAiOjE1NTM0NDk4Nzh9.5g14E2xV6wX6m0ONV08GqM5cuoMkIOYOgWddTZc9Lqo; Max-Age=86400; Expires=Sun, 24 Mar 2019 17:51:18 GMT; HttpOnly; SameSite=Strict; Path=/"
},
{
"key": "vary",
"value": "accept-encoding"
},
{
"key": "content-encoding",
"value": "gzip"
},
{
"key": "Date",
"value": "Sat, 23 Mar 2019 17:51:18 GMT"
},
{
"key": "Connection",
"value": "keep-alive"
},
{
"key": "Transfer-Encoding",
"value": "chunked"
}
],
"cookie": [],
"body": "{\n \"propertySession\": {\n \"status\": \"pending\",\n \"deletedAt\": null,\n \"_id\": \"5c96605bc0991ae840915878\",\n \"organization\": {\n \"pointOfContact\": {\n \"email\": \"test@gmail.com\",\n \"name\": \"Test Name\",\n \"phone\": \"9549074631\"\n },\n \"roles\": [\n \"5c966059c0991ae840915845\",\n \"5c966059c0991ae840915846\",\n \"5c96605ac0991ae840915850\",\n \"5c96605ac0991ae840915851\",\n \"5c96605ac0991ae840915852\"\n ],\n \"members\": [\n \"5c966057c0991ae840915843\",\n \"5c96605ac0991ae840915853\"\n ],\n \"offices\": [],\n \"_id\": \"5c966059c0991ae840915844\",\n \"propertyManager\": \"5c966057c0991ae840915843\",\n \"companyName\": \"TestCompany\",\n \"address1\": \"1713 Azalea CT\",\n \"address2\": null,\n \"zip\": \"34677\",\n \"city\": \"Oldsmar\",\n \"state\": \"FL\",\n \"phone\": \"9549074631\",\n \"email\": \"test@gmail.com\",\n \"dba\": \"testdba\",\n \"employerIdentificationNumber\": \"11111111111\",\n \"licenseNumber\": \"1111111\",\n \"mlsId\": \"13371337\",\n \"fees\": [\n {\n \"_id\": \"5c96605ac0991ae840915854\",\n \"name\": \"Ugly Fee\",\n \"internalDescription\": \"23\",\n \"publicRemark\": \"222\",\n \"fee\": 23\n },\n {\n \"_id\": \"5c96605ac0991ae840915855\",\n \"name\": \"Old Fee\",\n \"internalDescription\": \"23\",\n \"publicRemark\": \"222\",\n \"fee\": 23\n }\n ],\n \"deposits\": [\n {\n \"_id\": \"5c96605ac0991ae840915856\",\n \"name\": \"Cat Deposit\",\n \"internalDescription\": \"something\",\n \"publicRemark\": \"dogs are awesome\",\n \"type\": \"Fixed\",\n \"deposit\": 100\n },\n {\n \"_id\": \"5c96605ac0991ae840915857\",\n \"name\": \"Dog Deposit\",\n \"internalDescription\": \"something\",\n \"publicRemark\": \"dogs are awesome\",\n \"type\": \"Fixed\",\n \"deposit\": 100\n }\n ],\n \"leaseWrapupSteps\": [\n {\n \"_id\": \"5c96605ac0991ae84091585b\",\n \"label\": \"Old Fee\",\n \"type\": \"Fee\",\n \"amount\": 23,\n \"amountType\": null,\n \"createdAt\": \"2019-03-23T16:35:38.369Z\",\n \"updatedAt\": \"2019-03-23T16:35:38.369Z\"\n },\n {\n \"_id\": \"5c96605ac0991ae84091585a\",\n \"label\": \"Ugly Fee\",\n \"type\": \"Fee\",\n \"amount\": 23,\n \"amountType\": null,\n \"createdAt\": \"2019-03-23T16:35:38.369Z\",\n \"updatedAt\": \"2019-03-23T16:35:38.369Z\"\n },\n {\n \"_id\": \"5c96605ac0991ae840915859\",\n \"label\": \"Dog Deposit\",\n \"type\": \"Deposit\",\n \"amount\": 100,\n \"amountType\": \"Fixed\",\n \"createdAt\": \"2019-03-23T16:35:38.369Z\",\n \"updatedAt\": \"2019-03-23T16:35:38.369Z\"\n },\n {\n \"_id\": \"5c96605ac0991ae840915858\",\n \"label\": \"Cat Deposit\",\n \"type\": \"Deposit\",\n \"amount\": 100,\n \"amountType\": \"Fixed\",\n \"createdAt\": \"2019-03-23T16:35:38.369Z\",\n \"updatedAt\": \"2019-03-23T16:35:38.369Z\"\n },\n {\n \"_id\": \"5c966059c0991ae84091584f\",\n \"label\": \"Finalize Lease\",\n \"type\": \"Step\",\n \"amount\": null,\n \"amountType\": null,\n \"createdAt\": \"2019-03-23T16:35:37.779Z\",\n \"updatedAt\": \"2019-03-23T16:35:37.779Z\"\n },\n {\n \"_id\": \"5c966059c0991ae84091584e\",\n \"label\": \"First Months Rent\",\n \"type\": \"Step\",\n \"amount\": null,\n \"amountType\": null,\n \"createdAt\": \"2019-03-23T16:35:37.779Z\",\n \"updatedAt\": \"2019-03-23T16:35:37.779Z\"\n },\n {\n \"_id\": \"5c966059c0991ae84091584d\",\n \"label\": \"Sign Lease\",\n \"type\": \"Step\",\n \"amount\": null,\n \"amountType\": null,\n \"createdAt\": \"2019-03-23T16:35:37.779Z\",\n \"updatedAt\": \"2019-03-23T16:35:37.779Z\"\n },\n {\n \"_id\": \"5c966059c0991ae84091584c\",\n \"label\": \"Security Deposit\",\n \"type\": \"Deposit\",\n \"amount\": 100,\n \"amountType\": \"% of Rent\",\n \"createdAt\": \"2019-03-23T16:35:37.779Z\",\n \"updatedAt\": \"2019-03-23T16:35:37.779Z\"\n },\n {\n \"_id\": \"5c966059c0991ae84091584b\",\n \"label\": \"Upload Documents\",\n \"type\": \"Step\",\n \"amount\": null,\n \"amountType\": null,\n \"createdAt\": \"2019-03-23T16:35:37.779Z\",\n \"updatedAt\": \"2019-03-23T16:35:37.779Z\"\n },\n {\n \"_id\": \"5c966059c0991ae84091584a\",\n \"label\": \"Verify Details\",\n \"type\": \"Step\",\n \"amount\": null,\n \"amountType\": null,\n \"createdAt\": \"2019-03-23T16:35:37.779Z\",\n \"updatedAt\": \"2019-03-23T16:35:37.779Z\"\n },\n {\n \"_id\": \"5c966059c0991ae840915849\",\n \"label\": \"Profile Confirmation\",\n \"type\": \"Step\",\n \"amount\": null,\n \"amountType\": null,\n \"createdAt\": \"2019-03-23T16:35:37.779Z\",\n \"updatedAt\": \"2019-03-23T16:35:37.779Z\"\n }\n ],\n \"createdAt\": \"2019-03-23T16:35:37.779Z\",\n \"updatedAt\": \"2019-03-23T16:35:38.746Z\",\n \"__v\": 4,\n \"qualificationCriteria\": \"5c96605ac0991ae84091585c\",\n \"id\": \"5c966059c0991ae840915844\"\n },\n \"property\": {\n \"furnished\": false,\n \"images\": [\n \"5c9127b66de2aad5b67c5258\"\n ],\n \"_id\": \"5c96605ac0991ae840915876\",\n \"portfolio\": \"5c96605ac0991ae84091586a\",\n \"unitType\": \"SingleUnit\",\n \"propertyType\": \"APT\",\n \"address1\": \"1365 Massachusetts Ave\",\n \"city\": \"Arlington\",\n \"state\": \"MA\",\n \"zip\": \"02476\",\n \"location\": {\n \"coordinates\": [\n -104.9903,\n 39.7392\n ],\n \"_id\": \"5c96605ac0991ae840915877\",\n \"type\": \"Point\"\n },\n \"publicDescription\": \"fteart\",\n \"internalDescription\": \"rear\",\n \"beds\": 1,\n \"baths\": 1,\n \"parkingType\": \"none\",\n \"parkingSpaces\": 1,\n \"floors\": 1,\n \"livingArea\": 1000,\n \"subdivision\": \"1000\",\n \"petPolicy\": \"none\",\n \"features\": [],\n \"targetRent\": 1000,\n \"organization\": \"5c966059c0991ae840915844\",\n \"createdAt\": \"2019-03-23T16:35:38.991Z\",\n \"updatedAt\": \"2019-03-23T16:35:38.991Z\",\n \"__v\": 0\n },\n \"createdAt\": \"2019-03-23T16:35:39.003Z\",\n \"updatedAt\": \"2019-03-23T17:51:18.883Z\",\n \"__v\": 0,\n \"fixedPrice\": 1000,\n \"type\": \"FIXED\",\n \"winner\": \"5c9671f12b4c6bc2c13e455d\",\n \"id\": \"5c96605bc0991ae840915878\"\n },\n \"leaseWrapup\": {\n \"_id\": \"5c9672162b4c6bc2c13e459b\",\n \"steps\": [\n {\n \"_id\": \"5c9672162b4c6bc2c13e4590\",\n \"type\": \"Fee\",\n \"label\": \"Old Fee\",\n \"amount\": 23,\n \"updatedAt\": \"2019-03-23T16:35:38.369Z\",\n \"createdAt\": \"2019-03-23T16:35:38.369Z\"\n },\n {\n \"_id\": \"5c9672162b4c6bc2c13e4591\",\n \"type\": \"Fee\",\n \"label\": \"Ugly Fee\",\n \"amount\": 23,\n \"updatedAt\": \"2019-03-23T16:35:38.369Z\",\n \"createdAt\": \"2019-03-23T16:35:38.369Z\"\n },\n {\n \"_id\": \"5c9672162b4c6bc2c13e4592\",\n \"type\": \"Deposit\",\n \"label\": \"Dog Deposit\",\n \"amount\": 100,\n \"amountType\": \"Fixed\",\n \"updatedAt\": \"2019-03-23T16:35:38.369Z\",\n \"createdAt\": \"2019-03-23T16:35:38.369Z\"\n },\n {\n \"_id\": \"5c9672162b4c6bc2c13e4593\",\n \"type\": \"Deposit\",\n \"label\": \"Cat Deposit\",\n \"amount\": 100,\n \"amountType\": \"Fixed\",\n \"updatedAt\": \"2019-03-23T16:35:38.369Z\",\n \"createdAt\": \"2019-03-23T16:35:38.369Z\"\n },\n {\n \"_id\": \"5c9672162b4c6bc2c13e4594\",\n \"type\": \"Step\",\n \"label\": \"Finalize Lease\",\n \"amount\": null,\n \"amountType\": null,\n \"updatedAt\": \"2019-03-23T16:35:37.779Z\",\n \"createdAt\": \"2019-03-23T16:35:37.779Z\"\n },\n {\n \"_id\": \"5c9672162b4c6bc2c13e4595\",\n \"type\": \"Step\",\n \"label\": \"First Months Rent\",\n \"amount\": null,\n \"amountType\": null,\n \"updatedAt\": \"2019-03-23T16:35:37.779Z\",\n \"createdAt\": \"2019-03-23T16:35:37.779Z\"\n },\n {\n \"_id\": \"5c9672162b4c6bc2c13e4596\",\n \"type\": \"Step\",\n \"label\": \"Sign Lease\",\n \"amount\": null,\n \"amountType\": null,\n \"updatedAt\": \"2019-03-23T16:35:37.779Z\",\n \"createdAt\": \"2019-03-23T16:35:37.779Z\"\n },\n {\n \"_id\": \"5c9672162b4c6bc2c13e4597\",\n \"type\": \"Deposit\",\n \"label\": \"Security Deposit\",\n \"amount\": 100,\n \"amountType\": \"% of Rent\",\n \"updatedAt\": \"2019-03-23T16:35:37.779Z\",\n \"createdAt\": \"2019-03-23T16:35:37.779Z\"\n },\n {\n \"_id\": \"5c9672162b4c6bc2c13e4598\",\n \"type\": \"Step\",\n \"label\": \"Upload Documents\",\n \"amount\": null,\n \"amountType\": null,\n \"updatedAt\": \"2019-03-23T16:35:37.779Z\",\n \"createdAt\": \"2019-03-23T16:35:37.779Z\"\n },\n {\n \"_id\": \"5c9672162b4c6bc2c13e4599\",\n \"type\": \"Step\",\n \"label\": \"Verify Details\",\n \"amount\": null,\n \"amountType\": null,\n \"updatedAt\": \"2019-03-23T16:35:37.779Z\",\n \"createdAt\": \"2019-03-23T16:35:37.779Z\"\n },\n {\n \"_id\": \"5c9672162b4c6bc2c13e459a\",\n \"type\": \"Step\",\n \"label\": \"Profile Confirmation\",\n \"amount\": null,\n \"amountType\": null,\n \"updatedAt\": \"2019-03-23T16:35:37.779Z\",\n \"createdAt\": \"2019-03-23T16:35:37.779Z\"\n }\n ],\n \"propertySession\": \"5c96605bc0991ae840915878\",\n \"submissions\": [\n {\n \"submitted\": false,\n \"_id\": \"5c9672162b4c6bc2c13e45b6\",\n \"type\": \"Fee\",\n \"payments\": [\n {\n \"_id\": \"5c9672162b4c6bc2c13e4590\",\n \"type\": \"Fee\",\n \"label\": \"Old Fee\",\n \"amount\": 23,\n \"updatedAt\": \"2019-03-23T16:35:38.369Z\",\n \"createdAt\": \"2019-03-23T16:35:38.369Z\"\n },\n {\n \"_id\": \"5c9672162b4c6bc2c13e4591\",\n \"type\": \"Fee\",\n \"label\": \"Ugly Fee\",\n \"amount\": 23,\n \"updatedAt\": \"2019-03-23T16:35:38.369Z\",\n \"createdAt\": \"2019-03-23T16:35:38.369Z\"\n }\n ],\n \"createdAt\": \"2019-03-23T17:51:18.886Z\",\n \"updatedAt\": \"2019-03-23T17:51:18.886Z\",\n \"id\": \"5c9672162b4c6bc2c13e45b6\"\n },\n {\n \"submitted\": false,\n \"_id\": \"5c9672162b4c6bc2c13e45b7\",\n \"type\": \"Deposit\",\n \"payments\": [\n {\n \"_id\": \"5c9672162b4c6bc2c13e4592\",\n \"type\": \"Deposit\",\n \"label\": \"Dog Deposit\",\n \"amount\": 100,\n \"amountType\": \"Fixed\",\n \"updatedAt\": \"2019-03-23T16:35:38.369Z\",\n \"createdAt\": \"2019-03-23T16:35:38.369Z\"\n },\n {\n \"_id\": \"5c9672162b4c6bc2c13e4593\",\n \"type\": \"Deposit\",\n \"label\": \"Cat Deposit\",\n \"amount\": 100,\n \"amountType\": \"Fixed\",\n \"updatedAt\": \"2019-03-23T16:35:38.369Z\",\n \"createdAt\": \"2019-03-23T16:35:38.369Z\"\n }\n ],\n \"createdAt\": \"2019-03-23T17:51:18.886Z\",\n \"updatedAt\": \"2019-03-23T17:51:18.886Z\",\n \"id\": \"5c9672162b4c6bc2c13e45b7\"\n },\n {\n \"submitted\": false,\n \"_id\": \"5c9672162b4c6bc2c13e45b8\",\n \"type\": \"Step\",\n \"step\": {\n \"_id\": \"5c9672162b4c6bc2c13e4594\",\n \"type\": \"Step\",\n \"label\": \"Finalize Lease\",\n \"amount\": null,\n \"amountType\": null,\n \"updatedAt\": \"2019-03-23T16:35:37.779Z\",\n \"createdAt\": \"2019-03-23T16:35:37.779Z\"\n },\n \"payments\": [],\n \"createdAt\": \"2019-03-23T17:51:18.886Z\",\n \"updatedAt\": \"2019-03-23T17:51:18.886Z\",\n \"id\": \"5c9672162b4c6bc2c13e45b8\"\n },\n {\n \"submitted\": false,\n \"_id\": \"5c9672162b4c6bc2c13e45ba\",\n \"type\": \"Step\",\n \"step\": {\n \"_id\": \"5c9672162b4c6bc2c13e4595\",\n \"type\": \"Step\",\n \"label\": \"First Months Rent\",\n \"amount\": null,\n \"amountType\": null,\n \"updatedAt\": \"2019-03-23T16:35:37.779Z\",\n \"createdAt\": \"2019-03-23T16:35:37.779Z\"\n },\n \"payments\": [],\n \"createdAt\": \"2019-03-23T17:51:18.886Z\",\n \"updatedAt\": \"2019-03-23T17:51:18.886Z\",\n \"id\": \"5c9672162b4c6bc2c13e45ba\"\n },\n {\n \"submitted\": false,\n \"_id\": \"5c9672162b4c6bc2c13e45bc\",\n \"type\": \"Step\",\n \"step\": {\n \"_id\": \"5c9672162b4c6bc2c13e4596\",\n \"type\": \"Step\",\n \"label\": \"Sign Lease\",\n \"amount\": null,\n \"amountType\": null,\n \"updatedAt\": \"2019-03-23T16:35:37.779Z\",\n \"createdAt\": \"2019-03-23T16:35:37.779Z\"\n },\n \"payments\": [],\n \"createdAt\": \"2019-03-23T17:51:18.886Z\",\n \"updatedAt\": \"2019-03-23T17:51:18.886Z\",\n \"id\": \"5c9672162b4c6bc2c13e45bc\"\n },\n {\n \"submitted\": false,\n \"_id\": \"5c9672162b4c6bc2c13e45be\",\n \"type\": \"Deposit\",\n \"payments\": [\n {\n \"_id\": \"5c9672162b4c6bc2c13e4597\",\n \"type\": \"Deposit\",\n \"label\": \"Security Deposit\",\n \"amount\": 100,\n \"amountType\": \"% of Rent\",\n \"updatedAt\": \"2019-03-23T16:35:37.779Z\",\n \"createdAt\": \"2019-03-23T16:35:37.779Z\"\n }\n ],\n \"createdAt\": \"2019-03-23T17:51:18.886Z\",\n \"updatedAt\": \"2019-03-23T17:51:18.886Z\",\n \"id\": \"5c9672162b4c6bc2c13e45be\"\n },\n {\n \"submitted\": false,\n \"_id\": \"5c9672162b4c6bc2c13e45bf\",\n \"type\": \"Step\",\n \"step\": {\n \"_id\": \"5c9672162b4c6bc2c13e4598\",\n \"type\": \"Step\",\n \"label\": \"Upload Documents\",\n \"amount\": null,\n \"amountType\": null,\n \"updatedAt\": \"2019-03-23T16:35:37.779Z\",\n \"createdAt\": \"2019-03-23T16:35:37.779Z\"\n },\n \"payments\": [],\n \"createdAt\": \"2019-03-23T17:51:18.887Z\",\n \"updatedAt\": \"2019-03-23T17:51:18.887Z\",\n \"id\": \"5c9672162b4c6bc2c13e45bf\"\n },\n {\n \"submitted\": false,\n \"_id\": \"5c9672162b4c6bc2c13e45c1\",\n \"type\": \"Step\",\n \"step\": {\n \"_id\": \"5c9672162b4c6bc2c13e4599\",\n \"type\": \"Step\",\n \"label\": \"Verify Details\",\n \"amount\": null,\n \"amountType\": null,\n \"updatedAt\": \"2019-03-23T16:35:37.779Z\",\n \"createdAt\": \"2019-03-23T16:35:37.779Z\"\n },\n \"payments\": [],\n \"createdAt\": \"2019-03-23T17:51:18.887Z\",\n \"updatedAt\": \"2019-03-23T17:51:18.887Z\",\n \"id\": \"5c9672162b4c6bc2c13e45c1\"\n },\n {\n \"submitted\": false,\n \"_id\": \"5c9672162b4c6bc2c13e45c3\",\n \"type\": \"Step\",\n \"step\": {\n \"_id\": \"5c9672162b4c6bc2c13e459a\",\n \"type\": \"Step\",\n \"label\": \"Profile Confirmation\",\n \"amount\": null,\n \"amountType\": null,\n \"updatedAt\": \"2019-03-23T16:35:37.779Z\",\n \"createdAt\": \"2019-03-23T16:35:37.779Z\"\n },\n \"payments\": [],\n \"createdAt\": \"2019-03-23T17:51:18.887Z\",\n \"updatedAt\": \"2019-03-23T17:51:18.887Z\",\n \"id\": \"5c9672162b4c6bc2c13e45c3\"\n }\n ],\n \"createdAt\": \"2019-03-23T17:51:18.887Z\",\n \"updatedAt\": \"2019-03-23T17:51:18.887Z\",\n \"__v\": 0,\n \"metadata\": {\n \"currentSubmissionStepId\": \"5c9672162b4c6bc2c13e45b6\"\n },\n \"id\": \"5c9672162b4c6bc2c13e459b\"\n },\n \"user\": {\n \"settings\": {\n \"emailNotification\": false,\n \"smsNotification\": false,\n \"bidNotification\": false,\n \"pushNotifications\": false,\n \"compactNavBar\": false,\n \"autoSignOut\": false,\n \"loginAttemptAlerts\": false\n },\n \"registration\": {\n \"inProgress\": true,\n \"onBoarding\": false,\n \"bankingAcctsAdded\": false,\n \"userType\": \"renter\",\n \"tosAccepted\": true,\n \"emailVerified\": true,\n \"isSuperAdmin\": true,\n \"step\": 1,\n \"token\": \"38a7ed746cbc07ced96101ee8610776ff21b3bad\"\n },\n \"renterApplication\": \"5c9671fe2b4c6bc2c13e455e\",\n \"_id\": \"5c9671f12b4c6bc2c13e455d\",\n \"firstName\": \"test\",\n \"lastName\": \"test\",\n \"email\": \"0.07082682427610565@mailinator.com\",\n \"password\": \"$2a$10$kMLVzO2bZ13ybAqLgvPWU.vfqbu1h/J8QrhPV6MZw31pG7HBlltIq\",\n \"createdAt\": \"2019-03-23T17:50:41.462Z\",\n \"updatedAt\": \"2019-03-23T17:51:18.894Z\",\n \"__v\": 0,\n \"metadata\": {\n \"hasRenterApplication\": true,\n \"leaseWrapupInProgress\": true\n },\n \"leaseWrapupInProgress\": true,\n \"id\": \"5c9671f12b4c6bc2c13e455d\",\n \"scope\": \"renter\",\n \"leaseWrapup\": \"5c9672162b4c6bc2c13e459b\"\n }\n}"
}
]
},
{
"name": "Renter Get Lease Wrapup Steps",
"event": [
{
"listen": "test",
"script": {
"id": "cafe0502-0d5d-4126-945d-f2100f3792c9",
"exec": [
"",
"var resp = pm.response.json();",
"pm.environment.set(\"leaseWrapupSteps\", JSON.stringify(_.get(resp, 'leaseWrapupSteps')));",
"",
"pm.test(\"response is ok 200\", function () {",
" pm.response.to.have.status(200);",
"});",
"",
"const stepIds = [];",
"pm.test(\"response has resp.steps array\", function () {",
" pm.expect(resp.steps).to.exist;",
" pm.expect(resp.steps).to.be.an('array');",
" _.each(resp.steps, (step) => stepIds.push(step._id))",
"});",
"",
"",
"pm.test(\"response has resp.submissions array\", function () {",
" pm.expect(resp.submissions).to.exist;",
" pm.expect(resp.submissions).to.be.an('array');",
"});",
"",
"",
"pm.test(\"resp.submissions array contains all ids in resp.steps\", function () {",
" const submissionIds = [];",
" for (let spec of resp.submissions){",
" if (spec.type === 'Step'){",
" submissionIds.push(spec.step._id);",
" }",
" else {",
" for (let payment of spec.payments){",
" submissionIds.push(payment._id);",
" }",
" }",
" }",
" ",
" const stepIdToSubmissiondiff = _.difference(stepIds, submissionIds);",
" const diff = _.difference(submissionIds, stepIds);",
" ",
" pm.expect(stepIdToSubmissiondiff.length === 0).to.equal(true);",
" pm.expect(diff.length === 0).to.equal(true);",
" pm.expect(stepIds.length).to.equal(submissionIds.length);",
"});",
"",
"",
"",
"pm.test(\"resp.submissions array contains correct values\", function () {",
" for (let spec of resp.submissions){",
" if (spec.type === 'Step'){",
" pm.expect(spec.step).to.exist;",
" pm.expect(spec.step._id).to.exist;",
" pm.expect(spec.payments.length > 0).to.equal(false);",
" ",
" ",
" const stepId = _.find(stepIds, (el) => el == spec.step._id);",
" pm.expect(stepId).to.exist;",
" }",
" else {",
" pm.expect(spec.payments).to.exist;",
" pm.expect(spec.payments).to.be.an('array');",
" pm.expect(spec.payments.length > 0).to.equal(true);",
" ",
" if (spec.type === 'Deposit'){",
" for (let payment of spec.payments){",
" pm.expect(payment.amountType).to.exist;",
" const stepId = _.find(stepIds, (el) => el == payment._id);",
" pm.expect(stepId).to.exist;",
" }",
" }",
" else {",
" for (let payment of spec.payments){",
" pm.expect(payment.amountType).to.not.exist;",
" const stepId = _.find(stepIds, (el) => el == payment._id);",
" pm.expect(stepId).to.exist;",
" }",
" }",
" }",
" }",
"});",
"",
"const submissionId = resp.metadata.currentSubmissionStepId;",
"if (submissionId !== false){",
" pm.environment.set(\"currentSubmissionId\", submissionId);",
" postman.setNextRequest(\"Submit Rent It Now Step\");",
"}",
"",
"",
"",
"",
"",
"",
"",
""
],
"type": "text/javascript"
}
}
],
"request": {
"method": "GET",
"header": [],
"body": {
"mode": "raw",
"raw": ""
},
"url": {
"raw": "{{Domain}}/api/lease-wrapup/{{leaseWrapupId}}?populate[0][path]=propertySession",
"host": [
"{{Domain}}"
],
"path": [
"api",
"lease-wrapup",
"{{leaseWrapupId}}"
],
"query": [
{
"key": "populate[0][path]",
"value": "propertySession"
}
]
}
},
"response": []
},
{
"name": "Submit Rent It Now Step",
"event": [
{
"listen": "test",
"script": {
"id": "c3836eef-c3d1-4b12-9c56-d1238843c45b",
"exec": [
"var jsonData = pm.response.json();",
"",
"pm.test(\"response is ok 200\", function () {",
" pm.response.to.have.status(200);",
"});",
"",
"",
"const remail = pm.environment.get('remail');",
"const domain = pm.environment.get('Domain');",
"pm.sendRequest({",
" url: `${domain}/api/session`,",
" method: 'GET'",
"}, function (err, response) {",
" const { user } = response.json();",
" if (jsonData.metadata.currentSubmissionStepId === false){",
" pm.test('should mark user.leaseWrapup to null', () => {",
" pm.expect(user.leaseWrapup).to.not.exist;",
" }) ",
" }",
" else {",
" pm.test('should have user.leaseWrapup', () => {",
" pm.expect(user.leaseWrapup).to.exist;",
" }) ",
" }",
"});",
"",
"",
"",
"if (jsonData.metadata.currentSubmissionStepId !== false){",
" postman.setNextRequest(\"Renter Get Lease Wrapup Steps\"); ",
"} else {",
" const unsubmitted = _.find(jsonData.submissions, { submitted: false});",
" pm.test('All steps have been submitted', () => {",
" pm.expect(unsubmitted).to.not.exist;",
" })",
"}",
""
],
"type": "text/javascript"
}
},
{
"listen": "prerequest",
"script": {
"id": "1a779b77-85a6-4cda-80f7-cf70222249b6",
"exec": [
""
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"name": "Content-Type",
"type": "text",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"propertySessionId\": \"{{propertySession}}\"\n}"
},
"url": "{{Domain}}/api/lease-wrapup/{{leaseWrapupId}}/submission/{{currentSubmissionId}}"
},
"response": []
}
],
"_postman_isSubFolder": true
}
],
"_postman_isSubFolder": true
}
],
"description": "This postman collection contains the entire flow of creating a property-listing and leasing it. Which includes\n\n- Property Manager\n\t1. Registration\n\t2. Email Verification\n\t3. Organization registration\n\t4. Adding Client to organization\n\t5. Adding Portfolio to Client\n\t6. Adding Property to Client's Portfolio\n\t7. Listing a Property as `active` such that it is listed in renter search results\n\n- Renter\n\t1. Registration\n\t2. Email Verification\n\t3. Renter Application\n\t4. Searching for a Property Listing\n\t5. `Rent it now` on a Property Listing\n\t6. Lease Wrapup Step submission\n\n",
"event": [
{
"listen": "prerequest",
"script": {
"id": "5707cb76-26b0-47f3-b430-0fac68841f01",
"type": "text/javascript",
"exec": [
""
]
}
},
{
"listen": "test",
"script": {
"id": "fbef5fa5-3a26-4c60-8448-a4f06e7bacbf",
"type": "text/javascript",
"exec": [
""
]
}
}
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment