syntax = "proto3";
package time_entry_service;

service TimeEntryService {
  rpc CreateEntry    (CreateEntryRequest)  returns (TimeEntryResponse);
  rpc ListEntries    (ListEntriesRequest)  returns (ListEntriesResponse);
  rpc BillingSummary (BillingSummaryReq)  returns (BillingSummaryResponse);
}

message CreateEntryRequest {
  string tenant_id         = 1;
  string matter_id         = 2;
  string attorney_id       = 3;
  int64  date              = 4;
  int32  duration_minutes  = 5;  // must be multiple of 6
  string task_code         = 6;
  string description       = 7;
  bool   billable          = 8;
}
message ListEntriesRequest  { string tenant_id = 1; string matter_id = 2; string attorney_id = 3; }
message BillingSummaryReq   { string tenant_id = 1; string matter_id = 2; }

message TimeEntryResponse     { string id = 1; string matter_id = 2; int32 duration_minutes = 3; string task_code = 4; bool billable = 5; }
message ListEntriesResponse   { repeated TimeEntryResponse entries = 1; }
message BillingSummaryResponse { string matter_id = 1; int32 total_minutes = 2; int32 billable_minutes = 3; double total_amount = 4; }
