Skip to content

PM-5307, PM-5306 project showcase post api#25

Open
vas3a wants to merge 4 commits into
devfrom
PM-5307_project-showcase-post-api
Open

PM-5307, PM-5306 project showcase post api#25
vas3a wants to merge 4 commits into
devfrom
PM-5307_project-showcase-post-api

Conversation

@vas3a

@vas3a vas3a commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator

This pull request introduces a new "Project Showcase Posts" feature to the project management system. It adds database schema changes, Prisma models, and a new API module to support creating, listing, and managing showcase posts linked to projects, including taxonomy for industries and categories. The implementation includes DTOs, controllers, and services for managing posts and their taxonomies, with filtering and pagination support.

Database and ORM changes:

  • Added new tables and enums for project showcase posts, including project_showcase_posts, industry and category taxonomies, and join tables for many-to-many relationships. Indexes were added for performance.
  • Updated the Prisma schema with new models: ProjectShowcasePost, ProjectPostIndustry, ProjectPostCategory, and their join tables, as well as the ProjectShowcasePostStatus enum. The Project model now relates to showcase posts.

API and module integration:

  • Introduced the ProjectShowcasePostModule and registered it in the main API module to expose showcase post endpoints.

  • Added DTOs for creating, updating, listing, and responding with project showcase posts, including support for filtering, pagination, and taxonomy associations.

  • Added DTOs and controllers for managing project post categories, including creation, update, deletion, and retrieval endpoints, with admin-only protections for mutations.
    Module setup:

  • Added the ProjectPostCategoryModule and registered its controller and service for category management.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new “Project Showcase Posts” feature area to the Projects API, including persistence (Prisma + SQL migrations) and new REST endpoints for managing showcase posts and their supporting taxonomies (industries/categories).

Changes:

  • Introduces Prisma models + SQL migration for ProjectShowcasePost, status enum, taxonomy tables, and join tables.
  • Adds NestJS module/controller/service + DTOs for showcase posts with filtering, sorting, and pagination.
  • Adds taxonomy controllers/services for industries and categories, plus related metadata constants and Swagger/module wiring updates.

Reviewed changes

Copilot reviewed 28 out of 28 changed files in this pull request and generated 17 comments.

Show a summary per file
File Description
test/fixtures/database-seed.ts Updates fixture seeding to match ProjectHistory audit fields.
src/shared/constants/event.constants.ts Adds metadata resource keys for post industry/category.
src/main.ts Extends Swagger module inclusion list to include MetadataModule.
src/api/api.module.ts Registers ProjectShowcasePostModule in the main API module.
src/api/metadata/metadata.module.ts Updates documentation comment describing aggregated metadata modules.
src/api/project-showcase-post/project-showcase-post.module.ts New module wiring for showcase posts + taxonomy endpoints.
src/api/project-showcase-post/project-showcase-post.controller.ts New REST endpoints for listing/searching/CRUD showcase posts under /projects.
src/api/project-showcase-post/project-showcase-post.service.ts Implements persistence, permission checks, filtering/sort/pagination, and nested taxonomy writes.
src/api/project-showcase-post/dto/create-project-showcase-post.dto.ts DTO for creating showcase posts (title/content/status/taxonomy/challenges).
src/api/project-showcase-post/dto/update-project-showcase-post.dto.ts DTO for updating showcase posts (partial).
src/api/project-showcase-post/dto/project-showcase-post-list-query.dto.ts Query DTO for filtering/sorting/pagination.
src/api/project-showcase-post/dto/project-showcase-post-response.dto.ts Response DTO for showcase posts.
src/api/project-showcase-post/project-post-industry/project-post-industry.module.ts New module for industry taxonomy endpoints.
src/api/project-showcase-post/project-post-industry/project-post-industry.controller.ts CRUD(-ish) endpoints for industry taxonomy.
src/api/project-showcase-post/project-post-industry/project-post-industry.service.ts Industry taxonomy persistence + (no-op) metadata event calls.
src/api/project-showcase-post/project-post-industry/dto/create-project-post-industry.dto.ts Create DTO for industry taxonomy.
src/api/project-showcase-post/project-post-industry/dto/update-project-post-industry.dto.ts Update DTO for industry taxonomy (partial).
src/api/project-showcase-post/project-post-industry/dto/project-post-industry-response.dto.ts Response DTO for industry taxonomy.
src/api/project-showcase-post/project-post-category/project-post-category.module.ts New module for category taxonomy endpoints.
src/api/project-showcase-post/project-post-category/project-post-category.controller.ts CRUD(-ish) endpoints for category taxonomy.
src/api/project-showcase-post/project-post-category/project-post-category.service.ts Category taxonomy persistence + (no-op) metadata event calls.
src/api/project-showcase-post/project-post-category/dto/create-project-post-category.dto.ts Create DTO for category taxonomy.
src/api/project-showcase-post/project-post-category/dto/update-project-post-category.dto.ts Update DTO for category taxonomy (partial).
src/api/project-showcase-post/project-post-category/dto/project-post-category-response.dto.ts Response DTO for category taxonomy.
prisma/schema.prisma Adds Prisma enum + models for showcase posts, taxonomies, and join tables; relates posts to Project.
prisma/migrations/20260624000000_add_project_showcase_cms/migration.sql Creates enum + tables + indexes for showcase posts and taxonomies.
prisma/migrations/0_init/migration.sql Adds/updates baseline schema migration content in-repo.
prisma/add_types.sql Adds ProjectShowcasePostStatus enum creation for bootstrap/type management.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread prisma/add_types.sql
Comment on lines +223 to +228
CREATE TYPE projects."ProjectShowcasePostStatus" AS ENUM (
'draft',
'published',
'archived'
);
END IF;
Comment on lines +38 to +41
@ApiPropertyOptional({ description: 'Filter by post status (draft, published, archived)' })
@IsOptional()
@Transform(({ value }) => parseFilterInput(value))
status?: string | string[] | Record<string, unknown>;
Comment on lines +327 to +334
const status = this.toStringListFilter(
criteria.status,
) as ProjectShowcasePostStatus[];
if (status.length === 1) {
where.status = status[0];
} else if (status.length > 1) {
where.status = { in: status };
}
Comment on lines +1 to +24
import { Module } from '@nestjs/common';
import { GlobalProvidersModule } from 'src/shared/modules/global/globalProviders.module';
import { ProjectShowcasePostController } from './project-showcase-post.controller';
import { ProjectShowcasePostService } from './project-showcase-post.service';
import { ProjectPostCategoryController } from './project-post-category/project-post-category.controller';
import { ProjectPostCategoryService } from './project-post-category/project-post-category.service';
import { ProjectPostIndustryController } from './project-post-industry/project-post-industry.controller';
import { ProjectPostIndustryService } from './project-post-industry/project-post-industry.service';

@Module({
imports: [GlobalProvidersModule],
controllers: [
ProjectShowcasePostController,
ProjectPostCategoryController,
ProjectPostIndustryController,
],
providers: [
ProjectShowcasePostService,
ProjectPostCategoryService,
ProjectPostIndustryService,
],
exports: [ProjectShowcasePostService],
})
export class ProjectShowcasePostModule {}
Comment on lines 24 to +30
* - `OrgConfigModule`: organization-level config entries.
* - `FormModule`: versioned form definitions.
* - `PlanConfigModule`: versioned plan configuration definitions.
* - `PriceConfigModule`: versioned pricing configuration definitions.
* - `WorkManagementPermissionModule`: permission policy records by template.
* - `ProjectPostIndustryModule`: project showcase post industry taxonomy.
* - `ProjectPostCategoryModule`: project showcase post category taxonomy.
Comment on lines +98 to +101
const parsedId = parseInt(id, 10);
if (Number.isNaN(parsedId)) {
throw new NotFoundException(`Category not found for id ${id}.`);
}
Comment on lines +133 to +136
const parsedId = parseInt(id, 10);
if (Number.isNaN(parsedId)) {
throw new NotFoundException(`Category not found for id ${id}.`);
}
Comment on lines +82 to +86
@Delete(':id')
@HttpCode(204)
@AdminOnly()
@ApiOperation({ summary: 'Delete project showcase post category (soft delete)' })
@ApiParam({ name: 'id', description: 'Category id' })
Comment on lines +1 to +15
import { ApiProperty } from '@nestjs/swagger';

export class ProjectShowcasePostResponseDto {
@ApiProperty()
id: string;

@ApiProperty()
title: string;

@ApiProperty()
content: string;

@ApiProperty()
status: string;

Comment on lines +140 to +144
async createPost(
projectId: string,
dto: CreateProjectShowcasePostDto,
user: JwtUser,
): Promise<ProjectShowcasePostResponseDto> {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants