This repository has been archived on 2023-10-10. You can view files and clone it, but cannot push or open issues/pull-requests.
inboice/inboice.proto

79 lines
1.6 KiB
Protocol Buffer

syntax = "proto3";
package proto;
message Item {
string title = 1;
uint64 count = 2;
uint64 unit_price = 3;
// in thousands of percent points
// (ie 23% == 23000)
uint64 vat = 4;
}
message ContactPoint {
string medium = 1;
string contact = 2;
}
message Invoice {
repeated Item item = 1;
repeated string invoicer_billing = 2;
repeated ContactPoint invoicer_contact = 3;
repeated string customer_billing = 4;
string invoicer_vat_id = 5;
string invoicer_company_number = 12;
string customer_vat_id = 6;
bool reverse_vat = 7;
bool us_customer = 11;
int64 days_due = 8;
string iban = 9;
string swift = 10;
}
message CreateInvoiceRequest {
Invoice invoice = 1;
}
message CreateInvoiceResponse {
// Unique invoice ID
string uid = 1;
}
message GetInvoiceRequest {
string uid = 1;
}
message GetInvoiceResponse {
Invoice invoice = 1;
enum State {
STATE_INVALID = 0;
STATE_PROFORMA = 1;
STATE_SEALED = 2;
};
State state = 2;
string final_uid = 3;
}
message RenderInvoiceRequest {
string uid = 1;
}
message RenderInvoiceResponse {
bytes data = 1;
}
message SealInvoiceRequest {
string uid = 1;
}
message SealInvoiceResponse {
}
service Inboice {
rpc CreateInvoice(CreateInvoiceRequest) returns (CreateInvoiceResponse);
rpc GetInvoice(GetInvoiceRequest) returns (GetInvoiceResponse);
rpc RenderInvoice(RenderInvoiceRequest) returns (stream RenderInvoiceResponse);
rpc SealInvoice(SealInvoiceRequest) returns (SealInvoiceResponse);
}