PM-5485 - media assets for project showcase#26
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds first-class “media assets” support to Project Showcase posts by introducing a new project_showcase_post_media persistence model and threading media through DTOs, service create/update logic, and tests.
Changes:
- Added a new
ProjectShowcasePostMediaPrisma model + SQL migration table for storing per-post media assets. - Extended create/update/read flows to persist media assets (create + full replacement on update) and include them in responses.
- Added/updated DTOs and unit tests to cover create/update with media.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/api/project-showcase-post/project-showcase-post.service.ts | Includes media in queries and implements create/update persistence + response mapping for media assets. |
| src/api/project-showcase-post/project-showcase-post.service.spec.ts | Adds assertions for create/update behavior when media assets are provided. |
| src/api/project-showcase-post/dto/project-showcase-post-response.dto.ts | Adds media to the post response DTO. |
| src/api/project-showcase-post/dto/project-showcase-post-media.dto.ts | Introduces DTO describing a media asset returned from the API. |
| src/api/project-showcase-post/dto/project-showcase-post-media-input.dto.ts | Introduces input DTO for media assets in create/update requests. |
| src/api/project-showcase-post/dto/create-project-showcase-post.dto.ts | Extends create DTO with nested media input. |
| prisma/schema.prisma | Adds ProjectShowcasePostMedia model and relation from ProjectShowcasePost. |
| prisma/migrations/20260624000000_add_project_showcase_cms/migration.sql | Creates project_showcase_post_media table as part of the migration. |
Comments suppressed due to low confidence (1)
prisma/migrations/20260624000000_add_project_showcase_cms/migration.sql:69
- The new
project_showcase_post_mediatable is queried byprojectShowcasePostId(relation include), but the migration doesn't create an index for it. Add an index to avoid full-table scans as media grows.
-- Indexes for query performance
CREATE INDEX "project_showcase_posts_status_idx" ON projects."project_showcase_posts"("status");
CREATE INDEX "project_showcase_posts_project_id_idx" ON projects."project_showcase_posts"("projectId");
CREATE INDEX "project_showcase_post_industries_project_showcase_post_id_idx" ON projects."project_showcase_post_industries"("projectShowcasePostId");
CREATE INDEX "project_showcase_post_industries_industry_id_idx" ON projects."project_showcase_post_industries"("industryId");
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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 adds support for attaching media assets (such as images and videos) to project showcase posts. It introduces the necessary database schema, DTOs, service logic, and tests to enable creating, updating, and retrieving media assets associated with posts.
Database and Schema Changes
project_showcase_post_mediato store media assets linked to showcase posts, including fields for type, URL, creator, and timestamps.ProjectShowcasePostMediamodel and relate it toProjectShowcasePost.DTO and API Changes
ProjectShowcasePostMediaInputDtoandProjectShowcasePostMediaDtofor input and output of media assets, and extended the create/update/showcase post DTOs to include amediafield.Service Logic
ProjectShowcasePostServiceto handle creation, updating, and retrieval of media assets as part of project showcase posts. Media assets are now created, updated (with full replacement), and returned in API responses.Testing