syntax = "proto3";
package hearings_service;

service HearingsService {
  rpc CreateHearing  (CreateHearingRequest)  returns (HearingResponse);
  rpc ListHearings   (ListHearingsRequest)   returns (ListHearingsResponse);
  rpc UpdateOutcome  (UpdateOutcomeRequest)  returns (HearingResponse);
  rpc CreateDeadline (CreateDeadlineRequest) returns (DeadlineResponse);
  rpc ListDeadlines  (ListDeadlinesRequest)  returns (ListDeadlinesResponse);
}

message CreateHearingRequest {
  string tenant_id  = 1;
  string matter_id  = 2;
  string court      = 3;
  string room       = 4;
  string type       = 5;  // initial | evidence | argument | judgment
  int64  date       = 6;
}
message ListHearingsRequest  { string tenant_id = 1; string matter_id = 2; string attorney_id = 3; }
message UpdateOutcomeRequest { string id = 1; string outcome = 2; string notes = 3; }
message CreateDeadlineRequest {
  string tenant_id    = 1;
  string matter_id    = 2;
  string description  = 3;
  int64  due_date     = 4;
  int32  warn_days    = 5;
}
message ListDeadlinesRequest { string tenant_id = 1; string matter_id = 2; bool overdue_only = 3; }

message HearingResponse  { string id = 1; string matter_id = 2; string court = 3; string type = 4; int64 date = 5; string outcome = 6; }
message DeadlineResponse { string id = 1; string matter_id = 2; string description = 3; int64 due_date = 4; bool completed = 5; }
message ListHearingsResponse  { repeated HearingResponse  hearings  = 1; }
message ListDeadlinesResponse { repeated DeadlineResponse deadlines = 1; }
