From 41560674bfe9651be593ed59d15ae8d83884792b Mon Sep 17 00:00:00 2001 From: "iamalin@outlook.com" <174322686@qq.com> Date: Fri, 12 Aug 2016 20:01:56 +0800 Subject: [PATCH] from lin --- ...QuoteManagementAPI.json.postman_collection | 260 +++ postman/TMForumLocal.postman_environment | 283 +++ postman/quoteCTKResult.html | 10 + postman/quoteCTKResult.json | 1987 +++++++++++++++++ .../dsmapi/commons/facade/AbstractFacade.java | 19 + .../tmf/dsmapi/commons/utils/BeanUtils.java | 5 +- .../tmf/dsmapi/quote/QuoteAdminResource.java | 72 +- .../org/tmf/dsmapi/quote/QuoteFacade.java | 623 ++++-- .../org/tmf/dsmapi/quote/QuoteResource.java | 116 +- .../tmf/dsmapi/quote/event/QuoteEvent.java | 41 +- .../quote/event/QuoteEventPublisher.java | 10 +- .../org/tmf/dsmapi/quote/model/Agreement.java | 24 + .../tmf/dsmapi/quote/model/Attachment.java | 18 + .../dsmapi/quote/model/BillingAccount.java | 17 + .../dsmapi/quote/model/Characteristic.java | 16 + .../org/tmf/dsmapi/quote/model/Customer.java | 23 + .../java/org/tmf/dsmapi/quote/model/Note.java | 24 +- .../org/tmf/dsmapi/quote/model/Price.java | 46 +- .../org/tmf/dsmapi/quote/model/Product.java | 38 +- .../org/tmf/dsmapi/quote/model/Quote.java | 98 +- .../quote/model/QuoteAuthorization.java | 128 +- .../org/tmf/dsmapi/quote/model/QuoteItem.java | 21 + .../org/tmf/dsmapi/quote/model/QuotePK.java | 46 + .../quote/model/QuotePriceAlteration.java | 21 + .../model/QuoteProductOfferingPrice.java | 82 +- .../tmf/dsmapi/quote/model/RelatedParty.java | 29 + .../org/tmf/dsmapi/quote/model/ValidFor.java | 16 + .../org/tmf/dsmapi/subscriber/Current.java | 11 +- 28 files changed, 3836 insertions(+), 248 deletions(-) create mode 100644 postman/TMFQuoteManagementAPI.json.postman_collection create mode 100644 postman/TMForumLocal.postman_environment create mode 100644 postman/quoteCTKResult.html create mode 100644 postman/quoteCTKResult.json create mode 100644 src/main/java/org/tmf/dsmapi/quote/model/QuotePK.java diff --git a/postman/TMFQuoteManagementAPI.json.postman_collection b/postman/TMFQuoteManagementAPI.json.postman_collection new file mode 100644 index 0000000..caeba52 --- /dev/null +++ b/postman/TMFQuoteManagementAPI.json.postman_collection @@ -0,0 +1,260 @@ +{ + "id": "d53b2802-92a5-d7aa-2b21-f1a8d349c445", + "name": "NEW TMF Quote Management API", + "description": "", + "order": [ + "d79291d0-d96c-9d6d-40b9-3c2f16bbf419", + "7c5e7058-4c56-9701-be7f-e85ff5e5ce7e", + "ed18fec3-a862-c616-3b45-7c78251bf84e", + "99f01fbd-10f8-b3d9-c491-74c3bfd4651f", + "3158407d-965d-f0e0-0a06-14ddc237cc65", + "a9e7996e-f766-55d3-2d1d-d1566fbbbb4f", + "d62f15e2-dbf1-bc92-c6e8-c01926af295e", + "9c8c29a5-ebdb-aadb-b896-35533bddb38b", + "4bfd8db3-b5bb-036d-7245-f112839d2fd0", + "6c73350a-dcba-7f3a-84d9-ed046111a6a5", + "84000cf5-233d-1854-2b1f-b816b9eaa544", + "89566752-6274-87d9-7581-00cd7c070f79" + ], + "folders": [], + "timestamp": 1469150558293, + "owner": 0, + "remoteLink": "", + "public": false, + "requests": [ + { + "id": "3158407d-965d-f0e0-0a06-14ddc237cc65", + "headers": "Accept: application/json\nContent-Type: application/json\n", + "url": "{{quoteManagementApi}}/quote/{{QUOTE_ID1}}:(version=1.0)", + "preRequestScript": "", + "pathVariables": {}, + "method": "GET", + "data": [], + "dataMode": "params", + "version": 2, + "tests": "var dataOut = JSON.parse(responseBody);\n\n\ntests[\"Content-Type is present \" + postman.getResponseHeader(\"Content-type\")] = postman.getResponseHeader(\"Content-type\");\n\ntests[\"Status code is 200\"] = responseCode.code === 200;\n\ntests[\"Response contains ID \" + dataOut.id.toString()] = dataOut.id.toString() !== \"\";\n\ntests[\"Response contains VERSION \" + dataOut.version.toString()] = dataOut.version.toString() !== \"\";\n\ntests[\"Response contains HREF \" + dataOut.href.toString()] = dataOut.href.toString() !== \"\";\n\ntests[\"Response contains QUOTE_DATE \" + dataOut.quoteDate.toString()] = dataOut.quoteDate.toString() !== \"\";\n\ntests[\"Response contains EFFECTIVE_QUOTE_COMPLETION_DATE \" + dataOut.effectiveQuoteCompletionDate.toString()] = dataOut.effectiveQuoteCompletionDate.toString() !== \"\";\n\ntests[\"Response contains CUSTOMER \" ] = typeof(dataOut.customer) !== 'undefined';\n\nif( typeof(dataOut.quoteItem) !== 'undefined' && dataOut.quoteItem.length > 0) {\n var items = dataOut.quoteItem;\n for(var i = 0; i < items.length; i++) {\n tests[\"Response contains quoteItem ID \" + items[i].id.toString() ] = items[i].id.toString() !== \"\";\n tests[\"Response contains quoteItem productOffering\"] = typeof(items[i].productOffering) !== 'undefined';\n }\n}", + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1469688207698, + "name": "get quote with id and version", + "description": "get quote whith id and version\n", + "collectionId": "d53b2802-92a5-d7aa-2b21-f1a8d349c445", + "responses": [] + }, + { + "id": "4bfd8db3-b5bb-036d-7245-f112839d2fd0", + "headers": "Content-Type: application/json-patch+json\n//Accept: application/json-patch+json\n", + "url": "{{quoteManagementApi}}/quote/{{QUOTE_ID1}}", + "preRequestScript": "", + "pathVariables": {}, + "method": "PATCH", + "data": [], + "dataMode": "raw", + "version": 2, + "tests": "var dataOut = JSON.parse(responseBody);\n\n\ntests[\"Content-Type is present \" + postman.getResponseHeader(\"Content-type\")] = postman.getResponseHeader(\"Content-type\");\n\ntests[\"Status code is 200\"] = responseCode.code === 200;\n\ntests[\"Response contains ID \" + dataOut.id.toString()] = dataOut.id.toString() !== \"\";\n\ntests[\"Response contains VERSION \" + dataOut.version.toString()] = dataOut.version.toString() !== \"\";\n\ntests[\"Response contains HREF \" + dataOut.href.toString()] = dataOut.href.toString() !== \"\";\n\ntests[\"Response contains QUOTE_DATE \" + dataOut.quoteDate.toString()] = dataOut.quoteDate.toString() !== \"\";\n\ntests[\"Response contains EFFECTIVE_QUOTE_COMPLETION_DATE \" + dataOut.effectiveQuoteCompletionDate.toString()] = dataOut.effectiveQuoteCompletionDate.toString() !== \"\";\n\ntests[\"Response contains CUSTOMER \" ] = typeof(dataOut.customer) !== 'undefined';\n\nif( typeof(dataOut.quoteItem) !== 'undefined' && dataOut.quoteItem.length > 0) {\n var items = dataOut.quoteItem;\n for(var i = 0; i < items.length; i++) {\n tests[\"Response contains quoteItem ID \" + items[i].id.toString() ] = items[i].id.toString() !== \"\";\n tests[\"Response contains quoteItem productOffering\"] = typeof(items[i].productOffering) !== 'undefined';\n }\n}", + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1470641795647, + "name": "Partial update appointement json-patch with id", + "description": " with json-patch", + "collectionId": "d53b2802-92a5-d7aa-2b21-f1a8d349c445", + "responses": [], + "rawModeData": "[\n {\n \"op\": \"replace\",\n \"path\": \"/note/0/text\",\n \"value\": \"A free text for MODIFIED detailing the note\"\n }\n]" + }, + { + "id": "6c73350a-dcba-7f3a-84d9-ed046111a6a5", + "headers": "Content-Type: application/json-patch+json\n//Accept: application/json-patch+json\n", + "url": "{{quoteManagementApi}}/quote/{{QUOTE_ID1}}:(version=1.0)", + "preRequestScript": "", + "pathVariables": {}, + "method": "PATCH", + "data": [], + "dataMode": "raw", + "version": 2, + "tests": "var dataOut = JSON.parse(responseBody);\n\n\ntests[\"Content-Type is present \" + postman.getResponseHeader(\"Content-type\")] = postman.getResponseHeader(\"Content-type\");\n\ntests[\"Status code is 200\"] = responseCode.code === 200;\n\ntests[\"Response contains ID \" + dataOut.id.toString()] = dataOut.id.toString() !== \"\";\n\ntests[\"Response contains VERSION \" + dataOut.version.toString()] = dataOut.version.toString() !== \"\";\n\ntests[\"Response contains HREF \" + dataOut.href.toString()] = dataOut.href.toString() !== \"\";\n\ntests[\"Response contains QUOTE_DATE \" + dataOut.quoteDate.toString()] = dataOut.quoteDate.toString() !== \"\";\n\ntests[\"Response contains EFFECTIVE_QUOTE_COMPLETION_DATE \" + dataOut.effectiveQuoteCompletionDate.toString()] = dataOut.effectiveQuoteCompletionDate.toString() !== \"\";\n\ntests[\"Response contains CUSTOMER \" ] = typeof(dataOut.customer) !== 'undefined';\n\nif( typeof(dataOut.quoteItem) !== 'undefined' && dataOut.quoteItem.length > 0) {\n var items = dataOut.quoteItem;\n for(var i = 0; i < items.length; i++) {\n tests[\"Response contains quoteItem ID \" + items[i].id.toString() ] = items[i].id.toString() !== \"\";\n tests[\"Response contains quoteItem productOffering\"] = typeof(items[i].productOffering) !== 'undefined';\n }\n}", + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1469688795220, + "name": "Partial update appointement json-patch with id and version", + "description": " with json-patch", + "collectionId": "d53b2802-92a5-d7aa-2b21-f1a8d349c445", + "responses": [], + "rawModeData": "[\n {\n \"op\": \"replace\",\n \"path\": \"/note/0/text\",\n \"value\": \"A free text for MODIFIED detailing the note\"\n },\n {\n \"op\": \"remove\",\n \"path\": \"/quoteItem/2\"\n },\n {\n \"op\": \"remove\",\n \"path\": \"/relatedParty/1\"\n },\n {\n \"op\": \"replace\",\n \"path\": \"/state\",\n \"value\": \"Pending\"\n }\n]" + }, + { + "id": "7c5e7058-4c56-9701-be7f-e85ff5e5ce7e", + "headers": "Accept: application/json\nContent-Type: application/json\n", + "url": "{{quoteManagementApi}}/quote", + "preRequestScript": "", + "pathVariables": {}, + "method": "POST", + "data": [], + "dataMode": "raw", + "version": 2, + "tests": "var dataOut = JSON.parse(responseBody);\n\ntests[\"Content-Type is present \" + postman.getResponseHeader(\"Content-type\")] = postman.getResponseHeader(\"Content-type\");\n\ntests[\"Status code is 201\"] = responseCode.code === 201;\n\ntests[\"Response contains ID \" + dataOut.id.toString()] = dataOut.id.toString() !== \"\";\n\ntests[\"Response contains VERSION \" + dataOut.version.toString()] = dataOut.version.toString() !== \"\";\n\ntests[\"Response contains HREF \" + dataOut.href.toString()] = dataOut.href.toString() !== \"\";\n\ntests[\"Response contains QUOTE_DATE \" + dataOut.quoteDate.toString()] = dataOut.quoteDate.toString() !== \"\";\n\ntests[\"Response contains EFFECTIVE_QUOTE_COMPLETION_DATE \" + dataOut.effectiveQuoteCompletionDate.toString()] = dataOut.effectiveQuoteCompletionDate.toString() !== \"\";\n\ntests[\"Response contains CUSTOMER \" ] = typeof(dataOut.customer) !== 'undefined';\n\npostman.setGlobalVariable(\"QUOTE_ID2\", dataOut.id.toString());\n\npostman.setGlobalVariable(\"lastResponse\" + postman.getEnvironmentVariable(\"testName\"), dataOut);\npostman.setGlobalVariable(\"lastRequest\"+ postman.getEnvironmentVariable(\"testName\"), request.data );\n\nvar dataIn = JSON.parse(request.data);\n\nconsole.log(\"request \" + dataIn);\nconsole.log(\"request type\" + typeof(dataIn));\n\n\nif( typeof(dataOut.quoteItem) !== 'undefined' && dataOut.quoteItem.length > 0) {\n var items = dataOut.quoteItem;\n for(var i = 0; i < items.length; i++) {\n tests[\"Response contains quoteItem ID \" + items[i].id.toString() ] = items[i].id.toString() !== \"\";\n tests[\"Response contains quoteItem productOffering\"] = typeof(items[i].productOffering) !== 'undefined';\n }\n}\nif (dataIn.externalId) {\n tests[\"POST Body Response externalId equals Request externalId\" ] = objectEquals(dataIn.externalId, dataOut.externalId);\n}\n\nif (dataIn.description) {\n tests[\"POST Body Response description equals Request description\" ] = objectEquals(dataIn.description, dataOut.description);\n}\n\nif (dataIn.notificationContact) {\n tests[\"POST Body Response notificationContact equals Request notificationContact\" ] = objectEquals(dataIn.notificationContact, dataOut.notificationContact);\n}\n\ntests[\"POST Body Response customer equals Request customer\" ] = objectEquals(dataIn.customer, dataOut.customer);\n\n\nif (dataIn.validFor) {\n tests[\"POST Body Response validFor equals Request validFor\" ] = objectEquals(dataIn.validFor, dataOut.validFor);\n}\n\nif (dataIn.billingAccount) {\n tests[\"POST Body Response billingAccount equals Request billingAccount\" ] = objectEquals(dataIn.billingAccount, dataOut.billingAccount);\n}\n\nif (dataIn.note) {\n tests[\"POST Body Response note equals Request note\" ] = objectEquals(dataIn.note, dataOut.note);\n}\n\nif (dataIn.characteristic) {\n tests[\"POST Body Response characteristic equals Request characteristic\" ] = objectEquals(dataIn.characteristic, dataOut.characteristic);\n}\n\nif (dataIn.relatedParty) {\n tests[\"POST Body Response relatedParty equals Request relatedParty\" ] = objectEquals(dataIn.relatedParty, dataOut.relatedParty);\n}\n\nif (dataIn.agreement) {\n tests[\"POST Body Response agreement equals Request agreement\" ] = objectEquals(dataIn.agreement, dataOut.agreement);\n}\n\nif (dataIn.quoteAuthorization) {\n tests[\"POST Body Response quoteAuthorization equals Request quoteAuthorization\" ] = objectEquals(dataIn.quoteAuthorization, dataOut.quoteAuthorization);\n \n}\n\nif (dataIn.quoteProductOfferingPrice) {\n tests[\"POST Body Response quoteProductOfferingPrice equals Request quoteProductOfferingPrice\" ] = objectEquals(dataIn.quoteProductOfferingPrice, dataOut.quoteProductOfferingPrice);\n}\n\ntests[\"POST Body Response quoteItem equals Request quoteItem\" ] = objectEquals(dataIn.quoteItem, dataOut.quoteItem);\n\nfunction objectEquals(v1, v2) {\n if (typeof(v1) !== typeof(v2)) {\n console.log(\"property typeof(v1) !==typeof(v2)\" + typeof(v1) + typeof(v2) + \"==>\" + v1 + \"!=\" + v2);\n return false;\n }\n\n if (typeof(v1) === \"function\") {\n return v1.toString() === v2.toString();\n }\n\n if (v1 instanceof Object && v2 instanceof Object) {\n \n var r = true;\n for (var k in v1) {\n r = objectEquals(v1[k], v2[k]);\n \n if (!r) {\n tests[\"property \" + k.toString() + \"==>\" + v1[k] + \"!=\" + v2[k]] = false;\n console.log(\"property \" + k.toString() + \"==>\" + v1[k] + \"!=\" + v2[k]);\n postman.setGlobalVariable(\"unequal\" + k.toString(), v1[k] + \"!=\" + v2[k]);\n \n return false;\n } else {\n //tests[\"property \" + k.toString() + \"==>\" + v1[k] + \"=\" + v2[k]] = true;\n }\n }\n return true;\n } else {\n return v1 === v2;\n }\n}", + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1470640843631, + "name": "create a quote copy", + "description": "create a quote\n", + "collectionId": "d53b2802-92a5-d7aa-2b21-f1a8d349c445", + "responses": [], + "rawModeData": "{\r\n\"id\":\"43\",\r\n\r\n\"externalId\":\"QuoteForTheConsumer_42\",\r\n\"description\":\"A wonderful 42 quote for brand new products\",\r\n\"category\":\"corporate\",\r\n\"state\":\"InProgress\",\r\n\"version\":\"1.0\",\r\n\r\n\"effectiveQuoteCompletionDate\":\"\",\r\n\"quoteCompletionDate\":\"2013-04-19T16:42:23+08:00\",\r\n\"notificationContact\":\"bill.dupont@hotmail.com\",\r\n\"validFor\":{\r\n \"startDateTime\":\"2013-04-12T16:42:23+08:00\",\r\n \"endDateTime\":\"2013-04-19T00:00:00+08:00\"\r\n },\r\n\"billingAccount\":[\r\n {\r\n \"id\":\"123456\",\r\n \"href\":\"http://serverlocation:port/billingManagement/billingAccount/123456\"\r\n }\r\n],\r\n\"note\":[\r\n {\r\n \"text\":\"Quote following opportunity #2345\",\r\n \"date\":\"2013-04-12T16:42:23+08:00\",\r\n \"author\":\"Bill Dupont\"\r\n }\r\n],\r\n\"characteristic\":[\r\n {\r\n \"name\":\"Business Unit\",\r\n \"value\":\"London South West Cor^porate\"\r\n }\r\n],\r\n\"customer\":{\r\n \"id\":\"345221\",\r\n \"href\":\"http://serverlocation:port/customerManagement/customer/345221\",\r\n \"name\":\"John Doe\"\r\n},\r\n\"relatedParty\":[\r\n {\r\n \"id\":\"57\",\r\n \"href\":\"http://serverlocation:port/partyManagement/partner/57\",\r\n \"name\":\"Shinoju White\",\r\n \"role\":\"authorizer\"\r\n },\r\n {\r\n \"id\":\"4563\",\r\n \"href\":\"http://serverlocation:port/partnerManagement/partner/4563\",\r\n \"name\":\"Bill Dupont\",\r\n \"role\":\"seller\"\r\n }\r\n],\r\n\"agreement\":[\r\n {\r\n \"id\":\"45\",\r\n \"href\":\"http://serverlocation:port/engagedPartyManagement/agreement/45\",\r\n \"name\":\" standard disclaimer\"\r\n }\r\n],\r\n\"quoteAuthorization\":[\r\n {\r\n \"authorizationDate\":\"2013-04-12T16:42:23+08:00\",\r\n \"authorizationState\":\"approved\",\r\n \"authorizationSignatureRepresentation\":\"digital\",\r\n \"attachment\":{\r\n \"id\":\"22\",\r\n \"href\":\"http://serverlocation:port/documentManagement/attachment/22\",\r\n \"type\":\"pdf\"\r\n },\r\n \"quoteProductOfferingPrice\":[{ \r\n \"quotePriceAlteration\":{\r\n \"name\":\"Global Discount\",\r\n \"description\":\"5% for all recurring charge\",\r\n \"validFor\":{\r\n\t\t\t\t\"startDateTime\":\"2013-04-19T16:42:23+08:00\"\r\n\t\t\t}\r\n },\r\n\t\t\"priceType\":\"recurrent\",\r\n\t\t\"unitOfMeasure\":\"\",\r\n\t\t\"price\":{\r\n\t\t\t\"percentage\":5\r\n\t\t},\r\n\t\t\"recurringChargePeriod\":\"\",\r\n\t\t\"priceCondition\":\"applied if all quote items are purchased\"\r\n }]\r\n }\r\n],\r\n\"quoteItem\":[\r\n {\r\n \"id\":\"1\",\r\n \"state\":\"InProgress\",\r\n \"attachment\":{\r\n \"id\":\"22\",\r\n \"href\":\"http://serverlocation:port/documentManagement/attachment/TMFVoiceEXtraRationale.pdf\",\r\n \"type\":\"pdf\"\r\n },\r\n \"relatedParty\":[\r\n {\r\n \"id\":\"345221\",\r\n \"href\":\"http://serverlocation:port/partyManagement/customer/345221\",\r\n \"name\":\"John Doe\",\r\n \"role\":\"customer\"\r\n },\r\n {\r\n \"id\":\"4563\",\r\n \"href\":\"http://serverlocation:port/partnerManagement/partner/4563\",\r\n \"name\":\"Bill Dupont\",\r\n \"role\":\"seller\"\r\n }\r\n ],\r\n \"productOffering\":{\r\n \"id\":\"198\",\r\n \"href\":\"http: //serverlocation: port/catalogManagement/productOffering/198\"\r\n },\r\n \"product\":{ }\r\n },\r\n {\r\n \"id\":\"2\",\r\n \"state\":\"InProgress\",\r\n \"note\":[\r\n {\r\n \"text\":\"xxxx\",\r\n \"date\":\"2013-04-12T16:42:23+08:00\",\r\n \"author\":\"Bill Dupont\"\r\n }\r\n ],\r\n \"itemQuoteAuthorization\":[\r\n {\r\n \"authorizationDate\":\"2013-04-12T18:42:23+08:00\",\r\n \"authorizationState\":\"approved\",\r\n \"authorizationSignatureRepresentation\":\"digital \",\r\n \"attachment\":{\r\n \"id\":\"22\",\r\n \"href\":\"http://serverlocation:port/documentManagement/attachment/22\",\r\n \"type\":\"JPG\"\r\n }\r\n }\r\n ],\r\n \"productOffering\":{\r\n \"id\":\" SamPhone i5s \",\r\n \"href\":\"http: //serverlocation: port/catalogManagement/productOffering/SamPhonei5s \"\r\n },\r\n \"product\":{\r\n \"productCharacteristic\":[\r\n {\r\n \"name\":\"color\",\r\n \"value\":\"pink\"\r\n }\r\n ]\r\n }\r\n },\r\n {\r\n \"id\":\"3\",\r\n \"state\":\"InProgress\",\r\n \"note\":[\r\n {\r\n \"text\":\"The leased line should be directly plugged from Joe’s Office\",\r\n \"date\":\"2013-04-12T16:42:23+08:00\",\r\n \"author\":\"Bill Dupont\"\r\n }\r\n ],\r\n \"productOffering\":{\r\n \"id\":\" TMF Fiber+\",\r\n \"href\":\"http: //serverlocation: port/catalogManagement/productOffering/TMFFiber+\"\r\n },\r\n \"product\":{\r\n \"productCharacteristic\":[\r\n {\r\n \"name\":\"Speed\",\r\n \"value\":\"100 Mo/s\"\r\n },\r\n {\r\n \"name\":\"Site A\",\r\n \"value\":\"12 Dupont Circle, 34511 Washington DC\"\r\n },\r\n {\r\n \"name\":\"Site B\",\r\n \"value\":\"436 25th Avenue, 34507 Washington DC\"\r\n }\r\n ]\r\n }\r\n },\r\n {\r\n \"id\":\"4\",\r\n \"state\":\"InProgress\",\r\n \"itemQuoteProductOfferingPrice\":[{\r\n \"priceType\":\"recurrent\",\r\n \"recurringChargePeriod\":\"monthly\",\r\n \"priceCondition\":\"\",\r\n \"quotePriceAlteration\":{\r\n\t\t\t\"name\":\"Discount on Bundle TV channel\",\r\n\t\t\t\"description\":\"Movie + sport is so fun\",\r\n\t\t\t\"validFor\":{\r\n\t\t\t\t\"startDateTime\":\"2013-04-19T16:42:23+08:00\"\r\n\t\t\t}\r\n\t\t},\r\n \r\n \"price\":{\r\n \"override\":23.87\r\n },\r\n \"unitOfMeasure\":\"\"\r\n \r\n }],\r\n \"productOffering\":{\r\n \"id\":\"TM TV+\",\r\n \"href\":\"http://serverlocation:port/catalogManagement/productOffering/BundleTMTV+\",\r\n \"bundledProductOffering\":[\r\n {\r\n \"id\":\" Sport TV Channel\",\r\n \"href\":\"http://serverlocation:port/catalogManagement/productOffering/SportChannel\"\r\n },\r\n {\r\n \"id\":\" Movie TV channel\",\r\n \"href\":\"http://serverlocation:port/catalogManagement/productOffering/MovieChannel\"\r\n }\r\n ]\r\n }\r\n }\r\n ]\r\n}" + }, + { + "id": "84000cf5-233d-1854-2b1f-b816b9eaa544", + "headers": "Accept: application/json\nContent-Type: application/json\n", + "url": "{{Host}}/DSQuoteManagement/api/admin/quote/{{QUOTE_ID1}}:(version=1.0)", + "preRequestScript": "", + "pathVariables": {}, + "method": "DELETE", + "data": [], + "dataMode": "params", + "version": 2, + "tests": "var dataOut = JSON.parse(responseBody);\n\ntests[\"Content-Type is present \" + postman.getResponseHeader(\"Content-type\")] = postman.getResponseHeader(\"Content-type\");\n\ntests[\"Status code is 200\"] = responseCode.code === 200;\n\ntests[\"Response contains previousRows \" + dataOut.previousRows.toString()] = dataOut.previousRows.toString() !== \"\";\n\ntests[\"Response contains affectedRows \" + dataOut.affectedRows.toString()] = dataOut.affectedRows.toString() !== \"\";\n\ntests[\"Response contains currentRows \" + dataOut.currentRows.toString()] = dataOut.currentRows.toString() !== \"\";", + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1469689329628, + "name": "[ADMIN] delete quote with version", + "description": "delete quote\n", + "collectionId": "d53b2802-92a5-d7aa-2b21-f1a8d349c445", + "responses": [] + }, + { + "id": "89566752-6274-87d9-7581-00cd7c070f79", + "headers": "Accept: application/json\nContent-Type: application/json\n", + "url": "{{Host}}/DSQuoteManagement/api/admin/quote/{{QUOTE_ID2}}", + "preRequestScript": "", + "pathVariables": {}, + "method": "DELETE", + "data": [], + "dataMode": "params", + "version": 2, + "tests": "var dataOut = JSON.parse(responseBody);\n\ntests[\"Content-Type is present \" + postman.getResponseHeader(\"Content-type\")] = postman.getResponseHeader(\"Content-type\");\n\ntests[\"Status code is 200\"] = responseCode.code === 200;\n\ntests[\"Response contains previousRows \" + dataOut.previousRows.toString()] = dataOut.previousRows.toString() !== \"\";\n\ntests[\"Response contains affectedRows \" + dataOut.affectedRows.toString()] = dataOut.affectedRows.toString() !== \"\";\n\ntests[\"Response contains currentRows \" + dataOut.currentRows.toString()] = dataOut.currentRows.toString() !== \"\";", + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1470641156137, + "name": "[ADMIN] delete quote", + "description": "delete quote\n", + "collectionId": "d53b2802-92a5-d7aa-2b21-f1a8d349c445", + "responses": [] + }, + { + "id": "99f01fbd-10f8-b3d9-c491-74c3bfd4651f", + "headers": "Accept: application/json\nContent-Type: application/json\n", + "url": "{{quoteManagementApi}}/quote/{{QUOTE_ID1}}", + "preRequestScript": "", + "pathVariables": {}, + "method": "GET", + "data": [], + "dataMode": "params", + "version": 2, + "tests": "var dataOut = JSON.parse(responseBody);\n\n\nvar lastRequest = globals[\"lastRequest\"+postman.getEnvironmentVariable(\"testName\")];\n\nvar lastResponse= globals[\"lastResponse\"+postman.getEnvironmentVariable(\"testName\")];\n\ntests[\"Content-Type is present \" + postman.getResponseHeader(\"Content-type\")] = postman.getResponseHeader(\"Content-type\");\n\ntests[\"Status code is 200\"] = responseCode.code === 200;\n\ntests[\"Response contains ID \" + dataOut.id.toString()] = dataOut.id.toString() !== \"\";\n\ntests[\"Response contains VERSION \" + dataOut.version.toString()] = dataOut.version.toString() !== \"\";\n\ntests[\"Response contains HREF \" + dataOut.href.toString()] = dataOut.href.toString() !== \"\";\n\ntests[\"Response contains QUOTE_DATE \" + dataOut.quoteDate.toString()] = dataOut.quoteDate.toString() !== \"\";\n\ntests[\"Response contains EFFECTIVE_QUOTE_COMPLETION_DATE \" + dataOut.effectiveQuoteCompletionDate.toString()] = dataOut.effectiveQuoteCompletionDate.toString() !== \"\";\n\ntests[\"Response contains CUSTOMER \" ] = typeof(dataOut.customer) !== 'undefined';\n\nif( typeof(dataOut.quoteItem) !== 'undefined' && dataOut.quoteItem.length > 0) {\n var items = dataOut.quoteItem;\n for(var i = 0; i < items.length; i++) {\n tests[\"Response contains quoteItem ID \" + items[i].id.toString() ] = items[i].id.toString() !== \"\";\n tests[\"Response contains quoteItem productOffering\"] = typeof(items[i].productOffering) !== 'undefined';\n }\n}\nvar dataIn = JSON.parse(lastRequest);\n\nif (dataIn.externalId) {\n tests[\"POST Body Response externalId equals LastRequest externalId\" ] = objectEquals(dataIn.externalId, dataOut.externalId);\n}\n\nif (dataIn.description) {\n tests[\"POST Body Response description equals LastRequest description\" ] = objectEquals(dataIn.description, dataOut.description);\n}\n\nif (dataIn.notificationContact) {\n tests[\"POST Body Response notificationContact equals LastRequest notificationContact\" ] = objectEquals(dataIn.notificationContact, dataOut.notificationContact);\n}\n\ntests[\"POST Body Response customer equals LastRequest customer\" ] = objectEquals(dataIn.customer, dataOut.customer);\n\n\nif (dataIn.validFor) {\n tests[\"POST Body Response validFor equals LastRequest validFor\" ] = objectEquals(dataIn.validFor, dataOut.validFor);\n}\n\nif (dataIn.billingAccount) {\n tests[\"POST Body Response billingAccount equals LastRequest billingAccount\" ] = objectEquals(dataIn.billingAccount, dataOut.billingAccount);\n}\n\nif (dataIn.note) {\n tests[\"POST Body Response note equals LastRequest note\" ] = objectEquals(dataIn.note, dataOut.note);\n}\n\nif (dataIn.characteristic) {\n tests[\"POST Body Response characteristic equals LastRequest characteristic\" ] = objectEquals(dataIn.characteristic, dataOut.characteristic);\n}\n\nif (dataIn.relatedParty) {\n tests[\"POST Body Response relatedParty equals LastRequest relatedParty\" ] = objectEquals(dataIn.relatedParty, dataOut.relatedParty);\n}\n\n\nif (dataIn.agreement) {\n tests[\"POST Body Response agreement equals LastRequest agreement\" ] = objectEquals(dataIn.agreement, dataOut.agreement);\n}\n\nif (dataIn.quoteAuthorization) {\n tests[\"POST Body Response quoteAuthorization equals LastRequest quoteAuthorization\" ] = objectEquals(dataIn.quoteAuthorization, dataOut.quoteAuthorization);\n \n}\n\nif (dataIn.quoteProductOfferingPrice) {\n tests[\"POST Body Response quoteProductOfferingPrice LastRequest LastRequest quoteProductOfferingPrice\" ] = objectEquals(dataIn.quoteProductOfferingPrice, dataIn.quoteProductOfferingPrice);\n}\n\ntests[\"POST Body Response quoteItem equals LastRequest quoteItem\" ] = objectEquals(dataIn.quoteItem, dataOut.quoteItem);\n\nfunction objectEquals(v1, v2) {\n if (typeof(v1) !== typeof(v2)) {\n console.log(\"property typeof(v1) !==typeof(v2)\" + typeof(v1) + typeof(v2) + \"==>\" + v1 + \"!=\" + v2);\n return false;\n }\n\n if (typeof(v1) === \"function\") {\n return v1.toString() === v2.toString();\n }\n\n if (v1 instanceof Object && v2 instanceof Object) {\n \n var r = true;\n for (var k in v1) {\n r = objectEquals(v1[k], v2[k]);\n \n if (!r) {\n tests[\"property \" + k.toString() + \"==>\" + v1[k] + \"!=\" + v2[k]] = false;\n console.log(\"property \" + k.toString() + \"==>\" + v1[k] + \"!=\" + v2[k]);\n postman.setGlobalVariable(\"unequal\" + k.toString(), v1[k] + \"!=\" + v2[k]);\n \n return false;\n } else {\n //tests[\"property \" + k.toString() + \"==>\" + v1[k] + \"=\" + v2[k]] = true;\n }\n }\n return true;\n } else {\n return v1 === v2;\n }\n}\n", + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1469687066574, + "name": "get quote with id ", + "description": "get quote whith id\n", + "collectionId": "d53b2802-92a5-d7aa-2b21-f1a8d349c445", + "responses": [] + }, + { + "id": "9c8c29a5-ebdb-aadb-b896-35533bddb38b", + "headers": "Accept: application/json\nContent-Type: application/json\n", + "url": "{{quoteManagementApi}}/quote/{{QUOTE_ID2}}:(version=1.0)", + "preRequestScript": "", + "pathVariables": {}, + "method": "PATCH", + "data": [], + "dataMode": "raw", + "version": 2, + "tests": "", + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1470640829678, + "name": "partial update quote with id and version", + "description": "partial update quote with id and version\n", + "collectionId": "d53b2802-92a5-d7aa-2b21-f1a8d349c445", + "responses": [], + "rawModeData": "{\r\n \"note\":[\r\n {\r\n \"text\":\"A free text detailing the note\"\r\n }\r\n ],\r\n \"relatedParty\":[\r\n {\r\n \"role\":\"customer\",\r\n \"id\":\"345221\",\r\n \"href\":\"http://serverlocation:port/partyManagement/customer/345221\",\r\n \"name\":\"John Doe\"\r\n },\r\n {\r\n \"role\":\"seller\",\r\n \"id\":\"4563\",\r\n \"href\":\"http://serverlocation:port/partnerManagement/partner/4563\"\r\n }\r\n ],\r\n \"quoteItem\":[\r\n {\r\n \"id\":\"1\",\r\n \"action\":\"add\",\r\n \"billingAccount\":[\r\n {\r\n \"id\":\"1789\",\r\n \"href\":\"http://serverlocation:port/billingManagement/billingAccount/1789\"\r\n }\r\n ],\r\n \"productOffering\":{\r\n \"id\":\"42\",\r\n \"href\":\"http: //serverlocation: port/catalogManagement/productOffering/42\"\r\n },\r\n \"product\":{\r\n \"productCharacteristic\":[\r\n {\r\n \"name\":\"Colour\",\r\n \"value\":\"White\"\r\n },\r\n {\r\n \"name\":\"Memory\",\r\n \"value\":\"16\"\r\n }\r\n ]\r\n }\r\n },\r\n {\r\n \"id\":\"2\",\r\n \"action\":\"modify\",\r\n \"product\":{\r\n \"id\":\"456\",\r\n \"href\":\"http: //serverlocation: port/inventoryManagement/product/456\",\r\n \"relatedParty\":[\r\n {\r\n \"role\":\"user\",\r\n \"id\":\"5667443\",\r\n \"href\":\"http://serverlocation:port/partyManagement/user/5667443\",\r\n \"name\":\"Jimmy Doe\"\r\n }\r\n ]\r\n }\r\n },\r\n {\r\n \"id\":\"3\",\r\n \"action\":\"delete\",\r\n \"product\":{\r\n \"id\":\"456\",\r\n \"href\":\"http: //serverlocation: port/inventoryManagement/product/456\"\r\n }\r\n }\r\n ]\r\n}" + }, + { + "id": "a9e7996e-f766-55d3-2d1d-d1566fbbbb4f", + "headers": "Accept: application/json\nContent-Type: application/json\n", + "url": "{{quoteManagementApi}}/quote?id={{QUOTE_ID1}}&version=1.0", + "preRequestScript": "", + "pathVariables": {}, + "method": "GET", + "data": [], + "dataMode": "params", + "version": 2, + "tests": "var dataOut = JSON.parse(responseBody);\n\ntests[\"Content-Type is present \" + postman.getResponseHeader(\"Content-type\")] = postman.getResponseHeader(\"Content-type\");\n\ntests[\"Status code is 200\"] = responseCode.code === 200;\n\nif (typeof(dataOut)!=='undefined' && dataOut.length>0) {\n var items = dataOut;\n for (var i = 0; i < items.length; i++) {\n tests[\"Response contains ID \" + items[i].id.toString()] = items[i].id.toString() !== \"\";\n\n tests[\"Response contains VERSION \" + items[i].version.toString()] = items[i].version.toString() !== \"\";\n\n tests[\"Response contains HREF \" + items[i].href.toString()] = items[i].href.toString() !== \"\";\n\n tests[\"Response contains QUOTE_DATE \" + items[i].quoteDate.toString()] = items[i].quoteDate.toString() !== \"\";\n\n tests[\"Response contains EFFECTIVE_QUOTE_COMPLETION_DATE \" + items[i].effectiveQuoteCompletionDate.toString()] = items[i].effectiveQuoteCompletionDate.toString() !== \"\";\n\n tests[\"Response contains CUSTOMER \" ] = typeof(items[i].customer) !== 'undefined';\n }\n}", + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1470633992014, + "name": "get quote with filter", + "description": "get quote whith filter", + "collectionId": "d53b2802-92a5-d7aa-2b21-f1a8d349c445", + "responses": [] + }, + { + "id": "d62f15e2-dbf1-bc92-c6e8-c01926af295e", + "headers": "Accept: application/json\nContent-Type: application/json\n", + "url": "{{quoteManagementApi}}/quote/{{QUOTE_ID2}}", + "preRequestScript": "", + "pathVariables": {}, + "method": "PATCH", + "data": [], + "dataMode": "raw", + "version": 2, + "tests": "", + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1470640821116, + "name": "partial update quote with id", + "description": "partial update quote with id\n", + "collectionId": "d53b2802-92a5-d7aa-2b21-f1a8d349c445", + "responses": [], + "rawModeData": "{\r\n \"note\":[\r\n {\r\n \"text\":\"A free text detailing the note\"\r\n }\r\n ],\r\n \"relatedParty\":[\r\n {\r\n \"role\":\"customer\",\r\n \"id\":\"345221\",\r\n \"href\":\"http://serverlocation:port/partyManagement/customer/345221\",\r\n \"name\":\"John Doe\"\r\n },\r\n {\r\n \"role\":\"seller\",\r\n \"id\":\"4563\",\r\n \"href\":\"http://serverlocation:port/partnerManagement/partner/4563\"\r\n }\r\n ],\r\n \"quoteItem\":[\r\n {\r\n \"id\":\"1\",\r\n \"action\":\"add\",\r\n \"billingAccount\":[\r\n {\r\n \"id\":\"1789\",\r\n \"href\":\"http://serverlocation:port/billingManagement/billingAccount/1789\"\r\n }\r\n ],\r\n \"productOffering\":{\r\n \"id\":\"42\",\r\n \"href\":\"http: //serverlocation: port/catalogManagement/productOffering/42\"\r\n },\r\n \"product\":{\r\n \"productCharacteristic\":[\r\n {\r\n \"name\":\"Colour\",\r\n \"value\":\"White\"\r\n },\r\n {\r\n \"name\":\"Memory\",\r\n \"value\":\"16\"\r\n }\r\n ]\r\n }\r\n },\r\n {\r\n \"id\":\"2\",\r\n \"action\":\"modify\",\r\n \"product\":{\r\n \"id\":\"456\",\r\n \"href\":\"http: //serverlocation: port/inventoryManagement/product/456\",\r\n \"relatedParty\":[\r\n {\r\n \"role\":\"user\",\r\n \"id\":\"5667443\",\r\n \"href\":\"http://serverlocation:port/partyManagement/user/5667443\",\r\n \"name\":\"Jimmy Doe\"\r\n }\r\n ]\r\n }\r\n },\r\n {\r\n \"id\":\"3\",\r\n \"action\":\"delete\",\r\n \"product\":{\r\n \"id\":\"456\",\r\n \"href\":\"http: //serverlocation: port/inventoryManagement/product/456\"\r\n }\r\n }\r\n ]\r\n}" + }, + { + "id": "d79291d0-d96c-9d6d-40b9-3c2f16bbf419", + "headers": "Accept: application/json\nContent-Type: application/json\n", + "url": "{{quoteManagementApi}}/quote", + "preRequestScript": "", + "pathVariables": {}, + "method": "POST", + "data": [], + "dataMode": "raw", + "version": 2, + "tests": "var dataOut = JSON.parse(responseBody);\n\ntests[\"Content-Type is present \" + postman.getResponseHeader(\"Content-type\")] = postman.getResponseHeader(\"Content-type\");\n\ntests[\"Status code is 201\"] = responseCode.code === 201;\n\ntests[\"Response contains ID \" + dataOut.id.toString()] = dataOut.id.toString() !== \"\";\n\ntests[\"Response contains VERSION \" + dataOut.version.toString()] = dataOut.version.toString() !== \"\";\n\ntests[\"Response contains HREF \" + dataOut.href.toString()] = dataOut.href.toString() !== \"\";\n\ntests[\"Response contains QUOTE_DATE \" + dataOut.quoteDate.toString()] = dataOut.quoteDate.toString() !== \"\";\n\ntests[\"Response contains EFFECTIVE_QUOTE_COMPLETION_DATE \" + dataOut.effectiveQuoteCompletionDate.toString()] = dataOut.effectiveQuoteCompletionDate.toString() !== \"\";\n\ntests[\"Response contains CUSTOMER \" ] = typeof(dataOut.customer) !== 'undefined';\n\npostman.setGlobalVariable(\"QUOTE_ID1\", dataOut.id.toString());\n\npostman.setGlobalVariable(\"lastResponse\" + postman.getEnvironmentVariable(\"testName\"), dataOut);\npostman.setGlobalVariable(\"lastRequest\"+ postman.getEnvironmentVariable(\"testName\"), request.data );\n\nvar dataIn = JSON.parse(request.data);\n\nconsole.log(\"request \" + dataIn);\nconsole.log(\"request type\" + typeof(dataIn));\n\n\nif( typeof(dataOut.quoteItem) !== 'undefined' && dataOut.quoteItem.length > 0) {\n var items = dataOut.quoteItem;\n for(var i = 0; i < items.length; i++) {\n tests[\"Response contains quoteItem ID \" + items[i].id.toString() ] = items[i].id.toString() !== \"\";\n tests[\"Response contains quoteItem productOffering\"] = typeof(items[i].productOffering) !== 'undefined';\n }\n}\nif (dataIn.externalId) {\n tests[\"POST Body Response externalId equals Request externalId\" ] = objectEquals(dataIn.externalId, dataOut.externalId);\n}\n\nif (dataIn.description) {\n tests[\"POST Body Response description equals Request description\" ] = objectEquals(dataIn.description, dataOut.description);\n}\n\nif (dataIn.notificationContact) {\n tests[\"POST Body Response notificationContact equals Request notificationContact\" ] = objectEquals(dataIn.notificationContact, dataOut.notificationContact);\n}\n\ntests[\"POST Body Response customer equals Request customer\" ] = objectEquals(dataIn.customer, dataOut.customer);\n\n\nif (dataIn.validFor) {\n tests[\"POST Body Response validFor equals Request validFor\" ] = objectEquals(dataIn.validFor, dataOut.validFor);\n}\n\nif (dataIn.billingAccount) {\n tests[\"POST Body Response billingAccount equals Request billingAccount\" ] = objectEquals(dataIn.billingAccount, dataOut.billingAccount);\n}\n\nif (dataIn.note) {\n tests[\"POST Body Response note equals Request note\" ] = objectEquals(dataIn.note, dataOut.note);\n}\n\nif (dataIn.characteristic) {\n tests[\"POST Body Response characteristic equals Request characteristic\" ] = objectEquals(dataIn.characteristic, dataOut.characteristic);\n}\n\nif (dataIn.relatedParty) {\n tests[\"POST Body Response relatedParty equals Request relatedParty\" ] = objectEquals(dataIn.relatedParty, dataOut.relatedParty);\n}\n\nif (dataIn.agreement) {\n tests[\"POST Body Response agreement equals Request agreement\" ] = objectEquals(dataIn.agreement, dataOut.agreement);\n}\n\nif (dataIn.quoteAuthorization) {\n tests[\"POST Body Response quoteAuthorization equals Request quoteAuthorization\" ] = objectEquals(dataIn.quoteAuthorization, dataOut.quoteAuthorization);\n \n}\n\nif (dataIn.quoteProductOfferingPrice) {\n tests[\"POST Body Response quoteProductOfferingPrice equals Request quoteProductOfferingPrice\" ] = objectEquals(dataIn.quoteProductOfferingPrice, dataOut.quoteProductOfferingPrice);\n}\n\ntests[\"POST Body Response quoteItem equals Request quoteItem\" ] = objectEquals(dataIn.quoteItem, dataOut.quoteItem);\n\nfunction objectEquals(v1, v2) {\n if (typeof(v1) !== typeof(v2)) {\n console.log(\"property typeof(v1) !==typeof(v2)\" + typeof(v1) + typeof(v2) + \"==>\" + v1 + \"!=\" + v2);\n return false;\n }\n\n if (typeof(v1) === \"function\") {\n return v1.toString() === v2.toString();\n }\n\n if (v1 instanceof Object && v2 instanceof Object) {\n \n var r = true;\n for (var k in v1) {\n r = objectEquals(v1[k], v2[k]);\n \n if (!r) {\n tests[\"property \" + k.toString() + \"==>\" + v1[k] + \"!=\" + v2[k]] = false;\n console.log(\"property \" + k.toString() + \"==>\" + v1[k] + \"!=\" + v2[k]);\n postman.setGlobalVariable(\"unequal\" + k.toString(), v1[k] + \"!=\" + v2[k]);\n \n return false;\n } else {\n //tests[\"property \" + k.toString() + \"==>\" + v1[k] + \"=\" + v2[k]] = true;\n }\n }\n return true;\n } else {\n return v1 === v2;\n }\n}", + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1469687019211, + "name": "create a quote", + "description": "create a quote\n", + "collectionId": "d53b2802-92a5-d7aa-2b21-f1a8d349c445", + "responses": [], + "rawModeData": "{\r\n\"id\":\"42\",\r\n\r\n\"externalId\":\"QuoteForTheConsumer_42\",\r\n\"description\":\"A wonderful 42 quote for brand new products\",\r\n\"category\":\"corporate\",\r\n\"state\":\"InProgress\",\r\n\"version\":\"1.0\",\r\n\r\n\"effectiveQuoteCompletionDate\":\"\",\r\n\"quoteCompletionDate\":\"2013-04-19T16:42:23+08:00\",\r\n\"notificationContact\":\"bill.dupont@hotmail.com\",\r\n\"validFor\":{\r\n \"startDateTime\":\"2013-04-12T16:42:23+08:00\",\r\n \"endDateTime\":\"2013-04-19T00:00:00+08:00\"\r\n },\r\n\"billingAccount\":[\r\n {\r\n \"id\":\"123456\",\r\n \"href\":\"http://serverlocation:port/billingManagement/billingAccount/123456\"\r\n }\r\n],\r\n\"note\":[\r\n {\r\n \"text\":\"Quote following opportunity #2345\",\r\n \"date\":\"2013-04-12T16:42:23+08:00\",\r\n \"author\":\"Bill Dupont\"\r\n }\r\n],\r\n\"characteristic\":[\r\n {\r\n \"name\":\"Business Unit\",\r\n \"value\":\"London South West Cor^porate\"\r\n }\r\n],\r\n\"customer\":{\r\n \"id\":\"345221\",\r\n \"href\":\"http://serverlocation:port/customerManagement/customer/345221\",\r\n \"name\":\"John Doe\"\r\n},\r\n\"relatedParty\":[\r\n {\r\n \"id\":\"57\",\r\n \"href\":\"http://serverlocation:port/partyManagement/partner/57\",\r\n \"name\":\"Shinoju White\",\r\n \"role\":\"authorizer\"\r\n },\r\n {\r\n \"id\":\"4563\",\r\n \"href\":\"http://serverlocation:port/partnerManagement/partner/4563\",\r\n \"name\":\"Bill Dupont\",\r\n \"role\":\"seller\"\r\n }\r\n],\r\n\"agreement\":[\r\n {\r\n \"id\":\"45\",\r\n \"href\":\"http://serverlocation:port/engagedPartyManagement/agreement/45\",\r\n \"name\":\" standard disclaimer\"\r\n }\r\n],\r\n\"quoteAuthorization\":[\r\n {\r\n \"authorizationDate\":\"2013-04-12T16:42:23+08:00\",\r\n \"authorizationState\":\"approved\",\r\n \"authorizationSignatureRepresentation\":\"digital\",\r\n \"attachment\":{\r\n \"id\":\"22\",\r\n \"href\":\"http://serverlocation:port/documentManagement/attachment/22\",\r\n \"type\":\"pdf\"\r\n },\r\n \"quoteProductOfferingPrice\":[{ \r\n \"quotePriceAlteration\":{\r\n \"name\":\"Global Discount\",\r\n \"description\":\"5% for all recurring charge\",\r\n \"validFor\":{\r\n\t\t\t\t\"startDateTime\":\"2013-04-19T16:42:23+08:00\"\r\n\t\t\t}\r\n },\r\n\t\t\"priceType\":\"recurrent\",\r\n\t\t\"unitOfMeasure\":\"\",\r\n\t\t\"price\":{\r\n\t\t\t\"percentage\":5\r\n\t\t},\r\n\t\t\"recurringChargePeriod\":\"\",\r\n\t\t\"priceCondition\":\"applied if all quote items are purchased\"\r\n }]\r\n }\r\n],\r\n\"quoteItem\":[\r\n {\r\n \"id\":\"1\",\r\n \"state\":\"InProgress\",\r\n \"attachment\":{\r\n \"id\":\"22\",\r\n \"href\":\"http://serverlocation:port/documentManagement/attachment/TMFVoiceEXtraRationale.pdf\",\r\n \"type\":\"pdf\"\r\n },\r\n \"relatedParty\":[\r\n {\r\n \"id\":\"345221\",\r\n \"href\":\"http://serverlocation:port/partyManagement/customer/345221\",\r\n \"name\":\"John Doe\",\r\n \"role\":\"customer\"\r\n },\r\n {\r\n \"id\":\"4563\",\r\n \"href\":\"http://serverlocation:port/partnerManagement/partner/4563\",\r\n \"name\":\"Bill Dupont\",\r\n \"role\":\"seller\"\r\n }\r\n ],\r\n \"productOffering\":{\r\n \"id\":\"198\",\r\n \"href\":\"http: //serverlocation: port/catalogManagement/productOffering/198\"\r\n },\r\n \"product\":{ }\r\n },\r\n {\r\n \"id\":\"2\",\r\n \"state\":\"InProgress\",\r\n \"note\":[\r\n {\r\n \"text\":\"xxxx\",\r\n \"date\":\"2013-04-12T16:42:23+08:00\",\r\n \"author\":\"Bill Dupont\"\r\n }\r\n ],\r\n \"itemQuoteAuthorization\":[\r\n {\r\n \"authorizationDate\":\"2013-04-12T18:42:23+08:00\",\r\n \"authorizationState\":\"approved\",\r\n \"authorizationSignatureRepresentation\":\"digital \",\r\n \"attachment\":{\r\n \"id\":\"22\",\r\n \"href\":\"http://serverlocation:port/documentManagement/attachment/22\",\r\n \"type\":\"JPG\"\r\n }\r\n }\r\n ],\r\n \"productOffering\":{\r\n \"id\":\" SamPhone i5s \",\r\n \"href\":\"http: //serverlocation: port/catalogManagement/productOffering/SamPhonei5s \"\r\n },\r\n \"product\":{\r\n \"productCharacteristic\":[\r\n {\r\n \"name\":\"color\",\r\n \"value\":\"pink\"\r\n }\r\n ]\r\n }\r\n },\r\n {\r\n \"id\":\"3\",\r\n \"state\":\"InProgress\",\r\n \"note\":[\r\n {\r\n \"text\":\"The leased line should be directly plugged from Joe’s Office\",\r\n \"date\":\"2013-04-12T16:42:23+08:00\",\r\n \"author\":\"Bill Dupont\"\r\n }\r\n ],\r\n \"productOffering\":{\r\n \"id\":\" TMF Fiber+\",\r\n \"href\":\"http: //serverlocation: port/catalogManagement/productOffering/TMFFiber+\"\r\n },\r\n \"product\":{\r\n \"productCharacteristic\":[\r\n {\r\n \"name\":\"Speed\",\r\n \"value\":\"100 Mo/s\"\r\n },\r\n {\r\n \"name\":\"Site A\",\r\n \"value\":\"12 Dupont Circle, 34511 Washington DC\"\r\n },\r\n {\r\n \"name\":\"Site B\",\r\n \"value\":\"436 25th Avenue, 34507 Washington DC\"\r\n }\r\n ]\r\n }\r\n },\r\n {\r\n \"id\":\"4\",\r\n \"state\":\"InProgress\",\r\n \"itemQuoteProductOfferingPrice\":[{\r\n \"priceType\":\"recurrent\",\r\n \"recurringChargePeriod\":\"monthly\",\r\n \"priceCondition\":\"\",\r\n \"quotePriceAlteration\":{\r\n\t\t\t\"name\":\"Discount on Bundle TV channel\",\r\n\t\t\t\"description\":\"Movie + sport is so fun\",\r\n\t\t\t\"validFor\":{\r\n\t\t\t\t\"startDateTime\":\"2013-04-19T16:42:23+08:00\"\r\n\t\t\t}\r\n\t\t},\r\n \r\n \"price\":{\r\n \"override\":23.87\r\n },\r\n \"unitOfMeasure\":\"\"\r\n \r\n }],\r\n \"productOffering\":{\r\n \"id\":\"TM TV+\",\r\n \"href\":\"http://serverlocation:port/catalogManagement/productOffering/BundleTMTV+\",\r\n \"bundledProductOffering\":[\r\n {\r\n \"id\":\" Sport TV Channel\",\r\n \"href\":\"http://serverlocation:port/catalogManagement/productOffering/SportChannel\"\r\n },\r\n {\r\n \"id\":\" Movie TV channel\",\r\n \"href\":\"http://serverlocation:port/catalogManagement/productOffering/MovieChannel\"\r\n }\r\n ]\r\n }\r\n }\r\n ]\r\n}" + }, + { + "id": "ed18fec3-a862-c616-3b45-7c78251bf84e", + "headers": "Accept: application/json\nContent-Type: application/json\n", + "url": "{{quoteManagementApi}}/quote", + "preRequestScript": "", + "pathVariables": {}, + "method": "GET", + "data": [], + "dataMode": "params", + "version": 2, + "tests": "var dataOut = JSON.parse(responseBody);\n\ntests[\"Content-Type is present \" + postman.getResponseHeader(\"Content-type\")] = postman.getResponseHeader(\"Content-type\");\n\ntests[\"Status code is 200\"] = responseCode.code === 200;\n\nif (typeof(dataOut)!=='undefined' && dataOut.length>0) {\n var items = dataOut;\n for (var i = 0; i < items.length; i++) {\n tests[\"Response contains ID \" + items[i].id.toString()] = items[i].id.toString() !== \"\";\n\n tests[\"Response contains VERSION \" + items[i].version.toString()] = items[i].version.toString() !== \"\";\n\n tests[\"Response contains HREF \" + items[i].href.toString()] = items[i].href.toString() !== \"\";\n\n tests[\"Response contains QUOTE_DATE \" + items[i].quoteDate.toString()] = items[i].quoteDate.toString() !== \"\";\n\n tests[\"Response contains EFFECTIVE_QUOTE_COMPLETION_DATE \" + items[i].effectiveQuoteCompletionDate.toString()] = items[i].effectiveQuoteCompletionDate.toString() !== \"\";\n\n tests[\"Response contains CUSTOMER \" ] = typeof(items[i].customer) !== 'undefined';\n }\n}", + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1470367718221, + "name": "find all quote", + "description": "find quote\n", + "collectionId": "d53b2802-92a5-d7aa-2b21-f1a8d349c445", + "responses": [] + } + ] +} \ No newline at end of file diff --git a/postman/TMForumLocal.postman_environment b/postman/TMForumLocal.postman_environment new file mode 100644 index 0000000..8c8ca67 --- /dev/null +++ b/postman/TMForumLocal.postman_environment @@ -0,0 +1,283 @@ +{ + "id": "e9ff5be6-a134-95a0-3719-abe85cd8241b", + "name": "TMForum Local", + "values": [ + { + "key": "Host", + "value": "http://localhost:8080", + "type": "text", + "name": "Host", + "enabled": true, + "hovered": false + }, + { + "key": "billingManagementApi", + "value": "{{Host}}/DSBillingManagement/api/billingManagement/v2", + "type": "text", + "name": "billingManagementApi", + "enabled": true, + "hovered": false + }, + { + "key": "billingManagementAdminApi", + "value": "{{Host}}/DSBillingManagement/api/admin", + "type": "text", + "name": "billingManagementAdminApi", + "enabled": true, + "hovered": false + }, + { + "key": "billingManagementSubscriberApi", + "value": "{{Host}}/DSBillingManagement/subscriber/api", + "type": "text", + "name": "billingManagementSubscriberApi", + "enabled": true, + "hovered": false + }, + { + "key": "partyManagementApi", + "value": "{{Host}}/DSPartyManagement/api/partyManagement/v2", + "type": "text", + "name": "partyManagementApi", + "enabled": true, + "hovered": false + }, + { + "key": "partyManagementAdminApi", + "value": "{{Host}}/DSPartyManagement/api/admin", + "type": "text", + "name": "partyManagementAdminApi", + "enabled": true, + "hovered": false + }, + { + "key": "partyManagementSubscriberApi", + "value": "{{Host}}/DSPartyManagement/subscriber/api", + "type": "text", + "name": "partyManagementSubscriberApi", + "enabled": true, + "hovered": false + }, + { + "key": "customerManagementApi", + "value": "{{Host}}/DSCustomerManagement/api/customerManagement/v2", + "type": "text", + "name": "customerManagementApi", + "enabled": true, + "hovered": false + }, + { + "key": "customerManagementAdminApi", + "value": "{{Host}}/DSCustomerManagement/api/admin", + "type": "text", + "name": "customerManagementAdminApi", + "enabled": true, + "hovered": false + }, + { + "key": "customerManagementSubscriberApi", + "value": "{{Host}}/DSCustomerManagement/subscriber/api", + "type": "text", + "name": "customerManagementSubscriberApi", + "enabled": true, + "hovered": false + }, + { + "key": "productOrderingApi", + "value": "{{Host}}/DSProductOrdering/api/productOrdering/v2", + "type": "text", + "name": "productOrderingApi", + "enabled": true, + "hovered": false + }, + { + "key": "productOrderingAdminApi", + "value": "{{Host}}/DSProductOrdering/api/admin", + "type": "text", + "name": "productOrderingAdminApi", + "enabled": true, + "hovered": false + }, + { + "key": "productOrderingSubscriberApi", + "value": "{{Host}}/DSProductOrdering/subscriber/api", + "type": "text", + "name": "productOrderingSubscriberApi", + "enabled": true, + "hovered": false + }, + { + "key": "troubleTicketingApi", + "value": "{{Host}}/DSTroubleTicket/api/troubleTicketManagement/v2", + "type": "text", + "name": "troubleTicketingApi", + "enabled": true, + "hovered": false + }, + { + "key": "troubleTicketingAdminApi", + "value": "{{Host}}/DSTroubleTicket/api/admin/troubleTicket", + "type": "text", + "name": "troubleTicketingAdminApi", + "enabled": true, + "hovered": false + }, + { + "key": "troubleTicketingSubscriberApi", + "value": "{{Host}}/DSTroubleTicket/subscriber/api", + "type": "text", + "name": "troubleTicketingSubscriberApi", + "enabled": true, + "hovered": false + }, + { + "key": "productInventoryApi", + "value": "{{Host}}/DSProductInventory/api/productInventory/v2", + "type": "text", + "name": "productInventoryApi", + "enabled": true, + "hovered": false + }, + { + "key": "productInventoryAdminApi", + "value": "{{Host}}/DSProductInventory/api/admin", + "type": "text", + "name": "productInventoryAdminApi", + "enabled": true, + "hovered": false + }, + { + "key": "productInventorySubscriberApi", + "value": "{{Host}}/DSProductInventory/subscriber/api", + "type": "text", + "name": "productInventorySubscriberApi", + "enabled": true, + "hovered": false + }, + { + "key": "catalogManagementApi", + "value": "{{Host}}/DSProductCatalog/api/catalogManagement/v2", + "type": "text", + "name": "catalogManagementApi", + "enabled": true, + "hovered": false + }, + { + "key": "catalogManagementAdminApi", + "value": "{{Host}}/DSProductCatalog/api/admin", + "type": "text", + "name": "catalogManagementAdminApi", + "enabled": true, + "hovered": false + }, + { + "key": "catalogManagementSubscriberApi", + "value": "{{Host}}/DSProductCatalog/subscriber/eventApi", + "type": "text", + "name": "catalogManagementSubscriberApi", + "enabled": true, + "hovered": false + }, + { + "key": "slaManagementApi", + "value": "{{Host}}/DSLAManagement/api/slaManagement/v2", + "type": "text", + "name": "slaManagementApi", + "enabled": true, + "hovered": false + }, + { + "key": "slaManagementSubscriberApi", + "value": "{{Host}}/DSLAManagement/subscriber/api", + "type": "text", + "name": "slaManagementSubscriberApi", + "enabled": true, + "hovered": false + }, + { + "key": "slaManagementAdminApi", + "value": "{{Host}}/DSLAManagement/api/admin", + "type": "text", + "name": "slaManagementAdminApi", + "enabled": true, + "hovered": false + }, + { + "key": "usageManagementApi", + "value": "{{Host}}/DSUsageManagement/api/usageManagement/v2", + "type": "text", + "name": "usageManagementApi", + "enabled": true, + "hovered": false + }, + { + "key": "usageManagementSubscriberApi", + "value": "{{Host}}/DSUsageManagement/subscriber/api", + "type": "text", + "name": "usageManagementSubscriberApi", + "enabled": true, + "hovered": false + }, + { + "key": "usageManagementAdminApi", + "value": "{{Host}}/DSUsageManagement/api/admin/usage", + "type": "text", + "name": "usageManagementAdminApi", + "enabled": true, + "hovered": false + }, + { + "key": "testName", + "value": "tmf-product-offering-qualification-001", + "type": "text", + "name": "testName", + "enabled": true, + "hovered": false + }, + { + "key": "url1", + "value": "http://env-0693795.jelastic.servint.net/DSCustomerManagement/api/customerManagement/v2", + "type": "text", + "name": "url1", + "enabled": true, + "hovered": false + }, + { + "key": "appointmentManagementApi", + "value": "{{Host}}/DSAppointmentManagement/api/appointment/v1", + "type": "text", + "name": "appointmentManagementApi", + "enabled": true, + "hovered": false + }, + { + "key": "addressManagementApi", + "value": "{{Host}}/DSAddressManagement/api/addressManagement/v1", + "type": "text", + "name": "addressManagementApi", + "enabled": true, + "hovered": false + }, + { + "key": "addressManagementAdminApi", + "value": "{{Host}}/DSAddressManagement/api/admin", + "type": "text", + "name": "addressManagementAdminApi", + "enabled": true, + "hovered": false + }, + { + "key": "quoteManagementApi", + "value": "{{Host}}/DSQuoteManagement/api/quoteManagement/v1", + "type": "text", + "name": "quoteManagementApi", + "enabled": true, + "hovered": false + } + ], + "team": null, + "timestamp": 1469155606077, + "synced": false, + "syncedFilename": "", + "isDeleted": false +} \ No newline at end of file diff --git a/postman/quoteCTKResult.html b/postman/quoteCTKResult.html new file mode 100644 index 0000000..cf5f6ec --- /dev/null +++ b/postman/quoteCTKResult.html @@ -0,0 +1,10 @@ +

