MarketingSystemDataExportTool/grpc/finance/financev1/invoice.proto

397 lines
9.7 KiB
Protocol Buffer

syntax = "proto3";
package finance.api.inner;
import "buf/validate/validate.proto";
import "finance/financev1/model.proto";
import "finance/financev1/enum.proto";
import "finance/financev1/global.proto";
option go_package = "./finance/financev1;financev1";
// 发票相关
service Invoice {
// 创建发票项目
rpc CreateInvoiceProject (CreateInvoiceProjectRequest) returns (CreateInvoiceProjectReply) {}
// 更新发票项目
rpc UpdateInvoiceProject (UpdateInvoiceProjectRequest) returns (UpdateInvoiceProjectReply) {}
// 删除发票项目
rpc DeleteInvoiceProject (DeleteInvoiceProjectRequest) returns (DeleteInvoiceProjectReply) {}
// 获取发票项目
rpc GetInvoiceProject (GetInvoiceProjectRequest) returns (GetInvoiceProjectReply) {}
// 获取发票项目列表
rpc ListInvoiceProject (ListInvoiceProjectRequest) returns (ListInvoiceProjectReply) {}
// 开票资料
rpc InvoiceData (InvoiceDataRequest) returns (InvoiceDataReply) {}
// 编辑开票资料
rpc EditInvoiceIssue (EditInvoiceIssueRequest) returns (Empty) {}
// 创建收票信息
rpc EditInvoiceReceipt (EditInvoiceReceiptRequest) returns (Empty) {}
// 申请开票
rpc CreateInvoice(CreateInvoiceRequest) returns (Empty) {}
// 删除开票资料
rpc DeleteIssue (DeleteIssueRequest) returns (Empty) {}
// 删除收票信息
rpc DeleteReceipt (DeleteReceiptRequest) returns (Empty) {}
// 发票列表
rpc List(ListInvoiceRequest) returns (ListInvoiceReply) {}
// 开票金额变化日志
rpc MoneyLogList(InvoiceMoneyLogListRequest) returns (InvoiceMoneyLogListReply) {}
// 编辑发票
rpc EditInvoice(EditInvoiceRequest) returns (Empty) {}
// 发票详情
rpc InvoiceDetail(InvoiceDetailRequest) returns (InvoiceDetailReply) {}
// 导出
rpc Export(ListInvoiceRequest) returns (FileReply) {}
// 修改发票状态
rpc UpdateStatus(UpdateInvoiceStatusRequest) returns (UpdateInvoiceStatusReply) {}
// 下游开票金额
rpc Money(InvoiceMoneyRequest) returns (InvoiceMoneyReply) {}
// 同步状态
rpc SyncStatus(SyncInvoiceStatusRequest) returns (Empty) {}
// 刷新状态
rpc RefreshStatus(RefreshStatusRequest) returns (Empty) {}
// 校验纳税人识别号
rpc CheckTaxpayerNumber (CheckTaxpayerNumberRequest) returns (CheckTaxpayerNumberReply) {}
}
message AdjustMoneyRequest{
// 下游商户id
int32 resellerId = 1;
// 金额
double money = 2;
// 说明
string remark = 3;
}
message CheckTaxpayerNumberRequest {
string name = 1 [(buf.validate.field).cel = {
message: "公司名最大支持录入35字"
expression: "this.size() > 0 && this.size() <= 35"
}];
int32 resellerId = 2 [(buf.validate.field).cel = {
message: "下游供应商id必须填写"
expression: "this > 0"
}];
}
message CheckTaxpayerNumberReply {
repeated TaxpayerNumber list = 1;
}
message RefreshStatusRequest {
int32 id = 1;
}
message SyncInvoiceStatusRequest{
int32 id = 1;
}
message InvoiceMoneyRequest{
int32 resellerId = 1;
}
message InvoiceMoneyReply{
// 待开票金额
double totalAmount = 1;
// 已开票金额
double invoicedAmount = 2;
// 冻结开票金额
double freezeAmount = 3;
// 可开票金额
double amount = 4;
}
message InvoiceMoneyLogListRequest{
PageReq page = 1 [(buf.validate.field).required = true];
uint32 resellerId = 2;
// 关联单号
string number = 3;
// 1增加开票金额、2冻结开票金额、3解冻开票金额、4扣减冻结金额、5扣减开票金额
InvoiceMoneyLogType type = 4;
// 创建时间
repeated string createdAt = 5;
int32 id = 6;
repeated int32 ids = 7;
}
message InvoiceMoneyLogListReply{
repeated InvoiceMoneyLogItem items = 1;
PageReply page = 2;
}
message EditInvoiceRequest{
// 开票资料id
int32 issueId = 1 [(buf.validate.field).required = true];
// 收票资料id
int32 receiptId = 2 [(buf.validate.field).required = true];
// 备注
string remark = 3;
// 明细
repeated InvoiceProjectWithAmount items = 4;
// 发票性质 1电子 2纸质
InvoiceProperty property = 5;
// 发票类型 1增值税专用发票 2增值税普通发票
InvoiceType type = 6;
// 下游商户id
int32 resellerId = 7;
// 开票方主体
string subject = 8;
int32 id = 9 [(buf.validate.field).required = true];
}
message EditInvoiceReply {}
message UpdateInvoiceStatusRequest{
int32 id = 1;
InvoiceStatus status = 2;
string reason = 3;
int32 resellerId = 4;
}
message UpdateInvoiceStatusReply {}
message DeleteIssueRequest{
int32 id = 1;
int32 resellerId = 2;
}
message DeleteReceiptRequest{
int32 id = 1;
int32 resellerId = 2;
}
message ListInvoiceReply {
PageReply page = 1;
// 总开票金额
double totalAmount = 2;
// 总税额
double TaxAmount = 3;
// 发票信息
repeated InvoiceItem items = 4;
}
message ListInvoiceRequest {
repeated int32 ids = 1;
// 发票状态
InvoiceStatus status = 2;
// 下游商户id
int32 resellerId = 3;
PageReq page = 4;
repeated string createdAt = 5;
double taxRate = 6;
int32 from = 7;
// 发票金额
repeated double amountRange = 8;
// 主体名称
string subject = 9;
// 下游商户id列表
repeated int32 resellerIds = 10;
}
message FileReply {
string file = 1;
}
message InvoiceDetailRequest {
int32 id = 1;
int32 from = 2;
}
message InvoiceDetailReply{
// 编号
string invoiceNumber = 1;
// 发票性质 1电子 2纸质
EnumItem property = 2;
// 发票类型 1增值税专用发票 2增值税普通发票
EnumItem type = 3;
// 开票资料
InvoiceIssueItem issues = 4;
// 收票资料
InvoiceReceiptItem receipts = 5;
// 明细
repeated InvoiceProjectWithAmount items = 6;
int32 id = 7;
// 开票金额
double amount = 8;
// 备注
string remark = 9;
// 抬头
string title = 10;
// 纳税人识别号
string taxpayerNumber = 11;
// 公司地址
string address = 12;
// 公司电话
string mobile = 13;
// 开户银行
string bank = 14;
// 银行账号
string account = 15;
// 收件人
string addressee = 16;
// 取消原因
string reason = 17;
// 开票方主体
string subject = 18;
// 状态
EnumItem status = 19;
}
message CreateInvoiceRequest{
// 开票资料id
int32 issueId = 1 [(buf.validate.field).required = true];
// 收票资料id
int32 receiptId = 2 [(buf.validate.field).required = true];
// 备注
string remark = 3;
// 明细
repeated InvoiceProjectWithAmount items = 4;
// 发票性质 1电子 2纸质
InvoiceProperty property = 5;
// 发票类型 1增值税专用发票 2增值税普通发票
InvoiceType type = 6;
// 下游商户id
int32 resellerId = 7;
// 开票方主体
string subject = 8;
}
message CreateInvoiceReply{}
message InvoiceDataRequest {
int32 resellerId = 1;
}
message InvoiceDataReply{
repeated InvoiceIssueItem issues = 1;
repeated InvoiceReceiptItem receipts = 2;
ResellerItem reseller = 3;
}
message EditInvoiceReceiptRequest{
int32 resellerId = 1;
// 1电子 2纸质
InvoiceProperty property = 2;
// 收票人
string userName = 3;
// 手机号
string mobile = 4;
// 邮箱
string email = 5;
// 收货地址
string address = 6;
int32 id = 7;
}
message EditInvoiceIssueRequest{
int32 resellerId = 1;
// 发票抬头
string title = 2 [(buf.validate.field).cel = {
message: "发票抬头最大支持录入50字"
expression: "this.size() > 0 && this.size() <= 50"
}];
// 纳税人识别号
string taxpayerNumber = 3[(buf.validate.field).cel = {
message: "纳税人识别号最大支持录入20字"
expression: "this.size() >= 15 && this.size() <= 20"
}];
// 公司地址
string address = 4 [(buf.validate.field).cel = {
message: "公司地址最大支持录入100字"
expression: "this.size() <= 100"
}];
// 公司电话
string mobile = 5[(buf.validate.field).cel = {
message: "公司电话最大支持录入35字"
expression: "this.size() <= 35"
}];
// 开户银行
string bank = 6 [(buf.validate.field).cel = {
message: "开户银行最大支持录入35字"
expression: "this.size() <= 35"
}];
// 银行账号
string account = 7 [(buf.validate.field).cel = {
message: "银行账号最大支持录入35字"
expression: "this.size() <= 35"
}];
int32 id = 8;
}
message CreateInvoiceProjectRequest {
// 发票项目名称
string name = 1 [(buf.validate.field).cel = {
message: "最大支持录入30字"
expression: "this.size() > 0 && this.size() <= 30"
}];
// 发票税率(整数, 例如6.12% = 612), 最大值100% = 10000
int32 taxRate = 2 [(buf.validate.field).cel = {
message: "最大支持录入100%"
expression: "this <= 10000"
}];
// 税收分类编码
string code = 3;
// 项目主体
string subject = 4;
}
message CreateInvoiceProjectReply {}
message UpdateInvoiceProjectRequest {
int32 id = 1;
// 发票项目名称
string name = 2 [(buf.validate.field).cel = {
message: "最大支持录入30字"
expression: "this.size() > 0 && this.size() <= 30"
}];
// 发票税率(整数, 例如6.12% = 612), 最大值100% = 10000
int32 taxRate = 3 [(buf.validate.field).cel = {
message: "最大支持录入100%"
expression: "this <= 10000"
}];
// 税收分类编码
string code = 4;
// 项目主体
string subject = 5;
}
message UpdateInvoiceProjectReply {}
message DeleteInvoiceProjectRequest {
int32 id = 1;
}
message DeleteInvoiceProjectReply {}
message GetInvoiceProjectRequest {
int32 id = 1;
}
message GetInvoiceProjectReply {
InvoiceProjectItem detail = 1;
}
message ListInvoiceProjectRequest {
PageReq page = 1 [(buf.validate.field).required = true];
// 项目名称模糊查询
string keyword = 2;
// 项目主体
string subject = 3;
}
message ListInvoiceProjectReply {
repeated InvoiceProjectItem list = 1;
PageReply page = 2;
}