Skip to content

Commit

Permalink
Updated DAO/DTO/model_enum with discussion updates (#30)
Browse files Browse the repository at this point in the history
Closes #29 

As mentioned in the story, updated the following:
- new FilingState called FILING_INSTITUTION_APPROVED
- change the FilingType enum to be MANUAL (the only one we'll have for
MVP right now)
- add confirmation_id to SubmissionDAO
- add contact_id to FilingDAO

The alembic scripts were already updated to include these updates.
  • Loading branch information
jcadam14 authored Jan 18, 2024
1 parent f1a7c74 commit 66ffe22
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/entities/models/dao.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +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_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 All @@ -42,7 +43,8 @@ class FilingDAO(Base):
lei: Mapped[str]
state: Mapped[FilingState] = mapped_column(SAEnum(FilingState))
filing_period: Mapped[int] = mapped_column(ForeignKey("filing_period.id"))
institution_snapshot_id = Mapped[str] # not sure what this is
institution_snapshot_id: Mapped[str]
contact_info: Mapped[str]


# Commenting out for now since we're just storing the results from the data-validator as JSON.
Expand Down
2 changes: 2 additions & 0 deletions src/entities/models/dto.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class SubmissionDTO(BaseModel):
validation_ruleset_version: str | None = None
validation_json: Dict[str, Any] | None = None
filing: int
confirmation_id: str | None = None


class FilingDTO(BaseModel):
Expand All @@ -23,6 +24,7 @@ class FilingDTO(BaseModel):
state: FilingState
filing_period: int
institution_snapshot_id: str
contact_info: str


class FilingPeriodDTO(BaseModel):
Expand Down
4 changes: 2 additions & 2 deletions src/entities/models/model_enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ class SubmissionState(str, Enum):

class FilingState(str, Enum):
FILING_STARTED = "FILING_STARTED"
FILING_INSTITUTION_APPROVED = "FILING_INSTITUTION_APPROVED"
FILING_IN_PROGRESS = "FILING_IN_PROGRESS"
FILING_COMPLETE = "FILING_COMPLETE"


class FilingType(str, Enum):
TYPE_A = "TYPE_A"
TYPE_B = "TYPE_B"
MANUAL = "MANUAL"

0 comments on commit 66ffe22

Please sign in to comment.