{
	"info": {
		"_postman_id": "e4f864af-c26f-412d-8382-f07076e2299f",
		"name": "GeneralInsurance_Test2 Copy",
		"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
		"_exporter_id": "2489282",
		"_collection_link": "https://qacop1.postman.co/workspace/QACop_APIs~c0cd325f-9054-40db-8174-57a451347acb/collection/2489282-e4f864af-c26f-412d-8382-f07076e2299f?action=share&source=collection_link&creator=2489282"
	},
	"item": [
		{
			"name": "Driver APIs",
			"item": [
				{
					"name": "PostDriver",
					"event": [
						{
							"listen": "prerequest",
							"script": {
								"exec": [
									"// Generate a random three-digit number between 100 and 999",
									"const randomNumber = Math.floor(100 + Math.random() * 900);",
									"",
									"// Store it as a variable in Postman (local scope)",
									"pm.variables.set(\"random_three_digit\", randomNumber);",
									"",
									"// Also store it in the environment if needed",
									"pm.environment.set(\"random_three_digit\", randomNumber);"
								],
								"type": "text/javascript",
								"packages": {}
							}
						},
						{
							"listen": "test",
							"script": {
								"exec": [
									"// Parse the response body correctly",
									"var jsonData = pm.response.json();",
									"",
									"// Set environment variables correctly",
									"pm.environment.set(\"driver_id\", jsonData._id);",
									"pm.environment.set(\"driver_firstname\", jsonData.firstname);",
									"pm.environment.set(\"driver_lastname\", jsonData.lastname);",
									"pm.environment.set(\"driver_email\", jsonData.email);",
									"pm.environment.set(\"driver_phonenumber\", jsonData.phonenumber);",
									"",
									"",
									"pm.test(\"Status code is 201\", function () {",
									"    pm.response.to.have.status(201);",
									"});",
									""
								],
								"type": "text/javascript",
								"packages": {}
							}
						}
					],
					"request": {
						"auth": {
							"type": "bearer",
							"bearer": [
								{
									"key": "token",
									"value": "{{currentAccessToken}}",
									"type": "string"
								}
							]
						},
						"method": "POST",
						"header": [],
						"body": {
							"mode": "raw",
							"raw": "{\n    \"lastname\": \"ABC123\",\n    \"firstname\": \"Float125\",\n    \"middleinitial\": \"Mr\",\n    \"dob\": \"1980-07-06\",\n    \"email\": \"jason_Float7@gmail.com\",\n    \"ssn\": \"{{random_three_digit}}-11-6711\",\n    \"phonenumber\":\"328-942-1023\",\n    \"cellnumber\":\"{{$randomPhoneNumber}}\",\n    \"createddate\":\"2023-01-10\",\n    \"active\":\"true\",\n    \"isprimarypolicyholder\": false,\n    \"policy_id\": 45645216,\n    \"licenseissuedate\":\"1980-07-06\",\n    \"licenseissuestate\":\"New York\",\n    \"maritalstatus\": \"single\"\n}",
							"options": {
								"raw": {
									"language": "json"
								}
							}
						},
						"url": {
							"raw": "https://generalinsurance-ff4b.restdb.io/rest/driver",
							"protocol": "https",
							"host": [
								"generalinsurance-ff4b",
								"restdb",
								"io"
							],
							"path": [
								"rest",
								"driver"
							]
						}
					},
					"response": []
				},
				{
					"name": "GetDriver",
					"event": [
						{
							"listen": "test",
							"script": {
								"exec": [
									"pm.test(\"Status code is 200\", function () {",
									"    pm.response.to.have.status(200);",
									"});",
									"",
									"// First name validation",
									"pm.test(\"First name matched\", () => {",
									"    const responseJson = pm.response.json();",
									"    const expectedFirstName = pm.environment.get(\"driver_firstname\") || pm.variables.get(\"driver_firstname\");",
									"",
									"    pm.expect(responseJson.firstname).to.eql(expectedFirstName);",
									"});",
									"",
									""
								],
								"type": "text/javascript",
								"packages": {}
							}
						}
					],
					"protocolProfileBehavior": {
						"disableBodyPruning": true
					},
					"request": {
						"auth": {
							"type": "bearer",
							"bearer": [
								{
									"key": "token",
									"value": "{{currentAccessToken}}",
									"type": "string"
								}
							]
						},
						"method": "GET",
						"header": [],
						"body": {
							"mode": "raw",
							"raw": "",
							"options": {
								"raw": {
									"language": "json"
								}
							}
						},
						"url": {
							"raw": "https://generalinsurance-ff4b.restdb.io/rest/driver/{{driver_id}}",
							"protocol": "https",
							"host": [
								"generalinsurance-ff4b",
								"restdb",
								"io"
							],
							"path": [
								"rest",
								"driver",
								"{{driver_id}}"
							]
						}
					},
					"response": []
				},
				{
					"name": "PutDriver",
					"event": [
						{
							"listen": "test",
							"script": {
								"exec": [
									"pm.test(\"Status code is 200\", function () {",
									"    pm.response.to.have.status(200);",
									"});"
								],
								"type": "text/javascript",
								"packages": {}
							}
						}
					],
					"request": {
						"auth": {
							"type": "bearer",
							"bearer": [
								{
									"key": "token",
									"value": "{{currentAccessToken}}",
									"type": "string"
								}
							]
						},
						"method": "PUT",
						"header": [],
						"body": {
							"mode": "raw",
							"raw": "{\n    \"firstname\": \"Cruse\",\n    \"lastname\": \"Tom2\",\n    \"middleinitial\": \"Mr\",\n    \"dob\": \"1980-07-06T00:00:00.000Z\",\n    \"email\": \"tom_cruse@gmail.com\",\n    \"phonenumber\": \"728-941-1863\",\n    \"cellnumber\": \"728-941-1863\",\n    \"ssn\": 56,\n    \"isprimarypolicyholder\": false,\n    \"maritalstatus\": \"single\",\n    \"createddate\": \"2023-01-10\",\n    \"active\": true,\n    \"policy_id\": 45645216\n}",
							"options": {
								"raw": {
									"language": "json"
								}
							}
						},
						"url": {
							"raw": "https://generalinsurance-ff4b.restdb.io/rest/driver/{{driver_id}}",
							"protocol": "https",
							"host": [
								"generalinsurance-ff4b",
								"restdb",
								"io"
							],
							"path": [
								"rest",
								"driver",
								"{{driver_id}}"
							]
						}
					},
					"response": []
				},
				{
					"name": "PatchDriver",
					"event": [
						{
							"listen": "test",
							"script": {
								"exec": [
									"pm.test(\"Status code is 200\", function () {",
									"    pm.response.to.have.status(200);",
									"});"
								],
								"type": "text/javascript",
								"packages": {}
							}
						}
					],
					"request": {
						"auth": {
							"type": "bearer",
							"bearer": [
								{
									"key": "token",
									"value": "{{currentAccessToken}}",
									"type": "string"
								}
							]
						},
						"method": "PATCH",
						"header": [],
						"body": {
							"mode": "raw",
							"raw": "{\n    \"firstname\": \"Cruse8\"\n}",
							"options": {
								"raw": {
									"language": "json"
								}
							}
						},
						"url": {
							"raw": "https://generalinsurance-ff4b.restdb.io/rest/driver/{{driver_id}}",
							"protocol": "https",
							"host": [
								"generalinsurance-ff4b",
								"restdb",
								"io"
							],
							"path": [
								"rest",
								"driver",
								"{{driver_id}}"
							]
						}
					},
					"response": []
				},
				{
					"name": "DeleteDriver",
					"request": {
						"auth": {
							"type": "bearer",
							"bearer": [
								{
									"key": "token",
									"value": "{{currentAccessToken}}",
									"type": "string"
								}
							]
						},
						"method": "DELETE",
						"header": [],
						"body": {
							"mode": "raw",
							"raw": "",
							"options": {
								"raw": {
									"language": "json"
								}
							}
						},
						"url": {
							"raw": "https://generalinsurance-ff4b.restdb.io/rest/driver/{{driver_id}}",
							"protocol": "https",
							"host": [
								"generalinsurance-ff4b",
								"restdb",
								"io"
							],
							"path": [
								"rest",
								"driver",
								"{{driver_id}}"
							]
						}
					},
					"response": []
				}
			]
		},
		{
			"name": "Vehicle APIs",
			"item": [
				{
					"name": "PostVehicle",
					"event": [
						{
							"listen": "test",
							"script": {
								"exec": [
									"pm.test(\"Status code is 200\", function () {",
									"    pm.response.to.have.status(201);",
									"});",
									"",
									"// Parse the response body correctly",
									"var jsonData = pm.response.json();",
									"",
									"// Set environment variables correctly",
									"pm.environment.set(\"vehicleid\", jsonData._id);"
								],
								"type": "text/javascript",
								"packages": {}
							}
						}
					],
					"request": {
						"auth": {
							"type": "bearer",
							"bearer": [
								{
									"key": "token",
									"value": "{{currentAccessToken}}",
									"type": "string"
								}
							]
						},
						"method": "POST",
						"header": [],
						"body": {
							"mode": "raw",
							"raw": "{\n    \"year\": \"2022\",\n    \"Make\": \"Toyota\",\n    \"Trim\": \"LTZ\",\n    \"MIleage\": 23236,\n    \"numberplate\": \"KUO138\",\n    \"registeredstate\": \"WI\",\n    \"createdDate\": \"2022-06-18T00:00:00.000Z\",\n    \"vin\": \"AB128{{$randomInt}}\",\n    \"Model\": \"MRK\",\n    \"Color\": \"White\"\n}",
							"options": {
								"raw": {
									"language": "json"
								}
							}
						},
						"url": {
							"raw": "https://generalinsurance-ff4b.restdb.io/rest/vehicle",
							"protocol": "https",
							"host": [
								"generalinsurance-ff4b",
								"restdb",
								"io"
							],
							"path": [
								"rest",
								"vehicle"
							]
						}
					},
					"response": []
				},
				{
					"name": "GetVehicle",
					"event": [
						{
							"listen": "test",
							"script": {
								"exec": [
									"pm.test(\"Status code is 200\", function () {",
									"    pm.response.to.have.status(200);",
									"});"
								],
								"type": "text/javascript",
								"packages": {}
							}
						}
					],
					"protocolProfileBehavior": {
						"disableBodyPruning": true
					},
					"request": {
						"auth": {
							"type": "bearer",
							"bearer": [
								{
									"key": "token",
									"value": "{{currentAccessToken}}",
									"type": "string"
								}
							]
						},
						"method": "GET",
						"header": [],
						"body": {
							"mode": "raw",
							"raw": "",
							"options": {
								"raw": {
									"language": "json"
								}
							}
						},
						"url": {
							"raw": "https://generalinsurance-ff4b.restdb.io/rest/vehicle/{{vehicleid}}",
							"protocol": "https",
							"host": [
								"generalinsurance-ff4b",
								"restdb",
								"io"
							],
							"path": [
								"rest",
								"vehicle",
								"{{vehicleid}}"
							]
						}
					},
					"response": []
				},
				{
					"name": "PutVehicle",
					"event": [
						{
							"listen": "test",
							"script": {
								"exec": [
									"pm.test(\"Status code is 200\", function () {",
									"    pm.response.to.have.status(200);",
									"});"
								],
								"type": "text/javascript",
								"packages": {}
							}
						}
					],
					"request": {
						"auth": {
							"type": "bearer",
							"bearer": [
								{
									"key": "token",
									"value": "{{currentAccessToken}}",
									"type": "string"
								}
							]
						},
						"method": "PUT",
						"header": [],
						"body": {
							"mode": "raw",
							"raw": "{\n    \"year\": \"2022\",\n    \"Make\": \"Toyota\",\n    \"Trim\": \"LTZ\",\n    \"MIleage\": 30000,\n    \"numberplate\": \"KUO138\",\n    \"registeredstate\": \"New yark\",\n    \"createdDate\": \"2022-06-18T00:00:00.000Z\",\n    \"vin\": 69527781699,\n    \"Model\": \"MRK\",\n    \"Color\": \"White\"\n}",
							"options": {
								"raw": {
									"language": "json"
								}
							}
						},
						"url": {
							"raw": "https://generalinsurance-ff4b.restdb.io/rest/vehicle/{{vehicleid}}",
							"protocol": "https",
							"host": [
								"generalinsurance-ff4b",
								"restdb",
								"io"
							],
							"path": [
								"rest",
								"vehicle",
								"{{vehicleid}}"
							]
						}
					},
					"response": []
				},
				{
					"name": "PatchVehicle",
					"event": [
						{
							"listen": "test",
							"script": {
								"exec": [
									"pm.test(\"Status code is 200\", function () {",
									"    pm.response.to.have.status(200);",
									"});"
								],
								"type": "text/javascript",
								"packages": {}
							}
						}
					],
					"request": {
						"auth": {
							"type": "bearer",
							"bearer": [
								{
									"key": "token",
									"value": "{{currentAccessToken}}",
									"type": "string"
								}
							]
						},
						"method": "PATCH",
						"header": [],
						"body": {
							"mode": "raw",
							"raw": "{\n\n    \"MIleage\": 35000\n\n}",
							"options": {
								"raw": {
									"language": "json"
								}
							}
						},
						"url": {
							"raw": "https://generalinsurance-ff4b.restdb.io/rest/vehicle/{{vehicleid}}",
							"protocol": "https",
							"host": [
								"generalinsurance-ff4b",
								"restdb",
								"io"
							],
							"path": [
								"rest",
								"vehicle",
								"{{vehicleid}}"
							]
						}
					},
					"response": []
				},
				{
					"name": "GetVehiclewithmultiquery",
					"event": [
						{
							"listen": "test",
							"script": {
								"exec": [
									"pm.test(\"Status code is 200\", function () {",
									"    pm.response.to.have.status(200);",
									"});"
								],
								"type": "text/javascript",
								"packages": {}
							}
						}
					],
					"protocolProfileBehavior": {
						"disableBodyPruning": true
					},
					"request": {
						"auth": {
							"type": "bearer",
							"bearer": [
								{
									"key": "token",
									"value": "{{currentAccessToken}}",
									"type": "string"
								}
							]
						},
						"method": "GET",
						"header": [],
						"body": {
							"mode": "raw",
							"raw": "",
							"options": {
								"raw": {
									"language": "json"
								}
							}
						},
						"url": {
							"raw": "https://generalinsurance-ff4b.restdb.io/rest/vehicle?q={\"Make\":\"Toyota\",\"Trim\":\"Premium\"}",
							"protocol": "https",
							"host": [
								"generalinsurance-ff4b",
								"restdb",
								"io"
							],
							"path": [
								"rest",
								"vehicle"
							],
							"query": [
								{
									"key": "q",
									"value": "{\"Make\":\"Toyota\",\"Trim\":\"Premium\"}"
								},
								{
									"key": null,
									"value": ",\"Trim\":\"LTZ\"",
									"disabled": true
								}
							]
						}
					},
					"response": []
				},
				{
					"name": "DeleteVehicle",
					"event": [
						{
							"listen": "test",
							"script": {
								"exec": [
									"pm.test(\"Status code is 200\", function () {",
									"    pm.response.to.have.status(200);",
									"});"
								],
								"type": "text/javascript",
								"packages": {}
							}
						}
					],
					"request": {
						"auth": {
							"type": "bearer",
							"bearer": [
								{
									"key": "token",
									"value": "{{currentAccessToken}}",
									"type": "string"
								}
							]
						},
						"method": "DELETE",
						"header": [],
						"body": {
							"mode": "raw",
							"raw": "",
							"options": {
								"raw": {
									"language": "json"
								}
							}
						},
						"url": {
							"raw": "https://generalinsurance-ff4b.restdb.io/rest/vehicle/{{vechicleid}}",
							"protocol": "https",
							"host": [
								"generalinsurance-ff4b",
								"restdb",
								"io"
							],
							"path": [
								"rest",
								"vehicle",
								"{{vechicleid}}"
							]
						}
					},
					"response": []
				}
			]
		},
		{
			"name": "PolicyCoverage APIs",
			"item": [
				{
					"name": "PostPolicyCoverage",
					"event": [
						{
							"listen": "test",
							"script": {
								"exec": [
									"pm.test(\"Status code is 200\", function () {",
									"    pm.response.to.have.status(201);",
									"});",
									"",
									"// Parse the response body correctly",
									"var jsonData = pm.response.json();",
									"",
									"// Set environment variables correctly",
									"pm.environment.set(\"policycoverageid\", jsonData._id);"
								],
								"type": "text/javascript",
								"packages": {}
							}
						}
					],
					"request": {
						"auth": {
							"type": "bearer",
							"bearer": [
								{
									"key": "token",
									"value": "{{currentAccessToken}}",
									"type": "string"
								}
							]
						},
						"method": "POST",
						"header": [],
						"body": {
							"mode": "raw",
							"raw": "{\n    \"ID\": 36667888,\n    \"code\": 73,\n    \"coveragegroup\": \"B2YHVTTE\",\n    \"_mock\": true,\n    \"_recent\": false,\n    \"coveragename\": \"All coverage\",\n    \"ispolicycoverage\": true,\n    \"isvehiclecoverage\": true\n}",
							"options": {
								"raw": {
									"language": "json"
								}
							}
						},
						"url": {
							"raw": "https://generalinsurance-ff4b.restdb.io/rest/policycoverage",
							"protocol": "https",
							"host": [
								"generalinsurance-ff4b",
								"restdb",
								"io"
							],
							"path": [
								"rest",
								"policycoverage"
							]
						}
					},
					"response": []
				},
				{
					"name": "GetPolicyCoverage",
					"event": [
						{
							"listen": "test",
							"script": {
								"exec": [
									"pm.test(\"Status code is 200\", function () {",
									"    pm.response.to.have.status(200);",
									"});"
								],
								"type": "text/javascript",
								"packages": {}
							}
						}
					],
					"protocolProfileBehavior": {
						"disableBodyPruning": true
					},
					"request": {
						"auth": {
							"type": "bearer",
							"bearer": [
								{
									"key": "token",
									"value": "{{currentAccessToken}}",
									"type": "string"
								}
							]
						},
						"method": "GET",
						"header": [],
						"body": {
							"mode": "raw",
							"raw": "",
							"options": {
								"raw": {
									"language": "json"
								}
							}
						},
						"url": {
							"raw": "https://generalinsurance-ff4b.restdb.io/rest/policycoverage/{{policycoverageid}}",
							"protocol": "https",
							"host": [
								"generalinsurance-ff4b",
								"restdb",
								"io"
							],
							"path": [
								"rest",
								"policycoverage",
								"{{policycoverageid}}"
							]
						}
					},
					"response": []
				},
				{
					"name": "PutPolicyCoverage",
					"event": [
						{
							"listen": "test",
							"script": {
								"exec": [
									"pm.test(\"Status code is 200\", function () {",
									"    pm.response.to.have.status(200);",
									"});"
								],
								"type": "text/javascript",
								"packages": {}
							}
						}
					],
					"request": {
						"auth": {
							"type": "bearer",
							"bearer": [
								{
									"key": "token",
									"value": "{{currentAccessToken}}",
									"type": "string"
								}
							]
						},
						"method": "PUT",
						"header": [],
						"body": {
							"mode": "raw",
							"raw": "{\n    \"ID\": 36667888,\n    \"code\": 80,\n    \"coveragegroup\": \"B2YHVTTE\",\n    \"_mock\": true,\n    \"_recent\": false,\n    \"coveragename\": \"All coverage\",\n    \"ispolicycoverage\": true,\n    \"isvehiclecoverage\": true\n}",
							"options": {
								"raw": {
									"language": "json"
								}
							}
						},
						"url": {
							"raw": "https://generalinsurance-ff4b.restdb.io/rest/policycoverage/{{policycoverageid}}",
							"protocol": "https",
							"host": [
								"generalinsurance-ff4b",
								"restdb",
								"io"
							],
							"path": [
								"rest",
								"policycoverage",
								"{{policycoverageid}}"
							]
						}
					},
					"response": []
				},
				{
					"name": "PatchPolicyCoverage",
					"request": {
						"auth": {
							"type": "bearer",
							"bearer": [
								{
									"key": "token",
									"value": "{{currentAccessToken}}",
									"type": "string"
								}
							]
						},
						"method": "PATCH",
						"header": [],
						"body": {
							"mode": "raw",
							"raw": "{\n    \"code\": 80\n}",
							"options": {
								"raw": {
									"language": "json"
								}
							}
						},
						"url": {
							"raw": "https://generalinsurance-ff4b.restdb.io/rest/policycoverage/{{policycoverageid}}",
							"protocol": "https",
							"host": [
								"generalinsurance-ff4b",
								"restdb",
								"io"
							],
							"path": [
								"rest",
								"policycoverage",
								"{{policycoverageid}}"
							]
						}
					},
					"response": []
				},
				{
					"name": "DeletePolicyCoverage",
					"request": {
						"auth": {
							"type": "bearer",
							"bearer": [
								{
									"key": "token",
									"value": "{{currentAccessToken}}",
									"type": "string"
								}
							]
						},
						"method": "DELETE",
						"header": [],
						"body": {
							"mode": "raw",
							"raw": "",
							"options": {
								"raw": {
									"language": "json"
								}
							}
						},
						"url": {
							"raw": "https://generalinsurance-ff4b.restdb.io/rest/policycoverage/{{policycoverageid}}",
							"protocol": "https",
							"host": [
								"generalinsurance-ff4b",
								"restdb",
								"io"
							],
							"path": [
								"rest",
								"policycoverage",
								"{{policycoverageid}}"
							]
						}
					},
					"response": []
				}
			]
		},
		{
			"name": "DriverAddress APIs",
			"item": [
				{
					"name": "PostDriverAddress",
					"event": [
						{
							"listen": "test",
							"script": {
								"exec": [
									"pm.test(\"Status code is 200\", function () {",
									"    pm.response.to.have.status(201);",
									"});",
									"",
									"// Parse the response body correctly",
									"var jsonData = pm.response.json();",
									"",
									"// Set environment variables correctly",
									"pm.environment.set(\"driveraddressid\", jsonData._id);"
								],
								"type": "text/javascript",
								"packages": {}
							}
						}
					],
					"request": {
						"auth": {
							"type": "bearer",
							"bearer": [
								{
									"key": "token",
									"value": "{{currentAccessToken}}",
									"type": "string"
								}
							]
						},
						"method": "POST",
						"header": [],
						"body": {
							"mode": "raw",
							"raw": "{\n    \"addressline1\": \"820 Leda Cape Suite 971\\nKatelynnville, NE 56172-0040\",\n    \"addressline2\": \"Suite 177\",\n    \"city\": \"New Adolfo\",\n    \"state\": \"Georgia\",\n    \"country\": \"USA\",\n    \"zipcode\": 65001,\n    \"driver_id\": \"63e69916aa86{{$randomInt}}\"\n}",
							"options": {
								"raw": {
									"language": "json"
								}
							}
						},
						"url": {
							"raw": "https://generalinsurance-ff4b.restdb.io/rest/driveraddress",
							"protocol": "https",
							"host": [
								"generalinsurance-ff4b",
								"restdb",
								"io"
							],
							"path": [
								"rest",
								"driveraddress"
							]
						}
					},
					"response": []
				},
				{
					"name": "GetDriverAddress",
					"event": [
						{
							"listen": "test",
							"script": {
								"exec": [
									"pm.test(\"Status code is 200\", function () {",
									"    pm.response.to.have.status(200);",
									"});"
								],
								"type": "text/javascript",
								"packages": {}
							}
						}
					],
					"protocolProfileBehavior": {
						"disableBodyPruning": true
					},
					"request": {
						"auth": {
							"type": "bearer",
							"bearer": [
								{
									"key": "token",
									"value": "{{currentAccessToken}}",
									"type": "string"
								}
							]
						},
						"method": "GET",
						"header": [],
						"body": {
							"mode": "raw",
							"raw": "",
							"options": {
								"raw": {
									"language": "json"
								}
							}
						},
						"url": {
							"raw": "https://generalinsurance-ff4b.restdb.io/rest/driveraddress",
							"protocol": "https",
							"host": [
								"generalinsurance-ff4b",
								"restdb",
								"io"
							],
							"path": [
								"rest",
								"driveraddress"
							]
						}
					},
					"response": []
				},
				{
					"name": "PutDriverAddress",
					"request": {
						"auth": {
							"type": "bearer",
							"bearer": [
								{
									"key": "token",
									"value": "{{currentAccessToken}}",
									"type": "string"
								}
							]
						},
						"method": "PUT",
						"header": [],
						"body": {
							"mode": "raw",
							"raw": "{\n    \"addressline1\": \"820 Leda Cape Suite 971\\nKatelynnville, NE 56172-0040\",\n    \"addressline2\": \"Suite 177\",\n    \"city\": \"Franklin\",\n    \"state\": \"Georgia\",\n    \"country\": \"USA\",\n    \"zipcode\": \"65001\",\n    \"driver_id\": \"63c19ea2dab2072b00012a6b\"\n}",
							"options": {
								"raw": {
									"language": "json"
								}
							}
						},
						"url": {
							"raw": "https://generalinsurance-ff4b.restdb.io/rest/driveraddress/63e2aebdaa8607500003c713",
							"protocol": "https",
							"host": [
								"generalinsurance-ff4b",
								"restdb",
								"io"
							],
							"path": [
								"rest",
								"driveraddress",
								"63e2aebdaa8607500003c713"
							]
						}
					},
					"response": []
				},
				{
					"name": "PatchDriverAddress",
					"request": {
						"auth": {
							"type": "bearer",
							"bearer": [
								{
									"key": "token",
									"value": "{{currentAccessToken}}",
									"type": "string"
								}
							]
						},
						"method": "PATCH",
						"header": [],
						"body": {
							"mode": "raw",
							"raw": "{\n    \"city\": \"New Adolfo\"\n\n}",
							"options": {
								"raw": {
									"language": "json"
								}
							}
						},
						"url": {
							"raw": "https://generalinsurance-ff4b.restdb.io/rest/driveraddress/63e2aebdaa8607500003c713",
							"protocol": "https",
							"host": [
								"generalinsurance-ff4b",
								"restdb",
								"io"
							],
							"path": [
								"rest",
								"driveraddress",
								"63e2aebdaa8607500003c713"
							]
						}
					},
					"response": []
				},
				{
					"name": "DeleteDriverAddress",
					"request": {
						"auth": {
							"type": "bearer",
							"bearer": [
								{
									"key": "token",
									"value": "{{currentAccessToken}}",
									"type": "string"
								}
							]
						},
						"method": "DELETE",
						"header": [],
						"body": {
							"mode": "raw",
							"raw": "",
							"options": {
								"raw": {
									"language": "json"
								}
							}
						},
						"url": {
							"raw": "https://generalinsurance-ff4b.restdb.io/rest/driveraddress",
							"protocol": "https",
							"host": [
								"generalinsurance-ff4b",
								"restdb",
								"io"
							],
							"path": [
								"rest",
								"driveraddress"
							]
						}
					},
					"response": []
				}
			]
		},
		{
			"name": "Policy APIs",
			"item": [
				{
					"name": "PostPolicy",
					"event": [
						{
							"listen": "test",
							"script": {
								"exec": [
									"pm.test(\"Status code is 200\", function () {",
									"    pm.response.to.have.status(201);",
									"});",
									"",
									"// Parse the response body correctly",
									"var jsonData = pm.response.json();",
									"",
									"// Set environment variables correctly",
									"pm.environment.set(\"policyid\", jsonData._id);"
								],
								"type": "text/javascript",
								"packages": {}
							}
						}
					],
					"request": {
						"auth": {
							"type": "bearer",
							"bearer": [
								{
									"key": "token",
									"value": "{{currentAccessToken}}",
									"type": "string"
								}
							]
						},
						"method": "POST",
						"header": [],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"policynumber\": 87981889{{$randomInt}},\n  \"policteffectivedate\": \"2023-02-06\",\n  \"createddate\": \"20220668767-10\",\n  \"total_amount\": 900,\n  \"paymentoption\": [\n    \"toal123\"\n  ]\n}",
							"options": {
								"raw": {
									"language": "json"
								}
							}
						},
						"url": {
							"raw": "https://generalinsurance-ff4b.restdb.io/rest/policy",
							"protocol": "https",
							"host": [
								"generalinsurance-ff4b",
								"restdb",
								"io"
							],
							"path": [
								"rest",
								"policy"
							]
						}
					},
					"response": []
				},
				{
					"name": "GetPolicy",
					"protocolProfileBehavior": {
						"disableBodyPruning": true
					},
					"request": {
						"auth": {
							"type": "bearer",
							"bearer": [
								{
									"key": "token",
									"value": "{{currentAccessToken}}",
									"type": "string"
								}
							]
						},
						"method": "GET",
						"header": [],
						"body": {
							"mode": "raw",
							"raw": "",
							"options": {
								"raw": {
									"language": "json"
								}
							}
						},
						"url": {
							"raw": "https://generalinsurance-ff4b.restdb.io/rest/policy/{{policyid}}",
							"protocol": "https",
							"host": [
								"generalinsurance-ff4b",
								"restdb",
								"io"
							],
							"path": [
								"rest",
								"policy",
								"{{policyid}}"
							]
						}
					},
					"response": []
				},
				{
					"name": "PutPolicy",
					"request": {
						"auth": {
							"type": "bearer",
							"bearer": [
								{
									"key": "token",
									"value": "{{currentAccessToken}}",
									"type": "string"
								}
							]
						},
						"method": "PUT",
						"header": [],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"policynumber\": 69741933,\n  \"policteffectivedate\": \"2023-02-06\",\n  \"createddate\": \"2022-06-10\",\n  \"total amount\": 308,\n  \"paymentoption\": [\n    \"monthly\"\n  ]\n}",
							"options": {
								"raw": {
									"language": "json"
								}
							}
						},
						"url": {
							"raw": "https://generalinsurance-ff4b.restdb.io/rest/policy/{{policyid}}",
							"protocol": "https",
							"host": [
								"generalinsurance-ff4b",
								"restdb",
								"io"
							],
							"path": [
								"rest",
								"policy",
								"{{policyid}}"
							]
						}
					},
					"response": []
				},
				{
					"name": "PatchPolicy",
					"request": {
						"auth": {
							"type": "bearer",
							"bearer": [
								{
									"key": "token",
									"value": "{{currentAccessToken}}",
									"type": "string"
								}
							]
						},
						"method": "PATCH",
						"header": [],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"total amount\": 304\n  \n}",
							"options": {
								"raw": {
									"language": "json"
								}
							}
						},
						"url": {
							"raw": "https://generalinsurance-ff4b.restdb.io/rest/policy/{{policyid}}",
							"protocol": "https",
							"host": [
								"generalinsurance-ff4b",
								"restdb",
								"io"
							],
							"path": [
								"rest",
								"policy",
								"{{policyid}}"
							]
						}
					},
					"response": []
				},
				{
					"name": "DeletePolicy",
					"request": {
						"auth": {
							"type": "bearer",
							"bearer": [
								{
									"key": "token",
									"value": "{{currentAccessToken}}",
									"type": "string"
								}
							]
						},
						"method": "DELETE",
						"header": [],
						"body": {
							"mode": "raw",
							"raw": "",
							"options": {
								"raw": {
									"language": "json"
								}
							}
						},
						"url": {
							"raw": "https://generalinsurance-ff4b.restdb.io/rest/policy/{{policyid}}",
							"protocol": "https",
							"host": [
								"generalinsurance-ff4b",
								"restdb",
								"io"
							],
							"path": [
								"rest",
								"policy",
								"{{policyid}}"
							]
						}
					},
					"response": []
				}
			]
		}
	],
	"event": [
		{
			"listen": "prerequest",
			"script": {
				"type": "text/javascript",
				"exec": [
					"const echoPostRequest = {",
					"  url: 'https://dev-dj4vuaaxgimt7erd.us.auth0.com/oauth/token',",
					"  method: 'POST',",
					"  header: 'Content-Type:application/json',",
					"  body: {",
					"    mode: 'application/json',",
					"    raw: JSON.stringify(",
					"        {",
					"        \tclient_id:'LjJM2IJnaYIXqkNEVURLr4Lldu2thoIP',",
					"        \tclient_secret:'iObYF0cqiC9vvcFK4Nv1iuYLQ3VJM7srTu4bsaabyb1n1NyHiH_jw2IAHDvEMT9Y',",
					"        \t audience: 'test',",
					"             username: '',",
					"             password: '',",
					"             grant_type: 'password'",
					"        })",
					"  }",
					"};",
					"",
					"var getToken = true;",
					"",
					"if (!pm.environment.get('accessTokenExpiry') || ",
					"    !pm.environment.get('currentAccessToken')) {",
					"    console.log('Token or expiry date are missing')",
					"} else if (pm.environment.get('accessTokenExpiry') <= (new Date()).getTime()) {",
					"    console.log('Token is expired')",
					"} else {",
					"    getToken = false;",
					"    console.log('Token and expiry date are all good');",
					"}",
					"",
					"if (getToken === true) {",
					"    pm.sendRequest(echoPostRequest, function (err, res) {",
					"    console.log(err ? err : res.json());",
					"        if (err === null) {",
					"            console.log('Saving the token and expiry date')",
					"            var responseJson = res.json();",
					"            pm.environment.set('currentAccessToken', responseJson.access_token)",
					"    ",
					"            var expiryDate = new Date();",
					"            expiryDate.setSeconds(expiryDate.getSeconds() + responseJson.expires_in);",
					"            pm.environment.set('accessTokenExpiry', expiryDate.getTime());",
					"        }",
					"    });",
					"}",
					"",
					"",
					""
				]
			}
		},
		{
			"listen": "test",
			"script": {
				"type": "text/javascript",
				"exec": [
					""
				]
			}
		}
	]
}