syntax = "proto3";
package secFilings;
//import "descriptor.proto";
//import "validator.proto";

option go_package = "./;secFilings";

service SecFilings{
 rpc  CreateSecFiling(CreateSecFilingReq) returns (CommonResp) {}
 rpc  UpdateSecFiling(UpdateSecFilingReq) returns (CommonResp) {}
 rpc  DetailSecFiling(DetailSecFilingReq) returns (SecFilingDetailResp) {}
 rpc  ListSecFiling(ListSecFilingReq) returns (SecFilingListResp) {}
 rpc DeleteSecFiling(DeleteSecFilingReq)returns(CommonResp){}
 rpc IsSecFilingExist(IsSecFilingExistReq) returns (IsSecFilingExistResp) {}
 rpc UpdateSecFilingStatus(UpdateSecFilingStatusReq) returns(CommonResp) {}

}
message IsSecFilingExistReq{
    string filingDate = 1;
    string form = 2;
    string finalLink = 3;
}
message IsSecFilingExistResp{
    bool exist = 1;
}
message CommonResp{  
    string msg = 1 [json_name="msg"];
    string filingKey = 2[json_name="filing_key"];
}
message SecFiling{
    int32 idx = 1 [json_name="idx"];
    string filingKey = 2[json_name="filing_key"];
    string filingDate = 3[json_name="filing_date"];
    string form = 4[json_name="form"];
    string description = 5[json_name="description"];
    string formDescription = 6[json_name="form_description"];
    string fileLink = 7[json_name="file_link"];
    repeated DataFiles dataFiles = 8[json_name="data_files"];
    string pdfFile = 9[json_name="pdf_file"];
    string wordFile = 10[json_name="word_file"];
    string excelFile = 11[json_name="excel_file"];
    int32 status = 12[json_name="status"];
    string operator = 13[json_name="operator"];
    int32 operatorId = 14[json_name="operator_id"];
    string createdAt =15[json_name="created_at"];
    string updatedAt=16[json_name="updated_at"];
}
message DataFiles {
    string description = 1[json_name="description"];
    string fileUrl = 2[json_name="file_url"];
}
message CreateSecFilingReq{
    string filingDate = 1;
    string form = 2;
    string description = 3;
    string formDescription = 4;
    string fileLink = 5;
    repeated DataFiles dataFiles = 6;
    string pdfFile = 7;
    string wordFile = 8;
    string excelFile = 9;
    string operator = 10;
    int32 operatorId = 11;
}
message UpdateSecFilingReq{
    string filingKey = 1;
    string form = 2;
    string description = 3;
    string formDescription = 4;
    string fileLink = 5;
    repeated DataFiles dataFiles = 6;
    string pdfFile = 7;
    string wordFile = 8;
    string excelFile = 9;
    string operator = 10;
    int32 operatorId = 11;
    string filingDate = 12;

}
message DetailSecFilingReq{
    string filingKey = 1;
} 
message SecFilingDetailResp{
    string msg = 1;
    SecFiling data = 2;
}
message ListSecFilingReq{
    uint32 page = 1;
    uint32 pageSize = 2;
    string form = 3;
    string filingDateBegin = 4;
    string filingDateEnd = 5;
    int32 status = 6;
}
message SecFilingListResp{
    string msg = 1 [json_name="msg"];
    uint32 total = 2 [json_name="total"];
    repeated SecFiling data = 3 [json_name="data"];
}
message DeleteSecFilingReq {
    string filingKey = 1;
    string operator = 2;
    int32 operatorId = 3;
}
message UpdateSecFilingStatusReq{
    string filingKey = 1;
    int32 status = 2;
    string operator = 3;
    int32 operatorId = 4;
}