Биллинг подписок mono (зонтик): контракт billing + ledger2 + coopback + UI — НЕ мерджить, стек на ревью #129
Open
claude
wants to merge 21 commits from
provider-billing into dev
pull from: provider-billing
merge into: C9S:dev
C9S:main
C9S:dev
C9S:marketplace2
C9S:testnet
C9S:fix/598-51-membership-fee-and-type-cleanup
C9S:feat/capital-canon
C9S:feat/598-supplier-registry
C9S:feature/capital-cpp-private-data-templates
C9S:fix/soviet-install-validation
C9S:feat/ku-selforg
C9S:feat/membership-exit
C9S:feat/marketplace-admin-orders
C9S:fix/capital-share-onproject-event
C9S:ci/independent-env-deploy
C9S:fix/registration-pending-display
C9S:coopID
C9S:feat/expense-chassis-mvp
C9S:fix/zip-utf8-flag
C9S:feat/coopid-auth-ui
C9S:feat/coopid-7-signing-bridge
C9S:feat/coopid-12-recovery-account-from-confirm
C9S:feat/coopid-epic-9-metrics
C9S:feat/coopid-epic-6-access-rules-cleanup
C9S:feat/coopid-epic-12
C9S:feat/coopid-epic-11
C9S:feat/coopid-epic-7
C9S:feat/coopid-epic-9
C9S:feat/coopid-epic-6
C9S:feat/marketplace-process-registry
C9S:feat/marketplace-notifications-map
C9S:feat/marketplace-ku-economy
C9S:savanna
C9S:feat/apps-catalog-finish
C9S:feat/epic-13-billing-package-powerup
C9S:feat/coopid-epic-4
C9S:feat/coopid-epic-3
C9S:feat/blagorost-on-chassis
C9S:feat/coopid-epic-1
C9S:feat/marketplace-coop-stock
C9S:feat/marketplace-live-catalog
C9S:feat/coop-invest-blagorost
C9S:feat/ff-release-flow
C9S:fix/marketplace-offer-instance-not-template
C9S:fix/extension-config-lost-update
C9S:feature/C28-28-email-relay
C9S:feat/E16-onsite-sign-gate
C9S:feat/pwa-version-watch
C9S:fix/participants-registry-status-badges
C9S:feat/E16-coop-categories
C9S:fix/sanitize-blockchain-error-toast
C9S:fix/wallet-withdraw-no-phantom-payment
C9S:fix/agenda-program-offer-links
C9S:feat/notification-center-dc-v3
C9S:fix/chatcoop-livekit-room-name
C9S:feat/delete-inactive-participant
C9S:feat/registration-ledger2-suspense
C9S:feat/registration-refund
C9S:feat/registration-payment-dedup
C9S:perf/factory-parallel-fetch
C9S:feat/E16-sklad-rework
C9S:fix/decision-createproject-tsc
C9S:perf/factory-weasyprint-warm-pool
C9S:feat/E16-korzina-zakaz-agregat
C9S:fix/agenda-pending-new-question
C9S:feat/soviet-negative-consensus
C9S:feat/registration-payment-decline
C9S:feat/coop-standards-audit
C9S:parser2
C9S:feat/mkt-return-chairman-cosign
C9S:feat/registration-fsm
C9S:feat/pwa-reliable-update
C9S:parser2-block-time-and-version
C9S:fix/gorozhane-phantom-cleanup
C9S:fix/remove-bank-kpp
C9S:feat/E9-3b-sub-subscribe
C9S:feat/E9-9-approve-moderation
C9S:feat/E10-5-on-chain-watcher
C9S:feat/E10-4-install-pipeline
C9S:feat/E9-3b-ui-publish-package
C9S:feat/E1-tspp-docs-real-text
C9S:feat/E10-3b-dynamic-supergraph
C9S:apps-catalog
C9S:feat/E9-9-3-b-publish-mutation
C9S:feat/sig-v2-export
C9S:feat/E10-1-federation-subgraph
C9S:parser2-epic-4-forks
C9S:feat/decision-authorize-backend
C9S:feat/blagorost-program-expenses-ui
C9S:parser2-epic-6-canonical-storage
C9S:wip/pre-e16-desktop-docs
C9S:feat/E15-min-volume-per-ku
C9S:feat/blagorost-E2-E5-program-expenses
C9S:feat/epic-14-billing-notifications
C9S:blagorost
C9S:feat/E14-explicit-shipment
C9S:feat/marketplace-collective-supply
C9S:feat/blagorost-E1-contract
C9S:feat/C28-21-pg-signed-documents
C9S:fix/desktop-format-asset-errors
C9S:feat/marketplace-docs
C9S:feat/epic-12-billing-subscriptions
C9S:fix/min-soviet-members-3
C9S:parser2-epic-3-transport
C9S:feat/marketplace2-drop-blocked
C9S:worktree-design-wave1
C9S:feat/notif-mobile-canon
C9S:fix/vue-tsc-desktop
C9S:worktree-marketplace-docs-impl
C9S:feat/chatcoop-hide-matrix-room-id
C9S:feat/epic-8-coop-registry-provider
C9S:parser2-epic-2-idempotency
C9S:feat/chatcoop-secretary-rooms
C9S:feat/remove-l3-blocked
C9S:ci-trial-typecheck-2026-05-23
C9S:fix/controller-revert-transpileonly
C9S:chore/mongo-standalone-local
C9S:chore/ci-unify-release-workflows
C9S:feat/controller-swc-builder
C9S:feat/chatcoop-transcription-memo
C9S:fix/mono-base-ca-certificates
C9S:fix/wallet-withdraw-gateway-timing
C9S:feat/ledger2-burn-blocked-withdraw
C9S:fix/boot-tests-wallet-signagree-v2
C9S:chore/trustees-ownership
C9S:feat/capital-w-cap-gen-cooperative
C9S:chore/re-review-E5-apl-fail-fast
C9S:chore/re-review-E4-fail-fast-tx-hash
C9S:chore/re-review-E3-fix-withdraw-stub
C9S:chore/review-E3-vitrina-fixes
C9S:chore/review-E10-design-fixes
C9S:chore/review-E8-spisanie-fixes
C9S:chore/review-E7-vozvrat-fixes
C9S:chore/review-E6-vydacha-fixes
C9S:chore/review-E5-postavka-fixes
C9S:chore/review-E4-order-fixes
C9S:feat/epic0-onboarding-harness
C9S:chore/marketplace2-sync-dev-and-controller-di
C9S:feat/E11-stol-zakazov-frontend-and-tests
C9S:feat/E11-stol-zakazov-final
C9S:feat/capital-artifacts-access
C9S:fix/floor-asset-display
C9S:feat/epic-9-warehouse-reporting
C9S:feat/598-11-epic-8-writeoff
C9S:feat/E7-garantiynyy-vozvrat
C9S:design
C9S:fix/capital-revert-394-generation-convert-refs
C9S:fix/is-unioned-zod-string-parse
C9S:fix/capital-rename-generation-convert-to-money-invest
C9S:feat/E6-vydacha-payshchiku
C9S:worktree-remove-1081-1082-rename-1080
C9S:feat/init-by-server-from-provider
C9S:feat/E5-postavka-priemka
C9S:feat/E11-techdebt-L12-split-payout
C9S:feat/E4-zakaz
C9S:gh-pages
C9S:feat/E3-vitrina-canon
C9S:feat/E11-S1-ledger2-marketplace-ops
C9S:file-storage
C9S:feat/1-10-marketplace-registration-offer-status
C9S:feat/1-9-marketplace-board-acceptance
C9S:feat/1-8-marketplace-access-matrix
C9S:feat/1-7-marketplace-template-registry
C9S:feat/1-6-marketplace-role-guard
C9S:feat/1-5-marketplace-member-wallet
C9S:feat/1-4-marketplace-onboarding-gate
C9S:feat/1-3-marketplace-access-by-membership
C9S:feat/1-1-install-from-catalog
C9S:ci/lock-tags-only
C9S:onboarding
C9S:reports
C9S:ledger3
C9S:graph-standarts
C9S:feat/ledger-double-entry
C9S:feat/docs-enrichment
C9S:feat/documentation
C9S:feat/marketplace-orders
C9S:feat/interops-extension-system
C9S:cursor/development-environment-setup-2882
C9S:feat/unified-test-pipeline
C9S:fix/security-vulnerabilities
C9S:audio-stream
C9S:project-authorization-on-create
C9S:refactoring
C9S:capital
C9S:element
C9S:ledger
C9S:marketplace
C9S:notifications2
C9S:notifications
C9S:document2
C9S:TSK-900
C9S:TSK-878
C9S:dacom-dark-sun/sprint-4
C9S:uniconstructor/sprint-5
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Delete Branch "provider-billing"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Зонтичный PR биллинг-стека mono в dev — чтобы стек не терялся.
Структура стека:
dev← этот PR (provider-billing: Epic 12 контракт billing + w.wal.bill + cron + desktop, Epic 8 реестр коопов) ← #49 (Epic 13 package/PowerUp + Epic 14 mono-сторона)Свежие правки 2026-06-11 (в #49): on-chain anti-replay (таблица payments), billing::pay авторизует _provider, cron-цепочка invoice→pay→confirm, реактивный BillingPaymentListener, выпилен BILLING_CRON_PAYER. Контракт требует пересборки wasm/ABI.
Статус: ревью/правки; мерджить только после явного решения. Схема потока: blago проект 43, требование d9.
🤖 Generated with Claude Code
Stories 12.1–12.3 (контракты/ledger2): 12.1 — кошелёк w.wal.bill (USER_SHARED, L3) в реестре ledger2: - ledger2_wallets::BILLING_FUND_PAY = "w.wal.bill", «Членские взносы пайщика на оплату подписок»; реестр 15→16, маппинг программ 6→7 (program_id=1, ЦК). 12.2/12.3 — две новые операции ledger2 (инвариант: одна операция = одна пара кошельков, существующие не переиспользуются): - o.bil.fund (CONVERT): TRANSFER w.wal.share → w.wal.bill, Dr 80 / Cr 86 — трансляция паевого взноса в членский на биллинг-кошелёк (зеркало o.sov.axncnv, но в персональный кошелёк, а не кооперативный пул); - o.bil.pay (PAY): TRANSFER w.wal.bill → w.sov.infra, без проводки (оба разреза счёта 86) — оплата подписки членскими взносами. - процессы p.bil.fund / p.bil.pay. 12.3 — минимальный контракт billing (ровно два действия): - convert(coopname, username, amount, document2): require_auth(coopname), presence-only проверка плательщика-кооператива (по требованию @ant — без статуса), обязательное подписанное пайщиком заявление (document2, непустой hash), один Ledger2::apply(o.bil.fund); - pay(coopname, username, amount, payment_hash, memo): require_auth(coopname), presence-only проверка кооператива, идемпотентность по payment_hash (таблица payments), Ledger2::apply(o.bil.pay); подписок on-chain не хранит. - billing добавлен в contracts_whitelist, в сборку (CMakeLists), в boot (контракт + аккаунт с eosio.code). Проверено: ledger2 и billing собираются под CDT 4.1.0 (static_assert реестров проходят; billing.wasm + ABI: actions convert/migrate/pay, table payments). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>Разблокирует coopback-cron (12.6) и desktop UI (12.7): на этом слое появляется типизированный путь cooptypes → controller → @coopenomics/sdk для contract `billing`. cooptypes (@coopenomics/cooptypes): - contracts/billing/{actions,tables}: обёртки convert/pay/migrate + таблица payments; interfaces/billing.ts (IConvert/IPay/IMigrate/IPayment/IDocument2); - регистрация _billing в common/names и BillingContract в contracts/index.ts; - wallets.generated.ts перегенерён из wallets.hpp (wallets 16, mapping 7). controller (@coopenomics/controller): - domain/billing/ports/billing-blockchain.port.ts (BILLING_BLOCKCHAIN_PORT); - infrastructure/blockchain/adapters/billing-blockchain.adapter.ts — подпись coopname@active (WIF из vault), account/action из cooptypes; прямой transact по прецеденту ledger2-walmove (операторские one-shot операции вне pending-pool); - application/billing: мутации billingConvert (роль user/member/chairman, несёт document2-заявление) и billingPay (роль chairman, идемпотентно по payment_hash); - schema.gql + zeus перегенерены (generate-schema + generate-client, +56/+280 строк, только billing). sdk (@coopenomics/sdk): - Mutations.Billing.{Convert,Pay} + selectors/billing/billingResultSelector; - регистрация домена Billing в mutations/index.ts. CLAUDE.md: снято ограничение «generate-schema/generate-client не запускать локально» (по указанию @ant — генерация отрабатывает локально при поднятом controller'е). Проверки: cooptypes/controller/sdk — tsc --noEmit чисто; cooptypes и sdk собраны (unbuild); schema/zeus-diff только billing, без постороннего шума. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>Oracle-паттерн (Antelope без deferred_trx — тик инициирует backend): - BillingProviderClient — HTTP к provider backend (server-secret): GET billing-summary + POST confirm-batch-payment; provider_base_url из конфига; - BillingCronService — на тик (config BILLING_CRON_EXPRESSION) обходит коопы (BILLING_CRON_COOPNAMES или COOPNAME узла), берёт сумму к оплате у провайдера, при total>0 и подошедшем next_payment_due проводит on-chain billing::pay через BILLING_BLOCKCHAIN_PORT, затем подтверждает платёж провайдеру; - инварианты: сумма=0 → списание не гоняется; идемпотентность по payment_hash; падение pay (нехватка на w.wal.bill) логируется и не зацикливает тик; guard от наложения тиков; cron off по умолчанию (BILLING_CRON_ENABLED=false). Плательщик (BILLING_CRON_PAYER) — пайщик, чей USER_SHARED-кошелёк w.wal.bill дебетуется: списание per-пайщик, без указанного плательщика тик пропускается (точка конфигурации до решения «кто платит за инфраструктуру коопа»). config: BILLING_CRON_ENABLED/EXPRESSION/COOPNAMES/PAYER (+ объект config.billing). Проверка: controller tsc --noEmit чисто. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>Готовит данные/документ для UI Восхода (форма конвертации + реестр коопов): Документ-заявление (Благорост-flow, по образцу 51.ConvertToAxonStatement): - cooptypes registry 1095.BillingConversionStatement (Action{convert_amount}, Meta, Model, title, HTML-context + ru-переводы: «прошу транслировать паевой в членский на биллинг-кошелёк… согласие на рекуррентные списания»); - factory: Actions/Templates 1095 + регистрация (Actions/Templates/registry/ index, factories-map). GenerateDocument теперь умеет registry_id=1095 без отдельного резолвера. getBillingSummary (проекция provider-агрегатора в GraphQL для реестра коопов): - controller: BillingSummary/BillingSummaryItem ObjectType + Query getBillingSummary(coopname, period) (роль chairman/member) → BillingProviderClient; - schema.gql + zeus перегенерены; - sdk: Queries.Billing.GetBillingSummary + billingSummarySelector. Проверки: cooptypes/factory/controller/sdk — tsc --noEmit чисто; cooptypes, factory, sdk собраны (dist), Mutations.Billing.* + Queries.Billing.* в SDK. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>ЛК пайщика (форма конвертации, AC#1): - features/Billing/ConvertToBilling: api (Mutations.Billing.Convert) + composable (generate заявление по registry 1095 → sign WIF пайщика → billingConvert), диалог (превью document2 + подпись), кнопка-триггер; isVisible — синглтон; - встроено в pages/User/WalletPage (кнопка в header + диалог). Реестр кооперативов (AC#2/#3): - entities/Billing: загрузка Queries.Billing.GetBillingSummary; - widgets/Billing/CooperativeBillingPanel: сумма к оплате/за период, дата следующего платежа, разбивка подписок с метками free/освобождён, кнопка «Оплатить/Продлить» (диалог) → features/Billing/PaySubscriptions (Mutations.Billing.Pay); - встроено в раскрытие строки pages/Union/ListOfCooperatives (доступ chairman/member — как у самой страницы реестра). ОТКРЫТО: плательщик billing::pay (USER_SHARED w.wal.bill дебетуется per-пайщик) указывается явно в диалоге оплаты — та же конфиг-точка, что BILLING_CRON_PAYER. Типы строго из @coopenomics/sdk; паттерны (generate→sign→mutation, client.Query) зеркалят features/Branch/SelectBranch. SDK/cooptypes-экспорты проверены (resolve). Полный vue-tsc по desktop не гоняется (правило проекта) — слой собран против проверенных типов SDK. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>- controller/sdk Zeus: регенерация schema.gql + zeus/{const,index}.ts под актуальный coopback (DTO 1095.BillingConversionStatement, registrator, billing-invoice). - controller billing.service / provider.service / cooperative-registry-item DTO: правки под Single-Hub. - boot init/booter+infra: подгон под новые BILLING_HUB_MODE-зависимости и init-порядок. - desktop ConnectionAgreementStepper: FSD-разгрузка ConnectionAgreementPage — FormStep удалён, выделены DomainStep + FinancialParamsStep, UnionMembershipStep/AgreementStep/ApprovalWaitingStep/InstallationStep/DomainValidationStep сокращены до канона BaseCard/BaseButton/BaseInput. - desktop entities/Wallet: новый composable useCooperativeMainWallet — единая точка для w.wal.bill COOPERATIVE. - desktop widgets/ConnectionDashboard: новый MembershipWallet поверх useCooperativeMainWallet, AxonWallet/DomainCard/SubscriptionsCard перевод на канон. - desktop pages/Union: новый CooperativeDetail; ListOfCooperatives рефакторинг. - desktop features/Billing/ConvertToBillingDialog: правки под убранный auto-setup на onboarding. - удалён мёртвый CooperativeBillingPanel widget + CooperativeDataForm feature (заменены каноном).View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.