syntax = "proto3";
option go_package = "./pb";

package pb;

import "models/rpc_messages.proto";
import "models/model_user_bill.proto";

// 账单相关服务
service UserBillService {
	// 手工生成订单
	rpc generateAllUserBills (GenerateAllUserBillsRequest) returns (RPCSuccess);

	// 计算所有账单数量
	rpc countAllUserBills (CountAllUserBillsRequest) returns (RPCCountResponse);

	// 列出单页账单
	rpc listUserBills (ListUserBillsRequest) returns (ListUserBillsResponse);
}

// 手工生成订单
message GenerateAllUserBillsRequest {
	string month = 1;
}

// 计算所有账单数量
message CountAllUserBillsRequest {
	int32 paidFlag = 1; // 0|1|-1
	int64 userId = 2;
	string month = 3;
}

// 列出单页账单
message ListUserBillsRequest {
	int32 paidFlag = 1;
	int64 userId = 2;
	string month = 5;

	int64 offset = 3;
	int64 size = 4;
}

message ListUserBillsResponse {
	repeated UserBill userBills = 1;
}