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:
@@ -31,10 +31,22 @@ const _SAMPLE_LOCATIONS = CITY_COORDINATES['Hồ Chí Minh'];
|
||||
async function seedUsers() {
|
||||
console.log('Seeding sample users...');
|
||||
|
||||
// Use deterministic IDs so we can upsert by primary key (Prisma 7 requires
|
||||
// unique fields in `where`, and `phone` is no longer unique after the PII
|
||||
// encryption migration added `phoneHash` as the unique index instead).
|
||||
const SEED_IDS = {
|
||||
admin: 'seed-user-admin',
|
||||
agent1: 'seed-user-agent1',
|
||||
agent2: 'seed-user-agent2',
|
||||
buyer: 'seed-user-buyer',
|
||||
seller: 'seed-user-seller',
|
||||
} as const;
|
||||
|
||||
const admin = await prisma.user.upsert({
|
||||
where: { phone: '0900000001' },
|
||||
where: { id: SEED_IDS.admin },
|
||||
update: {},
|
||||
create: {
|
||||
id: SEED_IDS.admin,
|
||||
phone: '0900000001',
|
||||
email: 'admin@goodgo.vn',
|
||||
fullName: 'Admin GoodGo',
|
||||
@@ -45,9 +57,10 @@ async function seedUsers() {
|
||||
});
|
||||
|
||||
const agent1 = await prisma.user.upsert({
|
||||
where: { phone: '0900000002' },
|
||||
where: { id: SEED_IDS.agent1 },
|
||||
update: {},
|
||||
create: {
|
||||
id: SEED_IDS.agent1,
|
||||
phone: '0900000002',
|
||||
email: 'agent.nguyen@goodgo.vn',
|
||||
fullName: 'Nguyễn Văn An',
|
||||
@@ -58,9 +71,10 @@ async function seedUsers() {
|
||||
});
|
||||
|
||||
const agent2 = await prisma.user.upsert({
|
||||
where: { phone: '0900000003' },
|
||||
where: { id: SEED_IDS.agent2 },
|
||||
update: {},
|
||||
create: {
|
||||
id: SEED_IDS.agent2,
|
||||
phone: '0900000003',
|
||||
email: 'agent.tran@goodgo.vn',
|
||||
fullName: 'Trần Thị Bình',
|
||||
@@ -71,9 +85,10 @@ async function seedUsers() {
|
||||
});
|
||||
|
||||
const buyer = await prisma.user.upsert({
|
||||
where: { phone: '0900000004' },
|
||||
where: { id: SEED_IDS.buyer },
|
||||
update: {},
|
||||
create: {
|
||||
id: SEED_IDS.buyer,
|
||||
phone: '0900000004',
|
||||
email: 'buyer.le@gmail.com',
|
||||
fullName: 'Lê Minh Cường',
|
||||
@@ -84,9 +99,10 @@ async function seedUsers() {
|
||||
});
|
||||
|
||||
const seller = await prisma.user.upsert({
|
||||
where: { phone: '0900000005' },
|
||||
where: { id: SEED_IDS.seller },
|
||||
update: {},
|
||||
create: {
|
||||
id: SEED_IDS.seller,
|
||||
phone: '0900000005',
|
||||
email: 'seller.pham@gmail.com',
|
||||
fullName: 'Phạm Đức Dũng',
|
||||
|
||||
Reference in New Issue
Block a user