PM-5307, PM-5306 project showcase post api#25
Open
vas3a wants to merge 4 commits into
Open
Conversation
There was a problem hiding this comment.
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 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> { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
project_showcase_posts, industry and category taxonomies, and join tables for many-to-many relationships. Indexes were added for performance.ProjectShowcasePost,ProjectPostIndustry,ProjectPostCategory, and their join tables, as well as theProjectShowcasePostStatusenum. TheProjectmodel now relates to showcase posts.API and module integration:
Introduced the
ProjectShowcasePostModuleand 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
ProjectPostCategoryModuleand registered its controller and service for category management.