Fix Interface and Controller compilation errors
Fix interface and controller compilation errors according to code conventions.
NEVER use:
as keyword (type assertion)any typeFix type issues by properly defining interfaces.
Leave as-is:
console.log in Controller catch blocksconsole.error in Controller catch blocksThese are intentional and should not be changed to NestJS Logger.
Fix compilation errors in interface and controller files to ensure npm run build:main passes.
┌─────────────────────────────────────┐
│ Step 1: Run Build │
│ npm run build:main │
└───────────────┬─────────────────────┘
│
▼
┌─────────────────────────────────────┐
│ Step 2: Parse Interface Errors │
│ - Empty interfaces {} │
│ - Type mismatches │
│ - Missing properties │
└───────────────┬─────────────────────┘
│
▼
┌─────────────────────────────────────┐
│ Step 3: Fix by Convention │
│ - Fill empty interfaces │
│ - Add typia tags │
│ - Fix nullable types │
└───────────────┬─────────────────────┘
│
▼
┌─────────────────────────────────────┐
│ Step 4: Re-run Build │
│ Loop until 0 errors │
└─────────────────────────────────────┘
npm run build:main 2>&1 | head -100
Capture interface-related errors.
Common error patterns:
Type '{}' is not assignable → Empty interfaceProperty 'X' does not exist on type '{}' → Empty interfaceType 'string' is not assignable to type 'string & Format<"uuid">' → Missing typia tagRead Prisma schema and fill interface:
// Before
export type IEntity = {};
// After
import { tags } from "typia";
export type IEntity = {
id: string & tags.Format<"uuid">;
name: string;
status: "active" | "inactive";
created_at: string & tags.Format<"date-time">;
updated_at: string & tags.Format<"date-time">;
deleted_at: (string & tags.Format<"date-time">) | null;
};
export namespace IEntity {
export type ICreate = {
name: string;
status?: "active" | "inactive"; // optional with default
};
}
export namespace IEntity {
export type IUpdate = {
name?: string;
status?: "active" | "inactive";
};
}
export namespace IEntity {
export type ISummary = {
id: string & tags.Format<"uuid">;
name: string;
status: "active" | "inactive";
created_at: string & tags.Format<"date-time">;
};
}
export namespace IEntity {
export type IRequest = {
page?: number & tags.Minimum<1>;
limit?: number & tags.Minimum<1> & tags.Maximum<100>;
search?: string;
status?: "active" | "inactive";
};
}
// UUID