Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand Down
2 changes: 2 additions & 0 deletions api/db/models/bills.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")


Expand Down
1 change: 1 addition & 0 deletions api/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions api/tests/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions api/tests/test_bills.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]:
Expand Down