Files
ruoyi-vue-pro/docs/education/migration/issues/EDU-032-native-promotion-seckill.md

4.3 KiB
Raw Permalink Blame History

EDU-032 — Activate native Promotion seckill

  • Status: done — native tenant-owned seckill configuration, activities, SKU stock, Trade Order bridge, exact RBAC, corrected Vben UI, and PostgreSQL evidence delivered
  • Type: native module takeover / special-order promotion / tenant isolation
  • Phase: 5 / commercialization foundation
  • Blockers: EDU-025, EDU-027, PostgreSQL Flyway

Problem

The source backend has no seckill table, endpoint, job, or administration surface. RuoYi already owns a complete Promotion seckill lifecycle: time configurations, SPU/SKU activity authoring, atomic stock changes, Trade Order integration, app/admin APIs, exact permissions, and two Vben administration pages. Rebuilding those behaviors in Education would create a second promotion inventory and bypass native Product, Promotion, Trade, Member, and tenant/RBAC coordination.

Repository-wide source inventory under /Users/tiku1/code/tiku-backend found no seckill or 秒杀 capability. That absence is a data decision: the target capability starts empty and no legacy records are invented.

Delivered contract

  • SeckillConfigDO, SeckillActivityDO, and SeckillProductDO extend TenantBaseDO; the native controllers, services, mappers, Product APIs, Trade Order fields, and Vben pages remain authoritative.
  • V4440 creates promotion_seckill_config, promotion_seckill_activity, and promotion_seckill_product with (tenant_id,id) ownership, explicit PostgreSQL sequences, tenant-qualified Product SPU/SKU and activity references, JSON/time/price/stock/limit/state constraints, and fail-closed adoption of pre-existing global tables.
  • Tenant-aware triggers validate every configured time slot, keep product activity snapshots aligned, and reject deletion of a slot still used by an activity. trade_order gains a tenant-qualified seckill-activity reference and an order-type/activity consistency constraint.
  • Menu IDs 70407051 reuse the existing activity and time-config pages with exactly nine controller permissions: five activity permissions and four configuration permissions.
  • Service validation rejects duplicate SKUs, seckill prices above native SKU prices, stock above native SKU stock, invalid limit relationships, and unsafe stock restoration. Closing an activity transactionally disables its product snapshots; a used time configuration cannot be deleted.
  • The Vben pages use the real backend field shapes and permissions, validate time/limit/product relationships, handle empty products and prices safely, use the correct 0=enabled switch direction, and provide responsive forms.

Legacy data decision

V4440 activates all three native tables empty. There is no source seckill state to import, reconcile, or retire. This ticket does not reinterpret ordinary products, coupons, referral campaigns, or aggregate orders as seckill activities.

Verification

  • All 51 PostgreSQL Flyway scenarios pass through V4440, including the focused table/sequence/constraint/trigger/menu shape and fail-closed adoption cases.
  • A Spring/MyBatis PostgreSQL integration test imports the real native seckill services and production tenant SQL interceptor. Tenants 10 and 20 create the same numeric config/activity/product IDs; page and detail reads remain isolated; two concurrent attempts for the final unit produce exactly one success; restoration, close-state propagation, and used-slot deletion protection are verified.
  • Promotion contract tests prove the three records participate in framework tenant isolation and activity/config/product requests reject invalid time, limit, SKU, price, stock, status, and slider-image inputs.
  • The scoped Vben seckill files pass oxlint and oxfmt checks, and the complete @vben/web-antd typecheck passes.
  • The non-clean Maven reactor install through Education succeeds across 26 required modules without stopping the running server.

Explicitly open

  • Combination, Bargain, Point, and any other special-order Promotion families require separate tenant-safe activation slices.
  • Explicit legacy Product/coupon/order/refund/referral/settlement-proof import remains separate; no source seckill import is needed.
  • Purchase-driven Education entitlement fulfillment, refund-driven entitlement revocation, configured Pay runtime, and deployed end-to-end seckill checkout evidence remain required for production acceptance.