feat: reuse hub-core base schemas
This commit is contained in:
parent
3b48ce52a3
commit
8428a02f6c
5 changed files with 73 additions and 74 deletions
|
|
@ -3,41 +3,13 @@ from datetime import datetime
|
|||
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Capability Catalog schemas
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
class CatalogCreate(BaseModel):
|
||||
domain: str # slug, resolved to domain_id in router
|
||||
capability_type: str
|
||||
title: str
|
||||
description: str | None = None
|
||||
keywords: list[str] = []
|
||||
repo_slug: str | None = None # optional repo attribution
|
||||
|
||||
|
||||
class CatalogPatch(BaseModel):
|
||||
repo_slug: str | None = None
|
||||
description: str | None = None
|
||||
keywords: list[str] | None = None
|
||||
status: str | None = None
|
||||
|
||||
|
||||
class CatalogRead(BaseModel):
|
||||
model_config = ConfigDict(from_attributes=True)
|
||||
|
||||
id: uuid.UUID
|
||||
domain_slug: str
|
||||
repo_id: uuid.UUID | None = None
|
||||
repo_slug: str | None = None
|
||||
capability_type: str
|
||||
title: str
|
||||
description: str | None = None
|
||||
keywords: list[str] = []
|
||||
status: str
|
||||
created_at: datetime
|
||||
updated_at: datetime
|
||||
from hub_core.schemas.capability import (
|
||||
CapabilityRequestDispute,
|
||||
CapabilityRequestStatusPatch,
|
||||
CatalogCreate,
|
||||
CatalogPatch,
|
||||
CatalogRead,
|
||||
)
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
|
|
@ -60,11 +32,6 @@ class CapabilityRequestAccept(BaseModel):
|
|||
fulfilling_workstream_id: uuid.UUID | None = None
|
||||
|
||||
|
||||
class CapabilityRequestStatusPatch(BaseModel):
|
||||
status: str # in_progress | ready_for_review | completed | rejected | withdrawn
|
||||
note: str | None = None
|
||||
|
||||
|
||||
class CapabilityRequestPatch(BaseModel):
|
||||
catalog_entry_id: uuid.UUID | None = None
|
||||
priority: str | None = None
|
||||
|
|
@ -72,12 +39,6 @@ class CapabilityRequestPatch(BaseModel):
|
|||
fulfilling_workstream_id: uuid.UUID | None = None
|
||||
|
||||
|
||||
class CapabilityRequestDispute(BaseModel):
|
||||
reason: str
|
||||
disputed_by: str
|
||||
suggested_domain: str | None = None
|
||||
|
||||
|
||||
class CapabilityRequestReroute(BaseModel):
|
||||
note: str
|
||||
rerouted_by: str
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue