Skip to content

04.02 Routing Blueprint Editor

Статус: черновик для обсуждения

1. Назначение документа

Этот документ описывает Back Office UX для routing blueprint editor.

Blueprint editor используется в двух местах:

  • Merchant section -> Payment Method / MID;
  • Merchant section -> MASTER MID.

Цель editor: дать user максимально понятный способ увидеть и настроить routing не как набор технических таблиц, а как визуальную схему execution path.

2. Главный UX принцип

Routing должен отображаться как graph / blueprint:

text
Rule / conditions -> target box -> next routing level

User должен визуально понимать:

  • какие Rules / conditions ведут к какому target;
  • какие MASTER MID GROUP подключены к Payment Method / MID;
  • какие MASTER MID находятся внутри MASTER MID GROUP;
  • какие SUB MID GROUP подключены внутри MASTER MID blueprint;
  • куда transaction пойдет при fallback;
  • какие entities являются hidden/internal для merchant user.

Таблица rules может использоваться как supporting view, но основной UX должен быть blueprint / graph со стрелками и box-ами.

3. Payment Method / MID Blueprint

В Payment Method / MID blueprint отображается first-level routing.

User видит:

  • Routing Rules первого уровня;
  • Conditions внутри каждого Rule;
  • отдельный fallback route;
  • target MASTER MID GROUP;
  • MASTER MID внутри MASTER MID GROUP;
  • selection strategy MASTER MID GROUP;
  • weights / sequence;
  • fallback enabled/disabled.

MASTER MID GROUP создается directly inside Payment Method / MID blueprint.

MASTER MID GROUP does not need a user-defined name in MVP. UI can show generated labels such as Group #1, Group #2.

Selection strategy, weights, sequence and fallback settings can be changed directly on the MASTER MID GROUP node.

If user needs to add MASTER MID to MASTER MID GROUP, user selects from existing MASTER MID. If required MASTER MID does not exist, user should go to MASTER MID page and create it there. Creating MASTER MID from Payment Method / MID blueprint modal is not required in MVP.

Merchant user может видеть только тот уровень routing, который ему разрешен.

Если MASTER MID создан platform user и скрыт от merchant user:

  • merchant user видит, что route ведет к MASTER MID / MASTER MID GROUP;
  • merchant user не видит internal MASTER MID blueprint;
  • merchant user не видит SUB MID GROUP / SUB MID / provider details.

4. MASTER MID Blueprint

В MASTER MID blueprint отображается second-level routing.

User видит:

  • Routing Rules внутри MASTER MID;
  • Conditions внутри каждого Rule;
  • отдельный fallback route;
  • target SUB MID GROUP;
  • SUB MID / SUB MID AGGREGATOR внутри SUB MID GROUP, если user имеет access;
  • selection strategy SUB MID GROUP;
  • weights / sequence;
  • fallback enabled/disabled.

SUB MID GROUP создается directly inside MASTER MID blueprint.

SUB MID GROUP does not need a user-defined name in MVP. UI can show generated labels such as Group #1, Group #2.

SUB MID GROUP candidates can include:

  • SUB MID;
  • SUB MID AGGREGATOR;
  • SUB MID and SUB MID AGGREGATOR together.

Selection strategy, weights, sequence and fallback settings can be changed directly on SUB MID GROUP node.

Fallback inside SUB MID GROUP is enabled by default.

Merchant user can add SUB MID only if:

  • SUB MID was created under this merchant;
  • SUB MID is visible to this merchant user;
  • user has required permissions.

Merchant user cannot add SUB MID AGGREGATOR.

Platform user with permission can add both SUB MID and SUB MID AGGREGATOR.

If all candidates fail/skip inside SUB MID GROUP, routing returns to MASTER MID GROUP and tries next MASTER MID if fallback is enabled there.

Merchant user может редактировать MASTER MID blueprint только если:

  • у него есть permission;
  • MASTER MID доступен ему для редактирования;
  • он имеет нужный provider access, если внутри создаются / редактируются SUB MID.

5. Routing Rule creation

User должен иметь кнопку:

text
Add Rule

После нажатия создается новый Routing Rule.

Внутри Routing Rule user может добавлять Conditions.

Conditions внутри одного Routing Rule работают через:

text
AND

Пример:

text
Rule #1:
- customer.country in [LV, LT, EE]
- amount >= 100 EUR
-> MASTER MID GROUP #1

Если user хочет OR logic, он создает несколько Routing Rules.

Пример:

text
Rule #1: country = LV -> MASTER MID GROUP #1
Rule #2: country = LT -> MASTER MID GROUP #1

6. Rule and condition editing

Внутри Routing Rule user может:

  • добавить Condition;
  • удалить Condition;
  • изменить attribute;
  • изменить operator;
  • изменить value;
  • изменить target entity для Routing Rule;
  • изменить order Routing Rule.

Fallback route редактируется отдельно от списка Routing Rules.

User может:

  • выбрать fallback target;
  • изменить fallback target;
  • очистить fallback target.

MVP attributes:

  • customer.country;
  • amount;
  • currency.

Input UX:

  • customer.country uses multi-select;
  • currency uses multi-select;
  • amount uses numeric value with operator.

Amount rules are evaluated in EUR base amount.

7. Drag-and-drop

Blueprint editor должен поддерживать drag-and-drop для изменения:

  • sequence Routing Rules;
  • sequence MASTER MID внутри MASTER MID GROUP;
  • sequence SUB MID / SUB MID AGGREGATOR внутри SUB MID GROUP.

Drag-and-drop должен менять draft version, а не published version напрямую.

Drag-and-drop is required in MVP.

8. Drafts and versions side panel

Когда user открывает Payment Method / MID или MASTER MID, справа или сбоку должен быть version panel.

Version panel должен показывать:

  • current published version;
  • current published version number;
  • active draft, если он есть;
  • active draft version number, если draft существует;
  • previous published versions;
  • versions available for rollback;
  • кто создал draft;
  • кто сейчас редактирует draft;
  • publish status;
  • last published at;
  • last published by.

User flow:

  1. User открывает configuration.
  2. User нажимает Create draft.
  3. Draft создается как copy текущей published version.
  4. User редактирует draft.
  5. User видит validation errors/warnings.
  6. User пишет publish comment / reason.
  7. Draft changes are autosaved.
  8. User нажимает Publish.
  9. Draft становится published version.
  10. Предыдущая published version остается в version history.

Publish comment / reason обязателен.

Separate Save draft button is not required because draft changes autosave.

If another user is editing active draft:

  • second user can open draft in view-only mode;
  • second user cannot edit while lock is active;
  • UI must show who is editing the draft.

9. Version deletion / archiving

User может удалить non-active version из UI, если имеет permission.

Но deletion должен быть soft-delete / archive.

Active published version удалить нельзя.

Archived/deleted non-active versions are hidden by default. User can show archived versions through a toggle.

Если version использовалась transaction processing, система должна сохранить техническую возможность расследовать transaction.

Поэтому физическое удаление version history не должно ломать transaction timeline и investigation.

10. Validation before publish

Перед publish blueprint должен пройти validation.

Validation errors должны отображаться прямо на blueprint.

Примеры validation:

  • Routing Rule without target;
  • regular Rule without conditions;
  • fallback route target missing;
  • invalid operator for selected attribute;
  • invalid amount value;
  • invalid currency code;
  • target entity missing;
  • permission/access issue.

Fallback route:

  • is configured separately from Routing Rules;
  • has one target;
  • has no conditions;
  • is used only if no regular Routing Rule matched.

Regular Routing Rule without conditions is validation error.

Route to inactive entity не должен блокировать publish в MVP.

Empty MASTER MID GROUP / SUB MID GROUP не должен блокировать publish в MVP.

Если route ведет на empty group:

  • publish разрешен;
  • UI должен показать warning;
  • runtime routing считает group exhausted и продолжает fallback flow или rejected, если fallback path недоступен.

Если route ведет на inactive MASTER MID / SUB MID / SUB MID AGGREGATOR:

  • publish разрешен;
  • UI должен показать warning;
  • runtime routing пропустит inactive candidate, если до него дойдет execution.