Newman test report

Collection:
NEW TMF Quote Management API

Iterations:
1

Description:

Requests:


Description:
create a quote +

Mean time per request:
679 ms

Total tests that passed:
25

Total tests that failed:
0

Individual tests:
Test name Pass count Fail count
Content-Type is present application/json 1 0
Status code is 201 1 0
Response contains ID 42 1 0
Response contains VERSION 1.0 1 0
Response contains HREF http://localhost:8080/DSQuoteManagement/api/quoteManagement/v1/quote/42 1 0
Response contains QUOTE_DATE 2016-08-08T15:39:59+08:00 1 0
Response contains EFFECTIVE_QUOTE_COMPLETION_DATE 2016-08-08T15:39:59+08:00 1 0
Response contains CUSTOMER 1 0
Response contains quoteItem ID 1 1 0
Response contains quoteItem productOffering 1 0
Response contains quoteItem ID 2 1 0
Response contains quoteItem ID 3 1 0
Response contains quoteItem ID 4 1 0
POST Body Response externalId equals Request externalId 1 0
POST Body Response description equals Request description 1 0
POST Body Response notificationContact equals Request notificationContact 1 0
POST Body Response customer equals Request customer 1 0
POST Body Response validFor equals Request validFor 1 0
POST Body Response billingAccount equals Request billingAccount 1 0
POST Body Response note equals Request note 1 0
POST Body Response characteristic equals Request characteristic 1 0
POST Body Response relatedParty equals Request relatedParty 1 0
POST Body Response agreement equals Request agreement 1 0
POST Body Response quoteAuthorization equals Request quoteAuthorization 1 0
POST Body Response quoteItem equals Request quoteItem 1 0
Description:
create a quote +

Mean time per request:
333 ms

Total tests that passed:
25

Total tests that failed:
0

