WIP
This commit is contained in:
38
lib/customer_service_web/schemas/customer.ex
Normal file
38
lib/customer_service_web/schemas/customer.ex
Normal file
@@ -0,0 +1,38 @@
|
||||
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
|
||||
Reference in New Issue
Block a user