From 66ffe222abd732e6d43d6bc65a3b1be1b1c8bcf2 Mon Sep 17 00:00:00 2001 From: jcadam14 <41971533+jcadam14@users.noreply.github.com> Date: Thu, 18 Jan 2024 14:30:33 -0700 Subject: [PATCH] Updated DAO/DTO/model_enum with discussion updates (#30) 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. --- src/entities/models/dao.py | 4 +++- src/entities/models/dto.py | 2 ++ src/entities/models/model_enums.py | 4 ++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/entities/models/dao.py b/src/entities/models/dao.py index 61866294..4b916b0e 100644 --- a/src/entities/models/dao.py +++ b/src/entities/models/dao.py @@ -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}" @@ -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. diff --git a/src/entities/models/dto.py b/src/entities/models/dto.py index 1ec961a6..0a799a55 100644 --- a/src/entities/models/dto.py +++ b/src/entities/models/dto.py @@ -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): @@ -23,6 +24,7 @@ class FilingDTO(BaseModel): state: FilingState filing_period: int institution_snapshot_id: str + contact_info: str class FilingPeriodDTO(BaseModel): diff --git a/src/entities/models/model_enums.py b/src/entities/models/model_enums.py index 71eeef62..a198480f 100644 --- a/src/entities/models/model_enums.py +++ b/src/entities/models/model_enums.py @@ -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"