Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
189db61
feat(api): remove AllocationNotificationService file and module refer…
yurisim Oct 9, 2025
34335e1
refactor(api): remove AllocationNotificationService dependency from A…
yurisim Oct 9, 2025
39335a9
refactor(api): remove AllocationNotificationService dependency from A…
yurisim Oct 9, 2025
d872668
refactor(api): remove legacy allocation notification handlers from Ga…
yurisim Oct 9, 2025
4d94362
feat(frontend): remove allocation-specific notification UI components
yurisim Oct 9, 2025
6f87638
refactor(frontend): remove allocation-specific notification NgRx stor…
yurisim Oct 9, 2025
1b13e10
refactor(frontend): cleanup allocation websocket and generic notifica…
yurisim Oct 9, 2025
5becea8
docs: remove outdated allocation notification system documentation
yurisim Oct 9, 2025
6c2362f
feat(backend): Simplify aircraft allocation Prisma schema
yurisim Oct 9, 2025
343debb
feat(backend): Refactor allocation DTOs and controller endpoints
yurisim Oct 9, 2025
4c9e57d
feat(backend): Implement simplified allocation service logic
yurisim Oct 9, 2025
3863040
feat(backend): Update Game Gateway for simplified allocation events
yurisim Oct 9, 2025
17e4417
refactor(frontend): Remove NgRx Allocation module
yurisim Oct 9, 2025
9bd621a
refactor(frontend): Remove NgRx ATO module
yurisim Oct 9, 2025
b2eadc7
refactor(frontend): Update core app configuration to remove NgRx modules
yurisim Oct 9, 2025
88a25f2
refactor(frontend): Decouple generic WebSocketService from NgRx store
yurisim Oct 9, 2025
383ac8c
feat(frontend): Refactor AllocationSignalService for simplified workflow
yurisim Oct 9, 2025
54c9eb1
refactor(frontend): Update FlightPlannerDialog mock data for schema c…
yurisim Oct 9, 2025
db33c0f
refactor(frontend): Migrate AtoTableComponent to AtoStateService
yurisim Oct 9, 2025
18201fc
feat(frontend): Update CAOC Dashboard for simplified allocation
yurisim Oct 9, 2025
72cf7d7
feat(frontend): Update MOB Dashboard for simplified allocation
yurisim Oct 9, 2025
f2b443d
refactor(frontend): Remove deprecated and unused components
yurisim Oct 9, 2025
c9810df
docs: Add design document for aircraft allocation simplification
yurisim Oct 9, 2025
f17a4d6
refactor(ato): Use environment.apiUrl for API calls in AtoStateService
yurisim Oct 9, 2025
26adb8c
feat(allocation): Implement AllocationStateService for aircraft alloc…
yurisim Oct 9, 2025
4ffa153
feat(allocation): Add AllocationTableComponent with UI and unit tests
yurisim Oct 9, 2025
c187534
test(api): Add E2E tests for allocation table API endpoints
yurisim Oct 9, 2025
3138f2f
Refactor: Remove deprecated allocation cycle tests
Oct 10, 2025
c8e9cd1
Chore: Add Prisma generated client cleanup to project commands
Oct 10, 2025
474e153
Refactor(api): Use DTO for allocate aircraft request body
Oct 10, 2025
0f4d72e
Feat(e2e): Refine aircraft spawning in allocation table tests
Oct 10, 2025
cac075e
Refactor(e2e): Update allocation table E2E tests for API client and r…
Oct 10, 2025
c41557f
Fix(e2e): Update deallocation idempotency test to reflect API behavior
Oct 10, 2025
215a21b
Chore(e2e): Add afterEach cleanup for allocation tests
Oct 10, 2025
da0c777
feat(allocation): Add AllocateAircraftDto
Oct 10, 2025
fdc2247
Revert "Chore: Add Prisma generated client cleanup to project commands"
Oct 10, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
429 changes: 429 additions & 0 deletions apps/pac-shield-api-e2e/src/pac-shield-api/allocation-table.spec.ts

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Test, TestingModule } from '@nestjs/testing';
import { AircraftPoolService } from './aircraft-pool.service';
import { AllocationNotificationService } from './allocation-notification.service';
import { PrismaService } from '../../prisma/prisma.service';
import { GameGateway } from '../../game/game.gateway';
import { AircraftType } from '@prisma/client';
Expand All @@ -20,15 +19,6 @@ const mockPrismaService = {
},
} as any;

const mockAllocationNotificationService = {
notifyAllocationCycleCreated: jest.fn(),
notifyAllocationCycleStatusChanged: jest.fn(),
notifyAircraftRequestCreated: jest.fn(),
notifyAircraftRequestUpdated: jest.fn(),
notifyAircraftAllocated: jest.fn(),
notifyAircraftPoolUpdated: jest.fn(),
};

const mockGameGateway = {
broadcastAllocationCycleCreated: jest.fn(),
broadcastAllocationCycleStatusChanged: jest.fn(),
Expand All @@ -43,7 +33,6 @@ const mockGameGateway = {
describe('AircraftPoolService', () => {
let service: AircraftPoolService;
let prismaService: any;
let allocationNotificationService: any;
let gameGateway: any;

beforeEach(async () => {
Expand All @@ -54,10 +43,6 @@ describe('AircraftPoolService', () => {
provide: PrismaService,
useValue: mockPrismaService,
},
{
provide: AllocationNotificationService,
useValue: mockAllocationNotificationService,
},
{
provide: GameGateway,
useValue: mockGameGateway,
Expand All @@ -67,7 +52,6 @@ describe('AircraftPoolService', () => {

service = module.get<AircraftPoolService>(AircraftPoolService);
prismaService = module.get(PrismaService);
allocationNotificationService = module.get(AllocationNotificationService);
gameGateway = module.get(GameGateway);
});

Expand Down
33 changes: 0 additions & 33 deletions apps/pac-shield-api/src/app/allocation/aircraft-pool.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import {
AircraftPool,
AircraftType
} from '@prisma/client';
import { AllocationNotificationService } from './allocation-notification.service';
import { GameGateway } from '../../game/game.gateway';

/**
Expand All @@ -16,8 +15,6 @@ import { GameGateway } from '../../game/game.gateway';
export class AircraftPoolService {
constructor(
private prisma: PrismaService,
@Inject(forwardRef(() => AllocationNotificationService))
private allocationNotificationService: AllocationNotificationService,
@Inject(forwardRef(() => GameGateway))
private gameGateway: GameGateway
) {}
Expand Down Expand Up @@ -137,9 +134,6 @@ export class AircraftPoolService {
newPools.push(pool);
}

// Notify about pool updates
await this.notifyPoolUpdated(gameId, newPools);

return newPools;
}

Expand Down Expand Up @@ -398,31 +392,4 @@ export class AircraftPoolService {

return updatedPools;
}

// =============================================
// NOTIFICATION HELPERS
// =============================================

/**
* Notify about aircraft pool updates
*/
private async notifyPoolUpdated(gameId: number, pools: AircraftPool[]): Promise<void> {
try {
const poolStats = pools.reduce((acc, pool) => {
acc[pool.aircraftType] = {
available: pool.availableCount,
allocated: pool.allocatedCount,
inTransit: pool.inTransitCount,
maintenance: pool.maintenanceCount,
total: pool.availableCount + pool.allocatedCount + pool.inTransitCount + pool.maintenanceCount
};
return acc;
}, {} as any);

await this.allocationNotificationService.notifyAircraftPoolUpdated(gameId, poolStats);
} catch (error) {
// Log error but don't fail the pool update
console.error('Failed to send pool update notification:', error);
}
}
}

This file was deleted.

Loading