fix(api,ci): remove type-only imports for DI and isolate CI ports from dev

- Remove `type` keyword from NestJS injectable class imports across all
  modules to fix runtime DI resolution (330+ handler/listener files)
- Offset CI docker-compose ports (5433/6380/8109/9002) to avoid
  conflicts with running dev containers
- Update .env.test, playwright.config.ts, and e2e workflow to use
  isolated CI ports with configurable overrides
- Fix prisma/seed.ts to use deterministic IDs for Prisma 7 upsert
  compatibility (phoneHash replaced phone as unique index)
- Add dedicated Docker bridge network for CI service containers

Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>
This commit is contained in:
Ho Ngoc Hai
2026-04-13 01:40:14 +07:00
parent 1617921993
commit 25420720e7
345 changed files with 3266 additions and 924 deletions

View File

@@ -1,7 +1,7 @@
import { Injectable } from '@nestjs/common';
import { PassportStrategy } from '@nestjs/passport';
import { Strategy, type Profile, type VerifyCallback } from 'passport-google-oauth20';
import { type OAuthService, type OAuthUserProfile } from '../services/oauth.service';
import { Strategy, Profile, VerifyCallback } from 'passport-google-oauth20';
import { OAuthService, type OAuthUserProfile } from '../services/oauth.service';
@Injectable()
export class GoogleOAuthStrategy extends PassportStrategy(Strategy, 'google') {

View File

@@ -1,8 +1,8 @@
import { Injectable } from '@nestjs/common';
import { PassportStrategy } from '@nestjs/passport';
import { type Request } from 'express';
import { Request } from 'express';
import { ExtractJwt, Strategy } from 'passport-jwt';
import { type JwtPayload } from '../services/token.service';
import { JwtPayload } from '../services/token.service';
function extractJwtFromCookieOrHeader(req: Request): string | null {
const cookieToken = req.cookies?.['access_token'] as string | undefined;

View File

@@ -2,7 +2,7 @@ import { Inject, Injectable, Logger } from '@nestjs/common';
import { PassportStrategy } from '@nestjs/passport';
import { Strategy } from 'passport-local';
import { DomainException, normalizeVietnamPhone, UnauthorizedException } from '@modules/shared';
import { USER_REPOSITORY, type IUserRepository } from '../../domain/repositories/user.repository';
import { USER_REPOSITORY, IUserRepository } from '../../domain/repositories/user.repository';
export interface LocalStrategyResult {
id: string;

View File

@@ -1,7 +1,7 @@
import { Injectable } from '@nestjs/common';
import { type LoggerService } from '@modules/shared';
import { type OAuthService, type OAuthUserProfile } from '../services/oauth.service';
import { type TokenPair } from '../services/token.service';
import { LoggerService } from '@modules/shared';
import { OAuthService, type OAuthUserProfile } from '../services/oauth.service';
import { TokenPair } from '../services/token.service';
/**
* Zalo OAuth2 integration.