dont use S3 directly allow to use any document url (document service agnostic)
All checks were successful
Build and Publish / build-release (push) Successful in 1m30s

This commit is contained in:
2026-04-29 12:18:52 -05:00
parent 8782f957b0
commit d66a8805d0
16 changed files with 78 additions and 196 deletions

View File

@@ -18,22 +18,6 @@ defmodule ProviderServiceWeb.Schemas.Provider do
})
end
defmodule TemplateField do
require OpenApiSpex
OpenApiSpex.schema(%{
title: "TemplateField",
type: :object,
properties: %{
field: %Schema{type: :string, example: "beneficiary_name"},
label: %Schema{type: :string, example: "Beneficiary Name"},
type: %Schema{type: :string, enum: ["string", "date", "number", "select", "boolean"]},
required: %Schema{type: :boolean},
options: %Schema{type: :array, items: %Schema{type: :string}, nullable: true}
}
})
end
defmodule Template do
require OpenApiSpex
@@ -44,9 +28,7 @@ defmodule ProviderServiceWeb.Schemas.Provider do
template_id: %Schema{type: :string, format: :uuid},
policy_type: %Schema{type: :string, enum: ["car", "life", "fire"]},
client_type: %Schema{type: :string, enum: ["natural", "juridico"]},
s3_key: %Schema{type: :string},
version: %Schema{type: :integer},
fields: %Schema{type: :array, items: TemplateField},
document_url: %Schema{type: :string},
active: %Schema{type: :boolean}
}
})
@@ -98,12 +80,11 @@ defmodule ProviderServiceWeb.Schemas.Provider do
OpenApiSpex.schema(%{
title: "UploadTemplateRequest",
type: :object,
required: [:file, :policy_type, :client_type],
required: [:document_url, :policy_type, :client_type],
properties: %{
file: %Schema{
document_url: %Schema{
type: :string,
format: :binary,
description: "Fillable PDF (AcroForm)"
description: "URL to the uploaded document"
},
policy_type: %Schema{
type: :string,
@@ -127,8 +108,7 @@ defmodule ProviderServiceWeb.Schemas.Provider do
type: :object,
properties: %{
template_id: %Schema{type: :string, format: :uuid},
s3_key: %Schema{type: :string},
fields: %Schema{type: :array, items: TemplateField}
document_url: %Schema{type: :string}
}
})
end