From 2dd7ac2166adcc0052802420be3b8aaee72b41e4 Mon Sep 17 00:00:00 2001 From: Martin Schneppenheim Date: Sun, 13 Dec 2020 16:20:53 +0100 Subject: [PATCH] Add protos --- protos/address.proto | 28 ++++++++++++++++++++++++++++ protos/customer.proto | 20 ++++++++++++++++++++ protos/order.proto | 37 +++++++++++++++++++++++++++++++++++++ 3 files changed, 85 insertions(+) create mode 100644 protos/address.proto create mode 100644 protos/customer.proto create mode 100644 protos/order.proto diff --git a/protos/address.proto b/protos/address.proto new file mode 100644 index 0000000..4e6686d --- /dev/null +++ b/protos/address.proto @@ -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; +} \ No newline at end of file diff --git a/protos/customer.proto b/protos/customer.proto new file mode 100644 index 0000000..8daf06e --- /dev/null +++ b/protos/customer.proto @@ -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; +} \ No newline at end of file diff --git a/protos/order.proto b/protos/order.proto new file mode 100644 index 0000000..0035956 --- /dev/null +++ b/protos/order.proto @@ -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; +} \ No newline at end of file