From 208622000c795678af88efd118a1ddd7e2acfbb5 Mon Sep 17 00:00:00 2001 From: Vantz Stockwell Date: Sat, 21 Feb 2026 13:24:24 -0500 Subject: [PATCH] =?UTF-8?q?fix:=20Wave=201=20=E2=80=94=20critical=20bug=20?= =?UTF-8?q?fixes=20across=209=20files?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Fix double-prefix URL bugs in 4 analytics/revenue views (/api/api → /api) - Fix AdminDashboard quick-links routing (/platform-admin/* → /admin/*) - Fix MigrationView import missing Authorization header - Remove dead ConsoleModule from app.module (conflicts with NatsBridgeGateway on /ws) - Fix store.service.ts raw Error throws → NotFoundException/ForbiddenException - Fix payment-order entity FK (webstore_subscription_id → WebstoreSubscription) Co-Authored-By: Claude Opus 4.6 --- backend-nest/src/app.module.ts | 2 - .../src/entities/payment-order.entity.ts | 5 ++- .../src/modules/store/store.service.ts | 6 +-- corrosion-final-push.md | 42 +++++++++++++++++++ frontend/src/views/admin/MapAnalyticsView.vue | 2 +- frontend/src/views/admin/MigrationView.vue | 3 ++ .../src/views/admin/PlayerRetentionView.vue | 2 +- frontend/src/views/admin/StoreRevenueView.vue | 2 +- .../src/views/admin/WipeAnalyticsView.vue | 2 +- .../views/platform-admin/AdminDashboard.vue | 8 ++-- 10 files changed, 59 insertions(+), 15 deletions(-) create mode 100644 corrosion-final-push.md diff --git a/backend-nest/src/app.module.ts b/backend-nest/src/app.module.ts index ca99b07..cffefc1 100644 --- a/backend-nest/src/app.module.ts +++ b/backend-nest/src/app.module.ts @@ -16,7 +16,6 @@ import { AuthModule } from './modules/auth/auth.module'; import { UsersModule } from './modules/users/users.module'; import { LicensesModule } from './modules/licenses/licenses.module'; import { ServersModule } from './modules/servers/servers.module'; -import { ConsoleModule } from './modules/console/console.module'; import { PlayersModule } from './modules/players/players.module'; import { WipesModule } from './modules/wipes/wipes.module'; import { MapsModule } from './modules/maps/maps.module'; @@ -86,7 +85,6 @@ import { NatsBridgeGateway } from './gateways/nats-bridge.gateway'; UsersModule, LicensesModule, ServersModule, - ConsoleModule, PlayersModule, WipesModule, MapsModule, diff --git a/backend-nest/src/entities/payment-order.entity.ts b/backend-nest/src/entities/payment-order.entity.ts index daebd04..26b743a 100644 --- a/backend-nest/src/entities/payment-order.entity.ts +++ b/backend-nest/src/entities/payment-order.entity.ts @@ -1,6 +1,7 @@ import { Entity, PrimaryGeneratedColumn, Column, ManyToOne, JoinColumn, Check } from 'typeorm'; import { Module } from './module.entity'; import { License } from './license.entity'; +import { WebstoreSubscription } from './webstore-subscription.entity'; @Entity('payment_orders') @Check(`"status" IN ('pending', 'completed', 'failed', 'refunded')`) @@ -52,7 +53,7 @@ export class PaymentOrder { @JoinColumn({ name: 'license_id' }) license: License; - @ManyToOne(() => License, { onDelete: 'SET NULL', nullable: true }) + @ManyToOne(() => WebstoreSubscription, { onDelete: 'SET NULL', nullable: true }) @JoinColumn({ name: 'webstore_subscription_id' }) - webstore_subscription: License | null; + webstore_subscription: WebstoreSubscription | null; } diff --git a/backend-nest/src/modules/store/store.service.ts b/backend-nest/src/modules/store/store.service.ts index 460e471..cb26339 100644 --- a/backend-nest/src/modules/store/store.service.ts +++ b/backend-nest/src/modules/store/store.service.ts @@ -1,4 +1,4 @@ -import { Injectable } from '@nestjs/common'; +import { Injectable, NotFoundException, ForbiddenException } from '@nestjs/common'; import { InjectRepository } from '@nestjs/typeorm'; import { Repository } from 'typeorm'; import { Module } from '../../entities/module.entity'; @@ -44,7 +44,7 @@ export class StoreService { const module = await this.moduleRepo.findOne({ where: { id: moduleId } }); if (!module) { - throw new Error('Module not found'); + throw new NotFoundException('Module not found'); } const purchase = this.purchaseRepo.create({ @@ -64,7 +64,7 @@ export class StoreService { }); if (!purchase) { - throw new Error('Module not purchased'); + throw new ForbiddenException('Module not purchased'); } // Stub - would create module_installation record diff --git a/corrosion-final-push.md b/corrosion-final-push.md new file mode 100644 index 0000000..01b4ec7 --- /dev/null +++ b/corrosion-final-push.md @@ -0,0 +1,42 @@ +# Operation: Corrosion Final Push + +**Date**: 2026-02-21 +**Operator**: XO (Opus 4.6) +**Commander**: Vantz Stockwell +**Mission**: Get Corrosion 100% wired up and finished + +--- + +## Pre-Op Intel Summary + +- **6 BROKEN views** (will error on load) +- **12 PARTIAL views** (dead buttons, missing forms) +- **5 DB tables** with no TypeORM entity +- **6 controllers** missing security guards +- **~15 backend features** are stubs +- **4 Docker issues** to harden + +## Execution Plan + +| Wave | Focus | Agents | Status | +|------|-------|--------|--------| +| 1 | Critical Bug Fixes | 3 Sonnet parallel | COMPLETE | +| 2 | Missing Entities + Security | 2 Sonnet parallel | PENDING | +| 3 | Frontend Wiring | 3 Sonnet parallel | PENDING | +| 4 | Backend Completion | 2 Sonnet parallel | PENDING | +| 5 | Docker + Polish | 1 Sonnet | PENDING | + +--- + +## Wave 1: Critical Bug Fixes + +**Status**: COMPLETE +**Started**: 2026-02-21 + +### Results (9 files modified) +1. Fixed 4 double-prefix URL bugs — removed `/api` prefix from `useApi()` calls in WipeAnalyticsView, MapAnalyticsView, PlayerRetentionView, StoreRevenueView +2. Fixed AdminDashboard quick-link paths — `/platform-admin/*` → `/admin/*` +3. Fixed MigrationView import — added auth header to raw fetch call +4. Removed ConsoleModule from app.module.ts — eliminates `/ws` namespace conflict with NatsBridgeGateway +5. Fixed Store module — `throw new Error()` → `NotFoundException` / `ForbiddenException` +6. Fixed payment-order entity FK — `webstore_subscription_id` now references `WebstoreSubscription` not `License` diff --git a/frontend/src/views/admin/MapAnalyticsView.vue b/frontend/src/views/admin/MapAnalyticsView.vue index ce41893..6483633 100644 --- a/frontend/src/views/admin/MapAnalyticsView.vue +++ b/frontend/src/views/admin/MapAnalyticsView.vue @@ -19,7 +19,7 @@ let performanceChartInstance: ECharts | null = null const loadMapAnalytics = async () => { loading.value = true try { - const response = await api.get(`/api/analytics/maps?range=${timeRange.value}`) + const response = await api.get(`/analytics/maps?range=${timeRange.value}`) analytics.value = response await nextTick() renderCharts() diff --git a/frontend/src/views/admin/MigrationView.vue b/frontend/src/views/admin/MigrationView.vue index 05a9507..6b5f1dd 100644 --- a/frontend/src/views/admin/MigrationView.vue +++ b/frontend/src/views/admin/MigrationView.vue @@ -1,6 +1,7 @@