add quick leads
All checks were successful
Build and Publish / build-release (push) Successful in 2m13s

This commit is contained in:
2026-04-30 16:40:40 -05:00
parent 3a22776568
commit cfd810beba
20 changed files with 1054 additions and 11 deletions

View File

@@ -114,6 +114,44 @@ defmodule CustomerServiceWeb.Schemas.Customer do
})
end
defmodule UpdateCustomer do
require OpenApiSpex
OpenApiSpex.schema(%{
title: "UpdateCustomer",
type: :object,
properties: %{
first_name: %Schema{type: :string},
last_name: %Schema{type: :string},
email: %Schema{type: :string, format: :email},
phone: %Schema{type: :string},
birth_date: %Schema{type: :string, format: :date},
gender: %Schema{type: :string},
document_id: %Schema{type: :string},
address: %Schema{type: :string}
}
})
end
defmodule UpdateCorporateCustomer do
require OpenApiSpex
OpenApiSpex.schema(%{
title: "UpdateCorporateCustomer",
type: :object,
properties: %{
legal_name: %Schema{type: :string},
commercial_name: %Schema{type: :string},
ruc: %Schema{type: :string},
legal_rep_name: %Schema{type: :string},
legal_rep_document_id: %Schema{type: :string},
email: %Schema{type: :string, format: :email},
phone: %Schema{type: :string},
address: %Schema{type: :string}
}
})
end
defmodule CustomerListResponse do
require OpenApiSpex

View File

@@ -0,0 +1,141 @@
defmodule CustomerServiceWeb.Schemas.Lead do
alias OpenApiSpex.Schema
defmodule PaginationMeta do
require OpenApiSpex
OpenApiSpex.schema(%{
title: "PaginationMeta",
type: :object,
properties: %{
total_count: %Schema{type: :integer},
total_pages: %Schema{type: :integer},
current_page: %Schema{type: :integer},
page_size: %Schema{type: :integer},
has_next: %Schema{type: :boolean},
has_prev: %Schema{type: :boolean}
}
})
end
defmodule LeadData do
require OpenApiSpex
OpenApiSpex.schema(%{
title: "QuickLead",
type: :object,
properties: %{
id: %Schema{type: :string, format: :uuid},
name: %Schema{type: :string},
email: %Schema{type: :string, format: :email},
phone: %Schema{type: :string},
company_name: %Schema{type: :string},
status: %Schema{
type: :string,
enum: ["new", "contacted", "qualified", "proposal", "negotiation", "converted", "lost"]
},
priority: %Schema{type: :string, enum: ["low", "medium", "high"]},
source: %Schema{
type: :string,
enum: ["website", "referral", "social_media", "cold_call", "email_campaign", "other"]
},
notes: %Schema{type: :string},
assigned_to: %Schema{type: :string},
estimated_value: %Schema{type: :string},
expected_close_date: %Schema{type: :string, format: :date},
status_history: %Schema{type: :array, items: %Schema{type: :object}},
inserted_at: %Schema{type: :string, format: :"date-time"},
updated_at: %Schema{type: :string, format: :"date-time"}
}
})
end
defmodule CreateQuickLead do
require OpenApiSpex
OpenApiSpex.schema(%{
title: "CreateQuickLead",
type: :object,
required: [:name],
properties: %{
name: %Schema{type: :string},
email: %Schema{type: :string, format: :email},
phone: %Schema{type: :string},
company_name: %Schema{type: :string},
status: %Schema{
type: :string,
enum: ["new", "contacted", "qualified", "proposal", "negotiation", "converted", "lost"]
},
priority: %Schema{type: :string, enum: ["low", "medium", "high"]},
source: %Schema{
type: :string,
enum: ["website", "referral", "social_media", "cold_call", "email_campaign", "other"]
},
notes: %Schema{type: :string},
assigned_to: %Schema{type: :string},
estimated_value: %Schema{type: :string},
expected_close_date: %Schema{type: :string, format: :date}
}
})
end
defmodule UpdateQuickLead do
require OpenApiSpex
OpenApiSpex.schema(%{
title: "UpdateQuickLead",
type: :object,
properties: %{
name: %Schema{type: :string},
email: %Schema{type: :string, format: :email},
phone: %Schema{type: :string},
company_name: %Schema{type: :string},
notes: %Schema{type: :string},
assigned_to: %Schema{type: :string},
estimated_value: %Schema{type: :string},
expected_close_date: %Schema{type: :string, format: :date}
}
})
end
defmodule UpdateLeadStatus do
require OpenApiSpex
OpenApiSpex.schema(%{
title: "UpdateLeadStatus",
type: :object,
required: [:status],
properties: %{
status: %Schema{
type: :string,
enum: ["new", "contacted", "qualified", "proposal", "negotiation", "converted", "lost"]
}
}
})
end
defmodule LeadListResponse do
require OpenApiSpex
OpenApiSpex.schema(%{
title: "LeadListResponse",
type: :object,
properties: %{
data: %Schema{type: :array, items: LeadData},
meta: PaginationMeta
}
})
end
defmodule LeadResponse do
require OpenApiSpex
OpenApiSpex.schema(%{
title: "LeadResponse",
type: :object,
properties: %{
data: LeadData
}
})
end
end