@restorecommerce/protos 3.1.2 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,16 +2,23 @@ syntax = "proto3";
2
2
 
3
3
  package io.restorecommerce.invoice;
4
4
 
5
+ import "google/protobuf/any.proto";
5
6
  import "io/restorecommerce/resource_base.proto";
6
7
  import "io/restorecommerce/meta.proto";
7
8
  import "io/restorecommerce/organization.proto";
8
9
  import "io/restorecommerce/auth.proto";
9
- import "google/protobuf/any.proto";
10
10
  import "io/restorecommerce/status.proto";
11
11
  import "io/restorecommerce/options.proto";
12
+ import "io/restorecommerce/address.proto";
13
+ import "io/restorecommerce/amount.proto";
14
+ import "io/restorecommerce/price.proto";
15
+ import "io/restorecommerce/file.proto";
16
+ import "io/restorecommerce/reference.proto";
12
17
 
13
18
  // Used by resolvers
19
+ import "io/restorecommerce/user.proto";
14
20
  import "io/restorecommerce/customer.proto";
21
+ import "io/restorecommerce/shop.proto";
15
22
 
16
23
  /*
17
24
  * Microservice definition.
@@ -21,28 +28,50 @@ service InvoiceService {
21
28
  option (io.restorecommerce.options.is_query) = true;
22
29
  };
23
30
  rpc Create (InvoiceList) returns (InvoiceListResponse);
24
- rpc Delete (io.restorecommerce.resourcebase.DeleteRequest) returns (io.restorecommerce.resourcebase.DeleteResponse);
25
31
  rpc Update (InvoiceList) returns (InvoiceListResponse);
26
32
  rpc Upsert (InvoiceList) returns (InvoiceListResponse);
33
+ rpc Delete (io.restorecommerce.resourcebase.DeleteRequest) returns (io.restorecommerce.resourcebase.DeleteResponse);
34
+
35
+ /*
36
+ * Render invoices as PDF to ostorage. (creates if not exist, updates if id is given)
37
+ */
38
+ rpc Render (InvoiceList) returns (InvoiceListResponse);
39
+
40
+ /*
41
+ * Mark invoices as withdrawn
42
+ */
43
+ rpc Withdraw (InvoiceIdList) returns (InvoiceListResponse);
44
+
45
+ /*
46
+ * Triggers notification-srv (sends invoice per email for instance)
47
+ */
48
+ rpc Send (InvoiceIdList) returns (io.restorecommerce.status.StatusListResponse);
49
+
50
+ /*
51
+ * Generate an incremented invoice number
52
+ */
27
53
  rpc GenerateInvoiceNumber(RequestInvoiceNumber) returns (InvoiceNumberResponse);
28
54
  }
29
55
 
56
+ enum PaymentState {
57
+ UNPAYED = 0;
58
+ PAYED = 1;
59
+ }
60
+
30
61
  message RequestInvoiceNumber {
31
- google.protobuf.Any context = 1;
32
- io.restorecommerce.auth.Subject subject = 3;
62
+ optional string shop_id = 1;
63
+ google.protobuf.Any context = 2;
64
+ io.restorecommerce.auth.Subject subject = 3;
33
65
  }
34
66
 
35
67
  message InvoiceNumberResponse {
36
- string invoice_no = 1;
68
+ string invoice_number = 1;
37
69
  }
38
70
 
39
71
  message Deleted {
40
72
  string id = 1;
41
73
  }
42
74
 
