Skip to content

[DEPLOY] v.48 stamp, partnership 리팩토링#279

Merged
BAEK0111 merged 6 commits intomainfrom
develop
Mar 2, 2026
Merged

[DEPLOY] v.48 stamp, partnership 리팩토링#279
BAEK0111 merged 6 commits intomainfrom
develop

Conversation

@BAEK0111
Copy link
Contributor

@BAEK0111 BAEK0111 commented Mar 2, 2026

#️⃣연관된 이슈

📝작업 내용

스탬프 멘트 수정
제휴 저장 로직 수정

🔎코드 설명(스크린샷(선택))

코드에 대한 설명을 작성해주세요.

💬고민사항 및 리뷰 요구사항 (Optional)

고민사항 및 의견 받고 싶은 부분 있으면 적어두기

비고 (Optional)

참고했던 링크 등 참고 사항을 적어주세요. 코드 리뷰하는 사람이 참고해야 하는 내용을 자유로운 형식으로 적을 수 있습니다.

Copilot AI review requested due to automatic review settings March 2, 2026 12:47
@BAEK0111 BAEK0111 changed the title DEPLOY V.44 [DEPLOY] v.48 Mar 2, 2026
@BAEK0111 BAEK0111 changed the title [DEPLOY] v.48 [DEPLOY] v.48 stamp, partnership 수정 Mar 2, 2026
@BAEK0111 BAEK0111 merged commit 89e8454 into main Mar 2, 2026
3 checks passed
@BAEK0111 BAEK0111 changed the title [DEPLOY] v.48 stamp, partnership 수정 [DEPLOY] v.48 stamp, partnership 리팩토링 Mar 2, 2026
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates partnership persistence so that PaperContent.category is populated from the single selected goods item (improving downstream display/usage), and adjusts the STAMP notification preview text formatting.

Changes:

  • Populate PaperContent.category with the goods name when an option contains exactly one goods item (both update and manual-create flows).
  • Add mutability to PaperContent to allow updating category during save.
  • Update STAMP notification preview message to remove the newline.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
src/main/java/com/assu/server/domain/partnership/service/PartnershipServiceImpl.java Sets category from single-goods options during partnership update/manual creation.
src/main/java/com/assu/server/domain/partnership/entity/PaperContent.java Adds Lombok @Setter to allow updating category before persisting.
src/main/java/com/assu/server/domain/notification/service/NotificationCommandServiceImpl.java Adjusts STAMP notification preview text formatting.
Comments suppressed due to low confidence (1)

src/main/java/com/assu/server/domain/partnership/service/PartnershipServiceImpl.java:323

  • Same index-coupled options()contents mutation logic is duplicated here. Consider extracting a small helper (or handling it during DTO→entity mapping) so future changes don’t have to be applied in multiple places.
            List<PaperContent> contents = request.toPaperContents(paper);
            
            for (int i = 0; i < contents.size(); i++) {
                var opt = request.options().get(i);
                if (opt.goods() != null && opt.goods().size() == 1) {
                    contents.get(i).setCategory(opt.goods().get(0).goodsName());
                }
            }

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

Comment on lines 13 to 18
@Entity
@Getter
@Setter
@NoArgsConstructor
@Builder
@AllArgsConstructor
Copy link

Copilot AI Mar 2, 2026

Choose a reason for hiding this comment

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

Adding @Setter at the entity class level makes all fields (including id, paper, and enum fields) mutable from anywhere, which can lead to unintended state changes on managed JPA entities. If the goal is only to update category, prefer a field-level @Setter on category (or a dedicated mutator like updateCategory(...)) rather than enabling setters for every field.

Copilot uses AI. Check for mistakes.
Comment on lines +126 to +133

for (int i = 0; i < newContents.size(); i++) {
var option = request.options().get(i);
if (option.goods() != null && option.goods().size() == 1) {
newContents.get(i).setCategory(option.goods().get(0).goodsName());
}
}

Copy link

Copilot AI Mar 2, 2026

Choose a reason for hiding this comment

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

request.options().get(i) is accessed via index alignment with newContents. This works only because toPaperContents() currently preserves ordering/size; consider iterating over options() directly (or setting category inside toPaperContents() / PartnershipOptionRequestDTO.toPaperContent) to avoid fragile index-based coupling and to keep the transformation in one place.

Suggested change
for (int i = 0; i < newContents.size(); i++) {
var option = request.options().get(i);
if (option.goods() != null && option.goods().size() == 1) {
newContents.get(i).setCategory(option.goods().get(0).goodsName());
}
}
List<?> options = request.options();
int count = Math.min(newContents.size(), options.size());
for (int i = 0; i < count; i++) {
var option = options.get(i);
if (option instanceof PartnershipOptionRequestDTO partnershipOption
&& partnershipOption.goods() != null
&& partnershipOption.goods().size() == 1) {
newContents.get(i).setCategory(partnershipOption.goods().get(0).goodsName());
}
}

Copilot uses AI. Check for mistakes.
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