party-management/elvis.config
Roman Pushkov 583174c653 HG-495: chargebacks (#346)
* wip chargeback handler

* add chargeback test draft

* update deps

* update deps

* create chargeback draft

* add create chargeback to client

* create chargeback test draft

* update dmsl

* update test

* cashflow wip

* update payment events

* update deps

* attempt fix deps

* update dmsl

* update test

* add get payment chargeback to client

* add get payment chargeback handler

* cashflow wip

* fix linter errors

* wip create chargeback

* damsel update

* fix dmsl

* update dominant

* merge cb terms

* update id generation

* add test placeheolders

* update hg client

* add update chargeback

* update client

* update tests

* update events

* add implementation wip

* update cancel

* update tests

* update damsel

* add more chargeback tests

* update implementation

* update dominant

* update damsel

* some fixes

* add reopen tests with hold funds

* update reopen logic

* udpate damsel

* add cancel after reopen test

* add cancel after reopen implementation

* add more tests

* add balance checks to tests

* cashflow fix

* add more balance checks in tests

* fix cashflow bug

* add tests for reopening chargebacks after failures

* add reopen after failures handling

* finalise test to be sure

* fix test

* do not change payment status on accept with partial cash

* remove failures from tests

* update damsel

* test updates and fixes

* update implementation

* update damsel

* type cleanup, some refactoring

* cleanup, remove ct:print, refactor

* minor cleanup

* update tests

* add inconsistent currency check

* udpate damsel

* update tests

* udpate damsel

* move chargebacks to separate module

* move chargebacks to a separate module

* fix types

* some refactoring

* types, some refactoring

* update damsel

* update dominant + minor

* update tests

* update implementation

* update damsel

* fix merge

* fix lost types

* add cash to pending, remove from cb changed

* update damsel

* update damsel

* update dominant

* minor

* update events

* add params to reject

* update damsel

* update tests WIP

* update invoice payment

* update chargebacks WIP

* update tests

* update damsel

* update events

* update invoice payment

* update chargeback implementation

* minor cleanup

* increase god module cap a bit

* cleanup

* update events

* update damsel

* update tests wip

* update implementation wip

* update events in tests

* update damsel

* update chargeback events

* clean prints, restore cash flow handling on first reopen, reset target status

* fix dialyzer

* update tests

* update cash flow handling and reject logic

* fix indentation

* refactoring, moved activities to chargebacks module

* move process result to chargeback

* fix config formatting

* move no pending chargebacks check to invoice

* move getters to chargebacks module

* idempotent creation

* merge party cb terms

* syntax fixes

* fail routing with no chargeback terms

* move choose_provider_account to payment institution

* fix export

* remove unnecessary validations

* revert accessibility validation

* fix deletion

* minor refactoring

* remove pending chargebacks check from invoice

* Fix postgresql link (#421)

* refactor chargeback activity, fix idempotency

* update tests

* update dmsl

* add cb to varset

* fix

* removed get_opts, set_opts

* clean up chargebacks

* update deps

* move choose_external_account

* fix types

* add todo for cash flow rework

* remove redundant aliases

* unified define_params_cash function

* remove contract validation

* remove contract validation

* cash flow handling rework, docs update

* remove redundant validation

* fix merge

* add partial capture chargeback test

* add separate plans for stages

* wrap events externally

* add partial payment chargeback test with exceeding body

* fix type errors

* rework event handling

* elvis update

* cleanup

* move pending chargebacks check

* move validations

* move more validations

* separate body and levy in cash flow

* minor

* update cb options

* minor rename

* disable cancel during initialisation

* update activity naming

* set operation_amount to 0 on reject

* update merge_change validations

* update test chargeback test fixture

* use remaining amount if body is undefined

* add double chargeback test

* fix wrong types

* move some validations

* move create validations, update opts

* longer hold period for capture

* update damsel

* add chargeback service terms validation

* add chargeback not allowed test

* minor cleanup

* tests cleanup, add chargeback fees placeholder

* add test placeholders for provider levy

* split service and provision cf contexts

* fix typo

* update dominant

* export hg_cashflow:compute_volume/2

* update test fixture

* implement provider levy

* formatting

* update tests

* fix types

* fix types

* prolong test timeout

* merge update

* reduce allow predicate

* cb provider levy cash flow update

* cleanup

* add chargebacks to reduce

* add eligibility validation

* fix chargeback terms reduction

* throw misconfiguration if allow can not be reduced

* use add_previous_stage function

* fix type errors

* update cancel handling, store last cash flow, use cb creation timestamp, cleanup

* update hg client

* update damsel

* update tests

* add occurred_at to invoice event

* update params macros

* implement occurred_at

* export cancel params

* disable flappy tests

* fix typo

* simplify occurred_at extraction

* restore explicit clause matching in finalise

* clean ct:prints

* fix whitespace

* attempt at unflapping tests

Co-authored-by: Sergey Yelin <elinsn@gmail.com>
2020-03-27 12:58:41 +03:00

97 lines
4.3 KiB
Plaintext

[
{elvis, [
{config, [
#{
dirs => ["apps/*/src"],
filter => "*.erl",
ignore => ["_thrift.erl$"],
rules => [
{elvis_style, line_length, #{limit => 120, skip_comments => false}},
{elvis_style, no_tabs},
{elvis_style, no_trailing_whitespace},
{elvis_style, macro_module_names},
{elvis_style, operator_spaces, #{rules => [{right, ","}, {right, "++"}, {left, "++"}]}},
{elvis_style, nesting_level, #{level => 3}},
{elvis_style, god_modules, #{
limit => 30,
ignore => [hg_client_party, hg_invoice_payment, hg_client_invoicing, pm_client_party]
}},
{elvis_style, no_if_expression},
{elvis_style, invalid_dynamic_call, #{ignore => [
elvis,
hg_proto_utils, % Reads meta from autogenerated thrift modules
pm_proto_utils % Reads meta from autogenerated thrift modules
]}},
{elvis_style, used_ignored_variable},
{elvis_style, no_behavior_info},
{elvis_style, module_naming_convention, #{regex => "^([a-z][a-z0-9]*_?)*(_SUITE)?$"}},
{elvis_style, function_naming_convention, #{regex => "^([a-z][a-z0-9]*_?)*$"}},
{elvis_style, state_record_and_type},
{elvis_style, no_spec_with_records},
{elvis_style, dont_repeat_yourself, #{min_complexity => 15}},
{elvis_style, no_debug_call, #{ignore => [elvis, elvis_utils]}}
]
},
#{
dirs => ["apps/*/test"],
filter => "*.erl",
rules => [
{elvis_style, line_length, #{limit => 120, skip_comments => false}},
{elvis_style, no_tabs},
{elvis_style, no_trailing_whitespace},
{elvis_style, macro_module_names},
{elvis_style, operator_spaces, #{rules => [{right, ","}, {right, "++"}, {left, "++"}]}},
{elvis_style, nesting_level, #{level => 3}},
{elvis_style, no_if_expression},
{elvis_style, used_ignored_variable},
{elvis_style, no_behavior_info},
{elvis_style, module_naming_convention, #{regex => "^([a-z][a-z0-9]*_?)*(_SUITE)?$"}},
{elvis_style, function_naming_convention, #{regex => "^([a-z][a-z0-9]*_?)*$"}},
{elvis_style, no_spec_with_records},
{elvis_style, dont_repeat_yourself, #{min_complexity => 30, ignore => [
hg_ct_helper,
pm_ct_helper % will be moved to separate repo
]}}
]
},
#{
dirs => ["."],
filter => "Makefile",
ruleset => makefiles
},
#{
dirs => ["."],
filter => "elvis.config",
ruleset => elvis_config
},
#{
dirs => ["apps", "apps/*"],
filter => "rebar.config",
rules => [
{elvis_style, line_length, #{limit => 120, skip_comments => false}},
{elvis_style, no_tabs},
{elvis_style, no_trailing_whitespace}
]
},
#{
dirs => ["."],
filter => "rebar.config",
rules => [
{elvis_style, line_length, #{limit => 120, skip_comments => false}},
{elvis_style, no_tabs},
{elvis_style, no_trailing_whitespace}
]
},
#{
dirs => ["apps/*/src"],
filter => "*.app.src",
rules => [
{elvis_style, line_length, #{limit => 120, skip_comments => false}},
{elvis_style, no_tabs},
{elvis_style, no_trailing_whitespace}
]
}
]}
]}
].