@peabody-soft/mbs-protos 1.1.0 → 1.3.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/Attachment.proto +7 -21
- package/AuthTokens.proto +10 -32
- package/AuthenticationMethod.proto +2 -4
- package/Business.proto +5 -9
- package/BusinessLink.proto +14 -32
- package/BusinessSyncInRequest.proto +9 -29
- package/BusinessSyncInResponse.proto +13 -15
- package/BusinessSyncOutRequest.proto +19 -77
- package/BusinessSyncOutResponse.proto +29 -80
- package/Configuration.proto +4 -7
- package/Constants.proto +29 -59
- package/CreateUserRequest.proto +16 -0
- package/Entity.proto +13 -27
- package/GeneralSettings.proto +2 -3
- package/Item.proto +2 -4
- package/Message.proto +5 -7
- package/Package.proto +4 -6
- package/PartyPreferencesPayload.proto +1 -1
- package/Price.proto +3 -6
- package/PriceList.proto +4 -19
- package/Product.proto +4 -6
- package/ProductCategory.proto +2 -4
- package/ProfileSyncOutRequest.proto +10 -29
- package/ProfileSyncOutResponse.proto +13 -48
- package/ReservedPackage.proto +3 -15
- package/Role.proto +3 -12
- package/SalesOrderPayload.proto +3 -4
- package/ShoppingList.proto +6 -12
- package/ShoppingListItem.proto +5 -6
- package/UrlAndToken.proto +14 -42
- package/User.proto +3 -8
- package/WorkingDays.proto +5 -10
- package/WorkingHours.proto +2 -6
- package/WorkingHoursRange.proto +5 -7
- package/package.json +1 -1
package/ShoppingListItem.proto
CHANGED
|
@@ -5,15 +5,14 @@ option java_package = "com.merabills.server.core.generated";
|
|
|
5
5
|
|
|
6
6
|
import "Tax.proto";
|
|
7
7
|
|
|
8
|
-
// A line item in a shopping list: the package
|
|
8
|
+
// A line item in a shopping list: the package bought, how much, and at what price.
|
|
9
9
|
// Excluded: batches.
|
|
10
|
-
// Not included because
|
|
11
|
-
// taxes
|
|
10
|
+
// Not included because it is derived: tax amounts, totalTax, finalPrice (= unitPrice x quantity +
|
|
11
|
+
// taxes - discount).
|
|
12
12
|
message ShoppingListItem {
|
|
13
13
|
|
|
14
|
-
// Id of the package
|
|
15
|
-
//
|
|
16
|
-
// gives those ids and how to build them. A client must label those lines itself.
|
|
14
|
+
// Id of the package bought. Four ids are reserved for charge/summary lines (see ReservedPackage)
|
|
15
|
+
// and will not be found in the catalog - label those yourself.
|
|
17
16
|
int64 packageId = 1;
|
|
18
17
|
|
|
19
18
|
// Quantity, multiplied by Constants.QUANTITY_FACTOR. 1.5 kg is stored as 1500.
|
package/UrlAndToken.proto
CHANGED
|
@@ -3,55 +3,27 @@ package com.merabills.storefront;
|
|
|
3
3
|
option java_multiple_files = true;
|
|
4
4
|
option java_package = "com.merabills.server.core.generated";
|
|
5
5
|
|
|
6
|
-
// Where a set of files is, the
|
|
7
|
-
//
|
|
8
|
-
//
|
|
6
|
+
// Where a set of files is, the read-only signature that authorizes reading them, and when both
|
|
7
|
+
// expire. Carried once, as BusinessSyncOutResponse.attachmentBaseUrl for a business's photos - not an
|
|
8
|
+
// entity, and never deleted, only expired.
|
|
9
9
|
//
|
|
10
|
-
//
|
|
11
|
-
//
|
|
12
|
-
//
|
|
13
|
-
// deleted either, so there is no tombstone for it; it only expires.
|
|
14
|
-
//
|
|
15
|
-
// A client builds the url of one file the way BlobClient.createBlobUrl does, by putting the storage
|
|
16
|
-
// file name of the attachment in the path and the token in the query string:
|
|
17
|
-
//
|
|
18
|
-
// resourceUrl + "/" + storage file name + "?" + sasToken
|
|
19
|
-
//
|
|
20
|
-
// The storage file name is derived from the attachment rather than sent - Attachment says how it is
|
|
21
|
-
// built. The container is flat: every file sits directly under resourceUrl, so a storage file name
|
|
22
|
-
// must never be turned into a path of its own.
|
|
23
|
-
//
|
|
24
|
-
// What the token grants is only what a storefront needs, and this is what a server must keep true
|
|
25
|
-
// when it fills this in. CloudDb.createAttachmentSasUrl grants read, grants create only to a caller
|
|
26
|
-
// with Right.ATTACHMENTS_MODIFY, and grants nothing else - no write, no delete, and no list, so
|
|
27
|
-
// holding this cannot be used to enumerate the container. A storefront customer has none of those
|
|
28
|
-
// rights and must be given the read only signature of the public container; the private container
|
|
29
|
-
// requires attachment rights and must never be handed to a storefront.
|
|
30
|
-
//
|
|
31
|
-
// The token is a credential: anyone holding it can read the files of that container until it
|
|
32
|
-
// expires, so it must not be logged. Unlike AuthTokens.userToken and BusinessLink.linkToken, which
|
|
33
|
-
// must never appear in a url, this one is meant to be in a url - a browser fetching an image can
|
|
34
|
-
// pass it no other way. It is safe there because it is scoped to one container, read only, and
|
|
10
|
+
// Build a file's url as resourceUrl + "/" + storage file name + "?" + sasToken (see Attachment for
|
|
11
|
+
// the storage file name). The token is a credential - do not log it - but unlike AuthTokens.userToken
|
|
12
|
+
// and BusinessLink.linkToken it is meant to go in a url: it is scoped to one container, read only and
|
|
35
13
|
// short lived.
|
|
36
14
|
message UrlAndToken {
|
|
37
15
|
|
|
38
|
-
// The url of the container the files are in
|
|
39
|
-
//
|
|
16
|
+
// The url of the container the files are in. Always https, never with a trailing slash or a query
|
|
17
|
+
// string of its own.
|
|
40
18
|
string resourceUrl = 1;
|
|
41
19
|
|
|
42
|
-
// The shared access signature that authorizes reading a file
|
|
43
|
-
//
|
|
44
|
-
// UrlAndToken.mSasToken, serialized as "st". A client appends it as it is; it never parses or
|
|
45
|
-
// rebuilds it.
|
|
20
|
+
// The shared access signature that authorizes reading a file, ready to use as a query string
|
|
21
|
+
// ("sv=...&se=...&sig=...", no leading "?"). Append it as-is; never parse or rebuild it.
|
|
46
22
|
string sasToken = 2;
|
|
47
23
|
|
|
48
|
-
// When the
|
|
49
|
-
//
|
|
50
|
-
//
|
|
51
|
-
//
|
|
52
|
-
//
|
|
53
|
-
// A client must treat this as reached Constants.ATTACHMENT_BASE_URL_EXPIRY_MARGIN before it
|
|
54
|
-
// actually is, the way UrlAndTokenFetcher.isTokenInvalid does, so that a url it is about to build
|
|
55
|
-
// cannot expire between building and fetching.
|
|
24
|
+
// When the fields above stop working, in milliseconds since Jan 1, 1970 UTC. Send this back as
|
|
25
|
+
// BusinessSyncOutRequest.attachmentBaseUrlExpiry. Treat it as expired
|
|
26
|
+
// Constants.ATTACHMENT_BASE_URL_EXPIRY_MARGIN early, so a url being built cannot expire before it
|
|
27
|
+
// is fetched.
|
|
56
28
|
int64 expiry = 3;
|
|
57
29
|
}
|
package/User.proto
CHANGED
|
@@ -6,14 +6,9 @@ option java_package = "com.merabills.server.core.generated";
|
|
|
6
6
|
import "AddressList.proto";
|
|
7
7
|
import "Entity.proto";
|
|
8
8
|
|
|
9
|
-
// A user of MeraBills
|
|
10
|
-
//
|
|
11
|
-
//
|
|
12
|
-
// ProfileSyncOutResponse and not by a BusinessSyncOutResponse, the way Java splits
|
|
13
|
-
// Service.profileSyncOut from Service.businessSyncOut. Do not add it to the business sync out: a
|
|
14
|
-
// client reads the caller once, by signing in, and then reads each business separately.
|
|
15
|
-
//
|
|
16
|
-
// Excluded: referralDetails, isCallingUser and all Translations fields.
|
|
9
|
+
// A user of MeraBills; a customer of a business is represented by one. Carried by a
|
|
10
|
+
// ProfileSyncOutResponse, not by a business sync out - a client reads the caller once, at sign in.
|
|
11
|
+
// Excluded: referralDetails, isCallingUser, all Translations fields.
|
|
17
12
|
// Not included because it is derived: formattedName (firstName + " " + lastName).
|
|
18
13
|
message User {
|
|
19
14
|
|
package/WorkingDays.proto
CHANGED
|
@@ -10,17 +10,12 @@ import "WorkingHours.proto";
|
|
|
10
10
|
// isOpenAt.
|
|
11
11
|
message WorkingDays {
|
|
12
12
|
|
|
13
|
-
// Up to Constants.DAYS_IN_WEEK values
|
|
14
|
-
//
|
|
15
|
-
// WorkingDays means the business works on every day of the week, which is the Java default.
|
|
13
|
+
// Up to Constants.DAYS_IN_WEEK values, index 0 = Sunday. True means the business works that day;
|
|
14
|
+
// missing means false. An absent WorkingDays means every day is worked (the default).
|
|
16
15
|
repeated bool days = 1;
|
|
17
16
|
|
|
18
|
-
//
|
|
19
|
-
// Constants.DAYS_IN_WEEK entries,
|
|
20
|
-
//
|
|
21
|
-
// An entry that is missing, or that is present with no ranges, means work goes on all day long on
|
|
22
|
-
// that day. So an empty workingHours means the business works round the clock on each of its
|
|
23
|
-
// working days. Hours are only meaningful on a day whose days entry is true; on any other day
|
|
24
|
-
// they must be ignored.
|
|
17
|
+
// Working hours of each day, indexed as days above (entry 0 = Sunday); up to
|
|
18
|
+
// Constants.DAYS_IN_WEEK entries, fewer is normal. A missing entry, or one with no ranges, means
|
|
19
|
+
// work all day; only meaningful on a day whose days entry is true.
|
|
25
20
|
repeated WorkingHours workingHours = 2;
|
|
26
21
|
}
|
package/WorkingHours.proto
CHANGED
|
@@ -9,11 +9,7 @@ import "WorkingHoursRange.proto";
|
|
|
9
9
|
// Not included because they are computed: rangeCount, isAllDay and contains.
|
|
10
10
|
message WorkingHours {
|
|
11
11
|
|
|
12
|
-
//
|
|
13
|
-
//
|
|
14
|
-
// exactly when the next opens is sent as one unbroken range.
|
|
15
|
-
//
|
|
16
|
-
// No ranges at all means work goes on all day long, which is also what a range covering the whole
|
|
17
|
-
// day would mean.
|
|
12
|
+
// Stretches worked in the day (at most Constants.WORKING_HOURS_MAX_RANGES): non-overlapping,
|
|
13
|
+
// ordered by openMinute, and merged when adjacent. No ranges means work goes on all day.
|
|
18
14
|
repeated WorkingHoursRange ranges = 1;
|
|
19
15
|
}
|
package/WorkingHoursRange.proto
CHANGED
|
@@ -3,13 +3,11 @@ 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 single stretch of working hours within
|
|
7
|
-
//
|
|
8
|
-
//
|
|
9
|
-
//
|
|
10
|
-
//
|
|
11
|
-
// Constants.MINUTES_PER_DAY on one day, and one opening at 0 on the day after.
|
|
12
|
-
// Not included because they are computed: isAllDay, contains and overlaps.
|
|
6
|
+
// A single stretch of working hours within a day, in minutes after local midnight (no time zone is
|
|
7
|
+
// carried - resolve using the business address's time zone).
|
|
8
|
+
// A range never spans midnight; work past midnight is two ranges - one closing at
|
|
9
|
+
// Constants.MINUTES_PER_DAY, one opening at 0 the next day.
|
|
10
|
+
// Not included because it is derived: isAllDay, contains, overlaps.
|
|
13
11
|
message WorkingHoursRange {
|
|
14
12
|
|
|
15
13
|
// Minute at which work starts, from 0 to Constants.MINUTES_PER_DAY - 1. This minute is worked.
|