-
Notifications
You must be signed in to change notification settings - Fork 0
chore: store-detail 구매자 조회 API 릴리즈 #161
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
78992f8
feat(store): 구매자 매장 상세 조회(storeDetail)와 StoreImage 스키마 추가
chanwoo7 04d5fc6
fix(store): 재시드 시 store_image FK 위반 방지 (resetSeedScope 정리 추가)
chanwoo7 03ab4d7
Merge pull request #157 from CaQuick/feat/store-detail-header
chanwoo7 703b5ae
feat(product): 구매자 매장 상품 목록·카테고리 조회 API
chanwoo7 24db098
fix(product): storeProductCategories에 매장 활성 필터 추가 (storeProducts와 일관)
chanwoo7 3f737ee
feat(store): 구매자 매장 후기 목록 조회(storeReviews)와 좋아요 집계
chanwoo7 847f8ac
fix(store): storeReviews를 활성 매장으로 제한 (storeDetail과 일관)
chanwoo7 e7efcdf
fix(product): storeProducts categoryIds·필터를 활성 카테고리로 제한
chanwoo7 fa88dc1
fix(store): storeReviews에서 탈퇴 작성자 닉네임 익명화
chanwoo7 6ea5913
fix(product): storeProducts 검색에서 soft-delete된 태그 제외
chanwoo7 7583830
Merge pull request #159 from CaQuick/feat/store-detail-reviews
chanwoo7 b778b39
fix(product): storeProducts의 0 값 ID 필터를 보존
chanwoo7 a8fd88b
fix(store): storeReviews의 0 값 cursor를 보존
chanwoo7 e028054
Merge pull request #158 from CaQuick/feat/store-detail-products
chanwoo7 93882a4
Merge pull request #160 from CaQuick/feat/store-review-cursor-fix
chanwoo7 41c1df9
fix: 릴리즈 리뷰 반영 (StoreImage soft-delete 등록·빈값/0n ID 방어·discountRate cl…
chanwoo7 64ea223
Merge pull request #162 from CaQuick/fix/store-detail-review-followups
chanwoo7 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
prisma/migrations/20260623175315_add_store_image_and_detail_columns/migration.sql
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| -- AlterTable | ||
| ALTER TABLE `store` ADD COLUMN `access_guide_text` VARCHAR(500) NULL, | ||
| ADD COLUMN `regular_closure_text` VARCHAR(200) NULL; | ||
|
|
||
| -- CreateTable | ||
| CREATE TABLE `store_image` ( | ||
| `id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT, | ||
| `store_id` BIGINT UNSIGNED NOT NULL, | ||
| `image_url` VARCHAR(2048) NOT NULL, | ||
| `sort_order` INTEGER NOT NULL DEFAULT 0, | ||
| `created_at` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3), | ||
| `updated_at` DATETIME(3) NOT NULL, | ||
| `deleted_at` DATETIME(3) NULL, | ||
|
|
||
| INDEX `idx_store_image_store`(`store_id`, `sort_order`), | ||
| INDEX `idx_store_image_deleted_at`(`deleted_at`), | ||
| PRIMARY KEY (`id`) | ||
| ) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; | ||
|
|
||
| -- AddForeignKey | ||
| ALTER TABLE `store_image` ADD CONSTRAINT `store_image_store_id_fkey` FOREIGN KEY (`store_id`) REFERENCES `store`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE; |
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
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
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
2 changes: 2 additions & 0 deletions
2
src/features/product/constants/product-storefront.constants.ts
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| /** 매장 상품 목록 기본 페이지 크기. */ | ||
| export const DEFAULT_STORE_PRODUCTS_LIMIT = 20; |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| import { | ||
| IsInt, | ||
| IsNotEmpty, | ||
| IsOptional, | ||
| IsString, | ||
| Max, | ||
| Min, | ||
| } from 'class-validator'; | ||
|
|
||
| export class StoreProductsInput { | ||
| @IsString() | ||
| @IsNotEmpty() | ||
| storeId!: string; | ||
|
|
||
| @IsOptional() | ||
| @IsString() | ||
| @IsNotEmpty() | ||
| categoryId?: string; | ||
|
|
||
| @IsOptional() | ||
| @IsString() | ||
| search?: string; | ||
|
|
||
| @IsOptional() | ||
| @IsString() | ||
| @IsNotEmpty() | ||
| cursor?: string; | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
|
|
||
| @IsOptional() | ||
| @IsInt() | ||
| @Min(1) | ||
| @Max(100) | ||
| limit?: number; | ||
| } | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| extend type Query { | ||
| """매장이 보유한 활성 상품의 카테고리 목록(좌측 사이드바). 빈 카테고리 제외. 비로그인 접근 가능.""" | ||
| storeProductCategories(storeId: ID!): [StoreProductCategory!]! | ||
|
|
||
| """매장 상품 목록(카테고리 필터 / 매장 내 검색 / 커서). 비로그인 접근 가능.""" | ||
| storeProducts(input: StoreProductsInput!): StoreProductConnection! | ||
| } | ||
|
|
||
| """매장 상품 카테고리(사이드바 항목).""" | ||
| type StoreProductCategory { | ||
| id: ID! | ||
| name: String! | ||
| categoryType: CategoryType! | ||
| sortOrder: Int! | ||
| """이 매장의 해당 카테고리 활성 상품 수.""" | ||
| productCount: Int! | ||
| } | ||
|
|
||
| """상품 카테고리 분류.""" | ||
| enum CategoryType { | ||
| EVENT | ||
| STYLE | ||
| OTHER | ||
| } | ||
|
|
||
| input StoreProductsInput { | ||
| storeId: ID! | ||
| """특정 카테고리 섹션만. 비우면 전체.""" | ||
| categoryId: ID | ||
| """매장 내 상품명·태그 검색어.""" | ||
| search: String | ||
| """이전 페이지 마지막 항목 id(이후부터 조회).""" | ||
| cursor: ID | ||
| limit: Int = 20 | ||
| } | ||
|
|
||
| """매장 상품 목록(커서 기반).""" | ||
| type StoreProductConnection { | ||
| items: [StoreProduct!]! | ||
| hasMore: Boolean! | ||
| nextCursor: ID | ||
| } | ||
|
|
||
| """매장 상품 카드.""" | ||
| type StoreProduct { | ||
| id: ID! | ||
| name: String! | ||
| description: String | ||
| """대표 이미지(sort_order 최소). 없으면 null.""" | ||
| thumbnailUrl: String | ||
| regularPrice: Int! | ||
| salePrice: Int | ||
| """할인율(0~100). salePrice 없으면 0.""" | ||
| discountRate: Int! | ||
| currency: String! | ||
| """소속 카테고리 ID(FE 섹션 그룹핑/스크롤 스파이용).""" | ||
| categoryIds: [ID!]! | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,15 @@ | ||
| import { Module } from '@nestjs/common'; | ||
|
|
||
| import { ProductRepository } from '@/features/product/repositories/product.repository'; | ||
| import { ProductStorefrontQueryResolver } from '@/features/product/resolvers/product-storefront-query.resolver'; | ||
| import { ProductStorefrontService } from '@/features/product/services/product-storefront.service'; | ||
|
|
||
| @Module({ | ||
| providers: [ProductRepository], | ||
| providers: [ | ||
| ProductRepository, | ||
| ProductStorefrontService, | ||
| ProductStorefrontQueryResolver, | ||
| ], | ||
| exports: [ProductRepository], | ||
| }) | ||
| export class ProductModule {} |
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This new soft-deletable model is not added to
SOFT_DELETE_MODELSinsrc/prisma/soft-delete.middleware.ts, so any directprisma.storeImage.findMany/findFirst/countread will not get the repository-widedeleted_at: nullfilter that other soft-deletable tables rely on. The current detail query filters nested images manually, but the first direct StoreImage read can return or count deleted carousel images unlessStoreImageis registered there.Useful? React with 👍 / 👎.