diff --git a/.github/workflows/erlang-pr.yml b/.github/workflows/erlang-pr.yml index f4ac7e0..38a3288 100644 --- a/.github/workflows/erlang-pr.yml +++ b/.github/workflows/erlang-pr.yml @@ -13,6 +13,8 @@ jobs: - uses: actions/checkout@v3 - uses: valitydev/action-setup-thrift@v1 + with: + thrift-version: "0.14.2.3" - uses: erlef/setup-beam@v1 id: beam diff --git a/proto/accounter.thrift b/proto/accounter.thrift index 0639962..6f3cb69 100644 --- a/proto/accounter.thrift +++ b/proto/accounter.thrift @@ -2,7 +2,8 @@ include 'base.thrift' include 'domain.thrift' namespace java dev.vality.damsel.accounter -namespace erlang accounter +namespace erlang dmsl.accounter + typedef base.ID PlanID typedef i64 BatchID typedef i64 AccountID @@ -126,4 +127,4 @@ service Accounter { throws (1: AccountNotFound ex) domain.Amount GetAccountBalanceDiff(1: AccountID id, 2: base.Timestamp from_time, 3: base.Timestamp to_time) throws (1: AccountNotFound ex) -} \ No newline at end of file +} diff --git a/proto/base.thrift b/proto/base.thrift index 39beb9c..c074805 100644 --- a/proto/base.thrift +++ b/proto/base.thrift @@ -3,6 +3,7 @@ */ namespace java dev.vality.damsel.base +namespace erlang dmsl.base /** Идентификатор */ typedef string ID diff --git a/proto/claim_management.thrift b/proto/claim_management.thrift index 370c190..09ee13e 100644 --- a/proto/claim_management.thrift +++ b/proto/claim_management.thrift @@ -1,5 +1,5 @@ namespace java dev.vality.damsel.claim_management -namespace erlang claim_management +namespace erlang dmsl.claimmgmt include "base.thrift" include "domain.thrift" diff --git a/proto/context.thrift b/proto/context.thrift index de04cac..0754d44 100644 --- a/proto/context.thrift +++ b/proto/context.thrift @@ -2,10 +2,10 @@ * Сервис для манипуляции непрозрачным контекстом объектов. */ -include "msgpack.thrift" - namespace java dev.vality.damsel.context -namespace erlang ctx +namespace erlang dmsl.context + +include "msgpack.thrift" // Types diff --git a/proto/domain.thrift b/proto/domain.thrift index 7f5c267..5ab7a20 100644 --- a/proto/domain.thrift +++ b/proto/domain.thrift @@ -7,7 +7,7 @@ include "msgpack.thrift" include "json.thrift" namespace java dev.vality.damsel.domain -namespace erlang domain +namespace erlang dmsl.domain typedef i64 DataRevision typedef i32 ObjectID @@ -2641,16 +2641,6 @@ struct Terminal { 17: optional MerchantCategoryCode mcc } -union TerminalSelector { - 1: list decisions - 2: set value -} - -struct TerminalDecision { - 1: required Predicate if_ - 2: required TerminalSelector then_ -} - struct ProviderTerminalRef { 1: required ObjectID id 2: optional i64 priority = 1000 diff --git a/proto/domain_config.thrift b/proto/domain_config.thrift index 32168dc..82c5e39 100644 --- a/proto/domain_config.thrift +++ b/proto/domain_config.thrift @@ -6,7 +6,7 @@ include "domain.thrift" namespace java dev.vality.damsel.domain_config -namespace erl domain +namespace erlang dmsl.domain_conf /** * Маркер вершины истории. diff --git a/proto/geo_ip.thrift b/proto/geo_ip.thrift index 954363a..2d98b91 100644 --- a/proto/geo_ip.thrift +++ b/proto/geo_ip.thrift @@ -4,7 +4,7 @@ include "domain.thrift" // moved to https://github.com/valitydev/columbus-proto namespace java dev.vality.damsel.columbus -namespace erlang columbus +namespace erlang dmsl.columbus /** * Идентификатор места по базе http://www.geonames.org/ @@ -21,4 +21,4 @@ struct LocationInfo { // Полное описание локации в json // подробное описание на сайте https://www.maxmind.com/en/geoip2-city 3: optional string raw_response; -} \ No newline at end of file +} diff --git a/proto/identity_document_storage.thrift b/proto/identity_document_storage.thrift index 19c8f7e..8bd20b9 100644 --- a/proto/identity_document_storage.thrift +++ b/proto/identity_document_storage.thrift @@ -1,7 +1,7 @@ include "base.thrift" namespace java dev.vality.damsel.identity_document_storage -namespace erlang ident_doc_store +namespace erlang dmsl.identdoc_storage /** * Интерфейс для безопасного хранения идентификационных данных diff --git a/proto/json.thrift b/proto/json.thrift index e9aee2c..dbf9293 100644 --- a/proto/json.thrift +++ b/proto/json.thrift @@ -1,4 +1,4 @@ -namespace erlang json +namespace erlang dmsl.json namespace java dev.vality.damsel.json /** diff --git a/proto/merch_stat.thrift b/proto/merch_stat.thrift index 7a6bbcd..0f9214d 100644 --- a/proto/merch_stat.thrift +++ b/proto/merch_stat.thrift @@ -7,7 +7,7 @@ include "domain.thrift" include "geo_ip.thrift" namespace java dev.vality.damsel.merch_stat -namespace erlang merchstat +namespace erlang dmsl.merchstat /** * Информация о платеже. diff --git a/proto/message_sender.thrift b/proto/message_sender.thrift index 8d5f8f4..a0acad1 100644 --- a/proto/message_sender.thrift +++ b/proto/message_sender.thrift @@ -2,7 +2,7 @@ include "base.thrift" include "domain.thrift" namespace java dev.vality.damsel.message_sender -namespace erlang message_sender +namespace erlang dmsl.message_sender struct MessageAttachment{ 1: required string name diff --git a/proto/msgpack.thrift b/proto/msgpack.thrift index 0d1079e..db308e8 100644 --- a/proto/msgpack.thrift +++ b/proto/msgpack.thrift @@ -1,4 +1,4 @@ -namespace erlang msgpack +namespace erlang dmsl.msgpack namespace java dev.vality.damsel.msgpack /** diff --git a/proto/papidmt.thrift b/proto/papidmt.thrift index de767bb..2edecc8 100644 --- a/proto/papidmt.thrift +++ b/proto/papidmt.thrift @@ -1,7 +1,7 @@ include "domain_config.thrift" namespace java dev.vality.damsel.papidmt -namespace erlang papidmt +namespace erlang dmsl.papidmt struct HistoryWrapper { 1: required domain_config.History history diff --git a/proto/payment_processing.thrift b/proto/payment_processing.thrift index 7d85cce..c3c5eb1 100644 --- a/proto/payment_processing.thrift +++ b/proto/payment_processing.thrift @@ -10,7 +10,7 @@ include "repairing.thrift" include "msgpack.thrift" namespace java dev.vality.damsel.payment_processing -namespace erlang payproc +namespace erlang dmsl.payproc /* Events */ diff --git a/proto/payment_processing_errors.thrift b/proto/payment_processing_errors.thrift index b18e0f6..0f7047d 100644 --- a/proto/payment_processing_errors.thrift +++ b/proto/payment_processing_errors.thrift @@ -1,5 +1,5 @@ namespace java dev.vality.damsel.payment_processing.errors -namespace erlang payprocerr +namespace erlang dmsl.payproc_error /** * TODO diff --git a/proto/payment_tool_provider.thrift b/proto/payment_tool_provider.thrift index f619a65..eef92b6 100644 --- a/proto/payment_tool_provider.thrift +++ b/proto/payment_tool_provider.thrift @@ -2,7 +2,7 @@ include "base.thrift" include "domain.thrift" namespace java dev.vality.damsel.payment_tool_provider -namespace erlang paytoolprv +namespace erlang dmsl.paytool_provider /** Атрибуты магазина в системе упакованные в идентификатор передаваемый провайдеру. diff --git a/proto/payment_tool_token.thrift b/proto/payment_tool_token.thrift index 8b51fba..1bc4192 100644 --- a/proto/payment_tool_token.thrift +++ b/proto/payment_tool_token.thrift @@ -2,7 +2,7 @@ include "base.thrift" include "domain.thrift" namespace java dev.vality.damsel.payment_tool_token -namespace erlang ptt +namespace erlang dmsl.paytool_token /** Платежный токен, который передается плательщику. Платежный токен содержит diff --git a/proto/payout_processing.thrift b/proto/payout_processing.thrift index 6dc3bc3..0699572 100644 --- a/proto/payout_processing.thrift +++ b/proto/payout_processing.thrift @@ -3,7 +3,7 @@ include "domain.thrift" include "msgpack.thrift" namespace java dev.vality.damsel.payout_processing -namespace erlang payout_processing +namespace erlang dmsl.payout_processing typedef base.ID PayoutID typedef list Events diff --git a/proto/preauth.thrift b/proto/preauth.thrift index d47fdb1..392adec 100644 --- a/proto/preauth.thrift +++ b/proto/preauth.thrift @@ -1,7 +1,7 @@ include "base.thrift" namespace java dev.vality.damsel.preauth -namespace erlang preauth +namespace erlang dmsl.preauth union Status { 1: Granted granted diff --git a/proto/proto_limiter.thrift b/proto/proto_limiter.thrift deleted file mode 100644 index 9daa301..0000000 --- a/proto/proto_limiter.thrift +++ /dev/null @@ -1,70 +0,0 @@ -include "base.thrift" -include "domain.thrift" - -namespace java dev.vality.damsel.proto_limiter -namespace erlang proto_limiter - -/** -* Описание сущностей лимитов является частью микросервиса proto-limiter -*/ - -typedef base.ID LimitChangeID -typedef domain.TurnoverLimitID LimitID - -struct Limit { - 1: required LimitID id - 2: required domain.Cash cash - 3: optional base.Timestamp creation_time - 4: optional base.Timestamp reload_time - 5: optional string description -} - -struct LimitChange { - 1: required LimitID id - 2: required LimitChangeID change_id - 3: required domain.Cash cash - 4: required base.Timestamp operation_timestamp -} - -exception LimitNotFound {} -exception LimitChangeNotFound {} -exception RateCurrencyNotFound { - 1: required domain.CurrencySymbolicCode limit_currency - 2: required domain.CurrencySymbolicCode rate_currency -} -exception RateQuoteNotFound {} -exception ForbiddenOperationAmount { - 1: required domain.Cash amount - 2: required domain.CashRange allowed_range -} - -service Limiter { - Limit Get(1: LimitID id, 2: base.Timestamp timestamp) throws ( - 1: LimitNotFound e1, - 2: base.InvalidRequest e3 - ) - void Hold(1: LimitChange change) throws ( - 1: LimitNotFound e1, - 2: RateCurrencyNotFound e2, - 3: base.InvalidRequest e3, - 4: RateQuoteNotFound e4 - ) - void Commit(1: LimitChange change) throws ( - 1: LimitNotFound e1, - 2: LimitChangeNotFound e2, - 3: base.InvalidRequest e3 - ) - void PartialCommit(1: LimitChange change) throws ( - 1: LimitNotFound e1, - 2: LimitChangeNotFound e2, - 3: ForbiddenOperationAmount e3, - 4: base.InvalidRequest e4 - 5: RateCurrencyNotFound e5, - 6: RateQuoteNotFound e6 - ) - void Rollback(1: LimitChange change) throws ( - 1: LimitNotFound e1, - 2: LimitChangeNotFound e2, - 3: base.InvalidRequest e3 - ) -} diff --git a/proto/proxy_inspector.thrift b/proto/proxy_inspector.thrift index b4eb6bf..b2ceda0 100644 --- a/proto/proxy_inspector.thrift +++ b/proto/proxy_inspector.thrift @@ -2,7 +2,7 @@ include "base.thrift" include "domain.thrift" namespace java dev.vality.damsel.proxy_inspector -namespace erlang proxy_inspector +namespace erlang dmsl.proxy_inspector /** * Набор данных для взаимодействия с инспекторским прокси. diff --git a/proto/proxy_provider.thrift b/proto/proxy_provider.thrift index 4e8acfb..9c6c8ea 100644 --- a/proto/proxy_provider.thrift +++ b/proto/proxy_provider.thrift @@ -4,7 +4,7 @@ include "user_interaction.thrift" include "timeout_behaviour.thrift" namespace java dev.vality.damsel.proxy_provider -namespace erlang prxprv +namespace erlang dmsl.proxy_provider /** * Непрозрачное для процессинга состояние адаптера, связанное с определённой сессией взаимодействия diff --git a/proto/repairing.thrift b/proto/repairing.thrift index c9258de..c8a2586 100644 --- a/proto/repairing.thrift +++ b/proto/repairing.thrift @@ -3,7 +3,7 @@ */ namespace java dev.vality.damsel.repairing -namespace erlang repair +namespace erlang dmsl.repair include "base.thrift" diff --git a/proto/reporting.thrift b/proto/reporting.thrift index 9a59a19..19a2bc0 100644 --- a/proto/reporting.thrift +++ b/proto/reporting.thrift @@ -2,7 +2,7 @@ include "base.thrift" include "domain.thrift" namespace java dev.vality.damsel.reports -namespace erlang reports +namespace erlang dmsl.reports typedef base.Timestamp Timestamp typedef base.InvalidRequest InvalidRequest diff --git a/proto/test.thrift b/proto/test.thrift index 27dd60b..37f301d 100644 --- a/proto/test.thrift +++ b/proto/test.thrift @@ -5,6 +5,7 @@ include "base.thrift" namespace java dev.vality.damsel.test +namespace erlang dmsl.test struct Shout { 1: required string contents diff --git a/proto/timeout_behaviour.thrift b/proto/timeout_behaviour.thrift index 0600275..c0e9f2c 100644 --- a/proto/timeout_behaviour.thrift +++ b/proto/timeout_behaviour.thrift @@ -1,5 +1,6 @@ -namespace erlang tmbhv namespace java dev.vality.damsel.timeout_behaviour +namespace erlang dmsl.timeout_behaviour + include "base.thrift" include "domain.thrift" diff --git a/proto/user_interaction.thrift b/proto/user_interaction.thrift index 5818832..5247da6 100644 --- a/proto/user_interaction.thrift +++ b/proto/user_interaction.thrift @@ -1,6 +1,8 @@ -namespace java dev.vality.damsel.user_interaction include "base.thrift" +namespace java dev.vality.damsel.user_interaction +namespace erlang dmsl.user_interaction + /** * Строковый шаблон согласно [RFC6570](https://tools.ietf.org/html/rfc6570) Level 4. */ diff --git a/proto/walker.thrift b/proto/walker.thrift index 390f417..25ce104 100644 --- a/proto/walker.thrift +++ b/proto/walker.thrift @@ -3,7 +3,7 @@ include "payment_processing.thrift" namespace java dev.vality.damsel.walker - namespace erlang walker + namespace erlang dmsl.walker typedef i64 ClaimID typedef domain.PartyID PartyID diff --git a/proto/webhooker.thrift b/proto/webhooker.thrift index 86d4984..b1e46aa 100644 --- a/proto/webhooker.thrift +++ b/proto/webhooker.thrift @@ -2,7 +2,7 @@ include "base.thrift" include "domain.thrift" namespace java dev.vality.damsel.webhooker -namespace erlang webhooker +namespace erlang dmsl.webhooker typedef string Url typedef string Key @@ -180,4 +180,4 @@ service WebhookManager { service WebhookMessageService { void Send(1: WebhookID hook_id, 2: SourceID source_id) throws (1: WebhookNotFound ex1, 2: SourceNotFound ex2) -} \ No newline at end of file +} diff --git a/proto/withdrawals_domain.thrift b/proto/withdrawals_domain.thrift index d68f5ef..0611a54 100644 --- a/proto/withdrawals_domain.thrift +++ b/proto/withdrawals_domain.thrift @@ -2,7 +2,7 @@ include "base.thrift" include "domain.thrift" namespace java dev.vality.damsel.withdrawals.domain -namespace erlang wthdm +namespace erlang dmsl.wthd_domain /// Domain diff --git a/proto/withdrawals_errors.thrift b/proto/withdrawals_errors.thrift index 5275c12..6f94119 100644 --- a/proto/withdrawals_errors.thrift +++ b/proto/withdrawals_errors.thrift @@ -1,5 +1,5 @@ namespace java dev.vality.damsel.withdrawals.errors -namespace erlang wtherr +namespace erlang dmsl.wthd_error union WithdrawalFailure { 1: AuthorizationFailure authorization_failed diff --git a/proto/withdrawals_processing.thrift b/proto/withdrawals_processing.thrift index 952cf04..ce035cd 100644 --- a/proto/withdrawals_processing.thrift +++ b/proto/withdrawals_processing.thrift @@ -4,7 +4,7 @@ include "domain.thrift" include "withdrawals_domain.thrift" namespace java dev.vality.damsel.withdrawals.processing -namespace erlang wthproc +namespace erlang dmsl.wthdproc /// Processing diff --git a/proto/withdrawals_provider_adapter.thrift b/proto/withdrawals_provider_adapter.thrift index 0f4af90..75cef1d 100644 --- a/proto/withdrawals_provider_adapter.thrift +++ b/proto/withdrawals_provider_adapter.thrift @@ -4,7 +4,7 @@ include "domain.thrift" include "withdrawals_domain.thrift" namespace java dev.vality.damsel.withdrawals.provider_adapter -namespace erlang wthadpt +namespace erlang dmsl.wthd_provider typedef domain.Failure Failure diff --git a/rebar.config b/rebar.config index fd59fc6..ab3711b 100644 --- a/rebar.config +++ b/rebar.config @@ -1,6 +1,5 @@ %% Common project erlang options. {erl_opts, [ - % mandatory debug_info, warnings_as_errors, @@ -49,17 +48,17 @@ {plugins, [ {rebar3_thrift_compiler, - {git, "https://github.com/valitydev/rebar3_thrift_compiler.git", {tag, "0.3.1"}}} + {git, "https://github.com/valitydev/rebar3-thrift-compiler.git", {tag, "0.4"}}} ]}. {provider_hooks, [ {pre, [ {compile, {thrift, compile}}, - {clean , {thrift, clean }} + {clean, {thrift, clean}} ]} ]}. {thrift_compiler_opts, [ {in_dir, "proto"}, - {gen, "erlang:scoped_typenames,app_prefix=dmsl"} + {gen, "erlang:app_namespaces"} ]}.