ED-293/fixed: added support for legacy Claim structure (#29)

* fixed: added support for legacy Claim structure
This commit is contained in:
yuri-bukhalenkov 2021-11-24 13:39:53 +03:00 committed by GitHub
parent c756e131b7
commit da89dc695e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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(V1, V2, Claim = #payproc_Claim{changeset = Changeset}) ->
transmute_claim_status(V1, V2, Claim#payproc_Claim{ transmute_claim_status(V1, V2, Claim#payproc_Claim{
changeset = [transmute_party_modification(V1, V2, M) || M <- Changeset] 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 = [_ | _])}) -> transmute_claim_status(V1, V2, Claim = #payproc_Claim{status = ?accepted(Effects = [_ | _])}) ->