11. Inactive entities

Пока нет отдельного списка inactive entities, которые нужно специально подсвечивать серым цветом.

Если inactive entity отображается на blueprint, UI может показать ее как warning state.

Inactive state не должен автоматически скрывать entity из blueprint, потому что user должен понимать, что route настроен на эту entity.

12. Routing preview

Routing preview вида:

text
country = LV, amount = 20, currency = EUR -> route path

не входит в MVP.

Если routing preview будет добавлен позже, его могут запускать:

  • platform user с нужным access;
  • merchant user с нужным access.

Preview не должен раскрывать hidden/internal routing details merchant user-у.

12.1 Publish diff / preview

Отдельный visual diff / preview перед publish не входит в MVP.

Перед publish user должен видеть сам draft blueprint, validation errors/warnings and required publish comment field.

Product requirement:

text
User can publish without separate diff preview screen.

13. Test transaction

Кнопка Test transaction на странице Payment Method / MID не входит в MVP.

Test deposit можно создавать через Back Office, но это отдельный flow, не часть blueprint editor MVP.

14. Acceptance Criteria

Routing Blueprint Editor считается согласованным для MVP, если:

  • Payment Method / MID routing отображается как visual blueprint / graph.
  • MASTER MID routing отображается как visual blueprint / graph.
  • Blueprint показывает Routing Rules, Conditions, fallback route, targets and arrows.
  • Routing Rule ведет к одному target.
  • Conditions внутри Routing Rule работают через AND.
  • User может добавить Routing Rule через кнопку Add Rule.
  • User может добавлять Conditions внутри Routing Rule.
  • Drag-and-drop поддержан для sequence Routing Rules.
  • Drag-and-drop поддержан для sequence MASTER MID / SUB MID candidates.
  • Все изменения сначала применяются в draft.
  • Draft changes autosave.
  • Publish применяется только после explicit Publish.
  • Version panel показывает current published version, published version number, draft version number, drafts and previous versions.
  • Publish требует comment / reason.
  • Second user can open locked draft in view-only mode.
  • Second user cannot edit draft while another user is editing it.
  • Archived versions hidden by default and can be shown through toggle.
  • Validation errors отображаются на blueprint до publish.
  • MASTER MID GROUP создается внутри Payment Method / MID blueprint.
  • MASTER MID GROUP does not require user-defined name.
  • MASTER MID GROUP strategy/fallback/weights/sequence are editable on blueprint node.
  • Adding MASTER MID uses existing MASTER MID only.
  • Creating MASTER MID from Payment Method / MID blueprint modal is not required.
  • SUB MID GROUP создается внутри MASTER MID blueprint.
  • SUB MID GROUP does not require user-defined name.
  • SUB MID GROUP candidates can include SUB MID and SUB MID AGGREGATOR.
  • Merchant user cannot add SUB MID AGGREGATOR.
  • Platform user can add SUB MID and SUB MID AGGREGATOR.
  • SUB MID GROUP fallback is enabled by default.
  • If all SUB MID GROUP candidates fail/skip, routing returns to MASTER MID GROUP fallback.
  • Fallback route настраивается отдельно от Routing Rules.
  • Fallback route указывает на один target.
  • Fallback route has no conditions.
  • Regular Routing Rule without conditions is validation error.
  • Amount rules are evaluated in EUR base amount.
  • Route to inactive entity не блокирует publish в MVP.
  • Route to empty group не блокирует publish в MVP.
  • Inactive entity, если отображается, показывается как warning.
  • Routing preview не входит в MVP.
  • Separate visual diff / preview before publish не входит в MVP.
  • Test transaction button на blueprint не входит в MVP.
  • Merchant user не видит hidden/internal provider routing details.

15. Open Questions

Product open questions отсутствуют.

Technical/design follow-up:

  1. Определить exact visual layout для blueprint graph.
  2. Определить component behavior для drag-and-drop.
  3. Определить exact validation messages.
  4. Определить, как version panel выглядит на маленьких экранах.