@peabody-soft/mbs-protos 1.6.0 → 1.7.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.
package/Constants.proto CHANGED
@@ -46,7 +46,7 @@ enum Constants {
46
46
  PRODUCT_BRAND_MAX_LENGTH = 32;
47
47
  PRODUCT_MANUFACTURER_MAX_LENGTH = 32;
48
48
 
49
- // Product.taxes and ShoppingListItem.taxes
49
+ // Product.taxes, ShoppingListItem.taxes and GeneralSettings.deliveryChargeTaxes
50
50
  MAX_TAXES = 4;
51
51
 
52
52
  // Product.features
@@ -99,6 +99,18 @@ enum Constants {
99
99
  // GeneralSettings.deliveryRadiusKms - this value means there is no limit on the distance
100
100
  NO_RESTRICTIONS_DELIVERY_DISTANCE = 0;
101
101
 
102
+ // LatLong.latitude and LatLong.longitude
103
+ MIN_LATITUDE = -90;
104
+ MAX_LATITUDE = 90;
105
+ MIN_LONGITUDE = -180;
106
+ MAX_LONGITUDE = 180;
107
+
108
+ // GeneralSettings.googleBusinessCategoryId, GeneralSettings.googleBusinessCategoryName and
109
+ // GeneralSettings.onlineStoreThemeId
110
+ GOOGLE_BUSINESS_CATEGORY_ID_MAX_LENGTH = 128;
111
+ GOOGLE_BUSINESS_CATEGORY_NAME_MAX_LENGTH = 256;
112
+ ONLINE_STORE_THEME_ID_MAX_LENGTH = 64;
113
+
102
114
  // PaymentMethodDetail.data
103
115
  PAYMENT_METHOD_DATA_MAX_LENGTH = 320;
104
116
 
@@ -6,11 +6,14 @@ option java_package = "com.merabills.server.core.generated";
6
6
  import "AddressList.proto";
7
7
  import "BusinessIdentifier.proto";
8
8
  import "FulfillmentMode.proto";
9
+ import "LatLong.proto";
9
10
  import "PaymentMethodDetail.proto";
11
+ import "Tax.proto";
10
12
  import "WorkingDays.proto";
11
13
 
12
- // The publicly visible settings of a business - tagline, contact info, fulfillment and payment
13
- // options - held in the value of the business's public Configuration entity.
14
+ // The publicly visible settings of a business - tagline, contact info, location, fulfillment,
15
+ // payment and delivery options, and online store presentation - held in the value of the
16
+ // business's public Configuration entity.
14
17
  // Excluded: onlineShoppingEnabled, and the fields of the StoreSettings base class (authToken,
15
18
  // authTokenExpiry, lastSuccessfulSync and fees).
16
19
  // Not included because it is a constant: overdueAfterMillis.
@@ -40,16 +43,34 @@ message GeneralSettings {
40
43
  // Charge for delivering an order, multiplied by Constants.AMOUNT_FACTOR
41
44
  int64 deliveryCharge = 8;
42
45
 
46
+ // Taxes that apply to deliveryCharge (at most Constants.MAX_TAXES)
47
+ repeated Tax deliveryChargeTaxes = 9;
48
+
43
49
  // Order total at or above which delivery is free, multiplied by Constants.AMOUNT_FACTOR.
44
50
  // 0 means delivery is never free.
45
- int64 freeDeliveryTotal = 9;
51
+ int64 freeDeliveryTotal = 10;
46
52
 
47
53
  // Distance, in kilometres, within which this business delivers.
48
54
  // Constants.NO_RESTRICTIONS_DELIVERY_DISTANCE (0) means there is no limit.
49
- int32 deliveryRadiusKms = 10;
55
+ int32 deliveryRadiusKms = 11;
50
56
 
51
57
  // One line description of this business (at most Constants.STORE_TAGLINE_MAX_LENGTH)
52
- optional string storeTagline = 11;
58
+ optional string storeTagline = 12;
59
+
60
+ WorkingDays workingDays = 13;
61
+
62
+ // Geographic coordinates of this business's primary (main) address
63
+ LatLong primaryStoreLocation = 14;
64
+
65
+ // Id of this business's category on Google Business Profile
66
+ // (at most Constants.GOOGLE_BUSINESS_CATEGORY_ID_MAX_LENGTH)
67
+ optional string googleBusinessCategoryId = 15;
68
+
69
+ // Name of this business's category on Google Business Profile
70
+ // (at most Constants.GOOGLE_BUSINESS_CATEGORY_NAME_MAX_LENGTH)
71
+ optional string googleBusinessCategoryName = 16;
53
72
 
54
- WorkingDays workingDays = 12;
73
+ // Id of the visual theme applied to the online store
74
+ // (at most Constants.ONLINE_STORE_THEME_ID_MAX_LENGTH)
75
+ optional string onlineStoreThemeId = 17;
55
76
  }
package/LatLong.proto ADDED
@@ -0,0 +1,14 @@
1
+ syntax = "proto3";
2
+ package com.merabills.storefront;
3
+ option java_multiple_files = true;
4
+ option java_package = "com.merabills.server.core.generated";
5
+
6
+ // A point on Earth, given by its geographic coordinates.
7
+ message LatLong {
8
+
9
+ // Degrees, between Constants.MIN_LATITUDE and Constants.MAX_LATITUDE
10
+ double latitude = 1;
11
+
12
+ // Degrees, between Constants.MIN_LONGITUDE and Constants.MAX_LONGITUDE
13
+ double longitude = 2;
14
+ }
package/TaxType.proto CHANGED
@@ -3,11 +3,18 @@ package com.merabills.storefront;
3
3
  option java_multiple_files = true;
4
4
  option java_package = "com.merabills.server.core.generated";
5
5
 
6
- // A tax that applies to a product or to a line item.
7
- // Values match the Java tax codes, which are unique within a country: the country of the business
8
- // that owns the item is needed to interpret them.
6
+ // A tax that applies to a product or to a line item. A raw Java tax code is only unique within a
7
+ // country, so values here are not that raw code: they are computed ids, TaxType.createId(country,
8
+ // taxCode) = (country.getNumeric() << 8) | taxCode, making each value globally unique and
9
+ // self-describing rather than meaningful only together with some other, separately carried country
10
+ // code. A client can recover the ISO 3166-1 numeric country code with (value >> 8); it cannot
11
+ // recover the raw tax code beyond the low 8 bits, and does not need to - the enum name already
12
+ // carries that meaning.
9
13
  enum TaxType {
10
14
 
11
- // India: Goods and Services Tax
12
- GST = 0;
15
+ // No country's numeric code is ever 0, so this id can never collide with a real one
16
+ UNSPECIFIED_TAX_TYPE = 0;
17
+
18
+ // India (countryCode 356): Goods and Services Tax (taxCode 0)
19
+ GST = 91136;
13
20
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@peabody-soft/mbs-protos",
3
- "version": "1.6.0",
3
+ "version": "1.7.0",
4
4
  "description": "The MeraBills shop wire protocol",
5
5
  "author": "Peabody Soft",
6
6
  "license": "AGPL-3.0-or-later",