Commit Graph

6 Commits

Author SHA1 Message Date
Vantz Stockwell
071ab80e40 feat: Implement Phase 6 B2B hosting integration (minimal viable B2B)
All checks were successful
Test Asgard Runner / test (push) Successful in 3s
Backend infrastructure for hosting provider reseller program (Model B).

Database Schema (Migration 012):
- hosts table: Hosting company accounts with API key authentication
- host_licenses: Tracks licenses provisioned by each host
- host_billing_records: Monthly billing data ($6/server wholesale)

Host Provisioning Service:
- API key authentication (SHA-256 hashed, bearer token)
- Bulk license provisioning (single call creates user + license + associations)
- Auto-generation: license keys, companion tokens, subdomain slugs
- Active license counting for billing
- Monthly billing record generation with CSV export support

Host API Endpoints:
- POST /api/host/provision: Bulk license creation
  * Input: server_id, hostname, customer_email
  * Output: license_key, companion_token, plugin_download_url, subdomain, panel_url
- GET /api/host/licenses: List all host-provisioned licenses with status
- GET /api/host/billing/:month: Monthly billing report (YYYY-MM format)

Security:
- Separate authentication system (API keys vs user JWTs)
- Host-level query isolation (all operations scoped by host_id)
- SHA-256 API key hashing
- CORS protection on host endpoints

Business Model:
- $6/server/month wholesale rate (configurable per host)
- Manual invoicing (no Stripe integration in MVP)
- Hosts control their own markup to end customers

Per B2B_RESELLER_PLAN.md: Minimal viable B2B implementation (Model B).
No white-label branding, SSO, or complex integration required.
Simple API-based provisioning for hosting partners.

Production ready for initial hosting partner testing.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-15 15:05:17 -05:00
Vantz Stockwell
a8b7f536b5 feat: Add Phase 5 store item management UI
All checks were successful
Test Asgard Runner / test (push) Successful in 3s
2026-02-15 15:00:00 -05:00
Vantz Stockwell
381d447dd8 feat: Add Phase 5 revenue dashboard UI
All checks were successful
Test Asgard Runner / test (push) Successful in 3s
Revenue analytics dashboard for webstore owners:
- Summary cards: Total Revenue, Transactions, Pending Deliveries, Refunds
- Revenue chart: ECharts line graph showing daily revenue (last 30 days)
- Transaction table: Date, Player, Item, Amount, Status, Delivered
- Status filter dropdown (all/delivered/paid/pending/failed/refunded)
- CSV export with full transaction details
- Color-coded status badges for quick scanning
- Manual refresh button (no auto-polling)
- Route: /admin/webstore/revenue
- API: GET /api/webstore/transactions
- TypeScript: StoreTransaction interface

Phase 5 Progress: 3/4 frontend components complete (75%)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-15 14:59:23 -05:00
Vantz Stockwell
79f5071b77 feat: Add Phase 5 customer store frontend
All checks were successful
Test Asgard Runner / test (push) Successful in 2s
Build public-facing e-commerce interface for server owners' item stores.

Components:
- StoreView.vue (420 lines): Full customer purchase flow
  * Dynamic category filtering
  * Responsive 4-column grid (mobile-first)
  * Professional card design with hover effects
  * Purchase modal with Steam ID validation (17 digits)
  * PayPal redirect flow (new window)
  * Empty/error/loading states

Features:
- Steam ID input with regex validation
- Player name input (optional)
- Purchase limit enforcement
- Item type badges (kit/rank/currency/command)
- Legal disclaimer with auto-delivery notice
- Mobile-responsive professional design
- Gradient background, shadow effects, transitions

API Integration:
- GET /api/public-store/:subdomain (store info)
- GET /api/public-store/:subdomain/items (catalog)
- POST /api/public-store/:subdomain/purchase (PayPal order)

Security:
- Public route (no auth required)
- Subdomain-scoped queries
- Steam ID validation before submission

TypeScript:
- PublicStoreInfo, PublicStoreItem
- StorePurchaseRequest, StorePurchaseResponse

Items auto-deliver via NATS webhook after payment completion.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-15 14:58:50 -05:00
Vantz Stockwell
dfd63ba1c7 feat: Add Phase 5 store configuration UI
All checks were successful
Test Asgard Runner / test (push) Successful in 2s
- Built StoreConfigView.vue for webstore setup
- Form fields: store name, description, currency (USD/EUR/GBP)
- PayPal credentials (client ID/secret) with encryption support
- Sandbox/production mode toggle with warning states
- Store enable/disable with validation
- Empty state for unconfigured stores
- TypeScript StoreConfig interface
- Route: /admin/webstore/config (auth required)
- API integration: GET/PUT /api/webstore/config
- Responsive Tailwind design

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-15 14:57:30 -05:00
Vantz Stockwell
6c2436dfc6 feat: Phase 4 module auto-installation + Phase 5 webstore backend
All checks were successful
Test Asgard Runner / test (push) Successful in 2s
Phase 4 Contributions (Agent Golf):
- Module auto-installation service (module_installer.rs)
- NATS subject pattern for module installation commands
- Companion agent contract documentation
- API endpoint: POST /api/modules/install

Phase 5 XO Direct Touch:
- Webstore subscription API (PayPal recurring billing)
  * POST /api/webstore/subscription/create
  * GET /api/webstore/subscription
  * POST /api/webstore/subscription/cancel
  * POST /api/webstore/subscription/webhook
- Store configuration API (CRUD for store settings)
  * GET /api/webstore/config
  * PUT /api/webstore/config
- Store category/item management APIs (multi-tenant CRUD)
  * GET/POST/PUT/DELETE /api/webstore/categories
  * GET/POST/PUT/DELETE /api/webstore/items
- Public store API (customer-facing, subdomain-scoped)
  * GET /api/public-store/:subdomain
  * GET /api/public-store/:subdomain/items
  * POST /api/public-store/:subdomain/purchase
  * POST /api/public-store/:subdomain/webhook
- Transaction history API
  * GET /api/webstore/transactions
- Delivery system (NATS command execution on purchase)
- Migrations: payment_orders, webstore_subscriptions, store_config, store_items, store_transactions

Security:
- JWT auth + license_id scoping on admin endpoints
- Subdomain → license_id mapping on public endpoints
- Purchase limit enforcement
- Command injection prevention via placeholder replacement

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-15 14:53:53 -05:00