Skip to content

Data Diagram

jcadam14 edited this page Mar 18, 2024 · 6 revisions
---
title: Filing API Database Classes
---
classDiagram
    class `FilingTaskDAO(Base):`{
      __tablename__ = "filing_task"
      name: Mapped[str] = mapped_column#40;primary_key=True#41;
      task_order: Mapped[int]
   }

    class `FilingTaskStateDAO(Base):`{
      __tablename__ = "filing_task_state"
      id: Mapped[int] = mapped_column#40;primary_key=True, autoincrement=True#41;
      filing: Mapped[int] = mapped_column#40;ForeignKey#40;"filing.id"#41;#41;
      task_name: Mapped[str] = mapped_column#40;ForeignKey#40;"filing_task.name"#41;#41;
      user: Mapped[str] = mapped_column#40;nullable=True#41;
      state: Mapped[enum] = mapped_column#40;server_default=TaskStateEnum.STARTED#41;
      change_timestamp: Mapped[datetime] = mapped_column#40;server_default=datetime.now#40;#41;#41;
   }

   class `FilingTaskStateEnum:`{
       NOT_STARTED,
       IN_PROGRESS,
       COMPLETED
   }

    class `FilingDAO(AuditMixin, Base):`{
      __tablename__ = "filing"
      id: Mapped[int] = mapped_column#40;primary_key=True, autoincrement=True#41;
      filing_period = Mapped[str] = mapped_column#40;ForeignKey#40;"filing_period.name"#41;#41;
      lei: Mapped[str] = mapped_column#40;primary_key=True#41;
      tasks: Mapped[List[FilingTaskStateDAO]] = relationship#40;#41;
      institution_snapshot_id = Mapped[str]
      contact_info: Mapped[str] = mapped_column(nullable=True)
   }

class `FilingPeriodDAO(AuditMixin, Base):`{
    __tablename__ = "filing_period"
    code: Mapped[str] = mapped_column#40;primary_key=True#41;
    description: Mapped[str]
    start_period: Mapped[datetime]
    end_period: Mapped[datetime]
    due: Mapped[datetime]
    filing_type: Mapped[FilingType] = mapped_column#40;Enum#40;FilingType#41;#41;
}

class `SubmissionDAO(AuditMixin, Base):`{
    __tablename__ = "submission"
    id: Mapped[str] = mapped_column#40;index=True, primary_key=True, autoincrement=True#41;
    filing: Mapped[int] = mapped_column#40;ForeignKey#40;"filing.id"#41;#41;
    submitter: Mapped[str]
    state: Mapped[SubmissionState] = mapped_column#40;Enum#40;SubmissionState#41;#41;
    validation_ruleset_version: Mapped[str]
    validation_json: Mapped[dict[str, Any]] = mapped_column#40;JSON, nullable=True#41;
    confirmation_id: Mapped[str] = mapped_column#40;nullable=True#41;
    submission_time: Mapped[datetime] = mapped_column#40;server_default=func.now#40;#41;#41;
}
`FilingPeriodDAO(AuditMixin, Base):` *-- `FilingDAO(AuditMixin, Base):`
`FilingDAO(AuditMixin, Base):` *-- `SubmissionDAO(AuditMixin, Base):`
`FilingDAO(AuditMixin, Base):` *-- `FilingTaskStateDAO(Base):`
`FilingTaskStateDAO(Base):` *-- `FilingTaskDAO(Base):`
`FilingTaskStateDAO(Base):` *-- `FilingTaskStateEnum:`
Loading
Clone this wiki locally