From da89dc695e70bc0c20bbebc8e1c678c07f4325c7 Mon Sep 17 00:00:00 2001 From: yuri-bukhalenkov <78025148+yuri-bukhalenkov@users.noreply.github.com> Date: Wed, 24 Nov 2021 13:39:53 +0300 Subject: [PATCH] ED-293/fixed: added support for legacy Claim structure (#29) * fixed: added support for legacy Claim structure --- apps/party_management/src/pm_party_machine.erl | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/apps/party_management/src/pm_party_machine.erl b/apps/party_management/src/pm_party_machine.erl index 58eb893..a4c7ed2 100644 --- a/apps/party_management/src/pm_party_machine.erl +++ b/apps/party_management/src/pm_party_machine.erl @@ -1396,6 +1396,16 @@ transmute_state(V1, V2, ?legacy_st(Party, Timestamp, Claims, Meta, _, LastEventI transmute_claim(V1, V2, Claim = #payproc_Claim{changeset = Changeset}) -> transmute_claim_status(V1, V2, Claim#payproc_Claim{ changeset = [transmute_party_modification(V1, V2, M) || M <- Changeset] + }); +%% TODO: Hack. Remove later +transmute_claim(V1, V2, ?legacy_claim(ID, Status, Changeset, Revision, CreatedAt, UpdatedAt)) -> + transmute_claim(V1, V2, #payproc_Claim{ + id = ID, + status = Status, + changeset = Changeset, + revision = Revision, + created_at = CreatedAt, + updated_at = UpdatedAt }). transmute_claim_status(V1, V2, Claim = #payproc_Claim{status = ?accepted(Effects = [_ | _])}) ->