OPS-161: Fix potentially broken sets during migration (#21)

This commit is contained in:
Andrew Mayorov 2022-09-01 17:30:31 +03:00 committed by GitHub
parent 6f4ec7d9b8
commit 818360deb8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -28,6 +28,10 @@ migrate_legacy_payment_system_conditions(Data) ->
% anyway.
genlib_ted:run(
fun
({AllAnyOf, PredicateSet}, _Annos) when AllAnyOf == all_of; AllAnyOf == any_of ->
% NOTE
% Reconstruct potentially broken set (e.g. with duplicate elements).
{replace, ordsets:from_list(migrate_legacy_payment_system_conditions(PredicateSet))};
(Condition = #domain_BankCardCondition{}, _Annos) ->
{replace, migrate_legacy_payment_system_condition(Condition)};
(_, _Annos) ->