43
- /*
44
- * For multiple invoices
45
- */
46
75
  message InvoiceList {
47
76
  repeated Invoice items = 1;
48
77
  optional uint32 total_count = 2;
@@ -60,92 +89,110 @@ message InvoiceResponse {
60
89
  io.restorecommerce.status.Status status = 2;
61
90
  }
62
91
 
92
+ message InvoiceId {
93
+ optional string id = 1;
94
+ repeated string channel_ids = 2;
95
+ optional google.protobuf.Any options = 3;
96
+ optional io.restorecommerce.auth.Subject subject = 4;
97
+ }
98
+
99
+ message InvoiceIdList {
100
+ repeated InvoiceId items = 1;
101
+ optional uint32 total_count = 2;
102
+ io.restorecommerce.auth.Subject subject = 3;
103
+ }
104
+
63
105
  /*
64
- * A simple invoice.
106
+ * The Invoice recource, stored in DB.
65
107
  */
66
108
  message Invoice {
109
+ option (restorecommerce.options.kafka_subscriber) = {
110
+ plural: "invoices"
111
+ topic: "io.restorecommerce.invoice.resource"
112
+ created: "invoiceCreated"
113
+ updated: "invoiceUpdated"
114
+ deleted: "invoiceDeleted"
115
+ };
116
+
67
117
  optional string id = 1;
68
118
  optional io.restorecommerce.meta.Meta meta = 2;
69
- optional string timestamp = 4;
70
- optional string customer_id = 5 [
119
+ optional string invoice_number = 3;
120
+ repeated io.restorecommerce.reference.Reference references = 4;
121
+ optional string user_id = 5 [
122
+ (io.restorecommerce.options.resolver) = {
123
+ target_type: ".io.restorecommerce.user.User",
124
+ target_service: "identity",
125
+ target_sub_service: "user",
126
+ target_method: "Read",
127
+ field_name: "user",
128
+ }
129
+ ];
130
+ optional string customer_id = 6 [
71
131
  (io.restorecommerce.options.resolver) = {
72
132
  target_type: ".io.restorecommerce.customer.Customer",
73
- target_service: "master_data",
133
+ target_service: "resource",
74
134
  target_sub_service: "customer",
75
135
  target_method: "Read",
76
136
  field_name: "customer",
77
137
  }
78
- ];
79
- optional string payment_status = 6;
80
- optional double total_amount = 7;
81
- optional double net_amount = 8;
82
- optional double vat_amount = 9; // difference between net and total
83
- optional string document = 10;
84
- optional string invoice_number = 11;
85
- optional string customer_remark = 12;
86
- }
87
-
88
- /**
89
- * List of Invoice Positions data
90
- */
91
- message InvoicesPositionsData {
92
- repeated InvoicePositions invoice_positions = 1;
93
- }
94
-
95
- message InvoicePositions {
96
- optional string id = 1; // contract or customer identifier
97
- repeated InvoicePosition invoice_positions = 2;
98
- optional RecipientCustomer recipient_customer = 3;
99
- optional BillingAddress recipient_billing_address = 4;
100
- optional BillingAddress sender_billing_address = 5;
101
- optional io.restorecommerce.organization.Organization recipient_organization = 6;
102
- optional io.restorecommerce.organization.Organization sender_organization = 7;
103
- optional google.protobuf.Any payment_method_details = 8;
104
- optional string invoice_no = 9; // optional invoice number if not it will be generated by service
105
- optional double from_date = 10; // value performance from date
106
- optional double to_date = 11; // value performance to date
107
- }
108
-
109
- message RecipientCustomer {
110
- optional string id = 1; // customer id - used to store the resource in DB
111
- optional string customer_number = 2; // displayed in invoice
112
- }
113
-
114
- message BillingAddress {
115
- optional string email = 1;
116
- optional string website = 2;
117
- optional string street = 3;
118
- optional string building_number = 4;
119
- optional string postcode = 5;
120
- optional string region = 6;
121
- optional string country_name = 7;
122
- optional string telephone = 9;
123
- optional string timezone = 10;
124
- optional string economic_area = 11;
125
- optional string locality = 12;
126
- optional string organization_name = 13;
127
- }
128
-
129
- message InvoicePosition {
130
- optional string currency = 1;
131
- repeated InvoiceRow invoiceRows = 2;
132
- optional InvoicePrice totalPrice = 3;
133
- }
134
-
135
- message InvoiceRow {
136
- optional string product = 1;
137
- optional double pricePerUnit = 2;
138
- optional uint32 quantity = 3;
139
- optional string vat = 4;
140
- optional double amount = 5;
141
- optional double contract_start_date = 6; // if there is any contract associated with product
138
+ ]; // customer_number ref. to recipent orga
139
+ optional string shop_id = 7 [
140
+ (io.restorecommerce.options.resolver) = {
141
+ target_type: ".io.restorecommerce.shop.Shop",
142
+ target_service: "resource",
143
+ target_sub_service: "shop",
144
+ target_method: "Read",
145
+ field_name: "shop",
146
+ }
147
+ ]; // shop_number --- ref. to sender orga
148
+ optional double timestamp = 8;
149
+ optional PaymentState payment_state = 9;
150
+ optional io.restorecommerce.address.BillingAddress sender = 10;
151
+ optional io.restorecommerce.address.BillingAddress recipient = 11;
152
+ repeated Position positions = 12;
153
+ repeated io.restorecommerce.amount.Amount total_amounts = 13;
154
+ repeated string payment_hints = 14; // is there no better type for that?
155
+ repeated io.restorecommerce.file.File documents = 15; // url to rendered PDFs
156
+ optional string customer_remark = 16;
157
+ optional double from_date = 17; // value performance from date
158
+ optional double to_date = 18; // value performance to date
159
+ optional bool sent = 19;
160
+ optional bool withdrawn = 20;
161
+ }
162
+
163
+ message Position {
164
+ optional string id = 1;
165
+ repeated Row rows = 3;
166
+ repeated io.restorecommerce.amount.Amount amounts = 5; // repeated in case of multiple currencies?
142
167
  }
143
168
 
144
- message InvoicePrice {
145
- optional double gross = 1;
146
- optional double net = 2;
169
+ message Row {
170
+ optional string id = 1;
171
+ oneof item_type {
172
+ ProductItem product_item = 2;
173
+ ManualItem manual_item = 3;
174
+ }
175
+ optional io.restorecommerce.price.Price unit_price = 4;
176
+ optional uint32 quantity = 5;
177
+ optional io.restorecommerce.amount.Amount amount = 6;
178
+ optional double contract_start_date = 7; // if there is any contract associated with product
179
+ }
180
+
181
+ message ProductItem {
182
+ optional string product_id = 1 [
183
+ (io.restorecommerce.options.resolver) = {
184
+ target_type: ".io.restorecommerce.product.Product",
185
+ target_service: "catalog",
186
+ target_sub_service: "product",
187
+ target_method: "Read",
188
+ field_name: "product",
189
+ }
190
+ ];
191
+ optional string variant_id = 2;
147
192
  }
148
193
 
149
- message TriggerInvoices {
150
- repeated string ids = 1; // list of id referring to contract_ids or customer_ids
151
- }
194
+ message ManualItem {
195
+ optional string stock_keeping_unit = 1;
196
+ optional string name = 2;
197
+ optional string descritpion = 3;
198
+ }
@@ -3,6 +3,7 @@ syntax = "proto3";
3
3
  package io.restorecommerce.notification_req;
4
4
 
5
5
  import "io/restorecommerce/status.proto";
6
+ import "io/restorecommerce/reference.proto";
6
7
 
7
8
  service NotificationReqService {
8
9
  // direct notifications
@@ -35,6 +36,7 @@ message NotificationReq {
35
36
  optional string transport = 5; /// 'email', 'log', ... default == 'log'
36
37
  optional string provider = 6; /// specific transport provider, eg: 'console' for transport == 'log'
37
38
  repeated Attachment attachments = 7;
39
+ optional io.restorecommerce.reference.Reference reference = 8;
38
40
  }
39
41
 
40
42
  message Email {
@@ -2,16 +2,23 @@ syntax = "proto3";
2
2
 
3
3
  package io.restorecommerce.order;
4
4
 
5
+ import "google/protobuf/any.proto";
6
+
5
7
  import "io/restorecommerce/resource_base.proto";
6
8
  import "io/restorecommerce/meta.proto";
7
9
  import "io/restorecommerce/auth.proto";
8
10
  import "io/restorecommerce/status.proto";
9
11
  import "io/restorecommerce/options.proto";
10
12
  import "io/restorecommerce/address.proto";
11
- import "io/restorecommerce/tax.proto";
13
+ import "io/restorecommerce/amount.proto";
14
+ import "io/restorecommerce/price.proto";
12
15
  import "io/restorecommerce/country.proto";
13
16
  import "io/restorecommerce/fulfillment.proto";
14
17
  import "io/restorecommerce/fulfillment_product.proto";
18
+ import "io/restorecommerce/invoice.proto";
19
+
20
+ // Used by resolvers
21
+ import "io/restorecommerce/shop.proto";
15
22
 
16
23
 
17
24
  service OrderService {
@@ -26,34 +33,46 @@ service OrderService {
26
33
  rpc Withdraw (OrderIdList) returns (OrderListResponse);
27
34
  rpc Cancel (OrderIdList) returns (OrderListResponse);
28
35
  rpc Delete (io.restorecommerce.resourcebase.DeleteRequest) returns (io.restorecommerce.resourcebase.DeleteResponse);
29
-
36
+
30
37
  // Requires Fulfillment Service
31
38
  rpc QueryPackingSolution (FulfillmentRequestList) returns (io.restorecommerce.fulfillment_product.PackingSolutionListResponse);
32
39
  // Requires Fulfillment Service
33
40
  rpc CreateFulfillment (FulfillmentRequestList) returns (io.restorecommerce.fulfillment.FulfillmentListResponse);
34
41
  // Requires Fulfillment Service
35
42
  rpc TriggerFulfillment (FulfillmentRequestList) returns (io.restorecommerce.status.StatusListResponse);
43
+
44
+ // Requires Invoice Service
45
+ rpc CreateInvoice (InvoiceRequestList) returns (io.restorecommerce.invoice.InvoiceListResponse);
46
+ // Requires Invoice Service
47
+ rpc TriggerInvoice (InvoiceRequestList) returns (io.restorecommerce.status.StatusListResponse);
36
48
  }
37
49
 
38
- enum OrderState {
39
- Created = 0;
40
- Submitted = 1;
41
- Confirmed = 2;
42
- Invalid = 3;
43
- Shipping = 4;
44
- Failed = 5;
45
- Done = 6;
46
- Withdrawn = 7;
47
- Cancelled = 8;
50
+ enum State {
51
+ FAILED = 0;
52
+ INVALID = 1;
53
+ CREATED = 2;
54
+ SUBMITTED = 3;
55
+ IN_PROCESS = 4;
56
+ DONE = 5;
57
+ WITHDRAWN = 6;
58
+ CANCELLED = 7;
48
59
  }
49
60
 
50
- message OrderItem {
51
- optional string product_id = 1;
52
- optional string variant_id = 2;
53
- optional int32 quantity = 3;
54
- optional double unit_price = 4; //Set by service
55
- optional double price = 5; //Set by service
56
- repeated io.restorecommerce.tax.VAT vats = 6; //Set by service
61
+ message Item {
62
+ optional string id = 1;
63
+ optional string product_id = 2 [
64
+ (io.restorecommerce.options.resolver) = {
65
+ target_type: ".io.restorecommerce.product.Product",
66
+ target_service: "catalog",
67
+ target_sub_service: "product",
68
+ target_method: "Read",
69
+ field_name: "product",
70
+ }
71
+ ];
72
+ optional string variant_id = 3;
73
+ optional int32 quantity = 4;
74
+ optional io.restorecommerce.price.Price unit_price = 5; //Set by service
75
+ optional io.restorecommerce.amount.Amount amount = 6; //Set by service
57
76
  }
58
77
 
59
78
  /**
@@ -70,16 +89,44 @@ message Order {
70
89
 
71
90
  optional string id = 1;
72
91
  optional io.restorecommerce.meta.Meta meta = 2;
73
- optional OrderState state = 3;
74
- optional string customer_reference = 4;
75
- repeated OrderItem items = 5;
76
- optional double total_price = 6; //Set by service
77
- optional double total_vat = 7; //Set by service
78
- optional io.restorecommerce.address.ShippingAddress shipping_address = 8;
79
- optional io.restorecommerce.address.ShippingAddress billing_address = 9;
80
- optional string billing_email = 10;
81
- optional string notification_email = 11;
82
- optional io.restorecommerce.fulfillment_product.Preferences packing_preferences = 12;
92
+ optional string user_id = 3 [
93
+ (io.restorecommerce.options.resolver) = {
94
+ target_type: ".io.restorecommerce.customer.Customer",
95
+ target_service: "resource",
96
+ target_sub_service: "customer",
97
+ target_method: "Read",
98
+ field_name: "customer",
99
+ }
100
+ ];
101
+ optional string customer_id = 4 [
102
+ (io.restorecommerce.options.resolver) = {
103
+ target_type: ".io.restorecommerce.customer.Customer",
104
+ target_service: "resource",
105
+ target_sub_service: "customer",
106
+ target_method: "Read",
107
+ field_name: "customer",
108
+ }
109
+ ];
110
+ optional string shop_id = 5 [
111
+ (io.restorecommerce.options.resolver) = {
112
+ target_type: ".io.restorecommerce.shop.Shop",
113
+ target_service: "resource",
114
+ target_sub_service: "shop",
115
+ target_method: "Read",
116
+ field_name: "shop",
117
+ }
118
+ ];
119
+ repeated Item items = 6;
120
+ optional State order_state = 7; // Set by service
121
+ optional io.restorecommerce.fulfillment.State fulfillment_state = 8; // Set by kafka
122
+ optional io.restorecommerce.invoice.PaymentState payment_state = 9; // Set by kafka
123
+ repeated io.restorecommerce.amount.Amount total_amounts = 10; // Set by service --- repeated in case of variant currency?
124
+ optional io.restorecommerce.address.ShippingAddress shipping_address = 11;
125
+ optional io.restorecommerce.address.BillingAddress billing_address = 12;
126
+ optional string notification_email = 13;
127
+ optional string customer_order_nr = 14;
128
+ optional string customer_remark = 15;
129
+ optional io.restorecommerce.fulfillment_product.Preferences packaging_preferences = 16;
83
130
  }
84
131
 
85
132
  message OrderIdList {
@@ -108,20 +155,35 @@ message Deleted {
108
155
  string id = 1;
109
156
  }
110
157
 
111
- message ShippingDetails {
112
- optional string export_type = 1;
113
- optional string export_description = 2;
114
- optional string invoice_number = 3;
115
- optional io.restorecommerce.address.ShippingAddress sender_address = 4;
116
- }
117
-
118
158
  message FulfillmentRequest {
119
- optional string reference_id = 1;
120
- optional ShippingDetails shipping_details = 2;
159
+ optional string order_id = 1;
160
+ optional string export_type = 2; // @TODO: not used!
161
+ optional string export_description = 3; // @TODO: not used!
162
+ optional string invoice_number = 4; // @TODO: not used!
163
+ optional io.restorecommerce.address.ShippingAddress sender_address = 5;
164
+ repeated string include_items = 6; // includes all if empty
165
+ google.protobuf.Any data = 7;
121
166
  }
122
167
 
123
168
  message FulfillmentRequestList {
124
169
  repeated FulfillmentRequest items = 1;
125
170
  optional uint32 total_count = 2;
126
171
  io.restorecommerce.auth.Subject subject = 3;
127
- }
172
+ }
173
+
174
+ message InvoicePosition {
175
+ optional string order_id = 2;
176
+ repeated string included_items = 3; // includes all on empty
177
+ repeated string included_fulfillments = 4; // includes all on empty
178
+ }
179
+
180
+ message InvoiceRequest {
181
+ optional string invoice_number = 1; // if given
182
+ repeated InvoicePosition positions = 2;
183
+ }
184
+
185
+ message InvoiceRequestList {
186
+ repeated InvoiceRequest items = 1;
187
+ optional uint32 total_count = 2;
188
+ io.restorecommerce.auth.Subject subject = 3;
189
+ }
@@ -53,16 +53,7 @@ message OrganizationResponse {
53
53
  message Organization {
54
54
  optional string id = 1; /// Organization ID, unique, key
55
55
  optional io.restorecommerce.meta.Meta meta = 2;
56
- optional string address_id = 3 [
57
- (io.restorecommerce.options.resolver) = {
58
- target_type: ".io.restorecommerce.address.Address",
59
- target_service: "master_data",
60
- target_sub_service: "address",
61
- target_method: "Read",
62
- field_name: "address",
63
- }
64
- ]; /// Address for the organization
65
- optional string parent_id = 4 [
56
+ optional string parent_id = 3 [
66
57
  (io.restorecommerce.options.resolver) = {
67
58
  target_type: ".io.restorecommerce.organization.Organization",
68
59
  target_service: "master_data",
@@ -71,7 +62,7 @@ message Organization {
71
62
  field_name: "parent",
72
63
  }
73
64
  ]; // Hierarchically superior organization; may be null
74
- repeated string contact_point_ids = 6 [
65
+ repeated string contact_point_ids = 4 [
75
66
  (io.restorecommerce.options.resolver) = {
76
67
  target_type: ".io.restorecommerce.contact_point.ContactPoint",
77
68
  target_service: "master_data",
@@ -80,14 +71,14 @@ message Organization {
80
71
  field_name: "contactPoints",
81
72
  }
82
73
  ]; // list of possible legal addresses of different types
83
- optional string website = 7;
84
- optional string email = 8;
85
- optional string logo = 9; // base64; arangoDB does not support blob storage
86
- optional string vat_id = 10;
87
- optional string isic_v4 = 11;
88
- optional string registration = 12;
89
- optional string registration_court = 13;
90
- optional string name = 14;
91
- repeated string payment_method_ids = 15;
92
- optional google.protobuf.Any data = 16; /// additional data
74
+ optional string website = 5;
75
+ optional string email = 6;
76
+ optional string logo = 7; // base64; arangoDB does not support blob storage
77
+ optional string vat_id = 8;
78
+ optional string isic_v4 = 9;
79
+ optional string registration = 10;
80
+ optional string registration_court = 11;
81
+ optional string name = 12;
82
+ repeated string payment_method_ids = 13;
83
+ optional google.protobuf.Any data = 14; /// additional data
93
84
  }
@@ -0,0 +1,32 @@
1
+ syntax = "proto3";
2
+
3
+ package io.restorecommerce.price;
4
+
5
+ // Used by resolvers
6
+ import "io/restorecommerce/options.proto";
7
+ import "io/restorecommerce/tax.proto";
8
+ import "io/restorecommerce/currency.proto";
9
+
10
+ message Price {
11
+ optional double regular_price = 1;
12
+ optional bool sale = 2;
13
+ optional double sale_price = 3;
14
+ optional string currency_id = 4 [
15
+ (io.restorecommerce.options.resolver) = {
16
+ target_type: ".io.restorecommerce.currency.Currency",
17
+ target_service: "master_data",
18
+ target_sub_service: "currency",
19
+ target_method: "Read",
20
+ field_name: "currency",
21
+ }
22
+ ];
23
+ repeated string tax_ids = 5 [
24
+ (io.restorecommerce.options.resolver) = {
25
+ target_type: ".io.restorecommerce.tax.Tax",
26
+ target_service: "master_data",
27
+ target_sub_service: "tax",
28
+ target_method: "Read",
29
+ field_name: "taxes",
30
+ }
31
+ ];
32
+ }
@@ -11,6 +11,7 @@ import "io/restorecommerce/auth.proto";
11
11
  import "io/restorecommerce/status.proto";
12
12
  import "io/restorecommerce/attribute.proto";
13
13
  import "io/restorecommerce/geometry.proto";
14
+ import "io/restorecommerce/price.proto";
14
15
  import "io/restorecommerce/options.proto";
15
16
 
16
17
  // Used by resolvers
@@ -63,10 +64,19 @@ message Product {
63
64
  IndividualProduct product = 3;
64
65
  Bundle bundle = 4;
65
66
  }
66
- optional bool active = 5;
67
- repeated string tags = 6;
68
- repeated Association associations = 7;
69
- google.protobuf.Any data = 8;
67
+ optional string shop_id = 5 [
68
+ (io.restorecommerce.options.resolver) = {
69
+ target_type: ".io.restorecommerce.shop.Shop",
70
+ target_service: "resource",
71
+ target_sub_service: "shop",
72
+ target_method: "Read",
73
+ field_name: "shop",
74
+ }
75
+ ];
76
+ optional bool active = 6;
77
+ repeated string tags = 7;
78
+ repeated Association associations = 8;
79
+ google.protobuf.Any data = 9;
70
80
  }
71
81
 
72
82
  message IndividualProduct {
@@ -103,10 +113,11 @@ message IndividualProduct {
103
113
  ];
104
114
  }
105
115
  repeated string tax_ids = 7;
106
- optional string gtin = 8;
116
+ optional string currency_id = 8;
117
+ optional string gtin = 9;
107
118
  oneof nature {
108
- PhysicalProduct physical = 9;
109
- VirtualProduct virtual = 10;
119
+ PhysicalProduct physical = 10;
120
+ VirtualProduct virtual = 11;
110
121
  };
111
122
  }
112
123
 
@@ -146,15 +157,13 @@ message PhysicalVariant {
146
157
  optional string name = 2;
147
158
  optional string description = 3;
148
159
  optional int32 stock_level = 4;
149
- optional double price = 5;
150
- optional bool sale = 6;
151
- optional double sale_price = 7;
152
- repeated io.restorecommerce.image.Image images = 8;
153
- repeated io.restorecommerce.file.File files = 9;
154
- optional string stock_keeping_unit = 10;
155
- optional string template_variant = 11;
156
- optional Package package = 12;
157
- repeated io.restorecommerce.attribute.Attribute attributes = 13;
160
+ optional io.restorecommerce.price.Price price = 5;
161
+ repeated io.restorecommerce.image.Image images = 6;
162
+ repeated io.restorecommerce.file.File files = 7;
163
+ optional string stock_keeping_unit = 8;
164
+ optional string template_variant = 9;
165
+ optional Package package = 10;
166
+ repeated io.restorecommerce.attribute.Attribute attributes = 11;
158
167
  }
159
168
 
160
169
  message VirtualVariant {
@@ -162,14 +171,12 @@ message VirtualVariant {
162
171
  optional string name = 2;
163
172
  optional string description = 3;
164
173
  optional int32 stock_level = 4;
165
- optional double price = 5;
166
- optional bool sale = 6;
167
- optional double sale_price = 7;
168
- repeated io.restorecommerce.image.Image images = 8;
169
- repeated io.restorecommerce.file.File files = 9;
170
- optional string stock_keeping_unit = 10;
171
- optional string template_variant = 11;
172
- repeated io.restorecommerce.attribute.Attribute attributes = 12;
174
+ optional io.restorecommerce.price.Price price = 5;
175
+ repeated io.restorecommerce.image.Image images = 6;
176
+ repeated io.restorecommerce.file.File files = 7;
177
+ optional string stock_keeping_unit = 8;
178
+ optional string template_variant = 9;
179
+ repeated io.restorecommerce.attribute.Attribute attributes = 10;
173
180
  }
174
181
 
175
182
  message Bundle {
@@ -177,7 +184,7 @@ message Bundle {
177
184
  optional string description = 2;
178
185
  repeated io.restorecommerce.image.Image images = 3;
179
186
  repeated BundleProduct products = 4;
180
- optional double price = 5;
187
+ optional io.restorecommerce.price.Price price = 5;
181
188
  optional Package pre_packaged = 6;
182
189
  }
183
190
 
@@ -193,7 +200,7 @@ message BundleProduct {
193
200
  ];
194
201
  optional string variant_id = 2;
195
202
  optional uint32 quantity = 3;
196
- optional double tax_ratio = 4; //Discount in relation to the bundle price
203
+ optional double price_ratio = 4; //Price ratio in relation to the bundle price
197
204
  }
198
205
 
199
206
  message Deleted {