@@ -243,6 +243,8 @@ def _to_response(project: TaskingProject, task_count: int = 0) -> ProjectRespons
243243 created_by_name = project .created_by_name ,
244244 created_at = project .created_at ,
245245 updated_at = project .updated_at ,
246+ custom_imagery = project .custom_imagery , # type: ignore[arg-type]
247+ description = project .description , # type: ignore[arg-type]
246248 )
247249
248250 async def _provision_users_from_tdei (
@@ -468,6 +470,22 @@ async def list_projects(
468470 pagination = Pagination (page = page , page_size = page_size , total = total ),
469471 )
470472
473+ async def project_name_exists (self , workspace_id : int , name : str ) -> bool :
474+ result = await self .session .execute (
475+ select (func .count ())
476+ .select_from (TaskingProject )
477+ .where (
478+ (TaskingProject .workspace_id == workspace_id )
479+ & (TaskingProject .name == name )
480+ & (
481+ TaskingProject .deleted_at .is_ ( # pyright: ignore[reportAttributeAccessIssue, reportOptionalMemberAccess]
482+ None
483+ )
484+ )
485+ )
486+ )
487+ return int (result .scalar () or 0 ) > 0
488+
471489 async def create (
472490 self ,
473491 workspace_id : int ,
@@ -531,6 +549,8 @@ async def create(
531549 lock_timeout_hours = body .lock_timeout_hours ,
532550 created_by = current_user .user_uuid ,
533551 created_by_name = current_user .user_name ,
552+ custom_imagery = body .custom_imagery , # type: ignore[arg-type]
553+ description = body .description , # type: ignore[arg-type]
534554 )
535555 if body .aoi is not None :
536556 geom = _aoi_to_shapely (body .aoi )
@@ -632,6 +652,10 @@ async def patch(
632652 updates ["lock_timeout_hours" ] = body .lock_timeout_hours
633653 if body .review_required is not None :
634654 updates ["review_required" ] = body .review_required
655+ if body .custom_imagery is not None :
656+ updates ["custom_imagery" ] = body .custom_imagery # type: ignore[arg-type]
657+ if body .description is not None :
658+ updates ["description" ] = body .description
635659
636660 if updates :
637661 updates ["updated_at" ] = datetime .now ()
0 commit comments