impl string.chars
Some checks failed
Build and Publish / build-release (push) Failing after 24s

This commit is contained in:
2026-05-15 13:29:03 -05:00
parent d2f67f1e04
commit ac114869be
2 changed files with 20 additions and 8 deletions

View File

@@ -4,7 +4,7 @@ defmodule CustomerService.Aggregates.CustomerId do
customer_type: String.t(),
customer_id: String.t()
}
@derive {Jason.Encoder, only: [:org_id, :customer_type, :customer_id]}
@derive Jason.Encoder
defstruct [:org_id, :customer_type, :customer_id]
def new(org_id, customer_type, customer_id)
@@ -30,12 +30,14 @@ defmodule CustomerService.Aggregates.CustomerId do
{:error, :invalid_customer_id}
end
def to_string(%__MODULE__{
org_id: org_id,
customer_type: customer_type,
customer_id: customer_id
}) do
org_id <> ":" <> customer_type <> ":" <> customer_id
defimpl String.Chars do
def to_string(%CustomerService.Aggregates.LeadId{
org_id: org_id,
customer_type: type,
customer_id: customer_id
}) do
org_id <> ":" <> type <> ":" <> customer_id
end
end
defimpl Commanded.Serialization.JsonDecoder do