Skip to content

feat: 후원사 관련 API 구현#21

Merged
JaeHyuckSa merged 4 commits intomainfrom
feature/sponsor
Jun 7, 2025
Merged

feat: 후원사 관련 API 구현#21
JaeHyuckSa merged 4 commits intomainfrom
feature/sponsor

Conversation

@JaeHyuckSa
Copy link
Member

No description provided.

Signed-off-by: SaJH <wogur981208@gmail.com>
@JaeHyuckSa JaeHyuckSa requested a review from Copilot June 7, 2025 10:26
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 implements sponsor-related API functionality, including endpoints, models, serializers, migrations, translations, and configuration updates to support sponsor and sponsor tier management.

  • Introduces the Sponsor API endpoints with associated views, serializers, and URL routes.
  • Adds new models and migrations to define sponsor, sponsor tier, and their relationships.
  • Implements translations and registers models in the app configuration, along with updating project settings.

Reviewed Changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated no comments.

Show a summary per file
File Description
app/user/migrations/0003_alter_historicaluserext_is_active.py Updates the 'is_active' field for historical user extension.
app/event/views.py Removes the placeholder comment.
app/event/tests.py Removes the placeholder comment.
app/event/sponsor/views.py Implements the SponsorViewSet using DRF mixins.
app/event/sponsor/urls.py Adds URL routes for the Sponsor API endpoints.
app/event/sponsor/translation.py Registers translation options for sponsor models.
app/event/sponsor/serializers.py Adds serializers for Sponsor and SponsorTier models.
app/event/sponsor/models.py Defines new Sponsor models and the relationship through a join table.
app/event/sponsor/migrations/0001_initial.py Creates initial migration for sponsor-related models.
app/event/sponsor/apps.py Configures the sponsor app and registers models for history tracking and translation.
app/event/admin.py Removes the placeholder comment.
app/core/settings.py Adds the sponsor app to the project settings.
Comments suppressed due to low confidence (1)

app/event/sponsor/models.py:11

  • [nitpick] Consider renaming the 'sponsor_tier' field to 'sponsor_tiers' to more clearly indicate that it represents a collection of tiers.
sponsor_tier = models.ManyToManyField(to="SponsorTier", through="SponsorTierSponsorRelation")

Signed-off-by: SaJH <wogur981208@gmail.com>
Signed-off-by: SaJH <wogur981208@gmail.com>
event = models.ForeignKey(Event, on_delete=models.PROTECT, related_name="sponsors")
name = models.CharField(max_length=256, null=True, blank=True)
logo = models.URLField(null=True, blank=True)
description = models.CharField(max_length=1000, null=True, blank=True)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
description = models.CharField(max_length=1000, null=True, blank=True)
description = models.TextField(null=True, blank=True)

요건 어떨까요?

  • 저희 PSQL이라 varchar 타입이나 text 타입이나 둘 다 성능 차이가 없고
  • description으로 쿼리할 일이 없는지라, index 생성으로 인한 길이 제한 이슈가 없거든요!

Copy link
Member Author

Choose a reason for hiding this comment

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

어엇 이거 text field로 했었는데 왜 charfield로 되어있죠...ㅋㅋㅋㅋ 수정하겠습니다.



class SponsorViewSet(mixins.ListModelMixin, viewsets.GenericViewSet):
queryset = Sponsor.objects.prefetch_related("sponsor_tier").all()
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
queryset = Sponsor.objects.prefetch_related("sponsor_tier").all()
queryset = Sponsor.objects.prefetch_related("sponsor_tier").filter_active()

활성화된 것만 쿼리하도록 부탁드립니다 🙇‍♂️

Copy link
Member Author

Choose a reason for hiding this comment

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

수정했습니다.

Copy link
Member

@MU-Software MU-Software left a comment

Choose a reason for hiding this comment

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

위 사항 제외하면 LGTM임다! 👍

Copy link
Contributor

@earthyoung earthyoung left a comment

Choose a reason for hiding this comment

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

저도 LGTM 입니다 👍

Signed-off-by: SaJH <wogur981208@gmail.com>
@JaeHyuckSa JaeHyuckSa merged commit 381fef2 into main Jun 7, 2025
1 check passed
@JaeHyuckSa JaeHyuckSa deleted the feature/sponsor branch June 7, 2025 11:39
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.

4 participants