1"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[7173],{2194(e,n,r){r.r(n),r.d(n,{assets:()=>m,contentTitle:()=>d,default:()=>p,frontMatter:()=>u,metadata:()=>t,toc:()=>h});const t=JSON.parse('{"id":"guides/customers/create","title":"Criar cliente","description":"","source":"@site/docs/guides/customers/create.mdx","sourceDirName":"guides/customers","slug":"/guides/customers/create","permalink":"/docs/guides/customers/create","draft":false,"unlisted":false,"tags":[],"version":"current","sidebarPosition":2,"frontMatter":{"sidebar_position":2,"title":"Criar cliente","description":"","hide_table_of_contents":true},"sidebar":"guides","previous":{"title":"In\xedcio","permalink":"/docs/guides/customers/"},"next":{"title":"Consultar cliente","permalink":"/docs/guides/customers/get"}}');var a=r(4848),s=r(8453),i=r(1312),o=r(4660),l=r(4865),c=r(9365);const u={sidebar_position:2,title:"Criar cliente",description:"",hide_table_of_contents:!0},d="Criar cliente",m={},h=[];function f(e){const n={a:"a",code:"code",h1:"h1",header:"header",li:"li",pre:"pre",strong:"strong",ul:"ul",...(0,s.R)(),...e.components};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(n.header,{children:(0,a.jsx)(n.h1,{id:"criar-cliente",children:(0,a.jsx)(i.A,{id:"customers.create.title",children:"Criar cliente"})})}),"\n",(0,a.jsxs)("p",{children:[(0,a.jsx)(i.A,{id:"customers.create.recommendation",children:"Recomenda-se a utiliza\xe7\xe3o do par\xe2metro"})," ",(0,a.jsx)("code",{children:"customerId"})," ",(0,a.jsx)(i.A,{id:"customers.create.recommendation2",children:"para evitar registos duplicados."})]}),"\n",(0,a.jsx)("p",{children:(0,a.jsx)(i.A,{id:"customers.create.intro",children:"Cria\xe7\xe3o de um cliente com os seguintes dados:"})}),"\n",(0,a.jsxs)(n.ul,{children:["\n",(0,a.jsxs)(n.li,{children:[(0,a.jsxs)(n.strong,{children:[(0,a.jsx)(i.A,{id:"customers.create.customerId",children:"Identificador do cliente"}),":"]})," 1"]}),"\n",(0,a.jsxs)(n.li,{children:[(0,a.jsxs)(n.strong,{children:[(0,a.jsx)(i.A,{id:"customers.create.firstName",children:"Primeiro nome"}),":"]})," Jos\xe9"]}),"\n",(0,a.jsxs)(n.li,{children:[(0,a.jsxs)(n.strong,{children:[(0,a.jsx)(i.A,{id:"customers.create.lastName",children:"\xdaltimo nome"}),":"]})," Silva"]}),"\n",(0,a.jsxs)(n.li,{children:[(0,a.jsxs)(n.strong,{children:[(0,a.jsx)(i.A,{id:"customers.create.email",children:"Email"}),":"]})," ",(0,a.jsx)(n.a,{href:"mailto:[email protected]",children:"[email protected]"})]}),"\n",(0,a.jsxs)(n.li,{children:[(0,a.jsxs)(n.strong,{children:[(0,a.jsx)(i.A,{id:"customers.create.phoneNumber",children:"N\xfamero de telefone"}),":"]})," 351#961234567"]}),"\n"]}),"\n",(0,a.jsx)("button",{className:"btn-api btn-api--float-right",onClick:()=>(0,o.A)({idMenuOption:"customers",idOption:"customers/post/customers"}),children:(0,a.jsxs)("span",{children:[(0,a.jsx)(i.A,{id:"customers.create.consultApi",children:"Consultar API"})," \xa0\xa0\xa0",">"]})}),"\n",(0,a.jsxs)(l.A,{children:[(0,a.jsxs)(c.A,{value:"pedido",label:(0,a.jsx)(i.A,{id:"customers.create.tabs.request",children:"Pedido"}),children:[(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-php",children:"POST /customers\n"})}),(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-json",children:'{\n "customerId": "1",\n "firstName": "Jos\xe9",\n "lastName": "Silva",\n "email": "[email protected]",\n "phoneNumber": "351#123456789"\n}\n'})})]}),(0,a.jsx)(c.A,{value:"resposta",label:(0,a.jsx)(i.A,{id:"customers.create.tabs.response",children:"Resposta"}),children:(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-json",children:'{\n "date": "2021-12-07T18:01:19+00:00",\n "success": true,\n "data": {\n "uuid": "e2343605-cf46-43de-b20b-9b7d1c95a9b2",\n "customerId": "123",\n "firstName": "Jos\xe9",\n "lastName": "Silva",\n "email": "[email protected]",\n "phoneNumber": "351#961234567"\n }\n}\n'})})})]}),"\n",(0,a.jsx)("p",{children:(0,a.jsx)(i.A,{id:"customers.create.success",children:"Quando o cliente \xe9 criado com sucesso \xe9 gerado um identificador \xfanico (uuid) que identifica o cliente perante a API."})})]})}function p(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,a.jsx)(n,{...e,children:(0,a.jsx)(f,{...e})}):f(e)}},9365(e,n,r){r.d(n,{A:()=>l});r(6540);
1var t=r(4164),a=r(7751);const s="tabItem_Ymn6";var i=r(4848);function o(e){var n=e.children,r=e.className,a=e.hidden;return(0,i.jsx)("div",{role:"tabpanel",className:(0,t.A)(s,r),hidden:a,children:n})}function l(e){var n=e.children,r=e.className,t=e.value,s=(0,a.uc)(),l=s.selectedValue,c=s.lazy,u=t===l;return!u&&c?null:(0,i.jsx)(o,{className:r,hidden:!u,children:n})}},4865(e,n,r){r.d(n,{A:()=>f});r(6540);var t=r(4164),a=r(7559),s=r(7751),i=r(3104),o=r(2303);const l="tabList__CuJ",c="tabItem_LNqP";var u=r(4848);function d(e){var n=e.className,r=(0,s.uc)(),a=r.selectedValue,o=r.selectValue,l=r.tabValues,d=r.block,m=[],h=(0,i.a_)().blockElementScrollPositionUntilNextRender,f=function(e){var n=e.currentTarget,r=m.indexOf(n),t=l[r].value;t!==a&&(h(n),o(t))},p=function(e){var n,r=null;switch(e.key){case"Enter":f(e);break;case"ArrowRight":var t,a=m.indexOf(e.currentTarget)+1;r=null!=(t=m[a])?t:m[0];break;case"ArrowLeft":var s,i=m.indexOf(e.currentTarget)-1;r=null!=(s=m[i])?s:m[m.length-1]}null==(n=r)||n.focus()};return(0,u.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,t.A)("tabs",{"tabs--block":d},n),children:l.map(function(e){var n=e.value,r=e.label,s=e.attributes;return(0,u.jsx)("li",Object.assign({role:"tab",tabIndex:a===n?0:-1,"aria-selected":a===n,ref:function(e){m.push(e)},onKeyDown:p,onClick:f},s,{className:(0,t.A)("tabs__item",c,null==s?void 0:s.className,{"tabs__item--active":a===n}),children:null!=r?r:n}),n)})})}function m(e){var n=e.children;return(0,u.jsx)("div",{className:"margin-top--md",children:n})}function h(e){var n=e.className,r=e.children;return(0,u.jsxs)("div",{className:(0,t.A)(a.G.tabs.container,"tabs-container",l),children:[(0,u.jsx)(d,{className:n}),(0,u.jsx)(m,{children:r})]})}function f(e){var n=(0,o.A)(),r=(0,s.OC)(e);return(0,u.jsx)(s.O_,{value:r,children:(0,u.jsx)(h,{className:e.className,children:(0,s.vT)(e.children)})},String(n))}},7751(e,n,r){r.d(n,{OC:()=>f,O_:()=>b,uc:()=>v,vT:()=>u});var t=r(6540),a=r(6347),s=r(205),i=r(7485),o=r(679),l=r(1682),c=r(4848);function u(e){return t.Children.toArray(e).filter(function(e){return"\n"!==e})}function d(e){var n=e.values,r=e.children;return(0,t.useMemo)(function(){var e=null!=n?n:function(e){return t.Children.toArray(e).flatMap(function(e){if(!e)return[];if((0,t.isValidElement)(e)&&(n=e.props)&&"object"==typeof n&&"value"in n)return[e];var n,r="string"==typeof e.type?e.type:e.type.name;throw new Error("Docusaurus error: Bad <Tabs> child <"+r+'>: all children of the <Tabs> component should be <TabItem>, and every <TabItem> should have a unique "value" prop.\nIf you do not want to pass on a "value" prop to the direct children of <Tabs>, you can also pass an explicit <Tabs values={...}> prop.')}).map(function(e){var n=e.props;return{value:n.value,label:n.label,attributes:n.attributes,default:n.default}})}(r);return function(e){var n=(0,l.XI)(e,function(e,n){return e.value===n.value});if(n.length>0)throw new Error('Docusaurus error: Duplicate values "'+n.map(function(e){return"'"+e.value+"'"}).join(", ")+'" found in <Tabs>. Every value needs to be unique.')}(e),e},[n,r])}function m(e){var n=e.value;return e.tabValues.some(function(e){return e.value===n})}function h(e){var n=e.queryString,r=void 0!==n&&n,s=e.groupId,o=(0,a.W6)(),l=function(e){var n=e.queryString,r=void 0!==n&&n,t=e.groupId;if("string"==typeof r)return r;if(!1===r)return null;if(!0===r&&!t)throw new Error('Docusaurus error: The <Tabs> component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return null!=t?t:null}({queryString:r,groupId:s});return[(0,i.aZ)(l),(0,t.useCallback)(function(e){if(l){var n=new URLSearchParams(o.location.search);n.set(l,e),o.replace(Object.assign({},o.location,{search:n.toString()}))}},[l,o])]}function f(e){var n,r,a,i,l,c,u=e.defaultValue,f=e.queryString,p=void 0!==f&&f,v=e.groupId,b=d(e),x=(0,t.useState)(function(){return function(e){var n,r=e.defaultValue,t=e.tabValues;if(0===t.length)throw new Error("Docusaurus error: the <Tabs> component requires at least one <TabItem> children component");if(r){if(!m({value:r,tabValues:t}))throw new Error('Docusaurus error: The <Tabs> has a defaultValue "'+r+'" but none of its children has the corresponding value. Available values are: '+t.map(function(e){return e.value}).join(", ")+". If you intend to show no default tab, use defaultValue={null} instead.");return r}var a=null!=(n=t.find(function(e){return e.default}))?n:t[0];if(!a)throw new Error("Unexpected error: 0 tabValues");return a.value}({defaultValue:u,tabValues:b})}),g=x[0],j=x[1],y=h({queryString:p,groupId:v}),A=y[0],w=y[1],N=(a=function(e){return e?"docusaurus.tab."+e:null}({groupId:v}.groupId),i=(0,o.Dv)(a),l=i[0],c=i[1],[l,(0,t.useCallback)(function(e){a&&c.set(e)},[a,c])]),I=N[0],C=N[1],T=function(){var e=null!=A?A:I;return m({value:e,tabValues:b})?e:null}();return(0,s.A)(function(){T&&j(T)},[T]),{selectedValue:g,selectValue:(0,t.useCallback)(function(e){if(!m({value:e,tabValues:b}))throw new Error("Can't select invalid tab value="+e);j(e),w(e),C(e)},[w,C,b]),tabValues:b,lazy:null!=(n=e.lazy)&&n,block:null!=(r=e.block)&&r}}var p=(0,t.createContext)(null);function v(){var e=t.useContext(p);if(!e)throw new Error("useTabsContext() must be used within a Tabs component");return e}function b(e){return(0,c.jsx)(p.Provider,{value:e.value,children:e.children})}},4660(e,n,r){var t=r(6321);const a=function(e){var n=e.typeMenu,r=void 0===n?"tag":n,a=e.idMenuOption,s=e.idOption,i="model"!==r?"sidebar-tag/":"sidebar-models",o="model"!==r?"#tag/":"#model/",l="model"!==r?i+a:i,c=o+a,u="model"!==r?i+(void 0===s?null:s):i,d=o+a,m=d
1ocument.getElementById("iframePanel"),h=m.contentDocument.querySelectorAll("li.sidebar-group-item ul");h.length>0&&h.forEach(function(e){return e.parentNode.querySelector("button").click()}),window.setTimeout(function(){m.contentDocument.getElementById(l).querySelector("button").click()},700),m.contentWindow.location.hash=c,window.setTimeout(function(){m.contentDocument.getElementById(u).querySelector("a.sidebar-heading-link").click()},1e3),m.contentWindow.location.hash=d,(0,t.A)()};r.d(n,["A",0,a])},8453(e,n,r){r.d(n,{R:()=>i,x:()=>o});var t=r(6540);const a={},s=t.createContext(a);function i(e){const n=t.useContext(s);return t.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function o(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(a):e.components||a:i(e.components),t.createElement(s.Provider,{value:n},e.children)}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.