Individual tests:
Test name Pass count Fail count
Content-Type is present application/json 1 0
Status code is 201 1 0
Response contains ID 43 1 0
Response contains VERSION 1.0 1 0
Response contains HREF http://localhost:8080/DSQuoteManagement/api/quoteManagement/v1/quote/43 1 0
Response contains QUOTE_DATE 2016-08-08T15:39:59+08:00 1 0
Response contains EFFECTIVE_QUOTE_COMPLETION_DATE 2016-08-08T15:39:59+08:00 1 0
Response contains CUSTOMER 1 0
Response contains quoteItem ID 1 1 0
Response contains quoteItem productOffering 1 0
Response contains quoteItem ID 2 1 0
Response contains quoteItem ID 3 1 0
Response contains quoteItem ID 4 1 0
POST Body Response externalId equals Request externalId 1 0
POST Body Response description equals Request description 1 0
POST Body Response notificationContact equals Request notificationContact 1 0
POST Body Response customer equals Request customer 1 0
POST Body Response validFor equals Request validFor 1 0
POST Body Response billingAccount equals Request billingAccount 1 0
POST Body Response note equals Request note 1 0
POST Body Response characteristic equals Request characteristic 1 0
POST Body Response relatedParty equals Request relatedParty 1 0
POST Body Response agreement equals Request agreement 1 0
POST Body Response quoteAuthorization equals Request quoteAuthorization 1 0
POST Body Response quoteItem equals Request quoteItem 1 0
Description:
find quote +

Mean time per request:
31 ms

Total tests that passed:
10

Total tests that failed:
0

Individual tests:
Test name Pass count Fail count
Content-Type is present application/json 1 0
Status code is 200 1 0
Response contains ID 42 1 0
Response contains VERSION 1.0 1 0
Response contains HREF http://localhost:8080/DSQuoteManagement/api/quoteManagement/v1/quote/42 1 0
Response contains QUOTE_DATE 2016-08-08T15:39:59+08:00 1 0
Response contains EFFECTIVE_QUOTE_COMPLETION_DATE 2016-08-08T15:39:59+08:00 1 0
Response contains CUSTOMER 1 0
Response contains ID 43 1 0
Response contains HREF http://localhost:8080/DSQuoteManagement/api/quoteManagement/v1/quote/43 1 0
Description:
get quote whith id +

Mean time per request:
69 ms

Total tests that passed:
25

Total tests that failed:
0

Individual tests:
Test name Pass count Fail count
Content-Type is present application/json 1 0
Status code is 200 1 0
Response contains ID 42 1 0
Response contains VERSION 1.0 1 0
Response contains HREF http://localhost:8080/DSQuoteManagement/api/quoteManagement/v1/quote/42 1 0
Response contains QUOTE_DATE 2016-08-08T15:39:59+08:00 1 0
Response contains EFFECTIVE_QUOTE_COMPLETION_DATE 2016-08-08T15:39:59+08:00 1 0
Response contains CUSTOMER 1 0
Response contains quoteItem ID 1 1 0
Response contains quoteItem productOffering 1 0
Response contains quoteItem ID 2 1 0
Response contains quoteItem ID 3 1 0
Response contains quoteItem ID 4 1 0
POST Body Response externalId equals LastRequest externalId 1 0
POST Body Response description equals LastRequest description 1 0
POST Body Response notificationContact equals LastRequest notificationContact 1 0
POST Body Response customer equals LastRequest customer 1 0
POST Body Response validFor equals LastRequest validFor 1 0
POST Body Response billingAccount equals LastRequest billingAccount 1 0
POST Body Response note equals LastRequest note 1 0
POST Body Response characteristic equals LastRequest characteristic 1 0
POST Body Response relatedParty equals LastRequest relatedParty 1 0
POST Body Response agreement equals LastRequest agreement 1 0
POST Body Response quoteAuthorization equals LastRequest quoteAuthorization 1 0
POST Body Response quoteItem equals LastRequest quoteItem 1 0
Description:
get quote whith id and version +

Mean time per request:
68 ms

Total tests that passed:
13

Total tests that failed:
0

Individual tests:
Test name Pass count Fail count
Content-Type is present application/json 1 0
Status code is 200 1 0
Response contains ID 42 1 0
Response contains VERSION 1.0 1 0
Response contains HREF http://localhost:8080/DSQuoteManagement/api/quoteManagement/v1/quote/42 1 0
Response contains QUOTE_DATE 2016-08-08T15:39:59+08:00 1 0
Response contains EFFECTIVE_QUOTE_COMPLETION_DATE 2016-08-08T15:39:59+08:00 1 0
Response contains CUSTOMER 1 0
Response contains quoteItem ID 1 1 0
Response contains quoteItem productOffering 1 0
Response contains quoteItem ID 2 1 0
Response contains quoteItem ID 3 1 0
Response contains quoteItem ID 4 1 0
Description:
get quote whith filter

Mean time per request:
33 ms

Total tests that passed:
8

Total tests that failed:
0

Individual tests:
Test name Pass count Fail count
Content-Type is present application/json 1 0
Status code is 200 1 0
Response contains ID 42 1 0
Response contains VERSION 1.0 1 0
Response contains HREF http://localhost:8080/DSQuoteManagement/api/quoteManagement/v1/quote/42 1 0
Response contains QUOTE_DATE 2016-08-08T15:39:59+08:00 1 0
Response contains EFFECTIVE_QUOTE_COMPLETION_DATE 2016-08-08T15:39:59+08:00 1 0
Response contains CUSTOMER 1 0
Description:
partial update quote with id +

Mean time per request:
170 ms

Total tests that passed:
0

Total tests that failed:
0

Individual tests:
Test name Pass count Fail count
Description:
partial update quote with id and version +

Mean time per request:
161 ms

Total tests that passed:
0

Total tests that failed:
0

Individual tests:
Test name Pass count Fail count
Description:
with json-patch

Mean time per request:
353 ms

Total tests that passed:
13

Total tests that failed:
0

Individual tests:
Test name Pass count Fail count
Content-Type is present application/json 1 0
Status code is 200 1 0
Response contains ID 42 1 0
Response contains VERSION 1.0 1 0
Response contains HREF http://localhost:8080/DSQuoteManagement/api/quoteManagement/v1/quote/42 1 0
Response contains QUOTE_DATE 2016-08-08T15:39:59+08:00 1 0
Response contains EFFECTIVE_QUOTE_COMPLETION_DATE 2016-08-08T15:39:59+08:00 1 0
Response contains CUSTOMER 1 0
Response contains quoteItem ID 1 1 0
Response contains quoteItem productOffering 1 0
Response contains quoteItem ID 2 1 0
Response contains quoteItem ID 3 1 0
Response contains quoteItem ID 4 1 0
Description:
with json-patch

Mean time per request:
496 ms

Total tests that passed:
12

Total tests that failed:
0

Individual tests:
Test name Pass count Fail count
Content-Type is present application/json 1 0
Status code is 200 1 0
Response contains ID 42 1 0
Response contains VERSION 1.0 1 0
Response contains HREF http://localhost:8080/DSQuoteManagement/api/quoteManagement/v1/quote/42 1 0
Response contains QUOTE_DATE 2016-08-08T15:39:59+08:00 1 0
Response contains EFFECTIVE_QUOTE_COMPLETION_DATE 2016-08-08T15:39:59+08:00 1 0
Response contains CUSTOMER 1 0
Response contains quoteItem ID 2 1 0
Response contains quoteItem productOffering 1 0
Response contains quoteItem ID 4 1 0
Response contains quoteItem ID 3 1 0
Description:
delete quote +

Mean time per request:
4201 ms

Total tests that passed:
5

Total tests that failed:
0

Individual tests:
Test name Pass count Fail count
Content-Type is present application/json 1 0
Status code is 200 1 0
Response contains previousRows 2 1 0
Response contains affectedRows 1 1 0
Response contains currentRows 1 1 0
Description:
delete quote +

Mean time per request:
4188 ms

Total tests that passed:
5

Total tests that failed:
0

