diff --git a/luthor/alembic/versions/74058d75b7a0_initial_commit.py b/luthor/alembic/versions/74058d75b7a0_initial_commit.py
index 83850fb..ae035bb 100644
--- a/luthor/alembic/versions/74058d75b7a0_initial_commit.py
+++ b/luthor/alembic/versions/74058d75b7a0_initial_commit.py
@@ -255,6 +255,7 @@ def upgrade():
sa.Column("item_number", sa.Unicode(length=255), nullable=True),
sa.Column("bench", sa.Unicode(length=255), nullable=True),
sa.Column("proceedings", sa.Unicode(length=2000), nullable=True),
+ sa.Column("compliance_date", sa.DateTime(), nullable=True),
sa.Column("next_hearing_date", sa.DateTime(), nullable=True),
sa.Column("court_status_id", postgresql.UUID(as_uuid=True), nullable=True),
sa.Column("old_court_status_id", sa.Integer(), nullable=True),
diff --git a/luthor/luthor/models/hearing.py b/luthor/luthor/models/hearing.py
index b62d30e..059f9fe 100644
--- a/luthor/luthor/models/hearing.py
+++ b/luthor/luthor/models/hearing.py
@@ -25,6 +25,7 @@ class Hearing(Base):
bench = Column("bench", Unicode(255), nullable=False, unique=True)
proceedings = Column("proceedings", Unicode(255), nullable=False, unique=True)
next_hearing_date = Column("next_hearing_date", DateTime, nullable=False, index=True)
+ compliance_date = Column("compliance_date", DateTime, nullable=False, index=True)
court_status_id = Column("court_status_id", UUID(as_uuid=True), ForeignKey("court_statuses.id"), nullable=True)
court_status = relationship("CourtStatus", back_populates="hearings")
@@ -37,6 +38,7 @@ class Hearing(Base):
item_number=None,
bench=None,
proceedings=None,
+ compliance_date=None,
next_hearing_date=None,
court_status_id=None,
id_=None,
@@ -47,5 +49,6 @@ class Hearing(Base):
self.item_number = item_number
self.bench = bench
self.proceedings = proceedings
+ self.compliance_date = compliance_date
self.next_hearing_date = next_hearing_date
self.court_status_id = court_status_id
diff --git a/luthor/luthor/routers/case.py b/luthor/luthor/routers/case.py
index 9837cd2..4f72f70 100644
--- a/luthor/luthor/routers/case.py
+++ b/luthor/luthor/routers/case.py
@@ -74,6 +74,7 @@ def save(
item_number=h.item_number,
bench=h.bench,
proceedings=h.proceedings,
+ compliance_date=h.compliance_date,
next_hearing_date=h.next_hearing_date,
court_status_id=h.court_status.id_ if h.court_status is not None else None,
)
@@ -103,7 +104,7 @@ def update(
) -> schemas.Case:
try:
item: Case = db.query(Case).filter(Case.id == id_).first()
- item.case_source_id = data.case_source.id_,
+ item.case_source_id = data.case_source.id_
item.office_file_number = data.office_file_number
item.court_case_number = data.court_case_number
item.year = data.year
@@ -150,6 +151,7 @@ def update(
h.item_number = d.item_number
h.bench = d.bench
h.proceedings = d.proceedings
+ h.compliance_date = d.compliance_date
h.next_hearing_date = d.next_hearing_date
h.court_status_id = d.court_status.id_ if d.court_status is not None else None
for d in [d for d in data.hearings if d.id_ is None]:
@@ -158,6 +160,7 @@ def update(
item_number=d.item_number,
bench=d.bench,
proceedings=d.proceedings,
+ compliance_date=d.compliance_date,
next_hearing_date=d.next_hearing_date,
court_status_id=d.court_status.id_ if d.court_status is not None else None,
)
@@ -294,6 +297,7 @@ def case_info(item: Case) -> schemas.Case:
itemNumber=h.item_number if h.item_number is not None else "",
bench=h.bench if h.bench is not None else "",
proceedings=h.proceedings if h.proceedings is not None else "",
+ complianceDate=h.compliance_date,
nextHearingDate=h.next_hearing_date,
courtStatus=schemas.CourtStatusLink(id=h.court_status.id, name=h.court_status.name)
if h.court_status is not None
diff --git a/luthor/luthor/schemas/hearing.py b/luthor/luthor/schemas/hearing.py
index e52a2cf..3d2cba6 100644
--- a/luthor/luthor/schemas/hearing.py
+++ b/luthor/luthor/schemas/hearing.py
@@ -14,6 +14,7 @@ class HearingIn(BaseModel):
item_number: str
bench: str
proceedings: str
+ compliance_date: Optional[date]
next_hearing_date: Optional[date]
court_status: Optional[CourtStatusLink]
@@ -22,6 +23,14 @@ class HearingIn(BaseModel):
alias_generator = to_camel
json_encoders = {datetime: lambda v: v.strftime("%d-%b-%Y %H:%M"), date: lambda v: v.strftime("%d-%b-%Y")}
+ @validator("compliance_date", pre=True)
+ def parse_compliance_date(cls, value):
+ if isinstance(value, date):
+ return value
+ if value is None:
+ return None
+ return datetime.strptime(value, "%d-%b-%Y").date()
+
@validator("next_hearing_date", pre=True)
def parse_next_hearing_date(cls, value):
if isinstance(value, date):
diff --git a/otis/src/app/app-routing.module.ts b/otis/src/app/app-routing.module.ts
index 9d72e7c..f5878e4 100644
--- a/otis/src/app/app-routing.module.ts
+++ b/otis/src/app/app-routing.module.ts
@@ -3,7 +3,6 @@ import { Routes, RouterModule } from '@angular/router';
import { LoginComponent } from './auth/login/login.component';
import { LogoutComponent } from './auth/logout/logout.component';
-import { HomeComponent } from './home/home.component';
const routes: Routes = [
{
@@ -72,7 +71,7 @@ const routes: Routes = [
},
{ path: 'login', component: LoginComponent },
{ path: 'logout', component: LogoutComponent },
- { path: '', component: HomeComponent },
+ { path: '', redirectTo: '/cases', pathMatch: 'full' },
];
@NgModule({
imports: [
diff --git a/otis/src/app/app.module.ts b/otis/src/app/app.module.ts
index 6983993..34a745a 100644
--- a/otis/src/app/app.module.ts
+++ b/otis/src/app/app.module.ts
@@ -27,14 +27,13 @@ import { AppComponent } from './app.component';
import { LoginComponent } from './auth/login/login.component';
import { LogoutComponent } from './auth/logout/logout.component';
import { CoreModule } from './core/core.module';
-import { HomeComponent } from './home/home.component';
import { NavBarComponent } from './nav-bar/nav-bar.component';
import { SharedModule } from './shared/shared.module';
registerLocaleData(enIN);
@NgModule({
- declarations: [AppComponent, LoginComponent, LogoutComponent, HomeComponent, NavBarComponent],
+ declarations: [AppComponent, LoginComponent, LogoutComponent, NavBarComponent],
imports: [
BrowserModule,
AppRoutingModule,
diff --git a/otis/src/app/cases/case-detail/case-detail.component.html b/otis/src/app/cases/case-detail/case-detail.component.html
index 851f0aa..9bb9048 100644
--- a/otis/src/app/cases/case-detail/case-detail.component.html
+++ b/otis/src/app/cases/case-detail/case-detail.component.html
@@ -52,7 +52,14 @@
>