diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index bf20861..336ef71 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -37,7 +37,7 @@ jobs: - name: install Poetry uses: snok/install-poetry@v1.3.3 - name: cache Poetry virtualenv - uses: actions/cache@v2 + uses: actions/cache@v4 id: cache with: path: ~/.virtualenvs/ diff --git a/api/db/models/bills.py b/api/db/models/bills.py index b41644f..dfadd39 100644 --- a/api/db/models/bills.py +++ b/api/db/models/bills.py @@ -161,12 +161,14 @@ class DocumentLinkBase(PrimaryUUID): class BillDocument(DocVerBase, Base): __tablename__ = "opencivicdata_billdocument" + classification = Column(String) links = relationship("BillDocumentLink", back_populates="document") class BillVersion(DocVerBase, Base): __tablename__ = "opencivicdata_billversion" + classification = Column(String) links = relationship("BillVersionLink", back_populates="version") diff --git a/api/schemas.py b/api/schemas.py index da19841..0615602 100644 --- a/api/schemas.py +++ b/api/schemas.py @@ -294,6 +294,7 @@ class BillDocumentOrVersion(BaseModel): id: UUID = Field(..., example="f0049138-1ad8-4506-a2a4-f4dd1251bbba") note: str = Field(..., example="Latest Version") date: str = Field(..., example="2020-10-01") + classification: str = Field(..., example="amendment") links: List[BillDocumentLink] class Config: diff --git a/api/tests/fixtures.py b/api/tests/fixtures.py index 1f6e488..4978666 100644 --- a/api/tests/fixtures.py +++ b/api/tests/fixtures.py @@ -91,13 +91,13 @@ def create_test_bill( for n in range(sources): yield BillSource(bill=b, url="https://example.com/source", note="") for n in range(versions): - bv = BillVersion(bill=b, note=f"Version {n}", date="2020") + bv = BillVersion(bill=b, note=f"Version {n}", date="2020", classification="") yield bv yield BillVersionLink( version=bv, url=f"https://example.com/{n}", media_type="text/html" ) for n in range(documents): - bd = BillDocument(bill=b, note=f"Version {n}", date="2020") + bd = BillDocument(bill=b, note=f"Version {n}", date="2020", classification="") yield bd yield BillDocumentLink( document=bd, url=f"https://example.com/{n}", media_type="text/html" diff --git a/api/tests/test_bills.py b/api/tests/test_bills.py index f82f78f..3253bea 100644 --- a/api/tests/test_bills.py +++ b/api/tests/test_bills.py @@ -210,6 +210,7 @@ def test_bills_include_documents_versions(client): "note": "Version 0", "date": "2020", "links": [{"media_type": "text/html", "url": "https://example.com/0"}], + "classification": "", } for doc in b["documents"]: