From 973dbc85b67d52f4f61280ef87d7e3408a395e29 Mon Sep 17 00:00:00 2001 From: sm4640 Date: Fri, 2 May 2025 22:11:50 +0900 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Feat:=20[#41]=20=ED=94=84=EB=A1=9C?= =?UTF-8?q?=EC=A0=9D=ED=8A=B8=20=EC=B4=88=EB=8C=80=20=ED=85=8C=EC=9D=B4?= =?UTF-8?q?=EB=B8=94=20=EA=B0=9D=EC=B2=B4=20=EC=83=9D=EC=84=B1=20=EC=84=9C?= =?UTF-8?q?=EB=B9=84=EC=8A=A4=20=EB=A1=9C=EC=A7=81=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- projects/services.py | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/projects/services.py b/projects/services.py index 50b9a64..e993e06 100644 --- a/projects/services.py +++ b/projects/services.py @@ -1,4 +1,8 @@ -from .models import Project +from .models import * +from .serializers import * + +from users.models import * +from common.models.choiceModels import InvitationStatus ACTION_FIELD_MAP = { @@ -38,3 +42,16 @@ class ProjectStateChangeService: now_count = current_count+1 if add else max(current_count-1, 0) setattr(project, field_name, now_count) project.save(update_fields=[field_name]) + + +class ProjectInvitationService: + @staticmethod + def create_project_invitation(project: Project, from_user: User, to_user: User, notification: Notification): + return ProjectInvitation.objects.create( + project=project, + from_user=from_user, + to_user=to_user, + status= InvitationStatus.PENDING, + notification=notification + ) + \ No newline at end of file