Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Não deveria ser possível criar um pedido sem informar o apelido do cliente? #57

Open
mateus3009 opened this issue Jan 9, 2024 · 1 comment
Labels
bug Something isn't working question Further information is requested

Comments

@mateus3009
Copy link
Collaborator

O requisito diz que o cliente pode optar por não se identificar.

Entendo que nesse caso não precisamos obrigar o cliente a informar o apelido (Assim ele teria o número do pedido e iria acompanhar seu progresso utilizando esse número)

Hoje o preenchimento do campo customerNickname é obrigatório. A API retorna 404 BAD REQUEST quando o campo não é informado.

Payload:

{
  "customerNickname": null,
  "customerDocument": null,
  "items": [
    {
      "productNumber": 1,
      "quantity": 1
    }
  ]
}

Log do erro:

2024-01-09 13:31:31 2024-01-09T16:31:31.009Z  WARN 1 --- [nio-8080-exec-6] .w.s.m.s.DefaultHandlerExceptionResolver : Resolved [org.springframework.http.converter.HttpMessageNotReadableException: JSON parse error: Instantiation of [simple type, class com.fiap.selfordermanagement.adapters.driver.web.request.OrderRequest] value failed for JSON property customerNickname due to missing (therefore NULL) value for creator parameter customerNickname which is a non-nullable type]
@mateus3009 mateus3009 added bug Something isn't working question Further information is requested labels Jan 9, 2024
@wellyfrs
Copy link
Member

Essa é a razão do ID de pedido não ser UUID, mas um número incremental.

Fique à vontade para implementar uma proposta.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants