feat: implement project development module, transfer management features, and industrial AVM model integration

This commit is contained in:
Ho Ngoc Hai
2026-04-18 20:34:35 +07:00
parent 0f3b4d7b0d
commit 38b9def99a
66 changed files with 9051 additions and 17 deletions

View File

@@ -0,0 +1,23 @@
import { Inject } from '@nestjs/common';
import { type IQueryHandler, QueryHandler } from '@nestjs/cqrs';
import {
PROJECT_REPOSITORY,
type IProjectRepository,
type ProjectDetailData,
} from '../../../domain/repositories/project-development.repository';
import { GetProjectQuery } from './get-project.query';
@QueryHandler(GetProjectQuery)
export class GetProjectHandler implements IQueryHandler<GetProjectQuery> {
constructor(
@Inject(PROJECT_REPOSITORY)
private readonly repo: IProjectRepository,
) {}
async execute(query: GetProjectQuery): Promise<ProjectDetailData | null> {
// Try slug first, then ID
const bySlug = await this.repo.findDetailBySlug(query.slugOrId);
if (bySlug) return bySlug;
return this.repo.findDetailById(query.slugOrId);
}
}

View File

@@ -0,0 +1,3 @@
export class GetProjectQuery {
constructor(public readonly slugOrId: string) {}
}

View File

@@ -0,0 +1,30 @@
import { Inject } from '@nestjs/common';
import { type IQueryHandler, QueryHandler } from '@nestjs/cqrs';
import {
PROJECT_REPOSITORY,
type IProjectRepository,
type PaginatedResult,
type ProjectListItem,
} from '../../../domain/repositories/project-development.repository';
import { ListProjectsQuery } from './list-projects.query';
@QueryHandler(ListProjectsQuery)
export class ListProjectsHandler implements IQueryHandler<ListProjectsQuery> {
constructor(
@Inject(PROJECT_REPOSITORY)
private readonly repo: IProjectRepository,
) {}
async execute(query: ListProjectsQuery): Promise<PaginatedResult<ProjectListItem>> {
return this.repo.search({
query: query.query,
status: query.status,
city: query.city,
district: query.district,
developer: query.developer,
isVerified: query.isVerified,
page: query.page,
limit: query.limit,
});
}
}

View File

@@ -0,0 +1,14 @@
import type { ProjectDevelopmentStatus } from '@prisma/client';
export class ListProjectsQuery {
constructor(
public readonly query: string | undefined,
public readonly status: ProjectDevelopmentStatus | undefined,
public readonly city: string | undefined,
public readonly district: string | undefined,
public readonly developer: string | undefined,
public readonly isVerified: boolean | undefined,
public readonly page: number,
public readonly limit: number,
) {}
}