blob: 90fc8741077f374d40bad9980850696acb739f76 [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;
Sergiusz Bazanskic2d322c2019-05-01 13:14:32 +020032 string unit = 13;
Sergiusz Bazanskifb18c992019-05-01 12:27:03 +020033}
34
35message CreateInvoiceRequest {
36 Invoice invoice = 1;
37}
38
39message CreateInvoiceResponse {
40 // Unique invoice ID
41 string uid = 1;
42}
43
44message GetInvoiceRequest {
45 string uid = 1;
46}
47
48message GetInvoiceResponse {
49 Invoice invoice = 1;
50 enum State {
51 STATE_INVALID = 0;
52 STATE_PROFORMA = 1;
53 STATE_SEALED = 2;
54 };
55 State state = 2;
56 string final_uid = 3;
57}
58
59message RenderInvoiceRequest {
60 string uid = 1;
61}
62
63message RenderInvoiceResponse {
64 bytes data = 1;
65}
66
67message SealInvoiceRequest {
68 string uid = 1;
69}
70
71message SealInvoiceResponse {
72}
73
74service Invoicer {
75 rpc CreateInvoice(CreateInvoiceRequest) returns (CreateInvoiceResponse);
76 rpc GetInvoice(GetInvoiceRequest) returns (GetInvoiceResponse);
77 rpc RenderInvoice(RenderInvoiceRequest) returns (stream RenderInvoiceResponse);
78 rpc SealInvoice(SealInvoiceRequest) returns (SealInvoiceResponse);
79}