Files
protobuf/printerapis/printer/v1/pdf_invoice.proto
2022-05-31 09:30:19 +02:00

87 lines
1.8 KiB
Protocol Buffer

syntax = "proto3";
package printer.v1.invoice;
option go_package = "git.deineagentur.com/payment-backoffice/protobuf/gen/proto/printer";
import "google/type/money.proto";
import "google/type/datetime.proto";
import "google/api/annotations.proto";
// PaymentProvider represents the supported set
// of payment providers.
enum InvoiceType {
INVOICE_TYPE_UNSPECIFIED = 0;
INVOICE_TYPE_PAID = 1;
INVOICE_TYPE_OPEN = 2;
}
enum OrderType {
ORDER_TYPE_UNSPECIFIED = 0;
ORDER_TYPE_PHONE = 1;
ORDER_TYPE_WWW = 2;
ORDER_TYPE_EMAIL = 3;
}
message InvoiceInfo {
string invoice_id = 1;
google.type.DateTime invoice_date = 2;
google.type.DateTime invoice_due_date = 3;
InvoiceType invoice_type = 4;
}
message OrderInfo {
string order_id = 1;
google.type.DateTime order_date = 2;
google.type.DateTime order_due_date = 3;
OrderType order_type = 4;
repeated OrderItem order_items = 5;
repeated OrderVatItem order_vat_items = 6;
optional double deposit = 7;
}
message OfferInfo {
string offer_id = 1;
google.type.DateTime offer_date = 2;
google.type.DateTime offer_due_date = 3;
}
message OrderItem {
string description = 1;
double vat = 2;
uint64 count = 3;
double price_single = 4;
double price_sum = 5;
bool price_net = 6;
}
message OrderVatItem {
string description = 1;
double vat = 2;
double vat_money_sum = 3;
uint64 items_count = 4;
}
// Invoice
message Invoice {
OrderInfo order = 1;
OfferInfo offer = 2;
InvoiceInfo info = 3;
}
// PDF Response
message DocumentResponse {
bytes document = 1;
string signature = 2;
string sha512 = 3;
}
service PrinterService {
rpc InvoiceGen(Invoice) returns (DocumentResponse) {
option (google.api.http) = {
post: "/v1/printer/invoice"
body: "*"
};
};
}