Individual tests:
Test name Pass count Fail count
Content-Type is present application/json 1 0
Status code is 200 1 0
Response contains previousRows 1 1 0
Response contains affectedRows 1 1 0
Response contains currentRows 0 1 0
\ No newline at end of file diff --git a/postman/quoteCTKResult.json b/postman/quoteCTKResult.json new file mode 100644 index 0000000..5db61a1 --- /dev/null +++ b/postman/quoteCTKResult.json @@ -0,0 +1,1987 @@ +{ + "id": "", + "name": "Default", + "timestamp": 1470642010261, + "collection_id": "d53b2802-92a5-d7aa-2b21-f1a8d349c445", + "folder_id": 0, + "target_type": "collection", + "environment_id": "e9ff5be6-a134-95a0-3719-abe85cd8241b", + "count": 1, + "collection": { + "id": "d53b2802-92a5-d7aa-2b21-f1a8d349c445", + "name": "NEW TMF Quote Management API", + "description": "", + "order": [ + "d79291d0-d96c-9d6d-40b9-3c2f16bbf419", + "7c5e7058-4c56-9701-be7f-e85ff5e5ce7e", + "ed18fec3-a862-c616-3b45-7c78251bf84e", + "99f01fbd-10f8-b3d9-c491-74c3bfd4651f", + "3158407d-965d-f0e0-0a06-14ddc237cc65", + "a9e7996e-f766-55d3-2d1d-d1566fbbbb4f", + "d62f15e2-dbf1-bc92-c6e8-c01926af295e", + "9c8c29a5-ebdb-aadb-b896-35533bddb38b", + "4bfd8db3-b5bb-036d-7245-f112839d2fd0", + "6c73350a-dcba-7f3a-84d9-ed046111a6a5", + "84000cf5-233d-1854-2b1f-b816b9eaa544", + "89566752-6274-87d9-7581-00cd7c070f79" + ], + "folders": [], + "timestamp": 1469150558293, + "owner": 0, + "remoteLink": "", + "public": false, + "requests": [ + { + "id": "3158407d-965d-f0e0-0a06-14ddc237cc65", + "headers": "Accept: application/json\nContent-Type: application/json\n", + "url": "{{quoteManagementApi}}/quote/{{QUOTE_ID1}}:(version=1.0)", + "preRequestScript": "", + "pathVariables": {}, + "method": "GET", + "data": [], + "dataMode": "params", + "version": 2, + "tests": "var dataOut = JSON.parse(responseBody);\n\n\ntests[\"Content-Type is present \" + postman.getResponseHeader(\"Content-type\")] = postman.getResponseHeader(\"Content-type\");\n\ntests[\"Status code is 200\"] = responseCode.code === 200;\n\ntests[\"Response contains ID \" + dataOut.id.toString()] = dataOut.id.toString() !== \"\";\n\ntests[\"Response contains VERSION \" + dataOut.version.toString()] = dataOut.version.toString() !== \"\";\n\ntests[\"Response contains HREF \" + dataOut.href.toString()] = dataOut.href.toString() !== \"\";\n\ntests[\"Response contains QUOTE_DATE \" + dataOut.quoteDate.toString()] = dataOut.quoteDate.toString() !== \"\";\n\ntests[\"Response contains EFFECTIVE_QUOTE_COMPLETION_DATE \" + dataOut.effectiveQuoteCompletionDate.toString()] = dataOut.effectiveQuoteCompletionDate.toString() !== \"\";\n\ntests[\"Response contains CUSTOMER \" ] = typeof(dataOut.customer) !== 'undefined';\n\nif( typeof(dataOut.quoteItem) !== 'undefined' && dataOut.quoteItem.length > 0) {\n var items = dataOut.quoteItem;\n for(var i = 0; i < items.length; i++) {\n tests[\"Response contains quoteItem ID \" + items[i].id.toString() ] = items[i].id.toString() !== \"\";\n tests[\"Response contains quoteItem productOffering\"] = typeof(items[i].productOffering) !== 'undefined';\n }\n}", + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1469688207698, + "name": "get quote with id and version", + "description": "get quote whith id and version\n", + "collectionId": "d53b2802-92a5-d7aa-2b21-f1a8d349c445", + "responses": [] + }, + { + "id": "4bfd8db3-b5bb-036d-7245-f112839d2fd0", + "headers": "Content-Type: application/json-patch+json\n//Accept: application/json-patch+json\n", + "url": "{{quoteManagementApi}}/quote/{{QUOTE_ID1}}", + "preRequestScript": "", + "pathVariables": {}, + "method": "PATCH", + "data": [], + "dataMode": "raw", + "version": 2, + "tests": "var dataOut = JSON.parse(responseBody);\n\n\ntests[\"Content-Type is present \" + postman.getResponseHeader(\"Content-type\")] = postman.getResponseHeader(\"Content-type\");\n\ntests[\"Status code is 200\"] = responseCode.code === 200;\n\ntests[\"Response contains ID \" + dataOut.id.toString()] = dataOut.id.toString() !== \"\";\n\ntests[\"Response contains VERSION \" + dataOut.version.toString()] = dataOut.version.toString() !== \"\";\n\ntests[\"Response contains HREF \" + dataOut.href.toString()] = dataOut.href.toString() !== \"\";\n\ntests[\"Response contains QUOTE_DATE \" + dataOut.quoteDate.toString()] = dataOut.quoteDate.toString() !== \"\";\n\ntests[\"Response contains EFFECTIVE_QUOTE_COMPLETION_DATE \" + dataOut.effectiveQuoteCompletionDate.toString()] = dataOut.effectiveQuoteCompletionDate.toString() !== \"\";\n\ntests[\"Response contains CUSTOMER \" ] = typeof(dataOut.customer) !== 'undefined';\n\nif( typeof(dataOut.quoteItem) !== 'undefined' && dataOut.quoteItem.length > 0) {\n var items = dataOut.quoteItem;\n for(var i = 0; i < items.length; i++) {\n tests[\"Response contains quoteItem ID \" + items[i].id.toString() ] = items[i].id.toString() !== \"\";\n tests[\"Response contains quoteItem productOffering\"] = typeof(items[i].productOffering) !== 'undefined';\n }\n}", + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1470641795647, + "name": "Partial update appointement json-patch with id", + "description": " with json-patch", + "collectionId": "d53b2802-92a5-d7aa-2b21-f1a8d349c445", + "responses": [], + "rawModeData": "[\n {\n \"op\": \"replace\",\n \"path\": \"/note/0/text\",\n \"value\": \"A free text for MODIFIED detailing the note\"\n }\n]" + }, + { + "id": "6c73350a-dcba-7f3a-84d9-ed046111a6a5", + "headers": "Content-Type: application/json-patch+json\n//Accept: application/json-patch+json\n", + "url": "{{quoteManagementApi}}/quote/{{QUOTE_ID1}}:(version=1.0)", + "preRequestScript": "", + "pathVariables": {}, + "method": "PATCH", + "data": [], + "dataMode": "raw", + "version": 2, + "tests": "var dataOut = JSON.parse(responseBody);\n\n\ntests[\"Content-Type is present \" + postman.getResponseHeader(\"Content-type\")] = postman.getResponseHeader(\"Content-type\");\n\ntests[\"Status code is 200\"] = responseCode.code === 200;\n\ntests[\"Response contains ID \" + dataOut.id.toString()] = dataOut.id.toString() !== \"\";\n\ntests[\"Response contains VERSION \" + dataOut.version.toString()] = dataOut.version.toString() !== \"\";\n\ntests[\"Response contains HREF \" + dataOut.href.toString()] = dataOut.href.toString() !== \"\";\n\ntests[\"Response contains QUOTE_DATE \" + dataOut.quoteDate.toString()] = dataOut.quoteDate.toString() !== \"\";\n\ntests[\"Response contains EFFECTIVE_QUOTE_COMPLETION_DATE \" + dataOut.effectiveQuoteCompletionDate.toString()] = dataOut.effectiveQuoteCompletionDate.toString() !== \"\";\n\ntests[\"Response contains CUSTOMER \" ] = typeof(dataOut.customer) !== 'undefined';\n\nif( typeof(dataOut.quoteItem) !== 'undefined' && dataOut.quoteItem.length > 0) {\n var items = dataOut.quoteItem;\n for(var i = 0; i < items.length; i++) {\n tests[\"Response contains quoteItem ID \" + items[i].id.toString() ] = items[i].id.toString() !== \"\";\n tests[\"Response contains quoteItem productOffering\"] = typeof(items[i].productOffering) !== 'undefined';\n }\n}", + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1469688795220, + "name": "Partial update appointement json-patch with id and version", + "description": " with json-patch", + "collectionId": "d53b2802-92a5-d7aa-2b21-f1a8d349c445", + "responses": [], + "rawModeData": "[\n {\n \"op\": \"replace\",\n \"path\": \"/note/0/text\",\n \"value\": \"A free text for MODIFIED detailing the note\"\n },\n {\n \"op\": \"remove\",\n \"path\": \"/quoteItem/2\"\n },\n {\n \"op\": \"remove\",\n \"path\": \"/relatedParty/1\"\n },\n {\n \"op\": \"replace\",\n \"path\": \"/state\",\n \"value\": \"Pending\"\n }\n]" + }, + { + "id": "7c5e7058-4c56-9701-be7f-e85ff5e5ce7e", + "headers": "Accept: application/json\nContent-Type: application/json\n", + "url": "{{quoteManagementApi}}/quote", + "preRequestScript": "", + "pathVariables": {}, + "method": "POST", + "data": [], + "dataMode": "raw", + "version": 2, + "tests": "var dataOut = JSON.parse(responseBody);\n\ntests[\"Content-Type is present \" + postman.getResponseHeader(\"Content-type\")] = postman.getResponseHeader(\"Content-type\");\n\ntests[\"Status code is 201\"] = responseCode.code === 201;\n\ntests[\"Response contains ID \" + dataOut.id.toString()] = dataOut.id.toString() !== \"\";\n\ntests[\"Response contains VERSION \" + dataOut.version.toString()] = dataOut.version.toString() !== \"\";\n\ntests[\"Response contains HREF \" + dataOut.href.toString()] = dataOut.href.toString() !== \"\";\n\ntests[\"Response contains QUOTE_DATE \" + dataOut.quoteDate.toString()] = dataOut.quoteDate.toString() !== \"\";\n\ntests[\"Response contains EFFECTIVE_QUOTE_COMPLETION_DATE \" + dataOut.effectiveQuoteCompletionDate.toString()] = dataOut.effectiveQuoteCompletionDate.toString() !== \"\";\n\ntests[\"Response contains CUSTOMER \" ] = typeof(dataOut.customer) !== 'undefined';\n\npostman.setGlobalVariable(\"QUOTE_ID2\", dataOut.id.toString());\n\npostman.setGlobalVariable(\"lastResponse\" + postman.getEnvironmentVariable(\"testName\"), dataOut);\npostman.setGlobalVariable(\"lastRequest\"+ postman.getEnvironmentVariable(\"testName\"), request.data );\n\nvar dataIn = JSON.parse(request.data);\n\nconsole.log(\"request \" + dataIn);\nconsole.log(\"request type\" + typeof(dataIn));\n\n\nif( typeof(dataOut.quoteItem) !== 'undefined' && dataOut.quoteItem.length > 0) {\n var items = dataOut.quoteItem;\n for(var i = 0; i < items.length; i++) {\n tests[\"Response contains quoteItem ID \" + items[i].id.toString() ] = items[i].id.toString() !== \"\";\n tests[\"Response contains quoteItem productOffering\"] = typeof(items[i].productOffering) !== 'undefined';\n }\n}\nif (dataIn.externalId) {\n tests[\"POST Body Response externalId equals Request externalId\" ] = objectEquals(dataIn.externalId, dataOut.externalId);\n}\n\nif (dataIn.description) {\n tests[\"POST Body Response description equals Request description\" ] = objectEquals(dataIn.description, dataOut.description);\n}\n\nif (dataIn.notificationContact) {\n tests[\"POST Body Response notificationContact equals Request notificationContact\" ] = objectEquals(dataIn.notificationContact, dataOut.notificationContact);\n}\n\ntests[\"POST Body Response customer equals Request customer\" ] = objectEquals(dataIn.customer, dataOut.customer);\n\n\nif (dataIn.validFor) {\n tests[\"POST Body Response validFor equals Request validFor\" ] = objectEquals(dataIn.validFor, dataOut.validFor);\n}\n\nif (dataIn.billingAccount) {\n tests[\"POST Body Response billingAccount equals Request billingAccount\" ] = objectEquals(dataIn.billingAccount, dataOut.billingAccount);\n}\n\nif (dataIn.note) {\n tests[\"POST Body Response note equals Request note\" ] = objectEquals(dataIn.note, dataOut.note);\n}\n\nif (dataIn.characteristic) {\n tests[\"POST Body Response characteristic equals Request characteristic\" ] = objectEquals(dataIn.characteristic, dataOut.characteristic);\n}\n\nif (dataIn.relatedParty) {\n tests[\"POST Body Response relatedParty equals Request relatedParty\" ] = objectEquals(dataIn.relatedParty, dataOut.relatedParty);\n}\n\nif (dataIn.agreement) {\n tests[\"POST Body Response agreement equals Request agreement\" ] = objectEquals(dataIn.agreement, dataOut.agreement);\n}\n\nif (dataIn.quoteAuthorization) {\n tests[\"POST Body Response quoteAuthorization equals Request quoteAuthorization\" ] = objectEquals(dataIn.quoteAuthorization, dataOut.quoteAuthorization);\n \n}\n\nif (dataIn.quoteProductOfferingPrice) {\n tests[\"POST Body Response quoteProductOfferingPrice equals Request quoteProductOfferingPrice\" ] = objectEquals(dataIn.quoteProductOfferingPrice, dataOut.quoteProductOfferingPrice);\n}\n\ntests[\"POST Body Response quoteItem equals Request quoteItem\" ] = objectEquals(dataIn.quoteItem, dataOut.quoteItem);\n\nfunction objectEquals(v1, v2) {\n if (typeof(v1) !== typeof(v2)) {\n console.log(\"property typeof(v1) !==typeof(v2)\" + typeof(v1) + typeof(v2) + \"==>\" + v1 + \"!=\" + v2);\n return false;\n }\n\n if (typeof(v1) === \"function\") {\n return v1.toString() === v2.toString();\n }\n\n if (v1 instanceof Object && v2 instanceof Object) {\n \n var r = true;\n for (var k in v1) {\n r = objectEquals(v1[k], v2[k]);\n \n if (!r) {\n tests[\"property \" + k.toString() + \"==>\" + v1[k] + \"!=\" + v2[k]] = false;\n console.log(\"property \" + k.toString() + \"==>\" + v1[k] + \"!=\" + v2[k]);\n postman.setGlobalVariable(\"unequal\" + k.toString(), v1[k] + \"!=\" + v2[k]);\n \n return false;\n } else {\n //tests[\"property \" + k.toString() + \"==>\" + v1[k] + \"=\" + v2[k]] = true;\n }\n }\n return true;\n } else {\n return v1 === v2;\n }\n}", + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1470640843631, + "name": "create a quote copy", + "description": "create a quote\n", + "collectionId": "d53b2802-92a5-d7aa-2b21-f1a8d349c445", + "responses": [], + "rawModeData": "{\r\n\"id\":\"43\",\r\n\r\n\"externalId\":\"QuoteForTheConsumer_42\",\r\n\"description\":\"A wonderful 42 quote for brand new products\",\r\n\"category\":\"corporate\",\r\n\"state\":\"InProgress\",\r\n\"version\":\"1.0\",\r\n\r\n\"effectiveQuoteCompletionDate\":\"\",\r\n\"quoteCompletionDate\":\"2013-04-19T16:42:23+08:00\",\r\n\"notificationContact\":\"bill.dupont@hotmail.com\",\r\n\"validFor\":{\r\n \"startDateTime\":\"2013-04-12T16:42:23+08:00\",\r\n \"endDateTime\":\"2013-04-19T00:00:00+08:00\"\r\n },\r\n\"billingAccount\":[\r\n {\r\n \"id\":\"123456\",\r\n \"href\":\"http://serverlocation:port/billingManagement/billingAccount/123456\"\r\n }\r\n],\r\n\"note\":[\r\n {\r\n \"text\":\"Quote following opportunity #2345\",\r\n \"date\":\"2013-04-12T16:42:23+08:00\",\r\n \"author\":\"Bill Dupont\"\r\n }\r\n],\r\n\"characteristic\":[\r\n {\r\n \"name\":\"Business Unit\",\r\n \"value\":\"London South West Cor^porate\"\r\n }\r\n],\r\n\"customer\":{\r\n \"id\":\"345221\",\r\n \"href\":\"http://serverlocation:port/customerManagement/customer/345221\",\r\n \"name\":\"John Doe\"\r\n},\r\n\"relatedParty\":[\r\n {\r\n \"id\":\"57\",\r\n \"href\":\"http://serverlocation:port/partyManagement/partner/57\",\r\n \"name\":\"Shinoju White\",\r\n \"role\":\"authorizer\"\r\n },\r\n {\r\n \"id\":\"4563\",\r\n \"href\":\"http://serverlocation:port/partnerManagement/partner/4563\",\r\n \"name\":\"Bill Dupont\",\r\n \"role\":\"seller\"\r\n }\r\n],\r\n\"agreement\":[\r\n {\r\n \"id\":\"45\",\r\n \"href\":\"http://serverlocation:port/engagedPartyManagement/agreement/45\",\r\n \"name\":\" standard disclaimer\"\r\n }\r\n],\r\n\"quoteAuthorization\":[\r\n {\r\n \"authorizationDate\":\"2013-04-12T16:42:23+08:00\",\r\n \"authorizationState\":\"approved\",\r\n \"authorizationSignatureRepresentation\":\"digital\",\r\n \"attachment\":{\r\n \"id\":\"22\",\r\n \"href\":\"http://serverlocation:port/documentManagement/attachment/22\",\r\n \"type\":\"pdf\"\r\n },\r\n \"quoteProductOfferingPrice\":[{ \r\n \"quotePriceAlteration\":{\r\n \"name\":\"Global Discount\",\r\n \"description\":\"5% for all recurring charge\",\r\n \"validFor\":{\r\n\t\t\t\t\"startDateTime\":\"2013-04-19T16:42:23+08:00\"\r\n\t\t\t}\r\n },\r\n\t\t\"priceType\":\"recurrent\",\r\n\t\t\"unitOfMeasure\":\"\",\r\n\t\t\"price\":{\r\n\t\t\t\"percentage\":5\r\n\t\t},\r\n\t\t\"recurringChargePeriod\":\"\",\r\n\t\t\"priceCondition\":\"applied if all quote items are purchased\"\r\n }]\r\n }\r\n],\r\n\"quoteItem\":[\r\n {\r\n \"id\":\"1\",\r\n \"state\":\"InProgress\",\r\n \"attachment\":{\r\n \"id\":\"22\",\r\n \"href\":\"http://serverlocation:port/documentManagement/attachment/TMFVoiceEXtraRationale.pdf\",\r\n \"type\":\"pdf\"\r\n },\r\n \"relatedParty\":[\r\n {\r\n \"id\":\"345221\",\r\n \"href\":\"http://serverlocation:port/partyManagement/customer/345221\",\r\n \"name\":\"John Doe\",\r\n \"role\":\"customer\"\r\n },\r\n {\r\n \"id\":\"4563\",\r\n \"href\":\"http://serverlocation:port/partnerManagement/partner/4563\",\r\n \"name\":\"Bill Dupont\",\r\n \"role\":\"seller\"\r\n }\r\n ],\r\n \"productOffering\":{\r\n \"id\":\"198\",\r\n \"href\":\"http: //serverlocation: port/catalogManagement/productOffering/198\"\r\n },\r\n \"product\":{ }\r\n },\r\n {\r\n \"id\":\"2\",\r\n \"state\":\"InProgress\",\r\n \"note\":[\r\n {\r\n \"text\":\"xxxx\",\r\n \"date\":\"2013-04-12T16:42:23+08:00\",\r\n \"author\":\"Bill Dupont\"\r\n }\r\n ],\r\n \"itemQuoteAuthorization\":[\r\n {\r\n \"authorizationDate\":\"2013-04-12T18:42:23+08:00\",\r\n \"authorizationState\":\"approved\",\r\n \"authorizationSignatureRepresentation\":\"digital \",\r\n \"attachment\":{\r\n \"id\":\"22\",\r\n \"href\":\"http://serverlocation:port/documentManagement/attachment/22\",\r\n \"type\":\"JPG\"\r\n }\r\n }\r\n ],\r\n \"productOffering\":{\r\n \"id\":\" SamPhone i5s \",\r\n \"href\":\"http: //serverlocation: port/catalogManagement/productOffering/SamPhonei5s \"\r\n },\r\n \"product\":{\r\n \"productCharacteristic\":[\r\n {\r\n \"name\":\"color\",\r\n \"value\":\"pink\"\r\n }\r\n ]\r\n }\r\n },\r\n {\r\n \"id\":\"3\",\r\n \"state\":\"InProgress\",\r\n \"note\":[\r\n {\r\n \"text\":\"The leased line should be directly plugged from Joe’s Office\",\r\n \"date\":\"2013-04-12T16:42:23+08:00\",\r\n \"author\":\"Bill Dupont\"\r\n }\r\n ],\r\n \"productOffering\":{\r\n \"id\":\" TMF Fiber+\",\r\n \"href\":\"http: //serverlocation: port/catalogManagement/productOffering/TMFFiber+\"\r\n },\r\n \"product\":{\r\n \"productCharacteristic\":[\r\n {\r\n \"name\":\"Speed\",\r\n \"value\":\"100 Mo/s\"\r\n },\r\n {\r\n \"name\":\"Site A\",\r\n \"value\":\"12 Dupont Circle, 34511 Washington DC\"\r\n },\r\n {\r\n \"name\":\"Site B\",\r\n \"value\":\"436 25th Avenue, 34507 Washington DC\"\r\n }\r\n ]\r\n }\r\n },\r\n {\r\n \"id\":\"4\",\r\n \"state\":\"InProgress\",\r\n \"itemQuoteProductOfferingPrice\":[{\r\n \"priceType\":\"recurrent\",\r\n \"recurringChargePeriod\":\"monthly\",\r\n \"priceCondition\":\"\",\r\n \"quotePriceAlteration\":{\r\n\t\t\t\"name\":\"Discount on Bundle TV channel\",\r\n\t\t\t\"description\":\"Movie + sport is so fun\",\r\n\t\t\t\"validFor\":{\r\n\t\t\t\t\"startDateTime\":\"2013-04-19T16:42:23+08:00\"\r\n\t\t\t}\r\n\t\t},\r\n \r\n \"price\":{\r\n \"override\":23.87\r\n },\r\n \"unitOfMeasure\":\"\"\r\n \r\n }],\r\n \"productOffering\":{\r\n \"id\":\"TM TV+\",\r\n \"href\":\"http://serverlocation:port/catalogManagement/productOffering/BundleTMTV+\",\r\n \"bundledProductOffering\":[\r\n {\r\n \"id\":\" Sport TV Channel\",\r\n \"href\":\"http://serverlocation:port/catalogManagement/productOffering/SportChannel\"\r\n },\r\n {\r\n \"id\":\" Movie TV channel\",\r\n \"href\":\"http://serverlocation:port/catalogManagement/productOffering/MovieChannel\"\r\n }\r\n ]\r\n }\r\n }\r\n ]\r\n}" + }, + { + "id": "84000cf5-233d-1854-2b1f-b816b9eaa544", + "headers": "Accept: application/json\nContent-Type: application/json\n", + "url": "{{Host}}/DSQuoteManagement/api/admin/quote/{{QUOTE_ID1}}:(version=1.0)", + "preRequestScript": "", + "pathVariables": {}, + "method": "DELETE", + "data": [], + "dataMode": "params", + "version": 2, + "tests": "var dataOut = JSON.parse(responseBody);\n\ntests[\"Content-Type is present \" + postman.getResponseHeader(\"Content-type\")] = postman.getResponseHeader(\"Content-type\");\n\ntests[\"Status code is 200\"] = responseCode.code === 200;\n\ntests[\"Response contains previousRows \" + dataOut.previousRows.toString()] = dataOut.previousRows.toString() !== \"\";\n\ntests[\"Response contains affectedRows \" + dataOut.affectedRows.toString()] = dataOut.affectedRows.toString() !== \"\";\n\ntests[\"Response contains currentRows \" + dataOut.currentRows.toString()] = dataOut.currentRows.toString() !== \"\";", + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1469689329628, + "name": "[ADMIN] delete quote with version", + "description": "delete quote\n", + "collectionId": "d53b2802-92a5-d7aa-2b21-f1a8d349c445", + "responses": [] + }, + { + "id": "89566752-6274-87d9-7581-00cd7c070f79", + "headers": "Accept: application/json\nContent-Type: application/json\n", + "url": "{{Host}}/DSQuoteManagement/api/admin/quote/{{QUOTE_ID2}}", + "preRequestScript": "", + "pathVariables": {}, + "method": "DELETE", + "data": [], + "dataMode": "params", + "version": 2, + "tests": "var dataOut = JSON.parse(responseBody);\n\ntests[\"Content-Type is present \" + postman.getResponseHeader(\"Content-type\")] = postman.getResponseHeader(\"Content-type\");\n\ntests[\"Status code is 200\"] = responseCode.code === 200;\n\ntests[\"Response contains previousRows \" + dataOut.previousRows.toString()] = dataOut.previousRows.toString() !== \"\";\n\ntests[\"Response contains affectedRows \" + dataOut.affectedRows.toString()] = dataOut.affectedRows.toString() !== \"\";\n\ntests[\"Response contains currentRows \" + dataOut.currentRows.toString()] = dataOut.currentRows.toString() !== \"\";", + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1470641156137, + "name": "[ADMIN] delete quote", + "description": "delete quote\n", + "collectionId": "d53b2802-92a5-d7aa-2b21-f1a8d349c445", + "responses": [] + }, + { + "id": "99f01fbd-10f8-b3d9-c491-74c3bfd4651f", + "headers": "Accept: application/json\nContent-Type: application/json\n", + "url": "{{quoteManagementApi}}/quote/{{QUOTE_ID1}}", + "preRequestScript": "", + "pathVariables": {}, + "method": "GET", + "data": [], + "dataMode": "params", + "version": 2, + "tests": "var dataOut = JSON.parse(responseBody);\n\n\nvar lastRequest = globals[\"lastRequest\"+postman.getEnvironmentVariable(\"testName\")];\n\nvar lastResponse= globals[\"lastResponse\"+postman.getEnvironmentVariable(\"testName\")];\n\ntests[\"Content-Type is present \" + postman.getResponseHeader(\"Content-type\")] = postman.getResponseHeader(\"Content-type\");\n\ntests[\"Status code is 200\"] = responseCode.code === 200;\n\ntests[\"Response contains ID \" + dataOut.id.toString()] = dataOut.id.toString() !== \"\";\n\ntests[\"Response contains VERSION \" + dataOut.version.toString()] = dataOut.version.toString() !== \"\";\n\ntests[\"Response contains HREF \" + dataOut.href.toString()] = dataOut.href.toString() !== \"\";\n\ntests[\"Response contains QUOTE_DATE \" + dataOut.quoteDate.toString()] = dataOut.quoteDate.toString() !== \"\";\n\ntests[\"Response contains EFFECTIVE_QUOTE_COMPLETION_DATE \" + dataOut.effectiveQuoteCompletionDate.toString()] = dataOut.effectiveQuoteCompletionDate.toString() !== \"\";\n\ntests[\"Response contains CUSTOMER \" ] = typeof(dataOut.customer) !== 'undefined';\n\nif( typeof(dataOut.quoteItem) !== 'undefined' && dataOut.quoteItem.length > 0) {\n var items = dataOut.quoteItem;\n for(var i = 0; i < items.length; i++) {\n tests[\"Response contains quoteItem ID \" + items[i].id.toString() ] = items[i].id.toString() !== \"\";\n tests[\"Response contains quoteItem productOffering\"] = typeof(items[i].productOffering) !== 'undefined';\n }\n}\nvar dataIn = JSON.parse(lastRequest);\n\nif (dataIn.externalId) {\n tests[\"POST Body Response externalId equals LastRequest externalId\" ] = objectEquals(dataIn.externalId, dataOut.externalId);\n}\n\nif (dataIn.description) {\n tests[\"POST Body Response description equals LastRequest description\" ] = objectEquals(dataIn.description, dataOut.description);\n}\n\nif (dataIn.notificationContact) {\n tests[\"POST Body Response notificationContact equals LastRequest notificationContact\" ] = objectEquals(dataIn.notificationContact, dataOut.notificationContact);\n}\n\ntests[\"POST Body Response customer equals LastRequest customer\" ] = objectEquals(dataIn.customer, dataOut.customer);\n\n\nif (dataIn.validFor) {\n tests[\"POST Body Response validFor equals LastRequest validFor\" ] = objectEquals(dataIn.validFor, dataOut.validFor);\n}\n\nif (dataIn.billingAccount) {\n tests[\"POST Body Response billingAccount equals LastRequest billingAccount\" ] = objectEquals(dataIn.billingAccount, dataOut.billingAccount);\n}\n\nif (dataIn.note) {\n tests[\"POST Body Response note equals LastRequest note\" ] = objectEquals(dataIn.note, dataOut.note);\n}\n\nif (dataIn.characteristic) {\n tests[\"POST Body Response characteristic equals LastRequest characteristic\" ] = objectEquals(dataIn.characteristic, dataOut.characteristic);\n}\n\nif (dataIn.relatedParty) {\n tests[\"POST Body Response relatedParty equals LastRequest relatedParty\" ] = objectEquals(dataIn.relatedParty, dataOut.relatedParty);\n}\n\n\nif (dataIn.agreement) {\n tests[\"POST Body Response agreement equals LastRequest agreement\" ] = objectEquals(dataIn.agreement, dataOut.agreement);\n}\n\nif (dataIn.quoteAuthorization) {\n tests[\"POST Body Response quoteAuthorization equals LastRequest quoteAuthorization\" ] = objectEquals(dataIn.quoteAuthorization, dataOut.quoteAuthorization);\n \n}\n\nif (dataIn.quoteProductOfferingPrice) {\n tests[\"POST Body Response quoteProductOfferingPrice LastRequest LastRequest quoteProductOfferingPrice\" ] = objectEquals(dataIn.quoteProductOfferingPrice, dataIn.quoteProductOfferingPrice);\n}\n\ntests[\"POST Body Response quoteItem equals LastRequest quoteItem\" ] = objectEquals(dataIn.quoteItem, dataOut.quoteItem);\n\nfunction objectEquals(v1, v2) {\n if (typeof(v1) !== typeof(v2)) {\n console.log(\"property typeof(v1) !==typeof(v2)\" + typeof(v1) + typeof(v2) + \"==>\" + v1 + \"!=\" + v2);\n return false;\n }\n\n if (typeof(v1) === \"function\") {\n return v1.toString() === v2.toString();\n }\n\n if (v1 instanceof Object && v2 instanceof Object) {\n \n var r = true;\n for (var k in v1) {\n r = objectEquals(v1[k], v2[k]);\n \n if (!r) {\n tests[\"property \" + k.toString() + \"==>\" + v1[k] + \"!=\" + v2[k]] = false;\n console.log(\"property \" + k.toString() + \"==>\" + v1[k] + \"!=\" + v2[k]);\n postman.setGlobalVariable(\"unequal\" + k.toString(), v1[k] + \"!=\" + v2[k]);\n \n return false;\n } else {\n //tests[\"property \" + k.toString() + \"==>\" + v1[k] + \"=\" + v2[k]] = true;\n }\n }\n return true;\n } else {\n return v1 === v2;\n }\n}\n", + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1469687066574, + "name": "get quote with id ", + "description": "get quote whith id\n", + "collectionId": "d53b2802-92a5-d7aa-2b21-f1a8d349c445", + "responses": [] + }, + { + "id": "9c8c29a5-ebdb-aadb-b896-35533bddb38b", + "headers": "Accept: application/json\nContent-Type: application/json\n", + "url": "{{quoteManagementApi}}/quote/{{QUOTE_ID2}}:(version=1.0)", + "preRequestScript": "", + "pathVariables": {}, + "method": "PATCH", + "data": [], + "dataMode": "raw", + "version": 2, + "tests": "", + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1470640829678, + "name": "partial update quote with id and version", + "description": "partial update quote with id and version\n", + "collectionId": "d53b2802-92a5-d7aa-2b21-f1a8d349c445", + "responses": [], + "rawModeData": "{\r\n \"note\":[\r\n {\r\n \"text\":\"A free text detailing the note\"\r\n }\r\n ],\r\n \"relatedParty\":[\r\n {\r\n \"role\":\"customer\",\r\n \"id\":\"345221\",\r\n \"href\":\"http://serverlocation:port/partyManagement/customer/345221\",\r\n \"name\":\"John Doe\"\r\n },\r\n {\r\n \"role\":\"seller\",\r\n \"id\":\"4563\",\r\n \"href\":\"http://serverlocation:port/partnerManagement/partner/4563\"\r\n }\r\n ],\r\n \"quoteItem\":[\r\n {\r\n \"id\":\"1\",\r\n \"action\":\"add\",\r\n \"billingAccount\":[\r\n {\r\n \"id\":\"1789\",\r\n \"href\":\"http://serverlocation:port/billingManagement/billingAccount/1789\"\r\n }\r\n ],\r\n \"productOffering\":{\r\n \"id\":\"42\",\r\n \"href\":\"http: //serverlocation: port/catalogManagement/productOffering/42\"\r\n },\r\n \"product\":{\r\n \"productCharacteristic\":[\r\n {\r\n \"name\":\"Colour\",\r\n \"value\":\"White\"\r\n },\r\n {\r\n \"name\":\"Memory\",\r\n \"value\":\"16\"\r\n }\r\n ]\r\n }\r\n },\r\n {\r\n \"id\":\"2\",\r\n \"action\":\"modify\",\r\n \"product\":{\r\n \"id\":\"456\",\r\n \"href\":\"http: //serverlocation: port/inventoryManagement/product/456\",\r\n \"relatedParty\":[\r\n {\r\n \"role\":\"user\",\r\n \"id\":\"5667443\",\r\n \"href\":\"http://serverlocation:port/partyManagement/user/5667443\",\r\n \"name\":\"Jimmy Doe\"\r\n }\r\n ]\r\n }\r\n },\r\n {\r\n \"id\":\"3\",\r\n \"action\":\"delete\",\r\n \"product\":{\r\n \"id\":\"456\",\r\n \"href\":\"http: //serverlocation: port/inventoryManagement/product/456\"\r\n }\r\n }\r\n ]\r\n}" + }, + { + "id": "a9e7996e-f766-55d3-2d1d-d1566fbbbb4f", + "headers": "Accept: application/json\nContent-Type: application/json\n", + "url": "{{quoteManagementApi}}/quote?id={{QUOTE_ID1}}&version=1.0", + "preRequestScript": "", + "pathVariables": {}, + "method": "GET", + "data": [], + "dataMode": "params", + "version": 2, + "tests": "var dataOut = JSON.parse(responseBody);\n\ntests[\"Content-Type is present \" + postman.getResponseHeader(\"Content-type\")] = postman.getResponseHeader(\"Content-type\");\n\ntests[\"Status code is 200\"] = responseCode.code === 200;\n\nif (typeof(dataOut)!=='undefined' && dataOut.length>0) {\n var items = dataOut;\n for (var i = 0; i < items.length; i++) {\n tests[\"Response contains ID \" + items[i].id.toString()] = items[i].id.toString() !== \"\";\n\n tests[\"Response contains VERSION \" + items[i].version.toString()] = items[i].version.toString() !== \"\";\n\n tests[\"Response contains HREF \" + items[i].href.toString()] = items[i].href.toString() !== \"\";\n\n tests[\"Response contains QUOTE_DATE \" + items[i].quoteDate.toString()] = items[i].quoteDate.toString() !== \"\";\n\n tests[\"Response contains EFFECTIVE_QUOTE_COMPLETION_DATE \" + items[i].effectiveQuoteCompletionDate.toString()] = items[i].effectiveQuoteCompletionDate.toString() !== \"\";\n\n tests[\"Response contains CUSTOMER \" ] = typeof(items[i].customer) !== 'undefined';\n }\n}", + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1470633992014, + "name": "get quote with filter", + "description": "get quote whith filter", + "collectionId": "d53b2802-92a5-d7aa-2b21-f1a8d349c445", + "responses": [] + }, + { + "id": "d62f15e2-dbf1-bc92-c6e8-c01926af295e", + "headers": "Accept: application/json\nContent-Type: application/json\n", + "url": "{{quoteManagementApi}}/quote/{{QUOTE_ID2}}", + "preRequestScript": "", + "pathVariables": {}, + "method": "PATCH", + "data": [], + "dataMode": "raw", + "version": 2, + "tests": "", + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1470640821116, + "name": "partial update quote with id", + "description": "partial update quote with id\n", + "collectionId": "d53b2802-92a5-d7aa-2b21-f1a8d349c445", + "responses": [], + "rawModeData": "{\r\n \"note\":[\r\n {\r\n \"text\":\"A free text detailing the note\"\r\n }\r\n ],\r\n \"relatedParty\":[\r\n {\r\n \"role\":\"customer\",\r\n \"id\":\"345221\",\r\n \"href\":\"http://serverlocation:port/partyManagement/customer/345221\",\r\n \"name\":\"John Doe\"\r\n },\r\n {\r\n \"role\":\"seller\",\r\n \"id\":\"4563\",\r\n \"href\":\"http://serverlocation:port/partnerManagement/partner/4563\"\r\n }\r\n ],\r\n \"quoteItem\":[\r\n {\r\n \"id\":\"1\",\r\n \"action\":\"add\",\r\n \"billingAccount\":[\r\n {\r\n \"id\":\"1789\",\r\n \"href\":\"http://serverlocation:port/billingManagement/billingAccount/1789\"\r\n }\r\n ],\r\n \"productOffering\":{\r\n \"id\":\"42\",\r\n \"href\":\"http: //serverlocation: port/catalogManagement/productOffering/42\"\r\n },\r\n \"product\":{\r\n \"productCharacteristic\":[\r\n {\r\n \"name\":\"Colour\",\r\n \"value\":\"White\"\r\n },\r\n {\r\n \"name\":\"Memory\",\r\n \"value\":\"16\"\r\n }\r\n ]\r\n }\r\n },\r\n {\r\n \"id\":\"2\",\r\n \"action\":\"modify\",\r\n \"product\":{\r\n \"id\":\"456\",\r\n \"href\":\"http: //serverlocation: port/inventoryManagement/product/456\",\r\n \"relatedParty\":[\r\n {\r\n \"role\":\"user\",\r\n \"id\":\"5667443\",\r\n \"href\":\"http://serverlocation:port/partyManagement/user/5667443\",\r\n \"name\":\"Jimmy Doe\"\r\n }\r\n ]\r\n }\r\n },\r\n {\r\n \"id\":\"3\",\r\n \"action\":\"delete\",\r\n \"product\":{\r\n \"id\":\"456\",\r\n \"href\":\"http: //serverlocation: port/inventoryManagement/product/456\"\r\n }\r\n }\r\n ]\r\n}" + }, + { + "id": "d79291d0-d96c-9d6d-40b9-3c2f16bbf419", + "headers": "Accept: application/json\nContent-Type: application/json\n", + "url": "{{quoteManagementApi}}/quote", + "preRequestScript": "", + "pathVariables": {}, + "method": "POST", + "data": [], + "dataMode": "raw", + "version": 2, + "tests": "var dataOut = JSON.parse(responseBody);\n\ntests[\"Content-Type is present \" + postman.getResponseHeader(\"Content-type\")] = postman.getResponseHeader(\"Content-type\");\n\ntests[\"Status code is 201\"] = responseCode.code === 201;\n\ntests[\"Response contains ID \" + dataOut.id.toString()] = dataOut.id.toString() !== \"\";\n\ntests[\"Response contains VERSION \" + dataOut.version.toString()] = dataOut.version.toString() !== \"\";\n\ntests[\"Response contains HREF \" + dataOut.href.toString()] = dataOut.href.toString() !== \"\";\n\ntests[\"Response contains QUOTE_DATE \" + dataOut.quoteDate.toString()] = dataOut.quoteDate.toString() !== \"\";\n\ntests[\"Response contains EFFECTIVE_QUOTE_COMPLETION_DATE \" + dataOut.effectiveQuoteCompletionDate.toString()] = dataOut.effectiveQuoteCompletionDate.toString() !== \"\";\n\ntests[\"Response contains CUSTOMER \" ] = typeof(dataOut.customer) !== 'undefined';\n\npostman.setGlobalVariable(\"QUOTE_ID1\", dataOut.id.toString());\n\npostman.setGlobalVariable(\"lastResponse\" + postman.getEnvironmentVariable(\"testName\"), dataOut);\npostman.setGlobalVariable(\"lastRequest\"+ postman.getEnvironmentVariable(\"testName\"), request.data );\n\nvar dataIn = JSON.parse(request.data);\n\nconsole.log(\"request \" + dataIn);\nconsole.log(\"request type\" + typeof(dataIn));\n\n\nif( typeof(dataOut.quoteItem) !== 'undefined' && dataOut.quoteItem.length > 0) {\n var items = dataOut.quoteItem;\n for(var i = 0; i < items.length; i++) {\n tests[\"Response contains quoteItem ID \" + items[i].id.toString() ] = items[i].id.toString() !== \"\";\n tests[\"Response contains quoteItem productOffering\"] = typeof(items[i].productOffering) !== 'undefined';\n }\n}\nif (dataIn.externalId) {\n tests[\"POST Body Response externalId equals Request externalId\" ] = objectEquals(dataIn.externalId, dataOut.externalId);\n}\n\nif (dataIn.description) {\n tests[\"POST Body Response description equals Request description\" ] = objectEquals(dataIn.description, dataOut.description);\n}\n\nif (dataIn.notificationContact) {\n tests[\"POST Body Response notificationContact equals Request notificationContact\" ] = objectEquals(dataIn.notificationContact, dataOut.notificationContact);\n}\n\ntests[\"POST Body Response customer equals Request customer\" ] = objectEquals(dataIn.customer, dataOut.customer);\n\n\nif (dataIn.validFor) {\n tests[\"POST Body Response validFor equals Request validFor\" ] = objectEquals(dataIn.validFor, dataOut.validFor);\n}\n\nif (dataIn.billingAccount) {\n tests[\"POST Body Response billingAccount equals Request billingAccount\" ] = objectEquals(dataIn.billingAccount, dataOut.billingAccount);\n}\n\nif (dataIn.note) {\n tests[\"POST Body Response note equals Request note\" ] = objectEquals(dataIn.note, dataOut.note);\n}\n\nif (dataIn.characteristic) {\n tests[\"POST Body Response characteristic equals Request characteristic\" ] = objectEquals(dataIn.characteristic, dataOut.characteristic);\n}\n\nif (dataIn.relatedParty) {\n tests[\"POST Body Response relatedParty equals Request relatedParty\" ] = objectEquals(dataIn.relatedParty, dataOut.relatedParty);\n}\n\nif (dataIn.agreement) {\n tests[\"POST Body Response agreement equals Request agreement\" ] = objectEquals(dataIn.agreement, dataOut.agreement);\n}\n\nif (dataIn.quoteAuthorization) {\n tests[\"POST Body Response quoteAuthorization equals Request quoteAuthorization\" ] = objectEquals(dataIn.quoteAuthorization, dataOut.quoteAuthorization);\n \n}\n\nif (dataIn.quoteProductOfferingPrice) {\n tests[\"POST Body Response quoteProductOfferingPrice equals Request quoteProductOfferingPrice\" ] = objectEquals(dataIn.quoteProductOfferingPrice, dataOut.quoteProductOfferingPrice);\n}\n\ntests[\"POST Body Response quoteItem equals Request quoteItem\" ] = objectEquals(dataIn.quoteItem, dataOut.quoteItem);\n\nfunction objectEquals(v1, v2) {\n if (typeof(v1) !== typeof(v2)) {\n console.log(\"property typeof(v1) !==typeof(v2)\" + typeof(v1) + typeof(v2) + \"==>\" + v1 + \"!=\" + v2);\n return false;\n }\n\n if (typeof(v1) === \"function\") {\n return v1.toString() === v2.toString();\n }\n\n if (v1 instanceof Object && v2 instanceof Object) {\n \n var r = true;\n for (var k in v1) {\n r = objectEquals(v1[k], v2[k]);\n \n if (!r) {\n tests[\"property \" + k.toString() + \"==>\" + v1[k] + \"!=\" + v2[k]] = false;\n console.log(\"property \" + k.toString() + \"==>\" + v1[k] + \"!=\" + v2[k]);\n postman.setGlobalVariable(\"unequal\" + k.toString(), v1[k] + \"!=\" + v2[k]);\n \n return false;\n } else {\n //tests[\"property \" + k.toString() + \"==>\" + v1[k] + \"=\" + v2[k]] = true;\n }\n }\n return true;\n } else {\n return v1 === v2;\n }\n}", + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1469687019211, + "name": "create a quote", + "description": "create a quote\n", + "collectionId": "d53b2802-92a5-d7aa-2b21-f1a8d349c445", + "responses": [], + "rawModeData": "{\r\n\"id\":\"42\",\r\n\r\n\"externalId\":\"QuoteForTheConsumer_42\",\r\n\"description\":\"A wonderful 42 quote for brand new products\",\r\n\"category\":\"corporate\",\r\n\"state\":\"InProgress\",\r\n\"version\":\"1.0\",\r\n\r\n\"effectiveQuoteCompletionDate\":\"\",\r\n\"quoteCompletionDate\":\"2013-04-19T16:42:23+08:00\",\r\n\"notificationContact\":\"bill.dupont@hotmail.com\",\r\n\"validFor\":{\r\n \"startDateTime\":\"2013-04-12T16:42:23+08:00\",\r\n \"endDateTime\":\"2013-04-19T00:00:00+08:00\"\r\n },\r\n\"billingAccount\":[\r\n {\r\n \"id\":\"123456\",\r\n \"href\":\"http://serverlocation:port/billingManagement/billingAccount/123456\"\r\n }\r\n],\r\n\"note\":[\r\n {\r\n \"text\":\"Quote following opportunity #2345\",\r\n \"date\":\"2013-04-12T16:42:23+08:00\",\r\n \"author\":\"Bill Dupont\"\r\n }\r\n],\r\n\"characteristic\":[\r\n {\r\n \"name\":\"Business Unit\",\r\n \"value\":\"London South West Cor^porate\"\r\n }\r\n],\r\n\"customer\":{\r\n \"id\":\"345221\",\r\n \"href\":\"http://serverlocation:port/customerManagement/customer/345221\",\r\n \"name\":\"John Doe\"\r\n},\r\n\"relatedParty\":[\r\n {\r\n \"id\":\"57\",\r\n \"href\":\"http://serverlocation:port/partyManagement/partner/57\",\r\n \"name\":\"Shinoju White\",\r\n \"role\":\"authorizer\"\r\n },\r\n {\r\n \"id\":\"4563\",\r\n \"href\":\"http://serverlocation:port/partnerManagement/partner/4563\",\r\n \"name\":\"Bill Dupont\",\r\n \"role\":\"seller\"\r\n }\r\n],\r\n\"agreement\":[\r\n {\r\n \"id\":\"45\",\r\n \"href\":\"http://serverlocation:port/engagedPartyManagement/agreement/45\",\r\n \"name\":\" standard disclaimer\"\r\n }\r\n],\r\n\"quoteAuthorization\":[\r\n {\r\n \"authorizationDate\":\"2013-04-12T16:42:23+08:00\",\r\n \"authorizationState\":\"approved\",\r\n \"authorizationSignatureRepresentation\":\"digital\",\r\n \"attachment\":{\r\n \"id\":\"22\",\r\n \"href\":\"http://serverlocation:port/documentManagement/attachment/22\",\r\n \"type\":\"pdf\"\r\n },\r\n \"quoteProductOfferingPrice\":[{ \r\n \"quotePriceAlteration\":{\r\n \"name\":\"Global Discount\",\r\n \"description\":\"5% for all recurring charge\",\r\n \"validFor\":{\r\n\t\t\t\t\"startDateTime\":\"2013-04-19T16:42:23+08:00\"\r\n\t\t\t}\r\n },\r\n\t\t\"priceType\":\"recurrent\",\r\n\t\t\"unitOfMeasure\":\"\",\r\n\t\t\"price\":{\r\n\t\t\t\"percentage\":5\r\n\t\t},\r\n\t\t\"recurringChargePeriod\":\"\",\r\n\t\t\"priceCondition\":\"applied if all quote items are purchased\"\r\n }]\r\n }\r\n],\r\n\"quoteItem\":[\r\n {\r\n \"id\":\"1\",\r\n \"state\":\"InProgress\",\r\n \"attachment\":{\r\n \"id\":\"22\",\r\n \"href\":\"http://serverlocation:port/documentManagement/attachment/TMFVoiceEXtraRationale.pdf\",\r\n \"type\":\"pdf\"\r\n },\r\n \"relatedParty\":[\r\n {\r\n \"id\":\"345221\",\r\n \"href\":\"http://serverlocation:port/partyManagement/customer/345221\",\r\n \"name\":\"John Doe\",\r\n \"role\":\"customer\"\r\n },\r\n {\r\n \"id\":\"4563\",\r\n \"href\":\"http://serverlocation:port/partnerManagement/partner/4563\",\r\n \"name\":\"Bill Dupont\",\r\n \"role\":\"seller\"\r\n }\r\n ],\r\n \"productOffering\":{\r\n \"id\":\"198\",\r\n \"href\":\"http: //serverlocation: port/catalogManagement/productOffering/198\"\r\n },\r\n \"product\":{ }\r\n },\r\n {\r\n \"id\":\"2\",\r\n \"state\":\"InProgress\",\r\n \"note\":[\r\n {\r\n \"text\":\"xxxx\",\r\n \"date\":\"2013-04-12T16:42:23+08:00\",\r\n \"author\":\"Bill Dupont\"\r\n }\r\n ],\r\n \"itemQuoteAuthorization\":[\r\n {\r\n \"authorizationDate\":\"2013-04-12T18:42:23+08:00\",\r\n \"authorizationState\":\"approved\",\r\n \"authorizationSignatureRepresentation\":\"digital \",\r\n \"attachment\":{\r\n \"id\":\"22\",\r\n \"href\":\"http://serverlocation:port/documentManagement/attachment/22\",\r\n \"type\":\"JPG\"\r\n }\r\n }\r\n ],\r\n \"productOffering\":{\r\n \"id\":\" SamPhone i5s \",\r\n \"href\":\"http: //serverlocation: port/catalogManagement/productOffering/SamPhonei5s \"\r\n },\r\n \"product\":{\r\n \"productCharacteristic\":[\r\n {\r\n \"name\":\"color\",\r\n \"value\":\"pink\"\r\n }\r\n ]\r\n }\r\n },\r\n {\r\n \"id\":\"3\",\r\n \"state\":\"InProgress\",\r\n \"note\":[\r\n {\r\n \"text\":\"The leased line should be directly plugged from Joe’s Office\",\r\n \"date\":\"2013-04-12T16:42:23+08:00\",\r\n \"author\":\"Bill Dupont\"\r\n }\r\n ],\r\n \"productOffering\":{\r\n \"id\":\" TMF Fiber+\",\r\n \"href\":\"http: //serverlocation: port/catalogManagement/productOffering/TMFFiber+\"\r\n },\r\n \"product\":{\r\n \"productCharacteristic\":[\r\n {\r\n \"name\":\"Speed\",\r\n \"value\":\"100 Mo/s\"\r\n },\r\n {\r\n \"name\":\"Site A\",\r\n \"value\":\"12 Dupont Circle, 34511 Washington DC\"\r\n },\r\n {\r\n \"name\":\"Site B\",\r\n \"value\":\"436 25th Avenue, 34507 Washington DC\"\r\n }\r\n ]\r\n }\r\n },\r\n {\r\n \"id\":\"4\",\r\n \"state\":\"InProgress\",\r\n \"itemQuoteProductOfferingPrice\":[{\r\n \"priceType\":\"recurrent\",\r\n \"recurringChargePeriod\":\"monthly\",\r\n \"priceCondition\":\"\",\r\n \"quotePriceAlteration\":{\r\n\t\t\t\"name\":\"Discount on Bundle TV channel\",\r\n\t\t\t\"description\":\"Movie + sport is so fun\",\r\n\t\t\t\"validFor\":{\r\n\t\t\t\t\"startDateTime\":\"2013-04-19T16:42:23+08:00\"\r\n\t\t\t}\r\n\t\t},\r\n \r\n \"price\":{\r\n \"override\":23.87\r\n },\r\n \"unitOfMeasure\":\"\"\r\n \r\n }],\r\n \"productOffering\":{\r\n \"id\":\"TM TV+\",\r\n \"href\":\"http://serverlocation:port/catalogManagement/productOffering/BundleTMTV+\",\r\n \"bundledProductOffering\":[\r\n {\r\n \"id\":\" Sport TV Channel\",\r\n \"href\":\"http://serverlocation:port/catalogManagement/productOffering/SportChannel\"\r\n },\r\n {\r\n \"id\":\" Movie TV channel\",\r\n \"href\":\"http://serverlocation:port/catalogManagement/productOffering/MovieChannel\"\r\n }\r\n ]\r\n }\r\n }\r\n ]\r\n}" + }, + { + "id": "ed18fec3-a862-c616-3b45-7c78251bf84e", + "headers": "Accept: application/json\nContent-Type: application/json\n", + "url": "{{quoteManagementApi}}/quote", + "preRequestScript": "", + "pathVariables": {}, + "method": "GET", + "data": [], + "dataMode": "params", + "version": 2, + "tests": "var dataOut = JSON.parse(responseBody);\n\ntests[\"Content-Type is present \" + postman.getResponseHeader(\"Content-type\")] = postman.getResponseHeader(\"Content-type\");\n\ntests[\"Status code is 200\"] = responseCode.code === 200;\n\nif (typeof(dataOut)!=='undefined' && dataOut.length>0) {\n var items = dataOut;\n for (var i = 0; i < items.length; i++) {\n tests[\"Response contains ID \" + items[i].id.toString()] = items[i].id.toString() !== \"\";\n\n tests[\"Response contains VERSION \" + items[i].version.toString()] = items[i].version.toString() !== \"\";\n\n tests[\"Response contains HREF \" + items[i].href.toString()] = items[i].href.toString() !== \"\";\n\n tests[\"Response contains QUOTE_DATE \" + items[i].quoteDate.toString()] = items[i].quoteDate.toString() !== \"\";\n\n tests[\"Response contains EFFECTIVE_QUOTE_COMPLETION_DATE \" + items[i].effectiveQuoteCompletionDate.toString()] = items[i].effectiveQuoteCompletionDate.toString() !== \"\";\n\n tests[\"Response contains CUSTOMER \" ] = typeof(items[i].customer) !== 'undefined';\n }\n}", + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1470367718221, + "name": "find all quote", + "description": "find quote\n", + "collectionId": "d53b2802-92a5-d7aa-2b21-f1a8d349c445", + "responses": [] + } + ] + }, + "folder": null, + "globals": { + "values": [ + { + "key": "QUOTE_ID1", + "value": "42", + "type": "text", + "name": "QUOTE_ID1" + }, + { + "key": "lastResponsetmf-product-offering-qualification-001", + "value": { + "billingAccount": [ + { + "id": "123456", + "href": "http://serverlocation:port/billingManagement/billingAccount/123456" + } + ], + "state": "InProgress", + "id": "43", + "href": "http://localhost:8080/DSQuoteManagement/api/quoteManagement/v1/quote/43", + "externalId": "QuoteForTheConsumer_42", + "description": "A wonderful 42 quote for brand new products", + "category": "corporate", + "version": "1.0", + "notificationContact": "bill.dupont@hotmail.com", + "validFor": { + "startDateTime": "2013-04-12T16:42:23+08:00", + "endDateTime": "2013-04-19T00:00:00+08:00" + }, + "note": [ + { + "text": "Quote following opportunity #2345", + "author": "Bill Dupont", + "date": "2013-04-12T16:42:23+08:00" + } + ], + "characteristic": [ + { + "name": "Business Unit", + "value": "London South West Cor^porate" + } + ], + "customer": { + "id": "345221", + "href": "http://serverlocation:port/customerManagement/customer/345221", + "name": "John Doe" + }, + "relatedParty": [ + { + "id": "57", + "href": "http://serverlocation:port/partyManagement/partner/57", + "name": "Shinoju White", + "role": "authorizer" + }, + { + "id": "4563", + "href": "http://serverlocation:port/partnerManagement/partner/4563", + "name": "Bill Dupont", + "role": "seller" + } + ], + "agreement": [ + { + "id": "45", + "href": "http://serverlocation:port/engagedPartyManagement/agreement/45", + "name": " standard disclaimer" + } + ], + "quoteAuthorization": [ + { + "authorizationState": "approved", + "authorizationSignatureRepresentation": "digital", + "attachment": { + "id": "22", + "href": "http://serverlocation:port/documentManagement/attachment/22", + "type": "pdf" + }, + "quoteProductOfferingPrice": [ + { + "priceType": "recurrent", + "recurringChargePeriod": "", + "priceCondition": "applied if all quote items are purchased", + "quotePriceAlteration": { + "name": "Global Discount", + "description": "5% for all recurring charge", + "validFor": { + "startDateTime": "2013-04-19T16:42:23+08:00" + } + }, + "price": { + "percentage": 5 + }, + "unitOfMeasure": "" + } + ], + "authorizationDate": "2013-04-12T16:42:23+08:00" + } + ], + "quoteProductOfferingPrice": [], + "quoteItem": [ + { + "id": "1", + "state": "InProgress", + "action": "add", + "attachment": { + "id": "22", + "href": "http://serverlocation:port/documentManagement/attachment/TMFVoiceEXtraRationale.pdf", + "type": "pdf" + }, + "relatedParty": [ + { + "id": "345221", + "href": "http://serverlocation:port/partyManagement/customer/345221", + "name": "John Doe", + "role": "customer" + }, + { + "id": "4563", + "href": "http://serverlocation:port/partnerManagement/partner/4563", + "name": "Bill Dupont", + "role": "seller" + } + ], + "note": [], + "productOffering": { + "id": "198", + "href": "http: //serverlocation: port/catalogManagement/productOffering/198", + "bundledProductOffering": [] + }, + "product": { + "productCharacteristic": [], + "productRelationship": [] + }, + "itemQuoteProductOfferingPrice": [], + "itemQuoteAuthorization": [] + }, + { + "id": "2", + "state": "InProgress", + "action": "add", + "relatedParty": [], + "note": [ + { + "text": "xxxx", + "author": "Bill Dupont", + "date": "2013-04-12T16:42:23+08:00" + } + ], + "productOffering": { + "id": " SamPhone i5s ", + "href": "http: //serverlocation: port/catalogManagement/productOffering/SamPhonei5s ", + "bundledProductOffering": [] + }, + "product": { + "productCharacteristic": [ + { + "name": "color", + "value": "pink" + } + ], + "productRelationship": [] + }, + "itemQuoteProductOfferingPrice": [], + "itemQuoteAuthorization": [ + { + "authorizationState": "approved", + "authorizationSignatureRepresentation": "digital ", + "attachment": { + "id": "22", + "href": "http://serverlocation:port/documentManagement/attachment/22", + "type": "JPG" + }, + "quoteProductOfferingPrice": [], + "authorizationDate": "2013-04-12T18:42:23+08:00" + } + ] + }, + { + "id": "3", + "state": "InProgress", + "action": "add", + "relatedParty": [], + "note": [ + { + "text": "The leased line should be directly plugged from Joe’s Office", + "author": "Bill Dupont", + "date": "2013-04-12T16:42:23+08:00" + } + ], + "productOffering": { + "id": " TMF Fiber+", + "href": "http: //serverlocation: port/catalogManagement/productOffering/TMFFiber+", + "bundledProductOffering": [] + }, + "product": { + "productCharacteristic": [ + { + "name": "Speed", + "value": "100 Mo/s" + }, + { + "name": "Site A", + "value": "12 Dupont Circle, 34511 Washington DC" + }, + { + "name": "Site B", + "value": "436 25th Avenue, 34507 Washington DC" + } + ], + "productRelationship": [] + }, + "itemQuoteProductOfferingPrice": [], + "itemQuoteAuthorization": [] + }, + { + "id": "4", + "state": "InProgress", + "action": "add", + "relatedParty": [], + "note": [], + "productOffering": { + "id": "TM TV+", + "href": "http://serverlocation:port/catalogManagement/productOffering/BundleTMTV+", + "bundledProductOffering": [ + { + "id": " Sport TV Channel", + "href": "http://serverlocation:port/catalogManagement/productOffering/SportChannel", + "bundledProductOffering": [] + }, + { + "id": " Movie TV channel", + "href": "http://serverlocation:port/catalogManagement/productOffering/MovieChannel", + "bundledProductOffering": [] + } + ] + }, + "itemQuoteProductOfferingPrice": [ + { + "priceType": "recurrent", + "recurringChargePeriod": "monthly", + "priceCondition": "", + "quotePriceAlteration": { + "name": "Discount on Bundle TV channel", + "description": "Movie + sport is so fun", + "validFor": { + "startDateTime": "2013-04-19T16:42:23+08:00" + } + }, + "price": { + "override": 23.87 + }, + "unitOfMeasure": "" + } + ], + "itemQuoteAuthorization": [] + } + ], + "quoteDate": "2016-08-08T15:39:59+08:00", + "effectiveQuoteCompletionDate": "2016-08-08T15:39:59+08:00", + "quoteCompletionDate": "2013-04-19T16:42:23+08:00" + }, + "type": "text", + "name": "lastResponsetmf-product-offering-qualification-001" + }, + { + "key": "lastRequesttmf-product-offering-qualification-001", + "value": "{\r\n\"id\":\"43\",\r\n\r\n\"externalId\":\"QuoteForTheConsumer_42\",\r\n\"description\":\"A wonderful 42 quote for brand new products\",\r\n\"category\":\"corporate\",\r\n\"state\":\"InProgress\",\r\n\"version\":\"1.0\",\r\n\r\n\"effectiveQuoteCompletionDate\":\"\",\r\n\"quoteCompletionDate\":\"2013-04-19T16:42:23+08:00\",\r\n\"notificationContact\":\"bill.dupont@hotmail.com\",\r\n\"validFor\":{\r\n \"startDateTime\":\"2013-04-12T16:42:23+08:00\",\r\n \"endDateTime\":\"2013-04-19T00:00:00+08:00\"\r\n },\r\n\"billingAccount\":[\r\n {\r\n \"id\":\"123456\",\r\n \"href\":\"http://serverlocation:port/billingManagement/billingAccount/123456\"\r\n }\r\n],\r\n\"note\":[\r\n {\r\n \"text\":\"Quote following opportunity #2345\",\r\n \"date\":\"2013-04-12T16:42:23+08:00\",\r\n \"author\":\"Bill Dupont\"\r\n }\r\n],\r\n\"characteristic\":[\r\n {\r\n \"name\":\"Business Unit\",\r\n \"value\":\"London South West Cor^porate\"\r\n }\r\n],\r\n\"customer\":{\r\n \"id\":\"345221\",\r\n \"href\":\"http://serverlocation:port/customerManagement/customer/345221\",\r\n \"name\":\"John Doe\"\r\n},\r\n\"relatedParty\":[\r\n {\r\n \"id\":\"57\",\r\n \"href\":\"http://serverlocation:port/partyManagement/partner/57\",\r\n \"name\":\"Shinoju White\",\r\n \"role\":\"authorizer\"\r\n },\r\n {\r\n \"id\":\"4563\",\r\n \"href\":\"http://serverlocation:port/partnerManagement/partner/4563\",\r\n \"name\":\"Bill Dupont\",\r\n \"role\":\"seller\"\r\n }\r\n],\r\n\"agreement\":[\r\n {\r\n \"id\":\"45\",\r\n \"href\":\"http://serverlocation:port/engagedPartyManagement/agreement/45\",\r\n \"name\":\" standard disclaimer\"\r\n }\r\n],\r\n\"quoteAuthorization\":[\r\n {\r\n \"authorizationDate\":\"2013-04-12T16:42:23+08:00\",\r\n \"authorizationState\":\"approved\",\r\n \"authorizationSignatureRepresentation\":\"digital\",\r\n \"attachment\":{\r\n \"id\":\"22\",\r\n \"href\":\"http://serverlocation:port/documentManagement/attachment/22\",\r\n \"type\":\"pdf\"\r\n },\r\n \"quoteProductOfferingPrice\":[{ \r\n \"quotePriceAlteration\":{\r\n \"name\":\"Global Discount\",\r\n \"description\":\"5% for all recurring charge\",\r\n \"validFor\":{\r\n\t\t\t\t\"startDateTime\":\"2013-04-19T16:42:23+08:00\"\r\n\t\t\t}\r\n },\r\n\t\t\"priceType\":\"recurrent\",\r\n\t\t\"unitOfMeasure\":\"\",\r\n\t\t\"price\":{\r\n\t\t\t\"percentage\":5\r\n\t\t},\r\n\t\t\"recurringChargePeriod\":\"\",\r\n\t\t\"priceCondition\":\"applied if all quote items are purchased\"\r\n }]\r\n }\r\n],\r\n\"quoteItem\":[\r\n {\r\n \"id\":\"1\",\r\n \"state\":\"InProgress\",\r\n \"attachment\":{\r\n \"id\":\"22\",\r\n \"href\":\"http://serverlocation:port/documentManagement/attachment/TMFVoiceEXtraRationale.pdf\",\r\n \"type\":\"pdf\"\r\n },\r\n \"relatedParty\":[\r\n {\r\n \"id\":\"345221\",\r\n \"href\":\"http://serverlocation:port/partyManagement/customer/345221\",\r\n \"name\":\"John Doe\",\r\n \"role\":\"customer\"\r\n },\r\n {\r\n \"id\":\"4563\",\r\n \"href\":\"http://serverlocation:port/partnerManagement/partner/4563\",\r\n \"name\":\"Bill Dupont\",\r\n \"role\":\"seller\"\r\n }\r\n ],\r\n \"productOffering\":{\r\n \"id\":\"198\",\r\n \"href\":\"http: //serverlocation: port/catalogManagement/productOffering/198\"\r\n },\r\n \"product\":{ }\r\n },\r\n {\r\n \"id\":\"2\",\r\n \"state\":\"InProgress\",\r\n \"note\":[\r\n {\r\n \"text\":\"xxxx\",\r\n \"date\":\"2013-04-12T16:42:23+08:00\",\r\n \"author\":\"Bill Dupont\"\r\n }\r\n ],\r\n \"itemQuoteAuthorization\":[\r\n {\r\n \"authorizationDate\":\"2013-04-12T18:42:23+08:00\",\r\n \"authorizationState\":\"approved\",\r\n \"authorizationSignatureRepresentation\":\"digital \",\r\n \"attachment\":{\r\n \"id\":\"22\",\r\n \"href\":\"http://serverlocation:port/documentManagement/attachment/22\",\r\n \"type\":\"JPG\"\r\n }\r\n }\r\n ],\r\n \"productOffering\":{\r\n \"id\":\" SamPhone i5s \",\r\n \"href\":\"http: //serverlocation: port/catalogManagement/productOffering/SamPhonei5s \"\r\n },\r\n \"product\":{\r\n \"productCharacteristic\":[\r\n {\r\n \"name\":\"color\",\r\n \"value\":\"pink\"\r\n }\r\n ]\r\n }\r\n },\r\n {\r\n \"id\":\"3\",\r\n \"state\":\"InProgress\",\r\n \"note\":[\r\n {\r\n \"text\":\"The leased line should be directly plugged from Joe’s Office\",\r\n \"date\":\"2013-04-12T16:42:23+08:00\",\r\n \"author\":\"Bill Dupont\"\r\n }\r\n ],\r\n \"productOffering\":{\r\n \"id\":\" TMF Fiber+\",\r\n \"href\":\"http: //serverlocation: port/catalogManagement/productOffering/TMFFiber+\"\r\n },\r\n \"product\":{\r\n \"productCharacteristic\":[\r\n {\r\n \"name\":\"Speed\",\r\n \"value\":\"100 Mo/s\"\r\n },\r\n {\r\n \"name\":\"Site A\",\r\n \"value\":\"12 Dupont Circle, 34511 Washington DC\"\r\n },\r\n {\r\n \"name\":\"Site B\",\r\n \"value\":\"436 25th Avenue, 34507 Washington DC\"\r\n }\r\n ]\r\n }\r\n },\r\n {\r\n \"id\":\"4\",\r\n \"state\":\"InProgress\",\r\n \"itemQuoteProductOfferingPrice\":[{\r\n \"priceType\":\"recurrent\",\r\n \"recurringChargePeriod\":\"monthly\",\r\n \"priceCondition\":\"\",\r\n \"quotePriceAlteration\":{\r\n\t\t\t\"name\":\"Discount on Bundle TV channel\",\r\n\t\t\t\"description\":\"Movie + sport is so fun\",\r\n\t\t\t\"validFor\":{\r\n\t\t\t\t\"startDateTime\":\"2013-04-19T16:42:23+08:00\"\r\n\t\t\t}\r\n\t\t},\r\n \r\n \"price\":{\r\n \"override\":23.87\r\n },\r\n \"unitOfMeasure\":\"\"\r\n \r\n }],\r\n \"productOffering\":{\r\n \"id\":\"TM TV+\",\r\n \"href\":\"http://serverlocation:port/catalogManagement/productOffering/BundleTMTV+\",\r\n \"bundledProductOffering\":[\r\n {\r\n \"id\":\" Sport TV Channel\",\r\n \"href\":\"http://serverlocation:port/catalogManagement/productOffering/SportChannel\"\r\n },\r\n {\r\n \"id\":\" Movie TV channel\",\r\n \"href\":\"http://serverlocation:port/catalogManagement/productOffering/MovieChannel\"\r\n }\r\n ]\r\n }\r\n }\r\n ]\r\n}", + "type": "text", + "name": "lastRequesttmf-product-offering-qualification-001" + }, + { + "key": "QUOTE_ID2", + "value": "43", + "type": "text", + "name": "QUOTE_ID2" + } + ] + }, + "results": [ + { + "id": "d79291d0-d96c-9d6d-40b9-3c2f16bbf419", + "name": "create a quote", + "url": "{{quoteManagementApi}}/quote", + "totalTime": 679, + "responseCode": { + "code": 201, + "name": "", + "detail": "" + }, + "tests": { + "Content-Type is present application/json": "application/json", + "Status code is 201": true, + "Response contains ID 42": true, + "Response contains VERSION 1.0": true, + "Response contains HREF http://localhost:8080/DSQuoteManagement/api/quoteManagement/v1/quote/42": true, + "Response contains QUOTE_DATE 2016-08-08T15:39:59+08:00": true, + "Response contains EFFECTIVE_QUOTE_COMPLETION_DATE 2016-08-08T15:39:59+08:00": true, + "Response contains CUSTOMER ": true, + "Response contains quoteItem ID 1": true, + "Response contains quoteItem productOffering": true, + "Response contains quoteItem ID 2": true, + "Response contains quoteItem ID 3": true, + "Response contains quoteItem ID 4": true, + "POST Body Response externalId equals Request externalId": true, + "POST Body Response description equals Request description": true, + "POST Body Response notificationContact equals Request notificationContact": true, + "POST Body Response customer equals Request customer": true, + "POST Body Response validFor equals Request validFor": true, + "POST Body Response billingAccount equals Request billingAccount": true, + "POST Body Response note equals Request note": true, + "POST Body Response characteristic equals Request characteristic": true, + "POST Body Response relatedParty equals Request relatedParty": true, + "POST Body Response agreement equals Request agreement": true, + "POST Body Response quoteAuthorization equals Request quoteAuthorization": true, + "POST Body Response quoteItem equals Request quoteItem": true + }, + "totalPassFailCounts": { + "pass": 25, + "fail": 0 + }, + "testPassFailCounts": { + "Content-Type is present application/json": { + "pass": 1, + "fail": 0 + }, + "Status code is 201": { + "pass": 1, + "fail": 0 + }, + "Response contains ID 42": { + "pass": 1, + "fail": 0 + }, + "Response contains VERSION 1.0": { + "pass": 1, + "fail": 0 + }, + "Response contains HREF http://localhost:8080/DSQuoteManagement/api/quoteManagement/v1/quote/42": { + "pass": 1, + "fail": 0 + }, + "Response contains QUOTE_DATE 2016-08-08T15:39:59+08:00": { + "pass": 1, + "fail": 0 + }, + "Response contains EFFECTIVE_QUOTE_COMPLETION_DATE 2016-08-08T15:39:59+08:00": { + "pass": 1, + "fail": 0 + }, + "Response contains CUSTOMER ": { + "pass": 1, + "fail": 0 + }, + "Response contains quoteItem ID 1": { + "pass": 1, + "fail": 0 + }, + "Response contains quoteItem productOffering": { + "pass": 1, + "fail": 0 + }, + "Response contains quoteItem ID 2": { + "pass": 1, + "fail": 0 + }, + "Response contains quoteItem ID 3": { + "pass": 1, + "fail": 0 + }, + "Response contains quoteItem ID 4": { + "pass": 1, + "fail": 0 + }, + "POST Body Response externalId equals Request externalId": { + "pass": 1, + "fail": 0 + }, + "POST Body Response description equals Request description": { + "pass": 1, + "fail": 0 + }, + "POST Body Response notificationContact equals Request notificationContact": { + "pass": 1, + "fail": 0 + }, + "POST Body Response customer equals Request customer": { + "pass": 1, + "fail": 0 + }, + "POST Body Response validFor equals Request validFor": { + "pass": 1, + "fail": 0 + }, + "POST Body Response billingAccount equals Request billingAccount": { + "pass": 1, + "fail": 0 + }, + "POST Body Response note equals Request note": { + "pass": 1, + "fail": 0 + }, + "POST Body Response characteristic equals Request characteristic": { + "pass": 1, + "fail": 0 + }, + "POST Body Response relatedParty equals Request relatedParty": { + "pass": 1, + "fail": 0 + }, + "POST Body Response agreement equals Request agreement": { + "pass": 1, + "fail": 0 + }, + "POST Body Response quoteAuthorization equals Request quoteAuthorization": { + "pass": 1, + "fail": 0 + }, + "POST Body Response quoteItem equals Request quoteItem": { + "pass": 1, + "fail": 0 + } + }, + "times": [], + "allTests": [ + { + "Content-Type is present application/json": "application/json", + "Status code is 201": true, + "Response contains ID 42": true, + "Response contains VERSION 1.0": true, + "Response contains HREF http://localhost:8080/DSQuoteManagement/api/quoteManagement/v1/quote/42": true, + "Response contains QUOTE_DATE 2016-08-08T15:39:59+08:00": true, + "Response contains EFFECTIVE_QUOTE_COMPLETION_DATE 2016-08-08T15:39:59+08:00": true, + "Response contains CUSTOMER ": true, + "Response contains quoteItem ID 1": true, + "Response contains quoteItem productOffering": true, + "Response contains quoteItem ID 2": true, + "Response contains quoteItem ID 3": true, + "Response contains quoteItem ID 4": true, + "POST Body Response externalId equals Request externalId": true, + "POST Body Response description equals Request description": true, + "POST Body Response notificationContact equals Request notificationContact": true, + "POST Body Response customer equals Request customer": true, + "POST Body Response validFor equals Request validFor": true, + "POST Body Response billingAccount equals Request billingAccount": true, + "POST Body Response note equals Request note": true, + "POST Body Response characteristic equals Request characteristic": true, + "POST Body Response relatedParty equals Request relatedParty": true, + "POST Body Response agreement equals Request agreement": true, + "POST Body Response quoteAuthorization equals Request quoteAuthorization": true, + "POST Body Response quoteItem equals Request quoteItem": true + } + ], + "time": 679, + "meanResponseTime": 679 + }, + { + "id": "7c5e7058-4c56-9701-be7f-e85ff5e5ce7e", + "name": "create a quote copy", + "url": "{{quoteManagementApi}}/quote", + "totalTime": 333, + "responseCode": { + "code": 201, + "name": "", + "detail": "" + }, + "tests": { + "Content-Type is present application/json": "application/json", + "Status code is 201": true, + "Response contains ID 43": true, + "Response contains VERSION 1.0": true, + "Response contains HREF http://localhost:8080/DSQuoteManagement/api/quoteManagement/v1/quote/43": true, + "Response contains QUOTE_DATE 2016-08-08T15:39:59+08:00": true, + "Response contains EFFECTIVE_QUOTE_COMPLETION_DATE 2016-08-08T15:39:59+08:00": true, + "Response contains CUSTOMER ": true, + "Response contains quoteItem ID 1": true, + "Response contains quoteItem productOffering": true, + "Response contains quoteItem ID 2": true, + "Response contains quoteItem ID 3": true, + "Response contains quoteItem ID 4": true, + "POST Body Response externalId equals Request externalId": true, + "POST Body Response description equals Request description": true, + "POST Body Response notificationContact equals Request notificationContact": true, + "POST Body Response customer equals Request customer": true, + "POST Body Response validFor equals Request validFor": true, + "POST Body Response billingAccount equals Request billingAccount": true, + "POST Body Response note equals Request note": true, + "POST Body Response characteristic equals Request characteristic": true, + "POST Body Response relatedParty equals Request relatedParty": true, + "POST Body Response agreement equals Request agreement": true, + "POST Body Response quoteAuthorization equals Request quoteAuthorization": true, + "POST Body Response quoteItem equals Request quoteItem": true + }, + "totalPassFailCounts": { + "pass": 25, + "fail": 0 + }, + "testPassFailCounts": { + "Content-Type is present application/json": { + "pass": 1, + "fail": 0 + }, + "Status code is 201": { + "pass": 1, + "fail": 0 + }, + "Response contains ID 43": { + "pass": 1, + "fail": 0 + }, + "Response contains VERSION 1.0": { + "pass": 1, + "fail": 0 + }, + "Response contains HREF http://localhost:8080/DSQuoteManagement/api/quoteManagement/v1/quote/43": { + "pass": 1, + "fail": 0 + }, + "Response contains QUOTE_DATE 2016-08-08T15:39:59+08:00": { + "pass": 1, + "fail": 0 + }, + "Response contains EFFECTIVE_QUOTE_COMPLETION_DATE 2016-08-08T15:39:59+08:00": { + "pass": 1, + "fail": 0 + }, + "Response contains CUSTOMER ": { + "pass": 1, + "fail": 0 + }, + "Response contains quoteItem ID 1": { + "pass": 1, + "fail": 0 + }, + "Response contains quoteItem productOffering": { + "pass": 1, + "fail": 0 + }, + "Response contains quoteItem ID 2": { + "pass": 1, + "fail": 0 + }, + "Response contains quoteItem ID 3": { + "pass": 1, + "fail": 0 + }, + "Response contains quoteItem ID 4": { + "pass": 1, + "fail": 0 + }, + "POST Body Response externalId equals Request externalId": { + "pass": 1, + "fail": 0 + }, + "POST Body Response description equals Request description": { + "pass": 1, + "fail": 0 + }, + "POST Body Response notificationContact equals Request notificationContact": { + "pass": 1, + "fail": 0 + }, + "POST Body Response customer equals Request customer": { + "pass": 1, + "fail": 0 + }, + "POST Body Response validFor equals Request validFor": { + "pass": 1, + "fail": 0 + }, + "POST Body Response billingAccount equals Request billingAccount": { + "pass": 1, + "fail": 0 + }, + "POST Body Response note equals Request note": { + "pass": 1, + "fail": 0 + }, + "POST Body Response characteristic equals Request characteristic": { + "pass": 1, + "fail": 0 + }, + "POST Body Response relatedParty equals Request relatedParty": { + "pass": 1, + "fail": 0 + }, + "POST Body Response agreement equals Request agreement": { + "pass": 1, + "fail": 0 + }, + "POST Body Response quoteAuthorization equals Request quoteAuthorization": { + "pass": 1, + "fail": 0 + }, + "POST Body Response quoteItem equals Request quoteItem": { + "pass": 1, + "fail": 0 + } + }, + "times": [], + "allTests": [ + { + "Content-Type is present application/json": "application/json", + "Status code is 201": true, + "Response contains ID 43": true, + "Response contains VERSION 1.0": true, + "Response contains HREF http://localhost:8080/DSQuoteManagement/api/quoteManagement/v1/quote/43": true, + "Response contains QUOTE_DATE 2016-08-08T15:39:59+08:00": true, + "Response contains EFFECTIVE_QUOTE_COMPLETION_DATE 2016-08-08T15:39:59+08:00": true, + "Response contains CUSTOMER ": true, + "Response contains quoteItem ID 1": true, + "Response contains quoteItem productOffering": true, + "Response contains quoteItem ID 2": true, + "Response contains quoteItem ID 3": true, + "Response contains quoteItem ID 4": true, + "POST Body Response externalId equals Request externalId": true, + "POST Body Response description equals Request description": true, + "POST Body Response notificationContact equals Request notificationContact": true, + "POST Body Response customer equals Request customer": true, + "POST Body Response validFor equals Request validFor": true, + "POST Body Response billingAccount equals Request billingAccount": true, + "POST Body Response note equals Request note": true, + "POST Body Response characteristic equals Request characteristic": true, + "POST Body Response relatedParty equals Request relatedParty": true, + "POST Body Response agreement equals Request agreement": true, + "POST Body Response quoteAuthorization equals Request quoteAuthorization": true, + "POST Body Response quoteItem equals Request quoteItem": true + } + ], + "time": 333, + "meanResponseTime": 333 + }, + { + "id": "ed18fec3-a862-c616-3b45-7c78251bf84e", + "name": "find all quote", + "url": "{{quoteManagementApi}}/quote", + "totalTime": 31, + "responseCode": { + "code": 200, + "name": "", + "detail": "" + }, + "tests": { + "Content-Type is present application/json": "application/json", + "Status code is 200": true, + "Response contains ID 42": true, + "Response contains VERSION 1.0": true, + "Response contains HREF http://localhost:8080/DSQuoteManagement/api/quoteManagement/v1/quote/42": true, + "Response contains QUOTE_DATE 2016-08-08T15:39:59+08:00": true, + "Response contains EFFECTIVE_QUOTE_COMPLETION_DATE 2016-08-08T15:39:59+08:00": true, + "Response contains CUSTOMER ": true, + "Response contains ID 43": true, + "Response contains HREF http://localhost:8080/DSQuoteManagement/api/quoteManagement/v1/quote/43": true + }, + "totalPassFailCounts": { + "pass": 10, + "fail": 0 + }, + "testPassFailCounts": { + "Content-Type is present application/json": { + "pass": 1, + "fail": 0 + }, + "Status code is 200": { + "pass": 1, + "fail": 0 + }, + "Response contains ID 42": { + "pass": 1, + "fail": 0 + }, + "Response contains VERSION 1.0": { + "pass": 1, + "fail": 0 + }, + "Response contains HREF http://localhost:8080/DSQuoteManagement/api/quoteManagement/v1/quote/42": { + "pass": 1, + "fail": 0 + }, + "Response contains QUOTE_DATE 2016-08-08T15:39:59+08:00": { + "pass": 1, + "fail": 0 + }, + "Response contains EFFECTIVE_QUOTE_COMPLETION_DATE 2016-08-08T15:39:59+08:00": { + "pass": 1, + "fail": 0 + }, + "Response contains CUSTOMER ": { + "pass": 1, + "fail": 0 + }, + "Response contains ID 43": { + "pass": 1, + "fail": 0 + }, + "Response contains HREF http://localhost:8080/DSQuoteManagement/api/quoteManagement/v1/quote/43": { + "pass": 1, + "fail": 0 + } + }, + "times": [], + "allTests": [ + { + "Content-Type is present application/json": "application/json", + "Status code is 200": true, + "Response contains ID 42": true, + "Response contains VERSION 1.0": true, + "Response contains HREF http://localhost:8080/DSQuoteManagement/api/quoteManagement/v1/quote/42": true, + "Response contains QUOTE_DATE 2016-08-08T15:39:59+08:00": true, + "Response contains EFFECTIVE_QUOTE_COMPLETION_DATE 2016-08-08T15:39:59+08:00": true, + "Response contains CUSTOMER ": true, + "Response contains ID 43": true, + "Response contains HREF http://localhost:8080/DSQuoteManagement/api/quoteManagement/v1/quote/43": true + } + ], + "time": 31, + "meanResponseTime": 31 + }, + { + "id": "99f01fbd-10f8-b3d9-c491-74c3bfd4651f", + "name": "get quote with id ", + "url": "{{quoteManagementApi}}/quote/{{QUOTE_ID1}}", + "totalTime": 69, + "responseCode": { + "code": 200, + "name": "", + "detail": "" + }, + "tests": { + "Content-Type is present application/json": "application/json", + "Status code is 200": true, + "Response contains ID 42": true, + "Response contains VERSION 1.0": true, + "Response contains HREF http://localhost:8080/DSQuoteManagement/api/quoteManagement/v1/quote/42": true, + "Response contains QUOTE_DATE 2016-08-08T15:39:59+08:00": true, + "Response contains EFFECTIVE_QUOTE_COMPLETION_DATE 2016-08-08T15:39:59+08:00": true, + "Response contains CUSTOMER ": true, + "Response contains quoteItem ID 1": true, + "Response contains quoteItem productOffering": true, + "Response contains quoteItem ID 2": true, + "Response contains quoteItem ID 3": true, + "Response contains quoteItem ID 4": true, + "POST Body Response externalId equals LastRequest externalId": true, + "POST Body Response description equals LastRequest description": true, + "POST Body Response notificationContact equals LastRequest notificationContact": true, + "POST Body Response customer equals LastRequest customer": true, + "POST Body Response validFor equals LastRequest validFor": true, + "POST Body Response billingAccount equals LastRequest billingAccount": true, + "POST Body Response note equals LastRequest note": true, + "POST Body Response characteristic equals LastRequest characteristic": true, + "POST Body Response relatedParty equals LastRequest relatedParty": true, + "POST Body Response agreement equals LastRequest agreement": true, + "POST Body Response quoteAuthorization equals LastRequest quoteAuthorization": true, + "POST Body Response quoteItem equals LastRequest quoteItem": true + }, + "totalPassFailCounts": { + "pass": 25, + "fail": 0 + }, + "testPassFailCounts": { + "Content-Type is present application/json": { + "pass": 1, + "fail": 0 + }, + "Status code is 200": { + "pass": 1, + "fail": 0 + }, + "Response contains ID 42": { + "pass": 1, + "fail": 0 + }, + "Response contains VERSION 1.0": { + "pass": 1, + "fail": 0 + }, + "Response contains HREF http://localhost:8080/DSQuoteManagement/api/quoteManagement/v1/quote/42": { + "pass": 1, + "fail": 0 + }, + "Response contains QUOTE_DATE 2016-08-08T15:39:59+08:00": { + "pass": 1, + "fail": 0 + }, + "Response contains EFFECTIVE_QUOTE_COMPLETION_DATE 2016-08-08T15:39:59+08:00": { + "pass": 1, + "fail": 0 + }, + "Response contains CUSTOMER ": { + "pass": 1, + "fail": 0 + }, + "Response contains quoteItem ID 1": { + "pass": 1, + "fail": 0 + }, + "Response contains quoteItem productOffering": { + "pass": 1, + "fail": 0 + }, + "Response contains quoteItem ID 2": { + "pass": 1, + "fail": 0 + }, + "Response contains quoteItem ID 3": { + "pass": 1, + "fail": 0 + }, + "Response contains quoteItem ID 4": { + "pass": 1, + "fail": 0 + }, + "POST Body Response externalId equals LastRequest externalId": { + "pass": 1, + "fail": 0 + }, + "POST Body Response description equals LastRequest description": { + "pass": 1, + "fail": 0 + }, + "POST Body Response notificationContact equals LastRequest notificationContact": { + "pass": 1, + "fail": 0 + }, + "POST Body Response customer equals LastRequest customer": { + "pass": 1, + "fail": 0 + }, + "POST Body Response validFor equals LastRequest validFor": { + "pass": 1, + "fail": 0 + }, + "POST Body Response billingAccount equals LastRequest billingAccount": { + "pass": 1, + "fail": 0 + }, + "POST Body Response note equals LastRequest note": { + "pass": 1, + "fail": 0 + }, + "POST Body Response characteristic equals LastRequest characteristic": { + "pass": 1, + "fail": 0 + }, + "POST Body Response relatedParty equals LastRequest relatedParty": { + "pass": 1, + "fail": 0 + }, + "POST Body Response agreement equals LastRequest agreement": { + "pass": 1, + "fail": 0 + }, + "POST Body Response quoteAuthorization equals LastRequest quoteAuthorization": { + "pass": 1, + "fail": 0 + }, + "POST Body Response quoteItem equals LastRequest quoteItem": { + "pass": 1, + "fail": 0 + } + }, + "times": [], + "allTests": [ + { + "Content-Type is present application/json": "application/json", + "Status code is 200": true, + "Response contains ID 42": true, + "Response contains VERSION 1.0": true, + "Response contains HREF http://localhost:8080/DSQuoteManagement/api/quoteManagement/v1/quote/42": true, + "Response contains QUOTE_DATE 2016-08-08T15:39:59+08:00": true, + "Response contains EFFECTIVE_QUOTE_COMPLETION_DATE 2016-08-08T15:39:59+08:00": true, + "Response contains CUSTOMER ": true, + "Response contains quoteItem ID 1": true, + "Response contains quoteItem productOffering": true, + "Response contains quoteItem ID 2": true, + "Response contains quoteItem ID 3": true, + "Response contains quoteItem ID 4": true, + "POST Body Response externalId equals LastRequest externalId": true, + "POST Body Response description equals LastRequest description": true, + "POST Body Response notificationContact equals LastRequest notificationContact": true, + "POST Body Response customer equals LastRequest customer": true, + "POST Body Response validFor equals LastRequest validFor": true, + "POST Body Response billingAccount equals LastRequest billingAccount": true, + "POST Body Response note equals LastRequest note": true, + "POST Body Response characteristic equals LastRequest characteristic": true, + "POST Body Response relatedParty equals LastRequest relatedParty": true, + "POST Body Response agreement equals LastRequest agreement": true, + "POST Body Response quoteAuthorization equals LastRequest quoteAuthorization": true, + "POST Body Response quoteItem equals LastRequest quoteItem": true + } + ], + "time": 69, + "meanResponseTime": 69 + }, + { + "id": "3158407d-965d-f0e0-0a06-14ddc237cc65", + "name": "get quote with id and version", + "url": "{{quoteManagementApi}}/quote/{{QUOTE_ID1}}:(version=1.0)", + "totalTime": 68, + "responseCode": { + "code": 200, + "name": "", + "detail": "" + }, + "tests": { + "Content-Type is present application/json": "application/json", + "Status code is 200": true, + "Response contains ID 42": true, + "Response contains VERSION 1.0": true, + "Response contains HREF http://localhost:8080/DSQuoteManagement/api/quoteManagement/v1/quote/42": true, + "Response contains QUOTE_DATE 2016-08-08T15:39:59+08:00": true, + "Response contains EFFECTIVE_QUOTE_COMPLETION_DATE 2016-08-08T15:39:59+08:00": true, + "Response contains CUSTOMER ": true, + "Response contains quoteItem ID 1": true, + "Response contains quoteItem productOffering": true, + "Response contains quoteItem ID 2": true, + "Response contains quoteItem ID 3": true, + "Response contains quoteItem ID 4": true + }, + "totalPassFailCounts": { + "pass": 13, + "fail": 0 + }, + "testPassFailCounts": { + "Content-Type is present application/json": { + "pass": 1, + "fail": 0 + }, + "Status code is 200": { + "pass": 1, + "fail": 0 + }, + "Response contains ID 42": { + "pass": 1, + "fail": 0 + }, + "Response contains VERSION 1.0": { + "pass": 1, + "fail": 0 + }, + "Response contains HREF http://localhost:8080/DSQuoteManagement/api/quoteManagement/v1/quote/42": { + "pass": 1, + "fail": 0 + }, + "Response contains QUOTE_DATE 2016-08-08T15:39:59+08:00": { + "pass": 1, + "fail": 0 + }, + "Response contains EFFECTIVE_QUOTE_COMPLETION_DATE 2016-08-08T15:39:59+08:00": { + "pass": 1, + "fail": 0 + }, + "Response contains CUSTOMER ": { + "pass": 1, + "fail": 0 + }, + "Response contains quoteItem ID 1": { + "pass": 1, + "fail": 0 + }, + "Response contains quoteItem productOffering": { + "pass": 1, + "fail": 0 + }, + "Response contains quoteItem ID 2": { + "pass": 1, + "fail": 0 + }, + "Response contains quoteItem ID 3": { + "pass": 1, + "fail": 0 + }, + "Response contains quoteItem ID 4": { + "pass": 1, + "fail": 0 + } + }, + "times": [], + "allTests": [ + { + "Content-Type is present application/json": "application/json", + "Status code is 200": true, + "Response contains ID 42": true, + "Response contains VERSION 1.0": true, + "Response contains HREF http://localhost:8080/DSQuoteManagement/api/quoteManagement/v1/quote/42": true, + "Response contains QUOTE_DATE 2016-08-08T15:39:59+08:00": true, + "Response contains EFFECTIVE_QUOTE_COMPLETION_DATE 2016-08-08T15:39:59+08:00": true, + "Response contains CUSTOMER ": true, + "Response contains quoteItem ID 1": true, + "Response contains quoteItem productOffering": true, + "Response contains quoteItem ID 2": true, + "Response contains quoteItem ID 3": true, + "Response contains quoteItem ID 4": true + } + ], + "time": 68, + "meanResponseTime": 68 + }, + { + "id": "a9e7996e-f766-55d3-2d1d-d1566fbbbb4f", + "name": "get quote with filter", + "url": "{{quoteManagementApi}}/quote?id={{QUOTE_ID1}}&version=1.0", + "totalTime": 33, + "responseCode": { + "code": 200, + "name": "", + "detail": "" + }, + "tests": { + "Content-Type is present application/json": "application/json", + "Status code is 200": true, + "Response contains ID 42": true, + "Response contains VERSION 1.0": true, + "Response contains HREF http://localhost:8080/DSQuoteManagement/api/quoteManagement/v1/quote/42": true, + "Response contains QUOTE_DATE 2016-08-08T15:39:59+08:00": true, + "Response contains EFFECTIVE_QUOTE_COMPLETION_DATE 2016-08-08T15:39:59+08:00": true, + "Response contains CUSTOMER ": true + }, + "totalPassFailCounts": { + "pass": 8, + "fail": 0 + }, + "testPassFailCounts": { + "Content-Type is present application/json": { + "pass": 1, + "fail": 0 + }, + "Status code is 200": { + "pass": 1, + "fail": 0 + }, + "Response contains ID 42": { + "pass": 1, + "fail": 0 + }, + "Response contains VERSION 1.0": { + "pass": 1, + "fail": 0 + }, + "Response contains HREF http://localhost:8080/DSQuoteManagement/api/quoteManagement/v1/quote/42": { + "pass": 1, + "fail": 0 + }, + "Response contains QUOTE_DATE 2016-08-08T15:39:59+08:00": { + "pass": 1, + "fail": 0 + }, + "Response contains EFFECTIVE_QUOTE_COMPLETION_DATE 2016-08-08T15:39:59+08:00": { + "pass": 1, + "fail": 0 + }, + "Response contains CUSTOMER ": { + "pass": 1, + "fail": 0 + } + }, + "times": [], + "allTests": [ + { + "Content-Type is present application/json": "application/json", + "Status code is 200": true, + "Response contains ID 42": true, + "Response contains VERSION 1.0": true, + "Response contains HREF http://localhost:8080/DSQuoteManagement/api/quoteManagement/v1/quote/42": true, + "Response contains QUOTE_DATE 2016-08-08T15:39:59+08:00": true, + "Response contains EFFECTIVE_QUOTE_COMPLETION_DATE 2016-08-08T15:39:59+08:00": true, + "Response contains CUSTOMER ": true + } + ], + "time": 33, + "meanResponseTime": 33 + }, + { + "id": "d62f15e2-dbf1-bc92-c6e8-c01926af295e", + "name": "partial update quote with id", + "url": "{{quoteManagementApi}}/quote/{{QUOTE_ID2}}", + "totalTime": 170, + "responseCode": { + "code": 200, + "name": "", + "detail": "" + }, + "tests": {}, + "totalPassFailCounts": { + "pass": 0, + "fail": 0 + }, + "testPassFailCounts": {}, + "times": [], + "allTests": [ + {} + ], + "time": 170, + "meanResponseTime": 170 + }, + { + "id": "9c8c29a5-ebdb-aadb-b896-35533bddb38b", + "name": "partial update quote with id and version", + "url": "{{quoteManagementApi}}/quote/{{QUOTE_ID2}}:(version=1.0)", + "totalTime": 161, + "responseCode": { + "code": 200, + "name": "", + "detail": "" + }, + "tests": {}, + "totalPassFailCounts": { + "pass": 0, + "fail": 0 + }, + "testPassFailCounts": {}, + "times": [], + "allTests": [ + {} + ], + "time": 161, + "meanResponseTime": 161 + }, + { + "id": "4bfd8db3-b5bb-036d-7245-f112839d2fd0", + "name": "Partial update appointement json-patch with id", + "url": "{{quoteManagementApi}}/quote/{{QUOTE_ID1}}", + "totalTime": 353, + "responseCode": { + "code": 200, + "name": "", + "detail": "" + }, + "tests": { + "Content-Type is present application/json": "application/json", + "Status code is 200": true, + "Response contains ID 42": true, + "Response contains VERSION 1.0": true, + "Response contains HREF http://localhost:8080/DSQuoteManagement/api/quoteManagement/v1/quote/42": true, + "Response contains QUOTE_DATE 2016-08-08T15:39:59+08:00": true, + "Response contains EFFECTIVE_QUOTE_COMPLETION_DATE 2016-08-08T15:39:59+08:00": true, + "Response contains CUSTOMER ": true, + "Response contains quoteItem ID 1": true, + "Response contains quoteItem productOffering": true, + "Response contains quoteItem ID 2": true, + "Response contains quoteItem ID 3": true, + "Response contains quoteItem ID 4": true + }, + "totalPassFailCounts": { + "pass": 13, + "fail": 0 + }, + "testPassFailCounts": { + "Content-Type is present application/json": { + "pass": 1, + "fail": 0 + }, + "Status code is 200": { + "pass": 1, + "fail": 0 + }, + "Response contains ID 42": { + "pass": 1, + "fail": 0 + }, + "Response contains VERSION 1.0": { + "pass": 1, + "fail": 0 + }, + "Response contains HREF http://localhost:8080/DSQuoteManagement/api/quoteManagement/v1/quote/42": { + "pass": 1, + "fail": 0 + }, + "Response contains QUOTE_DATE 2016-08-08T15:39:59+08:00": { + "pass": 1, + "fail": 0 + }, + "Response contains EFFECTIVE_QUOTE_COMPLETION_DATE 2016-08-08T15:39:59+08:00": { + "pass": 1, + "fail": 0 + }, + "Response contains CUSTOMER ": { + "pass": 1, + "fail": 0 + }, + "Response contains quoteItem ID 1": { + "pass": 1, + "fail": 0 + }, + "Response contains quoteItem productOffering": { + "pass": 1, + "fail": 0 + }, + "Response contains quoteItem ID 2": { + "pass": 1, + "fail": 0 + }, + "Response contains quoteItem ID 3": { + "pass": 1, + "fail": 0 + }, + "Response contains quoteItem ID 4": { + "pass": 1, + "fail": 0 + } + }, + "times": [], + "allTests": [ + { + "Content-Type is present application/json": "application/json", + "Status code is 200": true, + "Response contains ID 42": true, + "Response contains VERSION 1.0": true, + "Response contains HREF http://localhost:8080/DSQuoteManagement/api/quoteManagement/v1/quote/42": true, + "Response contains QUOTE_DATE 2016-08-08T15:39:59+08:00": true, + "Response contains EFFECTIVE_QUOTE_COMPLETION_DATE 2016-08-08T15:39:59+08:00": true, + "Response contains CUSTOMER ": true, + "Response contains quoteItem ID 1": true, + "Response contains quoteItem productOffering": true, + "Response contains quoteItem ID 2": true, + "Response contains quoteItem ID 3": true, + "Response contains quoteItem ID 4": true + } + ], + "time": 353, + "meanResponseTime": 353 + }, + { + "id": "6c73350a-dcba-7f3a-84d9-ed046111a6a5", + "name": "Partial update appointement json-patch with id and version", + "url": "{{quoteManagementApi}}/quote/{{QUOTE_ID1}}:(version=1.0)", + "totalTime": 496, + "responseCode": { + "code": 200, + "name": "", + "detail": "" + }, + "tests": { + "Content-Type is present application/json": "application/json", + "Status code is 200": true, + "Response contains ID 42": true, + "Response contains VERSION 1.0": true, + "Response contains HREF http://localhost:8080/DSQuoteManagement/api/quoteManagement/v1/quote/42": true, + "Response contains QUOTE_DATE 2016-08-08T15:39:59+08:00": true, + "Response contains EFFECTIVE_QUOTE_COMPLETION_DATE 2016-08-08T15:39:59+08:00": true, + "Response contains CUSTOMER ": true, + "Response contains quoteItem ID 2": true, + "Response contains quoteItem productOffering": true, + "Response contains quoteItem ID 4": true, + "Response contains quoteItem ID 3": true + }, + "totalPassFailCounts": { + "pass": 12, + "fail": 0 + }, + "testPassFailCounts": { + "Content-Type is present application/json": { + "pass": 1, + "fail": 0 + }, + "Status code is 200": { + "pass": 1, + "fail": 0 + }, + "Response contains ID 42": { + "pass": 1, + "fail": 0 + }, + "Response contains VERSION 1.0": { + "pass": 1, + "fail": 0 + }, + "Response contains HREF http://localhost:8080/DSQuoteManagement/api/quoteManagement/v1/quote/42": { + "pass": 1, + "fail": 0 + }, + "Response contains QUOTE_DATE 2016-08-08T15:39:59+08:00": { + "pass": 1, + "fail": 0 + }, + "Response contains EFFECTIVE_QUOTE_COMPLETION_DATE 2016-08-08T15:39:59+08:00": { + "pass": 1, + "fail": 0 + }, + "Response contains CUSTOMER ": { + "pass": 1, + "fail": 0 + }, + "Response contains quoteItem ID 2": { + "pass": 1, + "fail": 0 + }, + "Response contains quoteItem productOffering": { + "pass": 1, + "fail": 0 + }, + "Response contains quoteItem ID 4": { + "pass": 1, + "fail": 0 + }, + "Response contains quoteItem ID 3": { + "pass": 1, + "fail": 0 + } + }, + "times": [], + "allTests": [ + { + "Content-Type is present application/json": "application/json", + "Status code is 200": true, + "Response contains ID 42": true, + "Response contains VERSION 1.0": true, + "Response contains HREF http://localhost:8080/DSQuoteManagement/api/quoteManagement/v1/quote/42": true, + "Response contains QUOTE_DATE 2016-08-08T15:39:59+08:00": true, + "Response contains EFFECTIVE_QUOTE_COMPLETION_DATE 2016-08-08T15:39:59+08:00": true, + "Response contains CUSTOMER ": true, + "Response contains quoteItem ID 2": true, + "Response contains quoteItem productOffering": true, + "Response contains quoteItem ID 4": true, + "Response contains quoteItem ID 3": true + } + ], + "time": 496, + "meanResponseTime": 496 + }, + { + "id": "84000cf5-233d-1854-2b1f-b816b9eaa544", + "name": "[ADMIN] delete quote with version", + "url": "{{Host}}/DSQuoteManagement/api/admin/quote/{{QUOTE_ID1}}:(version=1.0)", + "totalTime": 4201, + "responseCode": { + "code": 200, + "name": "", + "detail": "" + }, + "tests": { + "Content-Type is present application/json": "application/json", + "Status code is 200": true, + "Response contains previousRows 2": true, + "Response contains affectedRows 1": true, + "Response contains currentRows 1": true + }, + "totalPassFailCounts": { + "pass": 5, + "fail": 0 + }, + "testPassFailCounts": { + "Content-Type is present application/json": { + "pass": 1, + "fail": 0 + }, + "Status code is 200": { + "pass": 1, + "fail": 0 + }, + "Response contains previousRows 2": { + "pass": 1, + "fail": 0 + }, + "Response contains affectedRows 1": { + "pass": 1, + "fail": 0 + }, + "Response contains currentRows 1": { + "pass": 1, + "fail": 0 + } + }, + "times": [], + "allTests": [ + { + "Content-Type is present application/json": "application/json", + "Status code is 200": true, + "Response contains previousRows 2": true, + "Response contains affectedRows 1": true, + "Response contains currentRows 1": true + } + ], + "time": 4201, + "meanResponseTime": 4201 + }, + { + "id": "89566752-6274-87d9-7581-00cd7c070f79", + "name": "[ADMIN] delete quote", + "url": "{{Host}}/DSQuoteManagement/api/admin/quote/{{QUOTE_ID2}}", + "totalTime": 4188, + "responseCode": { + "code": 200, + "name": "", + "detail": "" + }, + "tests": { + "Content-Type is present application/json": "application/json", + "Status code is 200": true, + "Response contains previousRows 1": true, + "Response contains affectedRows 1": true, + "Response contains currentRows 0": true + }, + "totalPassFailCounts": { + "pass": 5, + "fail": 0 + }, + "testPassFailCounts": { + "Content-Type is present application/json": { + "pass": 1, + "fail": 0 + }, + "Status code is 200": { + "pass": 1, + "fail": 0 + }, + "Response contains previousRows 1": { + "pass": 1, + "fail": 0 + }, + "Response contains affectedRows 1": { + "pass": 1, + "fail": 0 + }, + "Response contains currentRows 0": { + "pass": 1, + "fail": 0 + } + }, + "times": [], + "allTests": [ + { + "Content-Type is present application/json": "application/json", + "Status code is 200": true, + "Response contains previousRows 1": true, + "Response contains affectedRows 1": true, + "Response contains currentRows 0": true + } + ], + "time": 4188, + "meanResponseTime": 4188 + } + ], + "environment": { + "id": "e9ff5be6-a134-95a0-3719-abe85cd8241b", + "name": "TMForum Local", + "values": [ + { + "key": "Host", + "value": "http://localhost:8080", + "type": "text", + "name": "Host", + "enabled": true, + "hovered": false + }, + { + "key": "billingManagementApi", + "value": "{{Host}}/DSBillingManagement/api/billingManagement/v2", + "type": "text", + "name": "billingManagementApi", + "enabled": true, + "hovered": false + }, + { + "key": "billingManagementAdminApi", + "value": "{{Host}}/DSBillingManagement/api/admin", + "type": "text", + "name": "billingManagementAdminApi", + "enabled": true, + "hovered": false + }, + { + "key": "billingManagementSubscriberApi", + "value": "{{Host}}/DSBillingManagement/subscriber/api", + "type": "text", + "name": "billingManagementSubscriberApi", + "enabled": true, + "hovered": false + }, + { + "key": "partyManagementApi", + "value": "{{Host}}/DSPartyManagement/api/partyManagement/v2", + "type": "text", + "name": "partyManagementApi", + "enabled": true, + "hovered": false + }, + { + "key": "partyManagementAdminApi", + "value": "{{Host}}/DSPartyManagement/api/admin", + "type": "text", + "name": "partyManagementAdminApi", + "enabled": true, + "hovered": false + }, + { + "key": "partyManagementSubscriberApi", + "value": "{{Host}}/DSPartyManagement/subscriber/api", + "type": "text", + "name": "partyManagementSubscriberApi", + "enabled": true, + "hovered": false + }, + { + "key": "customerManagementApi", + "value": "{{Host}}/DSCustomerManagement/api/customerManagement/v2", + "type": "text", + "name": "customerManagementApi", + "enabled": true, + "hovered": false + }, + { + "key": "customerManagementAdminApi", + "value": "{{Host}}/DSCustomerManagement/api/admin", + "type": "text", + "name": "customerManagementAdminApi", + "enabled": true, + "hovered": false + }, + { + "key": "customerManagementSubscriberApi", + "value": "{{Host}}/DSCustomerManagement/subscriber/api", + "type": "text", + "name": "customerManagementSubscriberApi", + "enabled": true, + "hovered": false + }, + { + "key": "productOrderingApi", + "value": "{{Host}}/DSProductOrdering/api/productOrdering/v2", + "type": "text", + "name": "productOrderingApi", + "enabled": true, + "hovered": false + }, + { + "key": "productOrderingAdminApi", + "value": "{{Host}}/DSProductOrdering/api/admin", + "type": "text", + "name": "productOrderingAdminApi", + "enabled": true, + "hovered": false + }, + { + "key": "productOrderingSubscriberApi", + "value": "{{Host}}/DSProductOrdering/subscriber/api", + "type": "text", + "name": "productOrderingSubscriberApi", + "enabled": true, + "hovered": false + }, + { + "key": "troubleTicketingApi", + "value": "{{Host}}/DSTroubleTicket/api/troubleTicketManagement/v2", + "type": "text", + "name": "troubleTicketingApi", + "enabled": true, + "hovered": false + }, + { + "key": "troubleTicketingAdminApi", + "value": "{{Host}}/DSTroubleTicket/api/admin/troubleTicket", + "type": "text", + "name": "troubleTicketingAdminApi", + "enabled": true, + "hovered": false + }, + { + "key": "troubleTicketingSubscriberApi", + "value": "{{Host}}/DSTroubleTicket/subscriber/api", + "type": "text", + "name": "troubleTicketingSubscriberApi", + "enabled": true, + "hovered": false + }, + { + "key": "productInventoryApi", + "value": "{{Host}}/DSProductInventory/api/productInventory/v2", + "type": "text", + "name": "productInventoryApi", + "enabled": true, + "hovered": false + }, + { + "key": "productInventoryAdminApi", + "value": "{{Host}}/DSProductInventory/api/admin", + "type": "text", + "name": "productInventoryAdminApi", + "enabled": true, + "hovered": false + }, + { + "key": "productInventorySubscriberApi", + "value": "{{Host}}/DSProductInventory/subscriber/api", + "type": "text", + "name": "productInventorySubscriberApi", + "enabled": true, + "hovered": false + }, + { + "key": "catalogManagementApi", + "value": "{{Host}}/DSProductCatalog/api/catalogManagement/v2", + "type": "text", + "name": "catalogManagementApi", + "enabled": true, + "hovered": false + }, + { + "key": "catalogManagementAdminApi", + "value": "{{Host}}/DSProductCatalog/api/admin", + "type": "text", + "name": "catalogManagementAdminApi", + "enabled": true, + "hovered": false + }, + { + "key": "catalogManagementSubscriberApi", + "value": "{{Host}}/DSProductCatalog/subscriber/eventApi", + "type": "text", + "name": "catalogManagementSubscriberApi", + "enabled": true, + "hovered": false + }, + { + "key": "slaManagementApi", + "value": "{{Host}}/DSLAManagement/api/slaManagement/v2", + "type": "text", + "name": "slaManagementApi", + "enabled": true, + "hovered": false + }, + { + "key": "slaManagementSubscriberApi", + "value": "{{Host}}/DSLAManagement/subscriber/api", + "type": "text", + "name": "slaManagementSubscriberApi", + "enabled": true, + "hovered": false + }, + { + "key": "slaManagementAdminApi", + "value": "{{Host}}/DSLAManagement/api/admin", + "type": "text", + "name": "slaManagementAdminApi", + "enabled": true, + "hovered": false + }, + { + "key": "usageManagementApi", + "value": "{{Host}}/DSUsageManagement/api/usageManagement/v2", + "type": "text", + "name": "usageManagementApi", + "enabled": true, + "hovered": false + }, + { + "key": "usageManagementSubscriberApi", + "value": "{{Host}}/DSUsageManagement/subscriber/api", + "type": "text", + "name": "usageManagementSubscriberApi", + "enabled": true, + "hovered": false + }, + { + "key": "usageManagementAdminApi", + "value": "{{Host}}/DSUsageManagement/api/admin/usage", + "type": "text", + "name": "usageManagementAdminApi", + "enabled": true, + "hovered": false + }, + { + "key": "testName", + "value": "tmf-product-offering-qualification-001", + "type": "text", + "name": "testName", + "enabled": true, + "hovered": false + }, + { + "key": "url1", + "value": "http://env-0693795.jelastic.servint.net/DSCustomerManagement/api/customerManagement/v2", + "type": "text", + "name": "url1", + "enabled": true, + "hovered": false + }, + { + "key": "appointmentManagementApi", + "value": "{{Host}}/DSAppointmentManagement/api/appointment/v1", + "type": "text", + "name": "appointmentManagementApi", + "enabled": true, + "hovered": false + }, + { + "key": "addressManagementApi", + "value": "{{Host}}/DSAddressManagement/api/addressManagement/v1", + "type": "text", + "name": "addressManagementApi", + "enabled": true, + "hovered": false + }, + { + "key": "addressManagementAdminApi", + "value": "{{Host}}/DSAddressManagement/api/admin", + "type": "text", + "name": "addressManagementAdminApi", + "enabled": true, + "hovered": false + }, + { + "key": "quoteManagementApi", + "value": "{{Host}}/DSQuoteManagement/api/quoteManagement/v1", + "type": "text", + "name": "quoteManagementApi", + "enabled": true, + "hovered": false + } + ], + "team": null, + "timestamp": 1469155606077, + "synced": false, + "syncedFilename": "", + "isDeleted": false + }, + "delay": 0 +} \ No newline at end of file diff --git a/src/main/java/org/tmf/dsmapi/commons/facade/AbstractFacade.java b/src/main/java/org/tmf/dsmapi/commons/facade/AbstractFacade.java index 84e9e86..73154a5 100644 --- a/src/main/java/org/tmf/dsmapi/commons/facade/AbstractFacade.java +++ b/src/main/java/org/tmf/dsmapi/commons/facade/AbstractFacade.java @@ -17,6 +17,7 @@ import javax.persistence.criteria.CriteriaBuilder; import javax.persistence.criteria.CriteriaQuery; import javax.persistence.criteria.Expression; +import javax.persistence.criteria.Order; import javax.persistence.criteria.Path; import javax.persistence.criteria.Predicate; import javax.persistence.criteria.Root; @@ -95,6 +96,16 @@ public void remove(Object id) throws UnknownResourceException { getEntityManager().remove(getEntityManager().merge(entity)); } + /** + * + * @param id + * @throws UnknownResourceException + */ + @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW) + public void removeQuoteWithVersion(T entity) throws UnknownResourceException { + getEntityManager().remove(getEntityManager().merge(entity)); + } + @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW) public void removeAll() { List all = findAll(); @@ -104,6 +115,13 @@ public void removeAll() { } } + @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW) + public void removeAllQuote(List all) { + EntityManager em = getEntityManager(); + for (T entity : all) { + em.remove(getEntityManager().merge(entity)); + } + } /** * * @param id @@ -205,6 +223,7 @@ public List findByCriteria(Map> map, Class clazz) { andPredicates.add(predicate); } cq.where(andPredicates.toArray(new Predicate[andPredicates.size()])); + cq.orderBy(criteriaBuilder.desc(tt.get("version"))); cq.select(tt); TypedQuery q = getEntityManager().createQuery(cq); resultsList = q.getResultList(); diff --git a/src/main/java/org/tmf/dsmapi/commons/utils/BeanUtils.java b/src/main/java/org/tmf/dsmapi/commons/utils/BeanUtils.java index 21deef8..8944514 100644 --- a/src/main/java/org/tmf/dsmapi/commons/utils/BeanUtils.java +++ b/src/main/java/org/tmf/dsmapi/commons/utils/BeanUtils.java @@ -65,9 +65,10 @@ public static boolean patch(Object currentBean, Object patchBean, JsonNode node) childNode = node.get(name); if (null != patchValue) { if (childNode.isArray() && !childNode.isNull()) { - for (final JsonNode nodeArray : childNode) { + //for (final JsonNode nodeArray : childNode) { + for (int i=0; i events = eventFacade.findAll(); for (QuoteEvent event : events) { - if (event.getResource().getId().equals(id)) { - eventFacade.remove(event.getId()); - } +// if (event.getResource().getId().equals(id)) { +// eventFacade.remove(event.getId()); +// } } //remove resource - quoteFacade.remove(id); + quoteFacade.removeQuoteWithVersion(entity); int affectedRows = 1; Report stat = new Report(quoteFacade.count()); @@ -166,6 +171,49 @@ public Response delete(@PathParam("id") String id) throws UnknownResourceExcepti return response; } + /** + * + * For test purpose only + * @param id + * @return + * @throws UnknownResourceException + */ + @DELETE + @Path("{id}") + public Response delete(@PathParam("id") String id) throws UnknownResourceException { + int previousRows = quoteFacade.count(); + List allEntity = quoteFacade.findAllQuoteById(id); + if (null == allEntity || allEntity.isEmpty()) { + throw new UnknownResourceException(ExceptionType.UNKNOWN_RESOURCE, + "not found quote with id :" + id); + } + try { + //Pause for 4 seconds to finish notification + Thread.sleep(4000); + } catch (InterruptedException ex) { + Logger.getLogger(QuoteAdminResource.class.getName()).log(Level.SEVERE, null, ex); + } + // remove event(s) binding to the resource + List events = eventFacade.findAll(); + for (QuoteEvent event : events) { +// if (event.getResource().getId().equals(id)) { +// eventFacade.remove(event.getId()); +// } + } + //remove resource + quoteFacade.removeAllQuote(allEntity); + + int affectedRows = 1; + Report stat = new Report(quoteFacade.count()); + //stat.setAffectedRows(affectedRows); + stat.setAffectedRows(allEntity.size()); + stat.setPreviousRows(previousRows); + + // 200 + Response response = Response.ok(stat).build(); + return response; + } + @GET @Produces({"application/json"}) @Path("event") @@ -196,10 +244,10 @@ public Response deleteEvent(@PathParam("id") String id) throws UnknownResourceEx int previousRows = eventFacade.count(); List events = eventFacade.findAll(); for (QuoteEvent event : events) { - if (event.getResource().getId().equals(id)) { - eventFacade.remove(event.getId()); - - } +// if (event.getResource().getId().equals(id)) { +// eventFacade.remove(event.getId()); +// +// } } int currentRows = eventFacade.count(); int affectedRows = previousRows - currentRows; diff --git a/src/main/java/org/tmf/dsmapi/quote/QuoteFacade.java b/src/main/java/org/tmf/dsmapi/quote/QuoteFacade.java index 3f52242..01e365b 100644 --- a/src/main/java/org/tmf/dsmapi/quote/QuoteFacade.java +++ b/src/main/java/org/tmf/dsmapi/quote/QuoteFacade.java @@ -16,8 +16,12 @@ import org.tmf.dsmapi.quote.event.QuoteEventPublisherLocal; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; import org.tmf.dsmapi.quote.model.QuoteItem; +import org.tmf.dsmapi.quote.model.QuoteProductOfferingPrice; import org.tmf.dsmapi.quote.model.StateQuote; import org.tmf.dsmapi.quote.model.StateQuoteItem; @@ -42,22 +46,38 @@ protected EntityManager getEntityManager() { public void checkCreation(Quote newQuote) throws BadUsageException, UnknownResourceException { Quote quoteEntity = null; - if (newQuote.getId() == null - || newQuote.getId().isEmpty()) { + if (null == newQuote.getVersion() + || newQuote.getVersion().isEmpty()) { + //newQuote.setVersion("1.0"); + throw new BadUsageException(ExceptionType.BAD_USAGE_MANDATORY_FIELDS, "version is mandatory"); + } + + if (newQuote.getId() == null && "1.0".equals(newQuote.getVersion())) { // throw new BadUsageException(ExceptionType.BAD_USAGE_GENERIC, "While creating Quote, id must be not null"); //Do nothing create ok Logger.getLogger(QuoteFacade.class.getName()).log(Level.INFO, "Quote with autogenerated id is being posted"); - } else { - try { - quoteEntity = this.find(newQuote.getId()); - if (null != quoteEntity) { - throw new BadUsageException(ExceptionType.BAD_USAGE_GENERIC, - "Duplicate Exception, Quote with same id :" + newQuote.getId() + " alreay exists"); - } - } catch (UnknownResourceException ex) { - //Do nothing create ok - Logger.getLogger(QuoteFacade.class.getName()).log(Level.INFO, "Quote with id = " + newQuote.getId() + " is being posted", ex); + }else if ("1.0".equals(newQuote.getVersion()) && newQuote.getId().isEmpty() ) { + throw new BadUsageException(ExceptionType.BAD_USAGE_GENERIC, + "Please input correct id!"); + } + else if (newQuote.getId() != null && !newQuote.getId().isEmpty()) { + //quoteEntity = this.find(newQuote.getId()); + Map> mutableMap = new HashMap(); + List idList = new ArrayList<>(); + List versionList = new ArrayList<>(); + idList.add(newQuote.getId()); + versionList.add(newQuote.getVersion()); + mutableMap.put("id", idList); + mutableMap.put("version", versionList); + List resultList = findByCriteria(mutableMap, Quote.class); + if (!resultList.isEmpty()) { + throw new BadUsageException(ExceptionType.BAD_USAGE_GENERIC, + "Duplicate Exception, Quote with same id :" + newQuote.getId() + " and the version:" + + newQuote.getVersion() + " alreay exists"); } + } else if ((newQuote.getId() == null || newQuote.getId().isEmpty()) && !"1.0".equals(newQuote.getVersion())) { + throw new BadUsageException(ExceptionType.BAD_USAGE_GENERIC, + "The version:"+ newQuote.getVersion() +" is not 1.0 ,the quote id is mandatory."); } //verify first status @@ -69,16 +89,37 @@ public void checkCreation(Quote newQuote) throws BadUsageException, UnknownResou throw new BadUsageException(ExceptionType.BAD_USAGE_FLOW_TRANSITION, "lifecycleState " + newQuote.getState().value() + " is not the first state, attempt : " + StateQuote.IN_PROGRESS.value()); } } - - if (null == newQuote.getVersion() - || newQuote.getVersion().isEmpty()) { - newQuote.setVersion("1.0"); + if (null != newQuote.getHref()) { + throw new BadUsageException(ExceptionType.BAD_USAGE_FLOW_TRANSITION, + "Href should be generated by system"); + } + + if (null == newQuote.getQuoteDate()) { + newQuote.setQuoteDate(new Date()); + }else { + throw new BadUsageException(ExceptionType.BAD_USAGE_FLOW_TRANSITION, + "QuoteDate should be generated by system"); + } + + if (null == newQuote.getEffectiveQuoteCompletionDate()) { + newQuote.setEffectiveQuoteCompletionDate(new Date()); + }else { + throw new BadUsageException(ExceptionType.BAD_USAGE_FLOW_TRANSITION, + "EffectiveQuoteCompletionDate should be generated by system"); } if (null == newQuote.getCustomer()){ throw new BadUsageException(ExceptionType.BAD_USAGE_MANDATORY_FIELDS, "customer is mandatory"); } + if (null != newQuote.getValidFor()) { + if(null != newQuote.getValidFor().getStartDateTime() && null != newQuote.getValidFor().getEndDateTime() && + newQuote.getValidFor().getStartDateTime().after(newQuote.getValidFor().getEndDateTime())) { + throw new BadUsageException(ExceptionType.BAD_USAGE_FLOW_TRANSITION, + "ValidFor endDateTime must later than startDateTime"); + } + } + // POST Mandatory attributes within product Quote item if (null != newQuote.getQuoteItem() && !newQuote.getQuoteItem().isEmpty()) { @@ -155,8 +196,62 @@ public void checkCreation(Quote newQuote) throws BadUsageException, UnknownResou } - public Quote patchAttributs(String id, Quote partialEntity) throws UnknownResourceException, BadUsageException { - Quote currentEntity = this.find(id); + /** + *find the lasted quote version by id + */ + public Quote findQuoteById(String id) { + Map> mutableMap = new HashMap(); + List idList = new ArrayList(); + idList.add(id); + mutableMap.put("id", idList); + + List resultList = findByCriteria(mutableMap, Quote.class); + if (!resultList.isEmpty()) { + return resultList.get(0); + } + + return null; + } + + /** + *find the lasted quote version by id + */ + public List findAllQuoteById(String id) { + Map> mutableMap = new HashMap(); + List idList = new ArrayList(); + idList.add(id); + mutableMap.put("id", idList); + + List resultList = findByCriteria(mutableMap, Quote.class); + if (!resultList.isEmpty()) { + return resultList; + } + + return null; + } + + public Quote findQuoteByIdAndVersion(String id, String ver) { + Map> mutableMap = new HashMap(); + List idList = new ArrayList(); + List versionList = new ArrayList(); + idList.add(id); + versionList.add(ver); + mutableMap.put("id", idList); + if (null != ver){ + mutableMap.put("version", versionList); + } + + List resultList = findByCriteria(mutableMap, Quote.class); + if (!resultList.isEmpty()) { + return resultList.get(0); + } + + return null; + } + + public Quote patchAttributs(String id, String ver, Quote partialEntity) throws UnknownResourceException, BadUsageException { + //Quote currentEntity = this.find(id); + Quote currentEntity = findQuoteByIdAndVersion(id, ver); if (currentEntity == null) { throw new UnknownResourceException(ExceptionType.UNKNOWN_RESOURCE); @@ -167,7 +262,10 @@ public Quote patchAttributs(String id, Quote partialEntity) throws UnknownResour ObjectMapper mapper = new ObjectMapper(); JsonNode node = mapper.convertValue(partialEntity, JsonNode.class); partialEntity.setId(id); + partialEntity.setVersion(ver); // appel de la methode pour patcher l'entity + + //checkPatchAttributs(currentEntity, partialEntity); if (BeanUtils.patch(currentEntity, partialEntity, node)) { publisher.valueChangedNotification(currentEntity, new Date()); } @@ -182,54 +280,211 @@ public void verifyStatus(Quote currentEntity, Quote partialEntity) throws BadUsa } } - public Quote checkPatchAttributs(long id, Quote partialEntity) throws UnknownResourceException, BadUsageException { - Quote currentEntity = this.find(id); + public void checkPatchAttributs(Quote entity, Quote newEntity) throws UnknownResourceException, BadUsageException { - if (currentEntity == null) { - throw new UnknownResourceException(ExceptionType.UNKNOWN_RESOURCE); + if (null == newEntity){ + throw new BadUsageException(ExceptionType.BAD_USAGE_OPERATOR, "quote id and version is not patchable"); } - - if (null != partialEntity.getState()) { - stateModel.checkTransition(currentEntity.getState(), partialEntity.getState()); + if (null != newEntity.getState() && !newEntity.getState().equals(entity.getState())) { + stateModel.checkTransition(entity.getState(), newEntity.getState()); System.out.println("About to publish statusChangedNotification "); - publisher.statusChangedNotification(currentEntity, new Date()); + publisher.statusChangedNotification(entity, new Date()); } else { System.out.println("No State detectd "); //throw new BadUsageException(ExceptionType.BAD_USAGE_MANDATORY_FIELDS, "state" + " is not found"); } - - if (null != partialEntity.getId()) { + + /**check quote id*/ + if (null != newEntity.getId() && !entity.getId().equals(newEntity.getId())) { throw new BadUsageException(ExceptionType.BAD_USAGE_OPERATOR, "id is not patchable"); } - - if (null != partialEntity.getHref()) { + + /**check quote href*/ + if (null != newEntity.getHref() && !entity.getHref().equals(newEntity.getHref()) ) { throw new BadUsageException(ExceptionType.BAD_USAGE_OPERATOR, "href is not patchable"); } - - if (null != partialEntity.getExternalId()) { + + /**check quote externalid*/ + if ((null == newEntity && null !=entity.getExternalId()) || + (null != newEntity && !newEntity.getExternalId().equals(entity.getExternalId()))) { throw new BadUsageException(ExceptionType.BAD_USAGE_OPERATOR, "externalId not patchable"); } + + /**check quote description*/ + if ((null == newEntity && null !=entity.getDescription()) || + (null != newEntity && !newEntity.getDescription().equals(entity.getDescription()))) { + if (null != entity.getState() && !entity.getState().name().equalsIgnoreCase(StateQuote.IN_PROGRESS.name()) && + !entity.getState().name().equalsIgnoreCase(StateQuote.PENDING.name()) ) { + throw new BadUsageException(ExceptionType.BAD_USAGE_FLOW_TRANSITION, + "Description is patchable only when quote state is Pending or InProgress"); + } + } - if (null != partialEntity.getState()) { - if (partialEntity.getState().name().equalsIgnoreCase(StateQuote.IN_PROGRESS.name())) { - if (null != currentEntity.getQuoteItem() - && !currentEntity.getQuoteItem().isEmpty()) { - for (QuoteItem quoteItem : currentEntity.getQuoteItem()) { - if (null == quoteItem.getState()) { - quoteItem.setState(StateQuoteItem.IN_PROGRESS); - } else { - if (!quoteItem.getState().name().equalsIgnoreCase(StateQuoteItem.IN_PROGRESS.name())) { - throw new BadUsageException(ExceptionType.BAD_USAGE_FLOW_TRANSITION, "lifecycleState QuoteItem state InProgress is mandatory with Quote State InProgress"); - } - } + /**check quote Category*/ + if (!entity.getCategory().equals(newEntity.getCategory())) { + if (null != entity.getState() && !entity.getState().name().equalsIgnoreCase(StateQuote.IN_PROGRESS.name()) && + !entity.getState().name().equalsIgnoreCase(StateQuote.PENDING.name()) ) { + throw new BadUsageException(ExceptionType.BAD_USAGE_FLOW_TRANSITION, + "Category is patchable only when quote state is Pending or InProgress"); + } + } + + /**check quote state*/ + checkQuoteStateForPatch(entity, newEntity); + + /**check quote version*/ + if (!entity.getVersion().equals(newEntity.getVersion())) { + throw new BadUsageException(ExceptionType.BAD_USAGE_OPERATOR, "version is not patchable"); + } + + /**check quotedate*/ + if (!entity.getQuoteDate().toString().equals(newEntity.getQuoteDate().toString())) { + System.out.println((entity.getQuoteDate().toString())); + System.out.println(newEntity.getQuoteDate().toString()); + throw new BadUsageException(ExceptionType.BAD_USAGE_OPERATOR, "quoteDate is not patchable"); + } + + /**check quote EffectiveQuoteCompletionDate*/ + if (!entity.getEffectiveQuoteCompletionDate().toString().equals(newEntity.getEffectiveQuoteCompletionDate().toString())) { + throw new BadUsageException(ExceptionType.BAD_USAGE_OPERATOR, "effectiveQuoteCompletionDate is not patchable"); + } + + /**check quote QuoteCompletionDate*/ + if ((null == newEntity.getQuoteCompletionDate() && null != entity.getQuoteCompletionDate()) || + (null != newEntity.getQuoteCompletionDate() && !entity.getQuoteCompletionDate().toString().equals(entity.getQuoteCompletionDate().toString()))){ + if(! entity.getState().name().equalsIgnoreCase(StateQuote.PENDING.name())){ + throw new BadUsageException(ExceptionType.BAD_USAGE_OPERATOR, "quoteCompletionDate is patchable only when quote state is Pending"); + } + } + + /**check quote ValidFor*/ + if ((null == newEntity.getValidFor() && null != entity.getValidFor()) + ||(null != newEntity.getValidFor() && !newEntity.getValidFor().equals(entity.getValidFor()))) { + if( !entity.getState().name().equalsIgnoreCase(StateQuote.PENDING.name())){ + throw new BadUsageException(ExceptionType.BAD_USAGE_OPERATOR, "ValidFor is patchable only when quote state is Pending"); + } + if(newEntity.getValidFor().getStartDateTime().after(newEntity.getValidFor().getEndDateTime())) { + throw new BadUsageException(ExceptionType.BAD_USAGE_OPERATOR, "ValidFor endDateTime must later than startDateTime"); + } + } + + /**check quote BillingAccount*/ + checkBillingAccountForPatch( entity, newEntity); + + /**check quote Note*/ + checkNoteForPatch( entity, newEntity); + + /**check quote Customer*/ + if (!entity.getCustomer().equals(newEntity.getCustomer())) { + throw new BadUsageException(ExceptionType.BAD_USAGE_OPERATOR, "Customer is not patchable"); + } + + /**check quote Characteristic*/ + checkCharacteristicForPatch( entity, newEntity); + + /**check quote RelatedParty*/ + checkRelatedPartyForPatch( entity, newEntity); + + /**check quote Agreement*/ + checkAgreementForPatch( entity, newEntity); + + /**check quote QuoteAuthorization*/ + checkQuoteAuthorizationForPatch( entity, newEntity); + + /**check quote QuoteProductOfferingPrice*/ + checkQuoteProductOfferingPriceForPatch(entity, newEntity); + + + +// if (null != newEntity.getQuoteItem()) { +// if (null != newEntity.getQuoteItem() +// && !newEntity.getQuoteItem().isEmpty()) { +// List l_quoteItem = newEntity.getQuoteItem(); +// for (QuoteItem quoteItem : l_quoteItem) { +// if (null != quoteItem.getId()) { +// throw new BadUsageException(ExceptionType.BAD_USAGE_OPERATOR, "quoteItem.id not patchable"); +// } +// if (null != quoteItem.getState() && quoteItem.getState().name().equalsIgnoreCase(StateQuote.PENDING.name())) { +// if (null != newEntity.getState() && ! newEntity.getState().name().equalsIgnoreCase(StateQuote.PENDING.name())) { +// throw new BadUsageException(ExceptionType.BAD_USAGE_FLOW_TRANSITION, "lifecycleState QuoteItem state InProgress only with Quote State Pending"); +// } +// newEntity.setState(StateQuote.PENDING); +// } +// if (null != quoteItem.getState() && quoteItem.getState().name().equalsIgnoreCase(StateQuote.REJECTED.name())) { +// if (null != newEntity.getState() && ! newEntity.getState().name().equalsIgnoreCase(StateQuote.REJECTED.name())) { +// throw new BadUsageException(ExceptionType.BAD_USAGE_FLOW_TRANSITION, "lifecycleState QuoteItem state Rejected only with Quote State Rejected"); +// } +// newEntity.setState(StateQuote.REJECTED); +// } +// if (null != quoteItem.getState() && quoteItem.getState().name().equalsIgnoreCase(StateQuote.APPROVED.name())) { +// if (null != newEntity.getState() && ! newEntity.getState().name().equalsIgnoreCase(StateQuote.APPROVED.name())) { +// throw new BadUsageException(ExceptionType.BAD_USAGE_FLOW_TRANSITION, "lifecycleState QuoteItem state Approved only with Quote State Approved"); +// } +// } +// if (null != quoteItem.getAttachment()) { +// if ( (null != newEntity.getState() && ! newEntity.getState().name().equalsIgnoreCase(StateQuote.PENDING.name())) +// && !newEntity.getState().name().equalsIgnoreCase(StateQuote.IN_PROGRESS.name())) { +// throw new BadUsageException(ExceptionType.BAD_USAGE_OPERATOR, "quoteItem.attachment not patchable when Quote state is Pending or InProgress"); +// } +// } +// if (null != quoteItem.getRelatedParty()) { +// if ( (null != newEntity.getState() && ! newEntity.getState().name().equalsIgnoreCase(StateQuote.PENDING.name())) +// && ! newEntity.getState().name().equalsIgnoreCase(StateQuote.IN_PROGRESS.name())) { +// throw new BadUsageException(ExceptionType.BAD_USAGE_OPERATOR, "quoteItem.relatedParty not patchable when Quote state is Pending or InProgress"); +// } +// } +// if (null != quoteItem.getProductOffering()) { +// if ( (null != newEntity.getState() && ! newEntity.getState().name().equalsIgnoreCase(StateQuote.PENDING.name())) +// && !newEntity.getState().name().equalsIgnoreCase(StateQuote.IN_PROGRESS.name())) { +// throw new BadUsageException(ExceptionType.BAD_USAGE_OPERATOR, "quoteItem.productOffering not patchable when Quote state is Pending or InProgress"); +// } +// } +// if (null != quoteItem.getNote()) { +// if ( (null != newEntity.getState() && ! newEntity.getState().name().equalsIgnoreCase(StateQuote.PENDING.name())) +// && !newEntity.getState().name().equalsIgnoreCase(StateQuote.IN_PROGRESS.name())) { +// throw new BadUsageException(ExceptionType.BAD_USAGE_OPERATOR, "quoteItem.note not patchable when Quote state is Pending or InProgress"); +// } +// } +// if (null != quoteItem.getItemQuoteAuthorization()) { +// if ( (null != newEntity.getState() && ! newEntity.getState().name().equalsIgnoreCase(StateQuote.PENDING.name())) || +// (null != quoteItem.getState() && !quoteItem.getState().name().equalsIgnoreCase(StateQuote.PENDING.name())) ) { +// throw new BadUsageException(ExceptionType.BAD_USAGE_OPERATOR, "quoteItem.itemQuoteAuthorization not patchable when Quote state and QuoteItem state are Pending"); +// } +// } +// if (null != quoteItem.getItemQuoteProductOfferingPrice()) { +// if ( (null != newEntity.getState() && ! newEntity.getState().name().equalsIgnoreCase(StateQuote.PENDING.name())) +// && !newEntity.getState().name().equalsIgnoreCase(StateQuote.IN_PROGRESS.name())) { +// throw new BadUsageException(ExceptionType.BAD_USAGE_OPERATOR, "quoteItem.itemQuoteProductOfferingPrice not patchable when Quote state is Pending or InProgress"); +// } +// } +// } +// } +// } + + } + + public void checkQuoteStateForPatch(Quote entity, Quote newEntity) throws UnknownResourceException, BadUsageException{ + if (null != newEntity.getState()) { + if (newEntity.getState().name().equalsIgnoreCase(StateQuote.IN_PROGRESS.name())) { + if (null != newEntity.getQuoteItem() + && !newEntity.getQuoteItem().isEmpty()) { + for (QuoteItem quoteItem : newEntity.getQuoteItem()) { +// if (null == quoteItem.getState()) { + quoteItem.setState(StateQuoteItem.IN_PROGRESS); +// } else { +// if (!quoteItem.getState().name().equalsIgnoreCase(StateQuoteItem.IN_PROGRESS.name())) { +// throw new BadUsageException(ExceptionType.BAD_USAGE_FLOW_TRANSITION, "lifecycleState QuoteItem state InProgress is mandatory with Quote State InProgress"); +// } +// } } } + } - if (partialEntity.getState().name().equalsIgnoreCase(StateQuote.PENDING.name())) { - if (null != currentEntity.getQuoteItem() - && !currentEntity.getQuoteItem().isEmpty()) { - for (QuoteItem quoteItem : currentEntity.getQuoteItem()) { + if (newEntity.getState().name().equalsIgnoreCase(StateQuote.PENDING.name())) { + if (null != entity.getQuoteItem() + && !entity.getQuoteItem().isEmpty()) { + for (QuoteItem quoteItem : entity.getQuoteItem()) { if (null == quoteItem.getState()) { quoteItem.setState(StateQuoteItem.IN_PROGRESS); } else { @@ -240,25 +495,27 @@ public Quote checkPatchAttributs(long id, Quote partialEntity) throws UnknownRes } } } + } - if (partialEntity.getState().name().equalsIgnoreCase(StateQuote.APPROVED.name())) { - if (null != currentEntity.getQuoteItem() - && !currentEntity.getQuoteItem().isEmpty()) { - for (QuoteItem quoteItem : currentEntity.getQuoteItem()) { - if (null == quoteItem.getState()) { + if (newEntity.getState().name().equalsIgnoreCase(StateQuote.APPROVED.name())) { + if (null != newEntity.getQuoteItem() + && !newEntity.getQuoteItem().isEmpty()) { + for (QuoteItem quoteItem : newEntity.getQuoteItem()) { + // if (null == quoteItem.getState()) { quoteItem.setState(StateQuoteItem.APPROVED); - } else { - if (!quoteItem.getState().name().equalsIgnoreCase(StateQuoteItem.APPROVED.name())) { - throw new BadUsageException(ExceptionType.BAD_USAGE_FLOW_TRANSITION, "lifecycleState QuoteItem state Approvec is mandatory with Quote State Approvec"); - } - } + // } else { + // if (!quoteItem.getState().name().equalsIgnoreCase(StateQuoteItem.APPROVED.name())) { + // throw new BadUsageException(ExceptionType.BAD_USAGE_FLOW_TRANSITION, "lifecycleState QuoteItem state Approved is mandatory with Quote State Approved"); + // } + // } } } + } - if (partialEntity.getState().name().equalsIgnoreCase(StateQuote.CANCELLED.name())) { - if (null != currentEntity.getQuoteItem() - && !currentEntity.getQuoteItem().isEmpty()) { - for (QuoteItem quoteItem : currentEntity.getQuoteItem()) { + if (newEntity.getState().name().equalsIgnoreCase(StateQuote.CANCELLED.name())) { + if (null != entity.getQuoteItem() + && !entity.getQuoteItem().isEmpty()) { + for (QuoteItem quoteItem : entity.getQuoteItem()) { if (null == quoteItem.getState()) { quoteItem.setState(StateQuoteItem.IN_PROGRESS); } else { @@ -269,25 +526,27 @@ public Quote checkPatchAttributs(long id, Quote partialEntity) throws UnknownRes } } } + } - if (partialEntity.getState().name().equalsIgnoreCase(StateQuote.ACCEPTED.name())) { - if (null != currentEntity.getQuoteItem() - && !currentEntity.getQuoteItem().isEmpty()) { - for (QuoteItem quoteItem : currentEntity.getQuoteItem()) { + if (newEntity.getState().name().equalsIgnoreCase(StateQuote.ACCEPTED.name())) { + if (null != entity.getQuoteItem() + && !entity.getQuoteItem().isEmpty()) { + for (QuoteItem quoteItem : entity.getQuoteItem()) { if (null == quoteItem.getState()) { quoteItem.setState(StateQuoteItem.APPROVED); } else { if (!quoteItem.getState().name().equalsIgnoreCase(StateQuoteItem.APPROVED.name())) { - throw new BadUsageException(ExceptionType.BAD_USAGE_FLOW_TRANSITION, "lifecycleState QuoteItem state Approvec is mandatory with Quote State Accepted"); + throw new BadUsageException(ExceptionType.BAD_USAGE_FLOW_TRANSITION, "lifecycleState QuoteItem state Approved is mandatory with Quote State Accepted"); } } } } + } - if (partialEntity.getState().name().equalsIgnoreCase(StateQuote.REJECTED.name())) { - if (null != currentEntity.getQuoteItem() - && !currentEntity.getQuoteItem().isEmpty()) { - for (QuoteItem quoteItem : currentEntity.getQuoteItem()) { + if (newEntity.getState().name().equalsIgnoreCase(StateQuote.REJECTED.name())) { + if (null != entity.getQuoteItem() + && !entity.getQuoteItem().isEmpty()) { + for (QuoteItem quoteItem : entity.getQuoteItem()) { if (null == quoteItem.getState()) { quoteItem.setState(StateQuoteItem.REJECTED); } else { @@ -298,115 +557,169 @@ public Quote checkPatchAttributs(long id, Quote partialEntity) throws UnknownRes } } } + } } - - if (null != partialEntity.getVersion() || !partialEntity.getVersion().isEmpty()) { - throw new BadUsageException(ExceptionType.BAD_USAGE_OPERATOR, "version is not patchable"); - } - - if (null != partialEntity.getQuoteDate()) { - throw new BadUsageException(ExceptionType.BAD_USAGE_OPERATOR, "quoteDate is not patchable"); - } - - if (null != partialEntity.getEffectiveQuoteCompletionDate()) { - throw new BadUsageException(ExceptionType.BAD_USAGE_OPERATOR, "effectiveQuoteCompletionDate is not patchable"); - } - - if (null != partialEntity.getQuoteCompletionDate()) { - if( ! partialEntity.getState().name().equalsIgnoreCase(StateQuote.PENDING.name())){ - throw new BadUsageException(ExceptionType.BAD_USAGE_OPERATOR, "quoteCompletionDate is patchable only when quote state is Pending"); + } + public void checkNoteForPatch(Quote entity, Quote newEntity) throws UnknownResourceException, BadUsageException{ + if (null == newEntity.getNote()&& null != entity.getNote()) { + if( (!entity.getState().name().equalsIgnoreCase(StateQuote.PENDING.name())) + && !entity.getState().name().equalsIgnoreCase(StateQuote.IN_PROGRESS.name())){ + throw new BadUsageException(ExceptionType.BAD_USAGE_OPERATOR, "Note is patchable only when quote state is Pending or InProgress"); } - } - - if (null != partialEntity.getValidFor()) { - if( ! partialEntity.getState().name().equalsIgnoreCase(StateQuote.PENDING.name())){ - throw new BadUsageException(ExceptionType.BAD_USAGE_OPERATOR, "ValidFor is patchable only when quote state is Pending"); + }else if(null != newEntity.getNote()) { + if( null == entity.getNote() || newEntity.getNote().size()!=entity.getNote().size()) { + if( (!entity.getState().name().equalsIgnoreCase(StateQuote.PENDING.name())) + && !entity.getState().name().equalsIgnoreCase(StateQuote.IN_PROGRESS.name())){ + throw new BadUsageException(ExceptionType.BAD_USAGE_OPERATOR, "Note is patchable only when quote state is Pending or InProgress"); + } + }else{ + for (int i=0; i l_quoteItem = partialEntity.getQuoteItem(); - for (QuoteItem quoteItem : l_quoteItem) { - if (null != quoteItem.getId()) { - throw new BadUsageException(ExceptionType.BAD_USAGE_OPERATOR, "quoteItem.id not patchable"); - } - if (quoteItem.getState().name().equalsIgnoreCase(StateQuote.PENDING.name())) { - if ( ! partialEntity.getState().name().equalsIgnoreCase(StateQuote.PENDING.name())) { - throw new BadUsageException(ExceptionType.BAD_USAGE_FLOW_TRANSITION, "lifecycleState QuoteItem state InProgress only with Quote State Pending"); - } - } - if (quoteItem.getState().name().equalsIgnoreCase(StateQuote.REJECTED.name())) { - if ( ! partialEntity.getState().name().equalsIgnoreCase(StateQuote.REJECTED.name())) { - throw new BadUsageException(ExceptionType.BAD_USAGE_FLOW_TRANSITION, "lifecycleState QuoteItem state Rejected only with Quote State Rejected"); - } - } - if (null != quoteItem.getAttachment()) { - if ( (! partialEntity.getState().name().equalsIgnoreCase(StateQuote.PENDING.name())) - && partialEntity.getState().name().equalsIgnoreCase(StateQuote.IN_PROGRESS.name())) { - throw new BadUsageException(ExceptionType.BAD_USAGE_OPERATOR, "quoteItem.attachment not patchable when Quote state is Pending or InProgress"); + }else{ + for (int i=0; i findByCriteria(Map> criteria) throws Bad } } + @GET @Path("{id}") @Produces({"application/json"}) - public Response get(@PathParam("id") String id, @Context UriInfo info) throws UnknownResourceException { + public Response get(@PathParam("id") String id, @Context UriInfo info) throws UnknownResourceException { - // search queryParameters - MultivaluedMap queryParameters = info.getQueryParameters(); + Set fieldSet = getFieldSet(info); - Map> mutableMap = new HashMap(); - for (Map.Entry> e : queryParameters.entrySet()) { - mutableMap.put(e.getKey(), e.getValue()); + //Quote quote = quoteFacade.find(id); + Quote quote = quoteFacade.findQuoteById(id); + Response response; + + // If the result list (list of bills) is not empty, it conains only 1 unique bill + if (quote != null) { + // 200 + if (fieldSet.isEmpty() || fieldSet.contains(URIParser.ALL_FIELDS)) { + response = Response.ok(quote).build(); + } else { + fieldSet.add(URIParser.ID_FIELD); + ObjectNode node = Jackson.createNode(quote, fieldSet); + response = Response.ok(node).build(); + } + } else { + // 404 not found + response = Response.status(Response.Status.NOT_FOUND).build(); } + return response; + } - // fields to filter view - Set fieldSet = URIParser.getFieldsSelection(mutableMap); + + @GET + @Path("{id}:(version={version})") + @Produces({"application/json"}) + public Response getByVersion(@PathParam("id") String id,@PathParam("version") String ver, @Context UriInfo info) throws BadUsageException { - Quote quote = quoteFacade.find(id); + Set fieldSet = getFieldSet(info); + + Quote quote = quoteFacade.findQuoteByIdAndVersion(id,ver); Response response; - + // If the result list (list of bills) is not empty, it conains only 1 unique bill if (quote != null) { // 200 @@ -138,15 +162,30 @@ public Response get(@PathParam("id") String id, @Context UriInfo info) throws Un response = Response.status(Response.Status.NOT_FOUND).build(); } return response; + } - + @PATCH @Path("{id}") @Consumes({"application/json"}) @Produces({"application/json"}) public Response patch(@PathParam("id") String id, Quote partialEntity) throws BadUsageException, UnknownResourceException { Response response = null; - Quote currentEntity = quoteFacade.patchAttributs(id, partialEntity); + Quote currentEntity = quoteFacade.patchAttributs(id, null, partialEntity); + + // 200 OK + location + response = Response.status(Response.Status.OK).entity(currentEntity).build(); + + return response; + } + + @PATCH + @Path("{id}:(version={version})") + @Consumes({"application/json"}) + @Produces({"application/json"}) + public Response patchWithVersion(@PathParam("id") String id,@PathParam("version") String ver, Quote partialEntity) throws BadUsageException, UnknownResourceException { + Response response = null; + Quote currentEntity = quoteFacade.patchAttributs(id, ver, partialEntity); // 200 OK + location response = Response.status(Response.Status.OK).entity(currentEntity).build(); @@ -161,8 +200,12 @@ public Response patch(@PathParam("id") String id, Quote partialEntity) throws Ba public Response jsonPatch(@PathParam("id") String id, JsonPatch patch) throws BadUsageException, UnknownResourceException, JsonPatchException, JsonProcessingException { Response response = null; //recup de l'entity persistée - Quote currentEntity = quoteFacade.find(id); - + //Quote currentEntity = quoteFacade.find(id); + Quote currentEntity = quoteFacade.findQuoteById(id); + if (currentEntity == null) { + throw new BadUsageException(ExceptionType.BAD_USAGE_GENERIC, + "not found quote with id :" + id ); + } //creation d'un JsonNode avec l'entity persistée ObjectMapper mapper = new ObjectMapper(); JsonNode currentNode = mapper.convertValue(currentEntity, JsonNode.class); @@ -171,12 +214,43 @@ public Response jsonPatch(@PathParam("id") String id, JsonPatch patch) throws Ba //transforme le JsonNode en Bean Quote patchCategory = mapper.treeToValue(patchedNode, Quote.class); //appel à la persistence + //check for modify + quoteFacade.checkPatchAttributs(currentEntity,patchCategory); quoteFacade.edit(patchCategory); // 200 OK + location response = Response.status(Response.Status.OK).entity(patchCategory).build(); return response; } + @PATCH + @Path("{id}:(version={version})") + @Consumes("application/json-patch+json") + @Produces({"application/json"}) + public Response jsonPatchWithVersion(@PathParam("id") String id ,@PathParam("version") String ver, JsonPatch patch) throws BadUsageException, UnknownResourceException, JsonPatchException, JsonProcessingException { + Response response = null; + //recup de l'entity persistée + //Quote currentEntity = quoteFacade.find(id); + Quote currentEntity = quoteFacade.findQuoteByIdAndVersion(id, ver); + if (currentEntity == null) { + throw new BadUsageException(ExceptionType.BAD_USAGE_GENERIC, + "not found quote with id :" + id + " and the version :" + ver); + } + //creation d'un JsonNode avec l'entity persistée + ObjectMapper mapper = new ObjectMapper(); + JsonNode currentNode = mapper.convertValue(currentEntity, JsonNode.class); + //patch de ce jsonNode + final JsonNode patchedNode = patch.apply(currentNode); + //transforme le JsonNode en Bean + Quote patchCategory = mapper.treeToValue(patchedNode, Quote.class); + ////check for modify + quoteFacade.checkPatchAttributs(currentEntity,patchCategory); + //appel à la persistence + quoteFacade.edit(patchCategory); + // 200 OK + location + response = Response.status(Response.Status.OK).entity(patchCategory).build(); + return response; + } + @POST @Path("getjsonpatch/{id}") @Consumes({"application/json"}) @@ -196,4 +270,18 @@ public Response getJsonPatch(@PathParam("id") String id, Quote patchEntity) thro return response; } + private Set getFieldSet(UriInfo info) { + // search queryParameters + MultivaluedMap queryParameters = info.getQueryParameters(); + + Map> mutableMap = new HashMap(); + for (Map.Entry> e : queryParameters.entrySet()) { + mutableMap.put(e.getKey(), e.getValue()); + } + + // fields to filter view + Set fieldSet = URIParser.getFieldsSelection(mutableMap); + + return fieldSet; + } } diff --git a/src/main/java/org/tmf/dsmapi/quote/event/QuoteEvent.java b/src/main/java/org/tmf/dsmapi/quote/event/QuoteEvent.java index cbb8c82..e5b2b98 100644 --- a/src/main/java/org/tmf/dsmapi/quote/event/QuoteEvent.java +++ b/src/main/java/org/tmf/dsmapi/quote/event/QuoteEvent.java @@ -7,6 +7,9 @@ import javax.persistence.Enumerated; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; +import javax.persistence.OneToOne; +import javax.persistence.JoinColumn; +import javax.persistence.JoinColumns; import javax.persistence.Id; import javax.persistence.Table; import javax.persistence.Temporal; @@ -19,6 +22,8 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import javax.persistence.CascadeType; +import javax.persistence.FetchType; import org.tmf.dsmapi.commons.utils.CustomJsonDateSerializer; import org.tmf.dsmapi.quote.model.Quote; @@ -40,7 +45,13 @@ public class QuoteEvent implements Serializable { @Enumerated(value = EnumType.STRING) private QuoteEventTypeEnum eventType; - private Quote resource; //check for object +// @JsonIgnore +// @OneToOne(targetEntity = Quote.class, cascade ={ CascadeType.MERGE, CascadeType.REFRESH, CascadeType.REMOVE, CascadeType.DETACH}, fetch = FetchType.EAGER) +// @JoinColumns({ +// @JoinColumn(name="QUOTE_ID", referencedColumnName="ID"), +// @JoinColumn(name="QUOTE_VERSION", referencedColumnName="VERSION_") +// }) +// private Quote resource; //check for object @JsonProperty("eventId") public String getId() { @@ -67,14 +78,14 @@ public void setEventType(QuoteEventTypeEnum eventType) { this.eventType = eventType; } - @JsonIgnore - public Quote getResource() { - return resource; - } - - public void setResource(Quote resource) { - this.resource = resource; - } + +// public Quote getResource() { +// return resource; +// } +// +// public void setResource(Quote resource) { +// this.resource = resource; +// } @JsonAutoDetect(fieldVisibility = ANY) class EventBody { @@ -87,14 +98,16 @@ public EventBody(Quote entity) { } } - @JsonProperty("event") - public EventBody getEvent() { - return new EventBody(getResource() ); - } +// @JsonProperty("event") +// public EventBody getEvent() { +// return new EventBody(getResource() ); +// } @Override public String toString() { - return "QuoteEvent{" + "id=" + id + ", eventTime=" + eventTime + ", eventType=" + eventType + ", event=" + resource + '}'; + return "QuoteEvent{" + "id=" + id + ", eventTime=" + eventTime + ", eventType=" + eventType + //+ ", event=" + resource + + '}'; } } diff --git a/src/main/java/org/tmf/dsmapi/quote/event/QuoteEventPublisher.java b/src/main/java/org/tmf/dsmapi/quote/event/QuoteEventPublisher.java index e008151..0b29082 100644 --- a/src/main/java/org/tmf/dsmapi/quote/event/QuoteEventPublisher.java +++ b/src/main/java/org/tmf/dsmapi/quote/event/QuoteEventPublisher.java @@ -58,7 +58,7 @@ public void createNotification(Quote bean, Date date) { QuoteEvent event = new QuoteEvent(); event.setEventTime(date); event.setEventType(QuoteEventTypeEnum.QuoteCreationNotification); - event.setResource(bean); + //event.setResource(bean); publish(event); } @@ -68,7 +68,7 @@ public void deletionNotification(Quote bean, Date date) { QuoteEvent event = new QuoteEvent(); event.setEventTime(date); event.setEventType(QuoteEventTypeEnum.QuoteDeletionNotification); - event.setResource(bean); + //event.setResource(bean); publish(event); } @@ -77,7 +77,7 @@ public void updateNotification(Quote bean, Date date) { QuoteEvent event = new QuoteEvent(); event.setEventTime(date); event.setEventType(QuoteEventTypeEnum.QuoteUpdateNotification); - event.setResource(bean); + //event.setResource(bean); publish(event); } @@ -86,7 +86,7 @@ public void valueChangedNotification(Quote bean, Date date) { QuoteEvent event = new QuoteEvent(); event.setEventTime(date); event.setEventType(QuoteEventTypeEnum.QuoteValueChangeNotification); - event.setResource(bean); + //event.setResource(bean); publish(event); } @@ -95,7 +95,7 @@ public void statusChangedNotification(Quote bean, Date date) { QuoteEvent event = new QuoteEvent(); event.setEventTime(date); event.setEventType(QuoteEventTypeEnum.QuoteStatusChangedNotification); - event.setResource(bean); + //event.setResource(bean); publish(event); } diff --git a/src/main/java/org/tmf/dsmapi/quote/model/Agreement.java b/src/main/java/org/tmf/dsmapi/quote/model/Agreement.java index 72c1f08..7636181 100644 --- a/src/main/java/org/tmf/dsmapi/quote/model/Agreement.java +++ b/src/main/java/org/tmf/dsmapi/quote/model/Agreement.java @@ -175,4 +175,28 @@ public void setHjid(Long value) { this.hjid = value; } + public boolean equals(Agreement agreement) { + + if ((null!=this.getName() && null!= agreement.getName() + && !this.getName().equals(agreement.getName())) + || null!=this.getName()&& null==agreement.getName() + || null==this.getName()&& null!=agreement.getName() ) { + return false; + } + if ((null!=this.getId()&& null!= agreement.getId() + && !this.getId().equals(agreement.getId())) + || null!=this.getId()&& null==agreement.getId() + || null==this.getId()&& null!=agreement.getId() ) { + return false; + } + if ((null!=this.getHref()&& null!= agreement.getHref() + && !this.getHref().equals(agreement.getHref())) + || null!=this.getHref()&& null==agreement.getHref() + || null==this.getHref()&& null!=agreement.getHref() ) { + return false; + } + + return true; + } + } diff --git a/src/main/java/org/tmf/dsmapi/quote/model/Attachment.java b/src/main/java/org/tmf/dsmapi/quote/model/Attachment.java index 7548370..526f5f5 100644 --- a/src/main/java/org/tmf/dsmapi/quote/model/Attachment.java +++ b/src/main/java/org/tmf/dsmapi/quote/model/Attachment.java @@ -175,4 +175,22 @@ public void setHjid(Long value) { this.hjid = value; } + public boolean equals(Attachment attachment) { + if (null!=this.getId() && null!=attachment.getId() && !this.getId().equals(attachment.getId()) + || null!=this.getId()&& null==attachment.getId() + || null==this.getId()&& null!=attachment.getId()) { + return false; + } + if (null!=this.getHref()&& null!=attachment.getHref() && !this.getHref().equals(attachment.getHref()) + || null!=this.getHref()&& null==attachment.getHref() + || null==this.getHref()&& null!=attachment.getHref()) { + return false; + } + if (null!=this.getType()&& null!=attachment.getType() && !this.getType().equals(attachment.getType()) + || null!=this.getType()&& null==attachment.getType() + || null==this.getType()&& null!=attachment.getType()) { + return false; + } + return true; + } } diff --git a/src/main/java/org/tmf/dsmapi/quote/model/BillingAccount.java b/src/main/java/org/tmf/dsmapi/quote/model/BillingAccount.java index 7b85d2c..5301913 100644 --- a/src/main/java/org/tmf/dsmapi/quote/model/BillingAccount.java +++ b/src/main/java/org/tmf/dsmapi/quote/model/BillingAccount.java @@ -145,5 +145,22 @@ public Long getHjid() { public void setHjid(Long value) { this.hjid = value; } + + public boolean equals(BillingAccount billingAccount) { + if ((null!=this.getId()&& null!= billingAccount.getId() + && !this.getId().equals(billingAccount.getId())) + || null!=this.getId()&& null==billingAccount.getId() + || null==this.getId()&& null!=billingAccount.getId() ) { + return false; + } + if ((null!=this.getHref()&& null!= billingAccount.getHref() + && !this.getHref().equals(billingAccount.getHref())) + || null!=this.getHref()&& null==billingAccount.getHref() + || null==this.getHref()&& null!=billingAccount.getHref() ) { + return false; + } + + return true; + } } diff --git a/src/main/java/org/tmf/dsmapi/quote/model/Characteristic.java b/src/main/java/org/tmf/dsmapi/quote/model/Characteristic.java index 5cf379f..b8fb618 100644 --- a/src/main/java/org/tmf/dsmapi/quote/model/Characteristic.java +++ b/src/main/java/org/tmf/dsmapi/quote/model/Characteristic.java @@ -146,4 +146,20 @@ public void setHjid(Long value) { this.hjid = value; } + public boolean equals(Characteristic charac) { + if ((null!=this.getName() && null!= charac.getName() + && !this.getName().equals(charac.getName())) + || null!=this.getName()&& null==charac.getName() + || null==this.getName()&& null!=charac.getName()) { + return false; + } + if ((null!=this.getValue()&& null!= charac.getValue() + && !this.getValue().equals(charac.getValue())) + || null!=this.getValue()&& null==charac.getValue() + || null==this.getValue()&& null!=charac.getValue() ) { + return false; + } + + return true; + } } diff --git a/src/main/java/org/tmf/dsmapi/quote/model/Customer.java b/src/main/java/org/tmf/dsmapi/quote/model/Customer.java index 0684161..2ceb6c2 100644 --- a/src/main/java/org/tmf/dsmapi/quote/model/Customer.java +++ b/src/main/java/org/tmf/dsmapi/quote/model/Customer.java @@ -175,4 +175,27 @@ public void setHjid(Long value) { this.hjid = value; } + public boolean equals(Customer cus) { + if ((null!=this.getId()&& null!= cus.getId() + && !this.getId().equals(cus.getId())) + || null!=this.getId()&& null==cus.getId() + || null==this.getId()&& null!=cus.getId() ) { + return false; + } + if ((null!=this.getName()&& null!= cus.getName() + && !this.getName().equals(cus.getName())) + || null!=this.getName()&& null==cus.getName() + || null==this.getName()&& null!=cus.getName() ) { + return false; + } + + if ((null!=this.getHref()&& null!= cus.getHref() + && !this.getHref().equals(cus.getHref())) + || null!=this.getHref()&& null==cus.getHref() + || null==this.getHref()&& null!=cus.getHref() ) { + return false; + } + return true; + } + } diff --git a/src/main/java/org/tmf/dsmapi/quote/model/Note.java b/src/main/java/org/tmf/dsmapi/quote/model/Note.java index 7a75667..966ef00 100644 --- a/src/main/java/org/tmf/dsmapi/quote/model/Note.java +++ b/src/main/java/org/tmf/dsmapi/quote/model/Note.java @@ -185,5 +185,27 @@ public Long getHjid() { public void setHjid(Long value) { this.hjid = value; } - + + public boolean equals(Note note) { + if ((null!=this.getAuthor()&& null!= note.getAuthor() + && !this.getAuthor().equals(note.getAuthor())) + || null!=this.getAuthor()&& null==note.getAuthor() + || null==this.getAuthor()&& null!=note.getAuthor() ) { + return false; + } + if ((null!=this.getText()&& null!= note.getText() + && !this.getText().equals(note.getText())) + || null!=this.getText()&& null==note.getText() + || null==this.getText()&& null!=note.getText() ) { + return false; + } + if ((null!=this.getDate()&& null!= note.getDate() + && !this.getDate().toString().equals(note.getDate().toString())) + || null!=this.getDate()&& null==note.getDate() + || null==this.getDate()&& null!=note.getDate() ) { + return false; + } + + return true; + } } diff --git a/src/main/java/org/tmf/dsmapi/quote/model/Price.java b/src/main/java/org/tmf/dsmapi/quote/model/Price.java index bd8d32d..9f709f7 100644 --- a/src/main/java/org/tmf/dsmapi/quote/model/Price.java +++ b/src/main/java/org/tmf/dsmapi/quote/model/Price.java @@ -47,7 +47,8 @@ */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "Price", propOrder = { - "percentage" + "percentage", + "override" }) @JsonInclude(JsonInclude.Include.NON_NULL) @Entity(name = "Price") @@ -60,6 +61,7 @@ public class Price private final static long serialVersionUID = 11L; protected Integer percentage; + protected Double override; protected Long hjid; @@ -89,6 +91,32 @@ public void setPercentage(Integer value) { this.percentage = value; } + /** + * Obtient la valeur de la propriété percentage. + * + * @return + * possible object is + * {@link Integer } + * + */ + @Basic + @Column(name = "OVERRIDE", precision = 10, scale = 0) + public Double getOverride() { + return override; + } + + /** + * Définit la valeur de la propriété percentage. + * + * @param value + * allowed object is + * {@link Integer } + * + */ + public void setOverride(Double value) { + this.override = value; + } + /** * Obtient la valeur de la propriété hjid. * @@ -116,5 +144,21 @@ public Long getHjid() { public void setHjid(Long value) { this.hjid = value; } + + public boolean equals(Price price) { + if (null !=this.getOverride()&& null!=price.getOverride() + && !this.getOverride().equals(price.getOverride()) + || null!=this.getOverride()&& null==price.getOverride() + || null==this.getOverride()&& null!=price.getOverride()) { + return false; + } + if (null !=this.getPercentage()&& null!=price.getPercentage() + && !this.getPercentage().equals(price.getPercentage()) + || null!=this.getPercentage()&& null==price.getPercentage() + || null==this.getPercentage()&& null!=price.getPercentage()) { + return false; + } + return true; + } } diff --git a/src/main/java/org/tmf/dsmapi/quote/model/Product.java b/src/main/java/org/tmf/dsmapi/quote/model/Product.java index 918247b..f0a138a 100644 --- a/src/main/java/org/tmf/dsmapi/quote/model/Product.java +++ b/src/main/java/org/tmf/dsmapi/quote/model/Product.java @@ -72,7 +72,7 @@ public class Product { private final static long serialVersionUID = 11L; - protected List relatedParty; + //protected List relatedParty; protected List productCharacteristic; protected String id; protected String href; @@ -102,24 +102,24 @@ public class Product * * */ - @OneToMany(targetEntity = RelatedParty.class, cascade = { - CascadeType.ALL - }) - @JoinColumn(name = "RELATED_PARTY_PRODUCT_HJID") - public List getRelatedParty() { - if (relatedParty == null) { - relatedParty = new ArrayList(); - } - return this.relatedParty; - } - - /** - * - * - */ - public void setRelatedParty(List relatedParty) { - this.relatedParty = relatedParty; - } +// @OneToMany(targetEntity = RelatedParty.class, cascade = { +// CascadeType.ALL +// }) +// @JoinColumn(name = "RELATED_PARTY_PRODUCT_HJID") +// public List getRelatedParty() { +// if (relatedParty == null) { +// relatedParty = new ArrayList(); +// } +// return this.relatedParty; +// } +// +// /** +// * +// * +// */ +// public void setRelatedParty(List relatedParty) { +// this.relatedParty = relatedParty; +// } /** * Gets the value of the productCharacteristic property. diff --git a/src/main/java/org/tmf/dsmapi/quote/model/Quote.java b/src/main/java/org/tmf/dsmapi/quote/model/Quote.java index 25d7dd5..cc897f6 100644 --- a/src/main/java/org/tmf/dsmapi/quote/model/Quote.java +++ b/src/main/java/org/tmf/dsmapi/quote/model/Quote.java @@ -25,6 +25,7 @@ import javax.persistence.Inheritance; import javax.persistence.InheritanceType; import javax.persistence.JoinColumn; +import javax.persistence.JoinColumns; import javax.persistence.ManyToOne; import javax.persistence.OneToMany; import javax.persistence.Table; @@ -37,6 +38,7 @@ import javax.xml.bind.annotation.XmlType; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.annotation.JsonInclude; +import javax.persistence.IdClass; import org.tmf.dsmapi.commons.utils.CustomJsonDateSerializer; @@ -68,6 +70,7 @@ * <element name="customer" type="{http://orange.com/api/quoteManagement/tmf/v1/model/business}Customer" minOccurs="0"/> * <element name="relatedParty" type="{http://orange.com/api/quoteManagement/tmf/v1/model/business}RelatedParty" maxOccurs="unbounded" minOccurs="0"/> * <element name="agreement" type="{http://orange.com/api/quoteManagement/tmf/v1/model/business}Agreement" maxOccurs="unbounded" minOccurs="0"/> + * <element name="quoteAuthorization" type="{http://orange.com/api/quoteManagement/tmf/v1/model/business}QuoteAuthorization" maxOccurs="unbounded" minOccurs="0"/> * <element name="quoteProductOfferingPrice" type="{http://orange.com/api/quoteManagement/tmf/v1/model/business}QuoteProductOfferingPrice" maxOccurs="unbounded" minOccurs="0"/> * <element name="quoteItem" type="{http://orange.com/api/quoteManagement/tmf/v1/model/business}QuoteItem" maxOccurs="unbounded" minOccurs="0"/> * </sequence> @@ -98,6 +101,7 @@ "customer", "relatedParty", "agreement", + "quoteAuthorization", "quoteProductOfferingPrice", "quoteItem" }) @@ -106,6 +110,7 @@ @Table(name = "QUOTE") @Inheritance(strategy = InheritanceType.JOINED) @DiscriminatorColumn(length = 127) +@IdClass(QuotePK.class) public class Quote implements Serializable { @@ -138,6 +143,7 @@ public class Quote protected Customer customer; protected List relatedParty; protected List agreement; + protected List quoteAuthorization; protected List quoteProductOfferingPrice; protected List quoteItem; @@ -166,7 +172,11 @@ public class Quote @OneToMany(targetEntity = BillingAccount.class, cascade = { CascadeType.ALL }) - @JoinColumn(name = "BILLING_ACCOUNT_QUOTE_ID") + //@JoinColumn(name = "BILLING_ACCOUNT_QUOTE_ID") + @JoinColumns({ + @JoinColumn(name = "BILLING_ACCOUNT_QUOTE_ID",referencedColumnName = "ID"), + @JoinColumn(name = "BILLING_ACCOUNT_QUOTE_VERSION",referencedColumnName = "VERSION_") + }) public List getBillingAccount() { if (billingAccount == null) { billingAccount = new ArrayList(); @@ -218,7 +228,7 @@ public void setState(StateQuote value) { * */ @Id - @Column(name = "ID") + @Column(name = "ID",nullable = false) @GeneratedValue(strategy = GenerationType.AUTO) public String getId() { return id; @@ -348,8 +358,8 @@ public void setCategory(String value) { * {@link String } * */ - @Basic - @Column(name = "VERSION_", length = 255) + @Id + @Column(name = "VERSION_",nullable = false, length = 255) public String getVersion() { return version; } @@ -526,7 +536,11 @@ public void setValidFor(ValidFor value) { @OneToMany(targetEntity = Note.class, cascade = { CascadeType.ALL }) - @JoinColumn(name = "NOTE_QUOTE_ID") + //@JoinColumn(name = "NOTE_QUOTE_ID", referencedColumnName = "ID") + @JoinColumns({ + @JoinColumn(name = "NOTE_QUOTE_ID",referencedColumnName = "ID"), + @JoinColumn(name = "NOTE_QUOTE_VERSION",referencedColumnName = "VERSION_") + }) public List getNote() { if (note == null) { note = new ArrayList(); @@ -567,7 +581,11 @@ public void setNote(List note) { @OneToMany(targetEntity = Characteristic.class, cascade = { CascadeType.ALL }) - @JoinColumn(name = "CHARACTERISTIC_QUOTE_ID") + //@JoinColumn(name = "CHARACTERISTIC_QUOTE_ID", referencedColumnName = "ID") + @JoinColumns({ + @JoinColumn(name = "CHARACTERISTIC_QUOTE_ID",referencedColumnName = "ID"), + @JoinColumn(name = "CHARACTERISTIC_QUOTE_VERSION",referencedColumnName = "VERSION_") + }) public List getCharacteristic() { if (characteristic == null) { characteristic = new ArrayList(); @@ -636,7 +654,10 @@ public void setCustomer(Customer value) { @OneToMany(targetEntity = RelatedParty.class, cascade = { CascadeType.ALL }) - @JoinColumn(name = "RELATED_PARTY_QUOTE_ID") + @JoinColumns({ + @JoinColumn(name = "RELATED_PARTY_QUOTE_ID",referencedColumnName = "ID"), + @JoinColumn(name = "RELATED_PARTY_QUOTE_VERSION",referencedColumnName = "VERSION_") + }) public List getRelatedParty() { if (relatedParty == null) { relatedParty = new ArrayList(); @@ -677,7 +698,11 @@ public void setRelatedParty(List relatedParty) { @OneToMany(targetEntity = Agreement.class, cascade = { CascadeType.ALL }) - @JoinColumn(name = "AGREEMENT_QUOTE_ID") + //@JoinColumn(name = "AGREEMENT_QUOTE_ID") + @JoinColumns({ + @JoinColumn(name = "AGREEMENT_QUOTE_ID",referencedColumnName = "ID"), + @JoinColumn(name = "AGREEMENT_QUOTE_VERSION",referencedColumnName = "VERSION_") + }) public List getAgreement() { if (agreement == null) { agreement = new ArrayList(); @@ -693,6 +718,51 @@ public void setAgreement(List agreement) { this.agreement = agreement; } + /** + * Gets the value of the QuoteAuthorization property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the QuoteAuthorization property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getQuoteAuthorization().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link QuoteAuthorization } + * + * + */ + @OneToMany(targetEntity = QuoteAuthorization.class, cascade = { + CascadeType.ALL + }) + //@JoinColumn(name = "QUOTE_AUTHORIZATION_QUOTE_ID") + @JoinColumns({ + @JoinColumn(name = "QUOTE_AUTHORIZATION_QUOTE_ID",referencedColumnName = "ID"), + @JoinColumn(name = "QUOTE_AUTHORIZATION_QUOTE_VERSION",referencedColumnName = "VERSION_") + }) + public List getQuoteAuthorization() { + if (quoteAuthorization == null) { + quoteAuthorization = new ArrayList(); + } + return this.quoteAuthorization; + } + + /** + * + * + */ + public void setQuoteAuthorization(List quoteAuthorization) { + this.quoteAuthorization = quoteAuthorization; + } + /** * Gets the value of the quoteProductOfferingPrice property. * @@ -718,7 +788,11 @@ public void setAgreement(List agreement) { @OneToMany(targetEntity = QuoteProductOfferingPrice.class, cascade = { CascadeType.ALL }) - @JoinColumn(name = "QUOTE_PRODUCT_OFFERING_PRICE_0") + //@JoinColumn(name = "QUOTE_PRODUCT_OFFERING_PRICE_0") + @JoinColumns({ + @JoinColumn(name = "QUOTE_PRODUCT_OFFERING_PRICE_QUOTE_ID",referencedColumnName = "ID"), + @JoinColumn(name = "QUOTE_PRODUCT_OFFERING_PRICE_QUOTE_VERSION",referencedColumnName = "VERSION_") + }) public List getQuoteProductOfferingPrice() { if (quoteProductOfferingPrice == null) { quoteProductOfferingPrice = new ArrayList(); @@ -759,7 +833,11 @@ public void setQuoteProductOfferingPrice(List quotePr @OneToMany(targetEntity = QuoteItem.class, cascade = { CascadeType.ALL }) - @JoinColumn(name = "QUOTE_ITEM_QUOTE_ID") + //@JoinColumn(name = "QUOTE_ITEM_QUOTE_ID") + @JoinColumns({ + @JoinColumn(name = "QUOTE_ITEM_QUOTE_ID",referencedColumnName = "ID"), + @JoinColumn(name = "QUOTE_ITEM_QUOTE_VERSION",referencedColumnName = "VERSION_") + }) public List getQuoteItem() { if (quoteItem == null) { quoteItem = new ArrayList(); diff --git a/src/main/java/org/tmf/dsmapi/quote/model/QuoteAuthorization.java b/src/main/java/org/tmf/dsmapi/quote/model/QuoteAuthorization.java index 183435c..23733c6 100644 --- a/src/main/java/org/tmf/dsmapi/quote/model/QuoteAuthorization.java +++ b/src/main/java/org/tmf/dsmapi/quote/model/QuoteAuthorization.java @@ -35,6 +35,7 @@ import javax.xml.bind.annotation.XmlType; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.annotation.JsonInclude; +import javax.persistence.ManyToOne; import org.tmf.dsmapi.commons.utils.CustomJsonDateSerializer; @@ -65,7 +66,8 @@ "authorizationDate", "authorizationState", "authorizationSignatureRepresentation", - "attachment" + "attachment", + "quoteProductOfferingPrice" }) @JsonInclude(JsonInclude.Include.NON_NULL) @Entity(name = "QuoteAuthorization") @@ -83,8 +85,8 @@ public class QuoteAuthorization protected Date authorizationDate; protected String authorizationState; protected String authorizationSignatureRepresentation; - protected List attachment; - + protected Attachment attachment; + protected List quoteProductOfferingPrice; protected Long hjid; /** @@ -166,6 +168,47 @@ public void setAuthorizationSignatureRepresentation(String value) { this.authorizationSignatureRepresentation = value; } +// /** +// * Gets the value of the attachment property. +// * +// *

+// * This accessor method returns a reference to the live list, +// * not a snapshot. Therefore any modification you make to the +// * returned list will be present inside the JAXB object. +// * This is why there is not a set method for the attachment property. +// * +// *

+// * For example, to add a new item, do as follows: +// *

+//     *    getAttachment().add(newItem);
+//     * 
+// * +// * +// *

+// * Objects of the following type(s) are allowed in the list +// * {@link Attachment } +// * +// * +// */ +// @OneToMany(targetEntity = Attachment.class, cascade = { +// CascadeType.ALL +// }) +// @JoinColumn(name = "ATTACHMENT_QUOTE_AUTHORIZATI_0") +// public List getAttachment() { +// if (attachment == null) { +// attachment = new ArrayList(); +// } +// return this.attachment; +// } + +// /** +// * +// * +// */ +// public void setAttachment(List attachment) { +// this.attachment = attachment; +// } + /** * Gets the value of the attachment property. * @@ -188,14 +231,11 @@ public void setAuthorizationSignatureRepresentation(String value) { * * */ - @OneToMany(targetEntity = Attachment.class, cascade = { + @ManyToOne(targetEntity = Attachment.class, cascade = { CascadeType.ALL }) - @JoinColumn(name = "ATTACHMENT_QUOTE_AUTHORIZATI_0") - public List getAttachment() { - if (attachment == null) { - attachment = new ArrayList(); - } + @JoinColumn(name = "ATTACHMENT_QUOTE_AUTHORIZATION_HJID") + public Attachment getAttachment() { return this.attachment; } @@ -203,10 +243,32 @@ public List getAttachment() { * * */ - public void setAttachment(List attachment) { + public void setAttachment(Attachment attachment) { this.attachment = attachment; } + + + + @OneToMany(targetEntity = QuoteProductOfferingPrice.class, cascade = { + CascadeType.ALL + }) + @JoinColumn(name = "QUOTE_PRODUCT_OFFERING_PRICE") + public List getQuoteProductOfferingPrice() { + if (quoteProductOfferingPrice == null) { + quoteProductOfferingPrice = new ArrayList(); + } + return this.quoteProductOfferingPrice; + } + /** + * + * + */ + public void setQuoteProductOfferingPrice(List quoteProductOfferingPrice) { + this.quoteProductOfferingPrice = quoteProductOfferingPrice; + } + + /** * Obtient la valeur de la propriété hjid. * @@ -235,4 +297,50 @@ public void setHjid(Long value) { this.hjid = value; } + public boolean equals(QuoteAuthorization quoteAuthor) { + if ((null!=this.getAttachment() && null!= quoteAuthor.getAttachment() + && !this.getAttachment().equals(quoteAuthor.getAttachment())) + || null!=this.getAttachment()&& null==quoteAuthor.getAttachment() + || null==this.getAttachment()&& null!=quoteAuthor.getAttachment() ) { + return false; + } + + if ((null!=this.getAuthorizationDate() && null!= quoteAuthor.getAuthorizationDate() + && !this.getAuthorizationDate().equals(quoteAuthor.getAuthorizationDate())) + || null!=this.getAuthorizationDate()&& null==quoteAuthor.getAuthorizationDate() + || null==this.getAuthorizationDate()&& null!=quoteAuthor.getAuthorizationDate() ) { + return false; + } + + if ((null!=this.getAuthorizationSignatureRepresentation() && null!= quoteAuthor.getAuthorizationSignatureRepresentation() + && !this.getAuthorizationSignatureRepresentation().equals(quoteAuthor.getAuthorizationSignatureRepresentation())) + || null!=this.getAuthorizationSignatureRepresentation()&& null==quoteAuthor.getAuthorizationSignatureRepresentation() + || null==this.getAuthorizationSignatureRepresentation()&& null!=quoteAuthor.getAuthorizationSignatureRepresentation() ) { + return false; + } + + if ((null!=this.getAuthorizationState() && null!= quoteAuthor.getAuthorizationState() + && !this.getAuthorizationState().equals(quoteAuthor.getAuthorizationState())) + || null!=this.getAuthorizationState()&& null==quoteAuthor.getAuthorizationState() + || null==this.getAuthorizationState()&& null!=quoteAuthor.getAuthorizationState() ) { + return false; + } + + if (null!=this.getQuoteProductOfferingPrice()&& null!=quoteAuthor.getQuoteProductOfferingPrice()){ + if (this.getQuoteProductOfferingPrice().size() == quoteAuthor.getQuoteProductOfferingPrice().size()) { + for (int i=0; i itemQuoteProductOfferingPrice; + protected List itemQuoteAuthorization; protected Long hjid; @@ -418,6 +419,26 @@ public void setItemQuoteProductOfferingPrice(List ite this.itemQuoteProductOfferingPrice = itemQuoteProductOfferingPrice; } + @OneToMany(targetEntity = QuoteAuthorization.class, cascade = { + CascadeType.ALL + }) + @JoinColumn(name = "ITEM_QUOTE_AUTHORIZATION_QUOTE_ID") + public List getItemQuoteAuthorization() { + if (itemQuoteAuthorization == null) { + itemQuoteAuthorization = new ArrayList(); + } + return this.itemQuoteAuthorization; + } + + /** + * + * + */ + public void setItemQuoteAuthorization(List itemQuoteAuthorization) { + this.itemQuoteAuthorization = itemQuoteAuthorization; + } + + /** * Obtient la valeur de la propriété hjid. * diff --git a/src/main/java/org/tmf/dsmapi/quote/model/QuotePK.java b/src/main/java/org/tmf/dsmapi/quote/model/QuotePK.java new file mode 100644 index 0000000..ef5fffa --- /dev/null +++ b/src/main/java/org/tmf/dsmapi/quote/model/QuotePK.java @@ -0,0 +1,46 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package org.tmf.dsmapi.quote.model; + +import java.io.Serializable; + +/** + * + * @author Administrator + */ +public class QuotePK implements Serializable{ + private String id; + private String version; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getVersion() { + return version; + } + + public void setVersion(String version) { + this.version = version; + } + + @Override + public boolean equals(Object obj) { + return super.equals(obj); //To change body of generated methods, choose Tools | Templates. + } + + @Override + public int hashCode() { + return super.hashCode(); //To change body of generated methods, choose Tools | Templates. + } + + + +} diff --git a/src/main/java/org/tmf/dsmapi/quote/model/QuotePriceAlteration.java b/src/main/java/org/tmf/dsmapi/quote/model/QuotePriceAlteration.java index 989097e..a1234e3 100644 --- a/src/main/java/org/tmf/dsmapi/quote/model/QuotePriceAlteration.java +++ b/src/main/java/org/tmf/dsmapi/quote/model/QuotePriceAlteration.java @@ -180,4 +180,25 @@ public void setHjid(Long value) { this.hjid = value; } + public boolean equals(QuotePriceAlteration quotePriceAl) { + if (null !=this.getDescription() && null!=quotePriceAl.getDescription() + && !this.getDescription().equals(quotePriceAl.getDescription()) + || null!=this.getDescription()&& null==quotePriceAl.getDescription() + || null==this.getDescription()&& null!=quotePriceAl.getDescription()) { + return false; + } + if (null !=this.getName()&& null!=quotePriceAl.getName() + && !this.getName().equals(quotePriceAl.getName()) + || null!=this.getName()&& null==quotePriceAl.getName() + || null==this.getName()&& null!=quotePriceAl.getName()) { + return false; + } + if (null !=this.getValidFor()&& null!=quotePriceAl.getValidFor() + && !this.getValidFor().equals(quotePriceAl.getValidFor()) + || null!=this.getValidFor()&& null==quotePriceAl.getValidFor() + || null==this.getValidFor()&& null!=quotePriceAl.getValidFor()) { + return false; + } + return true; + } } diff --git a/src/main/java/org/tmf/dsmapi/quote/model/QuoteProductOfferingPrice.java b/src/main/java/org/tmf/dsmapi/quote/model/QuoteProductOfferingPrice.java index 6449341..267e524 100644 --- a/src/main/java/org/tmf/dsmapi/quote/model/QuoteProductOfferingPrice.java +++ b/src/main/java/org/tmf/dsmapi/quote/model/QuoteProductOfferingPrice.java @@ -58,7 +58,8 @@ "recurringChargePeriod", "priceCondition", "quotePriceAlteration", - "price" + "price", + "unitOfMeasure" }) @JsonInclude(JsonInclude.Include.NON_NULL) @Entity(name = "QuoteProductOfferingPrice") @@ -75,6 +76,7 @@ public class QuoteProductOfferingPrice protected String priceCondition; protected QuotePriceAlteration quotePriceAlteration; protected Price price; + protected String unitOfMeasure; protected Long hjid; @@ -212,6 +214,35 @@ public void setPrice(Price value) { this.price = value; } + + + /** + * Obtient la valeur de la propriété priceType. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "UNIT_OF_MEASURE", length = 255) + public String getUnitOfMeasure() { + return unitOfMeasure; + } + + /** + * Définit la valeur de la propriété priceType. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setUnitOfMeasure(String value) { + this.unitOfMeasure = value; + } + + /** * Obtient la valeur de la propriété hjid. * @@ -240,4 +271,53 @@ public void setHjid(Long value) { this.hjid = value; } + public boolean equals(QuoteProductOfferingPrice offerPrice) { + if (null != this.getPrice()&& null != offerPrice.getPrice() + && !this.getPrice().equals(offerPrice.getPrice()) + || null!=this.getPrice()&& null==offerPrice.getPrice() + || null==this.getPrice()&& null!=offerPrice.getPrice() ) { + return false; + } + if (null != this.getPriceCondition()&& null != offerPrice.getPriceCondition() + && !this.getPriceCondition().equals(offerPrice.getPriceCondition()) + || null!=this.getPriceCondition()&& null==offerPrice.getPriceCondition() + || null==this.getPriceCondition()&& null!=offerPrice.getPriceCondition() ) { + return false; + } + if (null != this.getPriceType()&& null != offerPrice.getPriceType() + && !this.getPriceType().equals(offerPrice.getPriceType()) + || null!=this.getPriceType()&& null==offerPrice.getPriceType() + || null==this.getPriceType()&& null!=offerPrice.getPriceType() ) { + return false; + } + if (null != this.getQuotePriceAlteration() && null != offerPrice.getQuotePriceAlteration() + && !this.getQuotePriceAlteration().equals(offerPrice.getQuotePriceAlteration()) + || null!=this.getQuotePriceAlteration()&& null==offerPrice.getQuotePriceAlteration() + || null==this.getQuotePriceAlteration()&& null!=offerPrice.getQuotePriceAlteration() ) { + return false; + } + if (null != this.getRecurringChargePeriod()&& null != offerPrice.getRecurringChargePeriod() + && !this.getRecurringChargePeriod().equals(offerPrice.getRecurringChargePeriod()) + || null!=this.getRecurringChargePeriod()&& null==offerPrice.getRecurringChargePeriod() + || null==this.getRecurringChargePeriod()&& null!=offerPrice.getRecurringChargePeriod()) { + return false; + } + if (null != this.getUnitOfMeasure()&& null != offerPrice.getUnitOfMeasure() + && !this.getUnitOfMeasure().equals(offerPrice.getUnitOfMeasure()) + || null!=this.getUnitOfMeasure()&& null==offerPrice.getUnitOfMeasure() + || null==this.getUnitOfMeasure()&& null!=offerPrice.getUnitOfMeasure()) { + return false; + } + return true; + } + + public boolean isEqualsQuotePriceAlteration (QuoteProductOfferingPrice offerPrice) { + if (null != this.getQuotePriceAlteration() && null != offerPrice.getQuotePriceAlteration() + && this.getQuotePriceAlteration().equals(offerPrice.getQuotePriceAlteration()) + || null!=this.getQuotePriceAlteration()&& null==offerPrice.getQuotePriceAlteration() + || null==this.getQuotePriceAlteration()&& null!=offerPrice.getQuotePriceAlteration() ) { + return false; + } + return true; + } } diff --git a/src/main/java/org/tmf/dsmapi/quote/model/RelatedParty.java b/src/main/java/org/tmf/dsmapi/quote/model/RelatedParty.java index 2b9d406..6712e03 100644 --- a/src/main/java/org/tmf/dsmapi/quote/model/RelatedParty.java +++ b/src/main/java/org/tmf/dsmapi/quote/model/RelatedParty.java @@ -203,5 +203,34 @@ public Long getHjid() { public void setHjid(Long value) { this.hjid = value; } + + public boolean equals(RelatedParty relatedParty) { + if ((null!=this.getId()&& null!= relatedParty.getId() + && !this.getId().equals(relatedParty.getId())) + || null!=this.getId()&& null==relatedParty.getId() + || null==this.getId()&& null!=relatedParty.getId() ) { + return false; + } + if ((null!=this.getName()&& null!= relatedParty.getName() + && !this.getName().equals(relatedParty.getName())) + || null!=this.getName()&& null==relatedParty.getName() + || null==this.getName()&& null!=relatedParty.getName() ) { + return false; + } + if ((null!=this.getRole()&& null!= relatedParty.getRole() + && !this.getRole().equals(relatedParty.getRole())) + || null!=this.getRole()&& null==relatedParty.getRole() + || null==this.getRole()&& null!=relatedParty.getRole() ) { + return false; + } + if ((null!=this.getHref()&& null!= relatedParty.getHref() + && !this.getHref().equals(relatedParty.getHref())) + || null!=this.getHref()&& null==relatedParty.getHref() + || null==this.getHref()&& null!=relatedParty.getHref() ) { + return false; + } + + return true; + } } diff --git a/src/main/java/org/tmf/dsmapi/quote/model/ValidFor.java b/src/main/java/org/tmf/dsmapi/quote/model/ValidFor.java index bb1c1e0..8b164fc 100644 --- a/src/main/java/org/tmf/dsmapi/quote/model/ValidFor.java +++ b/src/main/java/org/tmf/dsmapi/quote/model/ValidFor.java @@ -161,4 +161,20 @@ public void setHjid(Long value) { this.hjid = value; } + public boolean equals(ValidFor var) { + if ((null!=this.getStartDateTime()&& null!= var.getStartDateTime() + && !this.getStartDateTime().toString().equals(var.getStartDateTime().toString())) + || null!=this.getStartDateTime()&& null==var.getStartDateTime() + || null==this.getStartDateTime()&& null!=var.getStartDateTime()) { + return false; + } + if ((null!=this.getEndDateTime()&& null!= var.getEndDateTime() + && !this.getEndDateTime().toString().equals(var.getEndDateTime().toString())) + || null!=this.getEndDateTime()&& null==var.getEndDateTime() + || null==this.getEndDateTime()&& null!=var.getEndDateTime() ) { + return false; + } + + return true; + } } diff --git a/src/main/java/org/tmf/dsmapi/subscriber/Current.java b/src/main/java/org/tmf/dsmapi/subscriber/Current.java index 7e37e6c..4163593 100644 --- a/src/main/java/org/tmf/dsmapi/subscriber/Current.java +++ b/src/main/java/org/tmf/dsmapi/subscriber/Current.java @@ -29,12 +29,15 @@ public void doGet(HttpServletRequest request, HttpServletResponse response) List events = subscriberFacade.findAll(); ServletOutputStream servletOut = response.getOutputStream(); EventBag mostRecentNotif = null; - for (int i = 0; events.size() > i; i++) { - mostRecentNotif = events.get(i); - if (events.get(i).getDateEvent().after(mostRecentNotif.getDateEvent())) { - mostRecentNotif = events.get(i); + if (null != events && events.size() > 0){ + mostRecentNotif = events.get(0); + for (int i = 0; events.size()-1 > i; i++) { + if (events.get(i+1).getDateEvent().after(mostRecentNotif.getDateEvent())) { + mostRecentNotif = events.get(i); + } } } + if (null != mostRecentNotif) { servletOut.write(mostRecentNotif.getEvent()); response.setContentType("application/json");