blob: e56253d2e3bb5124b6888b2250d39ba2b0c5db73 [file] [log] [blame]
Sergiusz Bazanskifb18c992019-05-01 12:27:03 +02001syntax = "proto3";
2
3package invoice;
4
5message Item {
6 string title = 1;
7 uint64 count = 2;
8 uint64 unit_price = 3;
9 // in thousands of percent points
10 // (ie 23% == 23000)
11 uint64 vat = 4;
12}
13
14message ContactPoint {
15 string medium = 1;
16 string contact = 2;
17}
18
19message Invoice {
20 repeated Item item = 1;
21 repeated string invoicer_billing = 2;
22 repeated ContactPoint invoicer_contact = 3;
23 repeated string customer_billing = 4;
24 string invoicer_vat_id = 5;
25 string invoicer_company_number = 12;
26 string customer_vat_id = 6;
27 bool reverse_vat = 7;
28 bool us_customer = 11;
29 int64 days_due = 8;
30 string iban = 9;
31 string swift = 10;
32}
33
34message CreateInvoiceRequest {
35 Invoice invoice = 1;
36}
37
38message CreateInvoiceResponse {
39 // Unique invoice ID
40 string uid = 1;
41}
42
43message GetInvoiceRequest {
44 string uid = 1;
45}
46
47message GetInvoiceResponse {
48 Invoice invoice = 1;
49 enum State {
50 STATE_INVALID = 0;
51 STATE_PROFORMA = 1;
52 STATE_SEALED = 2;
53 };
54 State state = 2;
55 string final_uid = 3;
56}
57
58message RenderInvoiceRequest {
59 string uid = 1;
60}
61
62message RenderInvoiceResponse {
63 bytes data = 1;
64}
65
66message SealInvoiceRequest {
67 string uid = 1;
68}
69
70message SealInvoiceResponse {
71}
72
73service Invoicer {
74 rpc CreateInvoice(CreateInvoiceRequest) returns (CreateInvoiceResponse);
75 rpc GetInvoice(GetInvoiceRequest) returns (GetInvoiceResponse);
76 rpc RenderInvoice(RenderInvoiceRequest) returns (stream RenderInvoiceResponse);
77 rpc SealInvoice(SealInvoiceRequest) returns (SealInvoiceResponse);
78}