generated from coulomb/repo-seed
Migrations (chain: b1c2d3e4f5a6 → c2d3e4f5a6b7 → d3e4f5a6b7c8): - c2d3e4f5a6b7: contributions table (contributiontype BR/FR/EP/UPR enum, contributionstatus 7-state lifecycle, FKs to topics/workstreams) - d3e4f5a6b7c8: sbom_entries table (ecosystem enum, snapshot-based replacement), + sbom_source + last_sbom_at columns on managed_repos New models: Contribution (ContributionType, ContributionStatus), SBOMEntry (Ecosystem) Modified: ManagedRepo (sbom_source, last_sbom_at columns) New routers: - /contributions/ — CRUD + lifecycle-guarded PATCH /status + soft-delete (withdrawn) - /sbom/ — ingest (replace snapshot), list, per-repo view, licence report Modified: - /state/summary now includes contribution_counts and licence_risk_count - main.py: registers contributions + sbom routers; bumps version to 0.6.0 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
44 lines
1.1 KiB
Python
44 lines
1.1 KiB
Python
import uuid
|
|
from datetime import datetime
|
|
|
|
from pydantic import BaseModel, ConfigDict
|
|
|
|
from api.models.contribution import ContributionStatus, ContributionType
|
|
|
|
|
|
class ContributionCreate(BaseModel):
|
|
type: ContributionType
|
|
target_org: str | None = None
|
|
target_repo: str | None = None
|
|
slug: str | None = None
|
|
title: str
|
|
body_path: str | None = None
|
|
related_topic_id: uuid.UUID | None = None
|
|
related_workstream_id: uuid.UUID | None = None
|
|
notes: str | None = None
|
|
|
|
|
|
class ContributionStatusPatch(BaseModel):
|
|
status: ContributionStatus
|
|
notes: str | None = None
|
|
|
|
|
|
class ContributionRead(BaseModel):
|
|
model_config = ConfigDict(from_attributes=True)
|
|
|
|
id: uuid.UUID
|
|
type: ContributionType
|
|
target_org: str | None = None
|
|
target_repo: str | None = None
|
|
slug: str | None = None
|
|
title: str
|
|
status: ContributionStatus
|
|
body_path: str | None = None
|
|
related_topic_id: uuid.UUID | None = None
|
|
related_workstream_id: uuid.UUID | None = None
|
|
submitted_at: datetime | None = None
|
|
resolved_at: datetime | None = None
|
|
notes: str | None = None
|
|
created_at: datetime
|
|
updated_at: datetime
|