Skip to content

Commit

Permalink
Add protos
Browse files Browse the repository at this point in the history
  • Loading branch information
weeco committed Dec 13, 2020
1 parent 2d22b69 commit 2dd7ac2
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 0 deletions.
28 changes: 28 additions & 0 deletions protos/address.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
syntax = "proto3";
package fake_models;

import "google/protobuf/timestamp.proto";
option go_package = "pkg/protobuf";

message Address {
int32 version = 1;
string id = 2;
message Customer {
string customer_id = 1;
string customer_type = 2;
}
Customer customer = 3;
string type = 4;
string first_name = 5;
string last_name = 6;
string state = 7;
string house_number = 8;
string city = 9;
string zip = 10;
float latitude = 11;
float longitude = 12;
string phone = 13;
string additional_address_info = 14;
google.protobuf.Timestamp created_at = 15;
int32 revision = 16;
}
20 changes: 20 additions & 0 deletions protos/customer.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
syntax = "proto3";
package fake_models;

option go_package = "pkg/protobuf";

message Customer {
int32 version = 1;
string id = 2;
string first_name = 3;
string last_name = 4;
string gender = 5;
string company_name = 6;
string email = 7;
enum CustomerType {
PERSONAL = 0;
BUSINESS = 1;
}
CustomerType customer_type = 8;
int32 revision = 9;
}
37 changes: 37 additions & 0 deletions protos/order.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
syntax = "proto3";
package fake_models;

import "google/protobuf/timestamp.proto";
import "customer.proto";
import "address.proto";
option go_package = "pkg/protobuf";

message Order {
int32 version = 1;
string id = 2;
google.protobuf.Timestamp created_at = 3;
google.protobuf.Timestamp last_updated_at = 4;
google.protobuf.Timestamp delivered_at = 5;
google.protobuf.Timestamp completed_at = 6;

Customer Customer = 7;
int32 OrderValue = 8;

message LineItem {
string article_id = 1;
string name = 2;
int32 quantity = 3;
string quantity_unit = 4;
int32 unit_price = 5;
int32 total_price = 6;
}
repeated LineItem line_items = 9;

message Payment {
string payment_id = 1;
string method = 2;
}
Payment payment = 10;
Address delivery_address = 11;
int32 revision = 12;
}

0 comments on commit 2dd7ac2

Please sign in to comment.