Skip to content

Commit 139f1cb

Browse files
committed
add platform_url to usecase
1 parent e864fad commit 139f1cb

File tree

3 files changed

+25
-1
lines changed

3 files changed

+25
-1
lines changed

api/models/UseCase.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ class UseCase(models.Model):
5454
)
5555
started_on = models.DateField(blank=True, null=True)
5656
completed_on = models.DateField(blank=True, null=True)
57+
platform_url = models.URLField(blank=True, null=True)
5758

5859
def save(self, *args: Any, **kwargs: Any) -> None:
5960
if self.title and not self.slug:

api/schema/usecase_schema.py

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,14 @@ class UseCaseInputPartial:
6565

6666
id: str
6767
title: auto
68-
slug: auto
6968
summary: auto
69+
platform_url: auto
70+
tags: auto
71+
sectors: auto
72+
started_on: auto
73+
completed_on: auto
74+
logo: auto
75+
running_status: auto
7076

7177

7278
@strawberry.type(name="Query")
@@ -357,6 +363,20 @@ def update_use_case(self, info: Info, data: UseCaseInputPartial) -> TypeUseCase:
357363
usecase.title = data.title.strip()
358364
if data.summary is not None:
359365
usecase.summary = data.summary.strip()
366+
if data.platform_url is not None:
367+
usecase.platform_url = data.platform_url.strip()
368+
if data.tags is not None:
369+
_update_usecase_tags(usecase, data.tags)
370+
if data.sectors is not None:
371+
_update_usecase_sectors(usecase, data.sectors)
372+
if data.started_on is not None:
373+
usecase.started_on = data.started_on
374+
if data.completed_on is not None:
375+
usecase.completed_on = data.completed_on
376+
if data.running_status is not None:
377+
usecase.running_status = data.running_status
378+
if data.logo is not None:
379+
usecase.logo = data.logo
360380
usecase.save()
361381
return TypeUseCase.from_django(usecase)
362382

api/types/type_usecase.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ class TypeUseCase(BaseType):
5858
organization: Optional[TypeOrganization] = strawberry.field(
5959
description="Organization associated with this use case"
6060
)
61+
platform_url: Optional[str] = strawberry.field(
62+
description="URL of the platform where this use case is published"
63+
)
6164

6265
@strawberry.field(
6366
description="Check if this use case is created by an individual user."

0 commit comments

Comments
 (0)