Skip to content

PM-5485 - media assets for project showcase#26

Merged
vas3a merged 2 commits into
devfrom
PM-5485_project-showcase-media-asset
Jun 30, 2026
Merged

PM-5485 - media assets for project showcase#26
vas3a merged 2 commits into
devfrom
PM-5485_project-showcase-media-asset

Conversation

@vas3a

@vas3a vas3a commented Jun 29, 2026

Copy link
Copy Markdown
Collaborator

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

  • Added a new table project_showcase_post_media to store media assets linked to showcase posts, including fields for type, URL, creator, and timestamps.
  • Updated the Prisma schema to include the ProjectShowcasePostMedia model and relate it to ProjectShowcasePost.

DTO and API Changes

  • Introduced ProjectShowcasePostMediaInputDto and ProjectShowcasePostMediaDto for input and output of media assets, and extended the create/update/showcase post DTOs to include a media field.

Service Logic

  • Updated ProjectShowcasePostService to 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

  • Added and extended tests to verify creating and updating posts with media assets, ensuring correct persistence and API response structure.

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 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 ProjectShowcasePostMedia Prisma 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_media table is queried by projectShowcasePostId (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.

Comment thread src/api/project-showcase-post/dto/create-project-showcase-post.dto.ts Outdated
Comment thread src/api/project-showcase-post/project-showcase-post.service.ts
Comment thread src/api/project-showcase-post/project-showcase-post.service.ts Outdated
Comment thread src/api/project-showcase-post/project-showcase-post.service.spec.ts
Comment thread src/api/project-showcase-post/project-showcase-post.service.spec.ts
@vas3a vas3a merged commit c2cd5e9 into dev Jun 30, 2026
5 checks passed

@kkartunov kkartunov left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good

@vas3a vas3a deleted the PM-5485_project-showcase-media-asset branch June 30, 2026 05:07
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.

3 participants