Skip to content

Monobank payment settings

Purpose

TBD by human

Identity & key fields

  • Primary key: id (uuid, default gen_random_uuid()).
  • token (text, NOT NULL).
  • paymentId (uuid, NOT NULL, UNIQUE, FK → payments.settings.id, on-delete cascade).

business meaning: TBD by human

Invariants

  • paymentId is UNIQUE → one Monobank credential row per payment-settings row (enforced in tktspace-backend/libs/shared/data-access-db/src/lib/schema/payments.schema.ts).
  • paymentId ON DELETE CASCADE (enforced in tktspace-backend/libs/shared/data-access-db/src/lib/schema/payments.schema.ts).
  • token NOT NULL (enforced in tktspace-backend/libs/shared/data-access-db/src/lib/schema/payments.schema.ts).

business invariants: TBD by human

Lifecycle

No explicit lifecycle.

Relationships

  • Payment settings (ENT-036) — paymentIdpayments.settings.id, UNIQUE, on-delete cascade. 1:1.

API surfaces

SurfaceExposedNotes
clientno — secret token
businessyes — managed via payments-admin moduleSwagger UI
super-adminno

Known gotchas / open questions

  • Stores token in plaintext text — encryption-at-rest TBD by infra.
  • Note that company_subscriptions.mono_wallet_id is a separate Monobank concept (saved-card token for auto-renewal on the platform side); the token here is the company’s merchant API token.