syntax = "proto3";

option go_package="./utils";
package utils;

message Document {
  uint64 id = 1;
  string title = 2;
  string description = 3;
  string content = 4;
  uint64 vector_id = 5;
  uint64 library_id = 6;
  uint64 user_id = 7;
}

message GetDocumentsRequest {
  string library = 1;
  string text = 2;
}

message GetDocumentsResponse {
  repeated Document documents = 1;
}

message GetNoVectorDocumentsRequest {
  Document document = 1;
}

message GetNoVectorDocumentsResponse {
  repeated Document documents = 1;
}


message UpdateDocumentRequest {
  uint64 id = 1;
  uint64 vector_id = 2;
}

message UpdateDocumentResponse {
  Document document = 1;
}

message GetDocumentByIdRequest {
  uint64 id = 1;
}


service DocumentSearchService {
  rpc GetNoVectorDocuments(GetNoVectorDocumentsRequest) returns (GetNoVectorDocumentsResponse);
  rpc UpdateDocument(UpdateDocumentRequest) returns (UpdateDocumentResponse);
  rpc GetDocumentById(GetDocumentByIdRequest) returns (Document);
}
