Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added filing_task and filing_task_state tables #50

Merged
merged 8 commits into from
Feb 7, 2024

Conversation

jcadam14
Copy link
Contributor

Closes #45

  • New DAOs and DTOs to support filing_task and filing_task_state tables
  • New FilingTaskState enum
  • New alembic scripts to create tables and update Filing table to remove "state" field and replace with filingtaskstate relationship
  • New pytests to test migration and FilingTask and FilingTaskState objects
  • Updated references to FilingDAO to remove "state" concept and add list of FilingTaskStates

- New DAOs and DTOs to support filing_task and filing_task_state tables
- New FilingTaskState enum
- New alembic scripts to create tables and update Filing table to remove "state" field and replace with filingtaskstate relationship
- New pytests to test migration and FilingTask and FilingTaskState objects
- Updated references to FilingDAO to remove "state" concept and add list of FilingTaskStates
@jcadam14 jcadam14 self-assigned this Jan 30, 2024
@jcadam14 jcadam14 linked an issue Jan 30, 2024 that may be closed by this pull request
Copy link

github-actions bot commented Jan 30, 2024

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  src/entities/models
  __init__.py
  dao.py 45, 58
  dto.py
  model_enums.py
  src/entities/repos
  submission_repo.py
Project Total  

This report was generated by python-coverage-comment-action



def downgrade() -> None:
op.drop_table("filing_task_state")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does the downgrade remove the custom type just by dropping the table, or do we need to do the drop type thing as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, updated the downgrade to have a drop of the filingtaskstate TYPE. Note that sqlite doesn't have that concept so it checks for the dialect.

class FilingDAO(Base):
__tablename__ = "filing"
id: Mapped[int] = mapped_column(primary_key=True, autoincrement=True)
lei: Mapped[str]
state: Mapped[FilingState] = mapped_column(SAEnum(FilingState))
tasks: Mapped[List[FilingTaskStateDAO]] = relationship(lazy="selectin", cascade="all, delete-orphan")
filing_period: Mapped[int] = mapped_column(ForeignKey("filing_period.id"))
institution_snapshot_id: Mapped[str]
contact_info: Mapped[str] = mapped_column(nullable=True)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good for this PR, but let's create a ticket to get contact_info as a separate table

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#62

@jcadam14 jcadam14 requested a review from lchen-2101 February 7, 2024 22:02
Copy link
Collaborator

@lchen-2101 lchen-2101 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@lchen-2101 lchen-2101 merged commit d876e27 into main Feb 7, 2024
3 checks passed
@lchen-2101 lchen-2101 deleted the 45-add-filing-steps-tables branch February 7, 2024 22:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Filing "steps" table(s)
2 participants