{"info":{"_postman_id":"41c32ebd-7a5c-485f-9e13-66e4d09472c6","name":"Documents service","description":"<html><head></head><body><p>API для микросервиса documents_service</p>\n</body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[],"owner":"5893038","collectionId":"41c32ebd-7a5c-485f-9e13-66e4d09472c6","publishedId":"SWECXvj2","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"EF5B25"},"publishDate":"2019-12-18T19:37:03.000Z"},"item":[{"name":"DocTypes","item":[{"name":"Get all DocTypes","event":[{"listen":"test","script":{"id":"080cc40e-37b2-41d7-a5b6-30b5be372ff8","exec":["pm.test(\"Response is ok\", function () {","    pm.response.to.have.status(200);","});","","let jsonResponse = pm.response.json();","","pm.test(\"Response should be a parsable JSON\", function() {","    pm.expect(jsonResponse).to.be.ok;","});","","pm.test(\"Response body should be an array\", function() {","    pm.expect(jsonResponse).to.be.an('array');","});","","if(jsonResponse.length > 0) {","    let elJsonResponse = jsonResponse[0]","    ","    pm.test(\"Elements of array have correct format\", function() {","        pm.expect(elJsonResponse.id).to.be.an('number');","        pm.expect(elJsonResponse.name).to.be.an('string');","    });","}","",""],"type":"text/javascript"}}],"id":"fa9c984d-69e2-49bd-b8cf-65e9f3b2aba5","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"body":{"mode":"raw","raw":""},"url":"http://docs-service.udachin.tech/doctypes","description":"<p>Получить список всех типов документов в виде массива</p>\n","urlObject":{"protocol":"http","path":["doctypes"],"host":["docs-service","udachin","tech"],"query":[],"variable":[]}},"response":[{"id":"98411f87-1061-497f-ae25-3530e20f4f6e","name":"Get - Status OK","originalRequest":{"method":"GET","header":[],"body":{"mode":"raw","raw":""},"url":"http://docs-service.udachin.tech/doctypes"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Server","value":"nginx/1.14.0 (Ubuntu)"},{"key":"Date","value":"Thu, 14 Nov 2019 22:13:59 GMT"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"61"},{"key":"Connection","value":"keep-alive"},{"key":"X-Powered-By","value":"Express"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Access-Control-Allow-Credentials","value":"true"},{"key":"ETag","value":"W/\"3d-QxE01j5gdTFwaNGMMdb1qf1RDVk\""}],"cookie":[],"responseTime":null,"body":"[\n    {\n        \"id\": 1,\n        \"name\": \"Passport\"\n    },\n    {\n        \"id\": 2,\n        \"name\": \"Student ticket\"\n    }\n]"}],"_postman_id":"fa9c984d-69e2-49bd-b8cf-65e9f3b2aba5"},{"name":"Create new DocType","event":[{"listen":"test","script":{"id":"82dad866-7915-4eea-bbb3-dd57d2c654a6","exec":["pm.test(\"Response is ok\", function () {","    pm.response.to.have.status(200);","});","","let jsonResponse = pm.response.json();","","pm.test(\"Response should be a parsable JSON\", function() {","    pm.expect(jsonResponse).to.be.ok;","});","","pm.test(\"Response body should be an Object\", function() {","    pm.expect(jsonResponse).to.be.an('object');","});","","pm.test(\"Fields of body have correct format\", function() {","        pm.expect(jsonResponse.status).to.be.an('string');","        pm.expect(jsonResponse.new_doctype).to.be.an('object');","    });"],"type":"text/javascript"}}],"id":"520793c9-0f29-466e-9a0b-ca7e8b37a79c","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n\t\"name\": \"Troyka\"\n}"},"url":"http://docs-service.udachin.tech/doctypes","description":"<p>Создать свой собственный тип документов (не чувствителен к регистру)</p>\n","urlObject":{"protocol":"http","path":["doctypes"],"host":["docs-service","udachin","tech"],"query":[],"variable":[]}},"response":[{"id":"27ca2b82-fb8d-4a9e-8276-8fd42c8c7a6d","name":"POST - Status OK","originalRequest":{"method":"POST","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n\t\"name\": \"Troyka\"\n}","options":{"raw":{"language":"json"}}},"url":"http://docs-service.udachin.tech/doctypes"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Server","value":"nginx/1.14.0 (Ubuntu)"},{"key":"Date","value":"Thu, 14 Nov 2019 22:17:11 GMT"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"59"},{"key":"Connection","value":"keep-alive"},{"key":"X-Powered-By","value":"Express"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Access-Control-Allow-Credentials","value":"true"},{"key":"ETag","value":"W/\"3b-SgIAL3GhsB/IZI0VM2ET5OttPUc\""}],"cookie":[],"responseTime":null,"body":"{\n    \"status\": \"success\",\n    \"new_doctype\": {\n        \"id\": 4,\n        \"name\": \"Troyka\"\n    }\n}"}],"_postman_id":"520793c9-0f29-466e-9a0b-ca7e8b37a79c"},{"name":"Add ExtraField to Doctype","event":[{"listen":"test","script":{"id":"080cc40e-37b2-41d7-a5b6-30b5be372ff8","exec":["pm.test(\"Response is ok\", function () {","    pm.response.to.have.status(200);","});","","let jsonResponse = pm.response.json();","","pm.test(\"Response should be a parsable JSON\", function() {","    pm.expect(jsonResponse).to.be.ok;","});","","pm.test(\"Response body should be an Object\", function() {","    pm.expect(jsonResponse).to.be.an('object');","});","","pm.test(\"Fields of body have correct format\", function() {","        pm.expect(jsonResponse.status).to.be.an('string');","        pm.expect(jsonResponse.new_extrafield).to.be.an('object');","    });"],"type":"text/javascript"}}],"id":"bf159c3e-41c8-45b2-b6cc-6a08c1dec948","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n\t\"doctype_name\": \"Passport\",\n\t\"extra_name\": \"Sex\"\n}"},"url":"http://docs-service.udachin.tech/doctypes/addExtraField","urlObject":{"protocol":"http","path":["doctypes","addExtraField"],"host":["docs-service","udachin","tech"],"query":[],"variable":[]}},"response":[],"_postman_id":"bf159c3e-41c8-45b2-b6cc-6a08c1dec948"},{"name":"Delete doctype","event":[{"listen":"test","script":{"id":"5c553ba8-ef51-4c86-95d7-2b67bfbad700","exec":["pm.test(\"Response is ok\", function () {","    pm.response.to.have.status(200);","});","","let jsonResponse = pm.response.json();","","pm.test(\"Response should be a parsable JSON\", function() {","    pm.expect(jsonResponse).to.be.ok;","});","","pm.test(\"Response body should be an Object\", function() {","    pm.expect(jsonResponse).to.be.an('object');","});","","pm.test(\"Fields of body have correct format\", function() {","        pm.expect(jsonResponse.status).to.be.an('string');","    });"],"type":"text/javascript"}}],"id":"f569c939-a583-45d5-a786-52e125aaa300","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"DELETE","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n\t\"name\": \"Troyka\"\n}"},"url":"http://docs-service.udachin.tech/doctypes","urlObject":{"protocol":"http","path":["doctypes"],"host":["docs-service","udachin","tech"],"query":[],"variable":[]}},"response":[],"_postman_id":"f569c939-a583-45d5-a786-52e125aaa300"},{"name":"Delete ExtraField","event":[{"listen":"test","script":{"id":"a5a08679-e94d-4ede-ae82-24070d60c648","exec":["pm.test(\"Response is ok\", function () {","    pm.response.to.have.status(200);","});","","let jsonResponse = pm.response.json();","","pm.test(\"Response should be a parsable JSON\", function() {","    pm.expect(jsonResponse).to.be.ok;","});","","pm.test(\"Response body should be an Object\", function() {","    pm.expect(jsonResponse).to.be.an('object');","});","","pm.test(\"Fields of body have correct format\", function() {","        pm.expect(jsonResponse.status).to.be.an('string');","        pm.expect(jsonResponse.wrongFields).to.be.an('array');","});"],"type":"text/javascript"}}],"id":"76c7487b-6353-4a59-9895-cfb755eb1a0d","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"DELETE","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n\t\"doctype_name\": \"Passport\",\n\t\"fields\": [\n\t\t{\n\t\t\t\"name\": \"Sex\"\n\t\t}\n\t]\n}"},"url":"http://docs-service.udachin.tech/doctypes/deleteExtraField","urlObject":{"protocol":"http","path":["doctypes","deleteExtraField"],"host":["docs-service","udachin","tech"],"query":[],"variable":[]}},"response":[],"_postman_id":"76c7487b-6353-4a59-9895-cfb755eb1a0d"}],"id":"a0dea7a5-9dd0-47ef-8d1d-2730f9df65ca","description":"<p>Типы документов (напр. Паспорт, Студенческий билет и т.д.)</p>\n","_postman_id":"a0dea7a5-9dd0-47ef-8d1d-2730f9df65ca"},{"name":"Documents","item":[{"name":"Get all Documents","event":[{"listen":"test","script":{"id":"080cc40e-37b2-41d7-a5b6-30b5be372ff8","exec":["pm.test(\"Response is ok\", function () {","    pm.response.to.have.status(200);","});","","let jsonResponse = pm.response.json();","","pm.test(\"Response should be a parsable JSON\", function() {","    pm.expect(jsonResponse).to.be.ok;","});","","pm.test(\"Response body should be an array\", function() {","    pm.expect(jsonResponse).to.be.an('array');","});","","if(jsonResponse.length > 0) {","    let elJsonResponse = jsonResponse[0]","    ","    pm.test(\"Elements of array have correct format\", function() {","        pm.expect(elJsonResponse.id).to.be.an('number');","        pm.expect(elJsonResponse.doctype_id).to.be.an('number');","        pm.expect(elJsonResponse.person_id).to.be.an('number');","        pm.expect(new Date(elJsonResponse.date_create)).to.be.an('date');","        pm.expect(new Date(elJsonResponse.date_destroy)).to.be.an('date');","        pm.expect(elJsonResponse.city_of_obtaining_id).to.be.an('string');","    });","}","",""],"type":"text/javascript"}}],"id":"d9353ea3-efac-4ebb-bb0f-49133e76b604","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"body":{"mode":"raw","raw":""},"url":"http://docs-service.udachin.tech/documents","description":"<p>Получить все существующие документы всех юзеров (данные не исчерпывающие)</p>\n","urlObject":{"protocol":"http","path":["documents"],"host":["docs-service","udachin","tech"],"query":[],"variable":[]}},"response":[{"id":"37d0d491-2dc3-4131-994d-4223009b3e20","name":"Get all Documents - Status OK","originalRequest":{"method":"GET","header":[],"body":{"mode":"raw","raw":""},"url":"http://docs-service.udachin.tech/documents"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Server","value":"nginx/1.14.0 (Ubuntu)"},{"key":"Date","value":"Thu, 14 Nov 2019 22:20:15 GMT"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"271"},{"key":"Connection","value":"keep-alive"},{"key":"X-Powered-By","value":"Express"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Access-Control-Allow-Credentials","value":"true"},{"key":"ETag","value":"W/\"10f-HwSeQWDmVFgjH6VHX+rM5GG4dnM\""}],"cookie":[],"responseTime":null,"body":"[\n    {\n        \"id\": 1,\n        \"doctype_id\": 1,\n        \"person_id\": 1,\n        \"date_create\": \"2019-11-14\",\n        \"date_destroy\": \"2023-10-24\",\n        \"city_of_obtaining_id\": \"77\",\n        \"doctypeId\": 1\n    },\n    {\n        \"id\": 2,\n        \"doctype_id\": 1,\n        \"person_id\": 2,\n        \"date_create\": \"2019-11-14\",\n        \"date_destroy\": \"2023-10-24\",\n        \"city_of_obtaining_id\": \"77\",\n        \"doctypeId\": 1\n    }\n]"}],"_postman_id":"d9353ea3-efac-4ebb-bb0f-49133e76b604"},{"name":"Add document to person","event":[{"listen":"test","script":{"id":"080cc40e-37b2-41d7-a5b6-30b5be372ff8","exec":["pm.test(\"Response is ok\", function () {","    pm.response.to.have.status(200);","});","","let jsonResponse = pm.response.json();","","pm.test(\"Response should be a parsable JSON\", function() {","    pm.expect(jsonResponse).to.be.ok;","});","","pm.test(\"Response body should be an Object\", function() {","    pm.expect(jsonResponse).to.be.an('object');","});","","pm.test(\"Fields of body have correct format\", function() {","    pm.expect(jsonResponse.status).to.be.an('string');","    pm.expect(jsonResponse.new_document).to.be.an('object');","    ","    pm.expect(jsonResponse.new_document.id).to.be.an('number');","    pm.expect(jsonResponse.new_document.doctype_id).to.be.an('number');","    pm.expect(jsonResponse.new_document.person_id).to.be.an('number');","    pm.expect(new Date(jsonResponse.new_document.date_create)).to.be.an('date');","    pm.expect(new Date(jsonResponse.new_document.date_destroy)).to.be.an('date');","    pm.expect(jsonResponse.new_document.city_of_obtaining_id).to.be.an('string');","});"],"type":"text/javascript"}}],"id":"946303f5-05b7-48b2-aeeb-a0e4d5562f3e","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n\t\"person_id\": \"2\",\n\t\"doctype_name\": \"Passport\",\n\t\"person_fisrtname\": \"vadim\",\n    \"person_lastname\": \"vadim\",\n    \"person_middlename\": \"vadim\",\n    \"person_email\": \"vadim@yandex.ru\",\n\t\"date_destroy\": \"10-04-2022\",\n\t\"city_of_obtaining_id\": \"99\"\n}"},"url":"http://docs-service.udachin.tech/documents/addDocumentToPerson","urlObject":{"protocol":"http","path":["documents","addDocumentToPerson"],"host":["docs-service","udachin","tech"],"query":[],"variable":[]}},"response":[],"_postman_id":"946303f5-05b7-48b2-aeeb-a0e4d5562f3e"},{"name":"Edit document's extra fields for person","event":[{"listen":"test","script":{"id":"080cc40e-37b2-41d7-a5b6-30b5be372ff8","exec":["pm.test(\"Response is ok\", function () {","    pm.response.to.have.status(200);","});","","let jsonResponse = pm.response.json();","","pm.test(\"Response should be a parsable JSON\", function() {","    pm.expect(jsonResponse).to.be.ok;","});","","pm.test(\"Response body should be an Object\", function() {","    pm.expect(jsonResponse).to.be.an('object');","});","","pm.test(\"Fields of body have correct format\", function() {","    pm.expect(jsonResponse.status).to.be.an('string');","    pm.expect(jsonResponse.new_document).to.be.an('object');","    ","    pm.expect(jsonResponse.new_document.id).to.be.an('number');","    pm.expect(jsonResponse.new_document.doctype_id).to.be.an('number');","    pm.expect(jsonResponse.new_document.person_id).to.be.an('number');","    pm.expect(new Date(jsonResponse.new_document.date_create)).to.be.an('date');","    pm.expect(new Date(jsonResponse.new_document.date_destroy)).to.be.an('date');","    pm.expect(jsonResponse.new_document.city_of_obtaining_id).to.be.an('string');","});"],"type":"text/javascript"}}],"id":"a8f9641a-749e-4740-8285-5ed56ba9b1bb","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PUT","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n\t\"fields\": [\n\t\t{\n\t\t\t\"name\": \"Национальность\",\n\t\t\t\"value\": \"Китаец\"\n\t\t}\t\n\t],\n\t\"doctype_name\": \"Passport\",\n\t\"person_id\": \"1\",\n\t\"person_fisrtname\": \"vadim\",\n    \"person_lastname\": \"vadim\",\n    \"person_middlename\": \"vadim\",\n    \"person_email\": \"vadim@yandex.ru\"\n}"},"url":"http://docs-service.udachin.tech/documents/editPersonData","urlObject":{"protocol":"http","path":["documents","editPersonData"],"host":["docs-service","udachin","tech"],"query":[],"variable":[]}},"response":[],"_postman_id":"a8f9641a-749e-4740-8285-5ed56ba9b1bb"},{"name":"Search [person_id, doctype_name]","id":"1e98d5b0-e8ea-4436-9385-e8f63594e8cf","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://docs-service.udachin.tech/documents/search?person_id=1","urlObject":{"protocol":"http","path":["documents","search"],"host":["docs-service","udachin","tech"],"query":[{"key":"person_id","value":"1"}],"variable":[]}},"response":[],"_postman_id":"1e98d5b0-e8ea-4436-9385-e8f63594e8cf"},{"name":"Delete document","id":"d30eaf9f-6227-47e2-ad69-fff70977ce43","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"DELETE","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n\t\"person_id\": \"1\",\n\t\"doctype_name\": \"Passport\"\n}"},"url":"http://docs-service.udachin.tech/documents","urlObject":{"protocol":"http","path":["documents"],"host":["docs-service","udachin","tech"],"query":[],"variable":[]}},"response":[],"_postman_id":"d30eaf9f-6227-47e2-ad69-fff70977ce43"}],"id":"806cf809-904d-4c66-8c95-d1f6e41ebe43","description":"<p>Личные документы юзеров созданные из DocTypes </p>\n","_postman_id":"806cf809-904d-4c66-8c95-d1f6e41ebe43"},{"name":"Logs","item":[{"name":"Get all logs","event":[{"listen":"test","script":{"id":"080cc40e-37b2-41d7-a5b6-30b5be372ff8","exec":[""],"type":"text/javascript"}}],"id":"5e71fe4b-e0e1-48d7-a670-7132fb135b36","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"body":{"mode":"raw","raw":""},"url":"http://docs-service.udachin.tech/logs","urlObject":{"protocol":"http","path":["logs"],"host":["docs-service","udachin","tech"],"query":[],"variable":[]}},"response":[],"_postman_id":"5e71fe4b-e0e1-48d7-a670-7132fb135b36"},{"name":"Search","event":[{"listen":"test","script":{"id":"080cc40e-37b2-41d7-a5b6-30b5be372ff8","exec":[""],"type":"text/javascript"}}],"id":"a119612f-fec9-4f8f-a5aa-1e3d1e67c472","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"body":{"mode":"raw","raw":""},"url":"http://docs-service.udachin.tech/logs","urlObject":{"protocol":"http","path":["logs"],"host":["docs-service","udachin","tech"],"query":[],"variable":[]}},"response":[],"_postman_id":"a119612f-fec9-4f8f-a5aa-1e3d1e67c472"}],"id":"899ebfd3-a8aa-434e-b6a7-852ba9755837","_postman_id":"899ebfd3-a8aa-434e-b6a7-852ba9755837","description":""},{"name":"Main","event":[{"listen":"test","script":{"id":"87b9fe8d-28e4-406d-9aab-03d43e44fc35","exec":["pm.test(\"response is ok\", function () {","    pm.response.to.have.status(200);","});","","let jsonResponse = pm.response.json();","","pm.test(\"Response should be a parsable JSON\", function() {","    pm.expect(jsonResponse).to.be.ok;","});","","pm.test(\"Response body should be an string\", function() {","    pm.expect(jsonResponse).to.be.an('string');","});","",""],"type":"text/javascript"}}],"id":"b4eba717-90f5-4ecb-ac6a-e66cda5b29c2","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://docs-service.udachin.tech","urlObject":{"protocol":"http","host":["docs-service","udachin","tech"],"query":[],"variable":[]}},"response":[],"_postman_id":"b4eba717-90f5-4ecb-ac6a-e66cda5b29c2"}]}