fix policy_id and use quotetaskconsumer
All checks were successful
Build and Publish / build-release (push) Successful in 1m33s

This commit is contained in:
2026-04-20 14:43:17 -05:00
parent f59c9cadfa
commit 079837a20b
4 changed files with 93 additions and 179 deletions

View File

@@ -1,7 +1,6 @@
defmodule PolicyService.Events.Policy do
defmodule PolicyService.Events do
@moduledoc """
Policy domain events.
Contains helpers for common event functionality.
Events macro for adding JsonDecoder to domain events.
"""
alias PolicyService.Aggregates.PolicyId
@@ -17,90 +16,52 @@ defmodule PolicyService.Events.Policy do
end
end
end
end
defmodule PolicyService.Events.Policy do
@moduledoc """
Policy domain events.
"""
defmodule PolicyApplicationSubmitted do
use PolicyService.Events.Policy
use PolicyService.Events
@derive Jason.Encoder
defstruct [
:id,
:submitted_by,
:applicant_info,
:policy_details,
:selected_providers,
:submitted_at
]
defstruct [:id, :submitted_by, :applicant_info, :policy_details, :selected_providers, :submitted_at]
end
defmodule QuoteRequestSent do
use PolicyService.Events.Policy
use PolicyService.Events
@derive Jason.Encoder
defstruct [
:id,
:provider_id,
:provider_email,
:applicant_info,
:policy_details,
:requested_at
]
defstruct [:id, :provider_id, :provider_email, :applicant_info, :policy_details, :requested_at]
end
defmodule ProviderQuoteReceived do
use PolicyService.Events.Policy
use PolicyService.Events
@derive Jason.Encoder
defstruct [
:id,
:recorded_by,
:provider_id,
:quote_id,
:premium,
:coverage_details,
:valid_until,
:plans,
:received_at
]
defstruct [:id, :recorded_by, :provider_id, :quote_id, :premium, :coverage_details, :valid_until, :plans, :received_at]
end
defmodule AllQuotesReceived do
use PolicyService.Events.Policy
use PolicyService.Events
@derive Jason.Encoder
defstruct [:id, :quote_count]
end
defmodule QuoteAccepted do
use PolicyService.Events.Policy
use PolicyService.Events
@derive Jason.Encoder
defstruct [
:id,
:accepted_by,
:quote,
:plan,
:provider,
:accepted_at
]
defstruct [:id, :accepted_by, :quote, :plan, :provider, :accepted_at]
end
defmodule SolicitationSent do
use PolicyService.Events.Policy
use PolicyService.Events
@derive Jason.Encoder
defstruct [
:id,
:solicitation_id,
:provider_id,
:template_id,
:s3_key,
:sent_at
]
defstruct [:id, :solicitation_id, :provider_id, :template_id, :s3_key, :sent_at]
end
defmodule PolicyIssued do
use PolicyService.Events.Policy
use PolicyService.Events
@derive Jason.Encoder
defstruct [
:id,
:policy_number,
:effective_date,
:expiry_date,
:issued_at
]
defstruct [:id, :policy_number, :effective_date, :expiry_date, :issued_at]
end
end