Files
ruoyi-vue-pro/docs/education/migration/issues/EDU-013-commercialization.md

57 lines
2.9 KiB
Markdown

# EDU-013 — Education commercialization binding
- **Status:** in-progress
- **Type:** bounded implementation
- **Phase:** 5
- **Blockers:** Mall order-item paid/refunded public event, CRM referral/commission public contract
## Delivered bounded slice
Education now owns only:
- `QUESTION_COLLECTION` to Mall SPU bindings;
- tenant/member/resource entitlement aggregate;
- duplicate-safe grant, revoke, refund, and time-based expiry decisions;
- admin fulfillment endpoints and an internal public Java API;
- fail-closed collection question and new-practice access checks.
`education_question_collection.access_mode` is authoritative (`FREE`, `PRIVATE`, `PAID`). Existing `access_rules` remains descriptive metadata and is never evaluated for authorization. Financial orders, payment status, refund status, amounts, and ledgers remain outside Education.
The Product public API can validate SPUs when a Product adapter is installed, but the current reactor does not enable Mall. Current Trade public DTOs omit order items/SKU data and Pay callbacks cannot fan out, so no adapter pretends to infer fulfillment from insufficient signatures. Mall-owned automatic fulfillment remains blocked on a public paid/refunded order-item event.
## Public/admin interfaces
- `EducationEntitlementApi`: idempotent grant/revoke/refund and access check for trusted module adapters.
- `POST /admin-api/education/commercialization/bindings`
- `PUT /admin-api/education/commercialization/bindings/{resourceType}/{resourceId}/deactivate`
- `POST /admin-api/education/commercialization/entitlement-events`
Permissions: `education:commercialization:binding`, `education:commercialization:entitlement`.
## Outcome
Education products and access rights are connected to Mall, Pay, Member, and CRM without creating a parallel product, order, payment, refund, membership, or financial ledger in Education.
## Education ownership
Education may own only domain bindings and fulfillment orchestration, such as:
- education product to course/exam/content binding;
- entitlement scope and education-resource association;
- duplicate-safe fulfillment event state where no platform facility exists.
## Acceptance criteria
- [x] Mall/Pay/Member/CRM public contracts are mapped before implementation.
- [x] Payment callbacks and refunds remain in Pay.
- [x] Generic products/orders remain in Mall where applicable.
- [x] Entitlement issuance, revocation, expiry, and refund effects are explicit and idempotent.
- [x] Paid/private practice remains inaccessible until entitlement checks are complete.
- [x] Reconciliation and commission/referral ownership is explicit.
- [x] Financial and authorization tests cover duplicate callbacks and cross-tenant access.
## Risk and rollback
- **Risk:** Very high financial and access-control risk.
- **Rollback:** Disable fulfillment handlers and paid access; preserve financial ledgers in their owning modules.