Skip to content

Commit

Permalink
Changed to confirmation_id (instead of number), updated pytests
Browse files Browse the repository at this point in the history
  • Loading branch information
jcadam14 committed Jan 17, 2024
1 parent 7815af3 commit 3a19194
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/entities/models/dao.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class SubmissionDAO(Base):
validation_ruleset_version: Mapped[str]
validation_json: Mapped[dict[str, Any]] = mapped_column(JSON, nullable=True)
filing: Mapped[str] = mapped_column(ForeignKey("filing.id"))
confirmation_number: Mapped[str]
confirmation_id: Mapped[str] = mapped_column(nullable=True)

def __str__(self):
return f"Submission ID: {self.id}, Submitter: {self.submitter}, State: {self.state}, Ruleset: {self.validation_ruleset_version}, Filing: {self.filing}"
Expand Down
2 changes: 1 addition & 1 deletion src/entities/models/dto.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class SubmissionDTO(BaseModel):
validation_ruleset_version: str | None = None
validation_json: Dict[str, Any] | None = None
filing: int
confirmation_number: str | None = None
confirmation_id: str | None = None


class FilingDTO(BaseModel):
Expand Down
14 changes: 12 additions & 2 deletions tests/entities/repos/test_submission_repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,18 @@ async def setup(
transaction_session.add(filing_period)

filing1 = FilingDAO(
lei="1234567890", state=FilingState.FILING_STARTED, institution_snapshot_id="Snapshot-1", filing_period=1
lei="1234567890",
state=FilingState.FILING_STARTED,
institution_snapshot_id="Snapshot-1",
filing_period=1,
contact_info="[email protected]",
)
filing2 = FilingDAO(
lei="ABCDEFGHIJ", state=FilingState.FILING_STARTED, institution_snapshot_id="Snapshot-1", filing_period=1
lei="ABCDEFGHIJ",
state=FilingState.FILING_STARTED,
institution_snapshot_id="Snapshot-1",
filing_period=1,
contact_info="[email protected]",
)
transaction_session.add(filing1)
transaction_session.add(filing2)
Expand Down Expand Up @@ -91,6 +99,7 @@ async def test_add_and_modify_filing(self, transaction_session: AsyncSession):
state=FilingState.FILING_IN_PROGRESS,
institution_snapshot_id="Snapshot-1",
filing_period=1,
contact_info="[email protected]",
)
res = await repo.upsert_filing(transaction_session, new_filing)
assert res.id == 3
Expand All @@ -103,6 +112,7 @@ async def test_add_and_modify_filing(self, transaction_session: AsyncSession):
state=FilingState.FILING_COMPLETE,
institution_snapshot_id="Snapshot-1",
filing_period=1,
contact_info="[email protected]",
)
res = await repo.upsert_filing(transaction_session, mod_filing)
assert res.id == 3
Expand Down

0 comments on commit 3a19194

Please sign in to comment.