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:
@@ -1,9 +1,9 @@
|
||||
import { Inject, Injectable } from '@nestjs/common';
|
||||
import { Prisma } from '@prisma/client';
|
||||
import { type LoggerService, type PrismaService } from '@modules/shared';
|
||||
import { LoggerService, PrismaService } from '@modules/shared';
|
||||
import {
|
||||
SEARCH_REPOSITORY,
|
||||
type ISearchRepository,
|
||||
ISearchRepository,
|
||||
type ListingDocument,
|
||||
} from '../../domain/repositories/search.repository';
|
||||
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { Prisma } from '@prisma/client';
|
||||
import { type LoggerService, type PrismaService } from '@modules/shared';
|
||||
import { LoggerService, PrismaService } from '@modules/shared';
|
||||
import {
|
||||
type ISearchRepository,
|
||||
ISearchRepository,
|
||||
type ListingDocument,
|
||||
type SearchParams,
|
||||
type SearchResult,
|
||||
} from '../../domain/repositories/search.repository';
|
||||
import { buildSearchConditions, buildOrderClause } from './search-query-builder';
|
||||
import { type RawListingRow, mapRowToListingDocument } from './search-result-mapper';
|
||||
import { RawListingRow, mapRowToListingDocument } from './search-result-mapper';
|
||||
|
||||
/**
|
||||
* PostgreSQL-backed search repository used as a fallback when Typesense
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { InjectMetric } from '@willsoto/nestjs-prometheus';
|
||||
import { type Counter } from 'prom-client';
|
||||
import { Counter } from 'prom-client';
|
||||
import {
|
||||
CircuitBreaker,
|
||||
CircuitOpenError,
|
||||
type CircuitState,
|
||||
type LoggerService,
|
||||
LoggerService,
|
||||
} from '@modules/shared';
|
||||
import {
|
||||
type ISearchRepository,
|
||||
ISearchRepository,
|
||||
type ListingDocument,
|
||||
type SearchParams,
|
||||
type SearchResult,
|
||||
} from '../../domain/repositories/search.repository';
|
||||
import { type PostgresSearchRepository } from './postgres-search.repository';
|
||||
import { type TypesenseSearchRepository } from './typesense-search.repository';
|
||||
import { PostgresSearchRepository } from './postgres-search.repository';
|
||||
import { TypesenseSearchRepository } from './typesense-search.repository';
|
||||
|
||||
export const SEARCH_DEGRADATION_TOTAL = 'search_degradation_total';
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Prisma } from '@prisma/client';
|
||||
import { type SearchParams } from '../../domain/repositories/search.repository';
|
||||
import { SearchParams } from '../../domain/repositories/search.repository';
|
||||
import { parseFilterBy } from './search-filter-parser';
|
||||
|
||||
const FTS_COLUMNS = `coalesce(p."title", '') || ' ' || coalesce(p."description", '') || ' ' || coalesce(p."address", '') || ' ' || coalesce(p."district", '') || ' ' || coalesce(p."city", '')`;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { type ListingDocument } from '../../domain/repositories/search.repository';
|
||||
import { ListingDocument } from '../../domain/repositories/search.repository';
|
||||
|
||||
export interface RawListingRow {
|
||||
listingId: string;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Injectable, type OnModuleInit } from '@nestjs/common';
|
||||
import { Injectable, OnModuleInit } from '@nestjs/common';
|
||||
import { Client as TypesenseClient } from 'typesense';
|
||||
import { type LoggerService } from '@modules/shared';
|
||||
import { LoggerService } from '@modules/shared';
|
||||
|
||||
@Injectable()
|
||||
export class TypesenseClientService implements OnModuleInit {
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { type Client as TypesenseClient } from 'typesense';
|
||||
import { type CollectionCreateSchema } from 'typesense/lib/Typesense/Collections';
|
||||
import { type LoggerService } from '@modules/shared';
|
||||
import { Client as TypesenseClient } from 'typesense';
|
||||
import { CollectionCreateSchema } from 'typesense/lib/Typesense/Collections';
|
||||
import { LoggerService } from '@modules/shared';
|
||||
import {
|
||||
type ISearchRepository,
|
||||
ISearchRepository,
|
||||
type ListingDocument,
|
||||
type SearchParams,
|
||||
type SearchResult,
|
||||
} from '../../domain/repositories/search.repository';
|
||||
import { type TypesenseClientService } from './typesense-client.service';
|
||||
import { TypesenseClientService } from './typesense-client.service';
|
||||
|
||||
const COLLECTION_NAME = 'listings';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user