39 lines
1.0 KiB
Elixir
39 lines
1.0 KiB
Elixir
defmodule CustomerServiceWeb.Schemas do
|
|
defmodule CustomerResponse do
|
|
require OpenApiSpex
|
|
alias OpenApiSpex.Schema
|
|
|
|
OpenApiSpex.schema(%{
|
|
title: "Customer",
|
|
type: :object,
|
|
properties: %{
|
|
id: %Schema{type: :string, format: :uuid},
|
|
first_name: %Schema{type: :string},
|
|
last_name: %Schema{type: :string},
|
|
birth_date: %Schema{type: :string, format: :date},
|
|
gender: %Schema{type: :string},
|
|
email: %Schema{type: :string, format: :email},
|
|
phone: %Schema{type: :string}
|
|
}
|
|
})
|
|
end
|
|
|
|
defmodule CreateCustomerRequest do
|
|
require OpenApiSpex
|
|
alias OpenApiSpex.Schema
|
|
|
|
OpenApiSpex.schema(%{
|
|
title: "CreateCustomer",
|
|
type: :object,
|
|
properties: %{
|
|
first_name: %Schema{type: :string},
|
|
last_name: %Schema{type: :string},
|
|
birth_date: %Schema{type: :string, format: :date},
|
|
gender: %Schema{type: :string},
|
|
email: %Schema{type: :string, format: :email},
|
|
phone: %Schema{type: :string}
|
|
}
|
|
})
|
|
end
|
|
end
|