Skip to content

Commit e53d2cd

Browse files
committed
chore(protos): update flipcash protobuf definitions
Add Hash message to common, enhance push Payload with substitutions, categories, and group key support. Signed-off-by: Brandon McAnsh <git@bmcreations.dev>
1 parent 48fab38 commit e53d2cd

2 files changed

Lines changed: 46 additions & 0 deletions

File tree

definitions/flipcash/protos/src/main/proto/common/v1/common.proto

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@ message Signature {
2222
}];
2323
}
2424

25+
message Hash {
26+
bytes value = 1 [(validate.rules).bytes = {
27+
min_len: 32
28+
max_len: 32
29+
}];
30+
}
31+
2532
// Auth provides an authentication information for RPCs/messages.
2633
//
2734
// Currently, only a single form is supported, but it may be useful in

definitions/flipcash/protos/src/main/proto/push/v1/model.proto

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ option java_package = "com.codeinc.flipcash.gen.push.v1";
77
option objc_class_prefix = "FPBPushV1";
88

99
import "common/v1/common.proto";
10+
import "phone/v1/model.proto";
1011
import "validate/validate.proto";
1112

1213
enum TokenType {
@@ -21,6 +22,29 @@ enum TokenType {
2122
message Payload {
2223
// If present, where the app should navigate to after clicking the push
2324
Navigation navigation = 1;
25+
26+
// Ordered substitutions to apply to push title
27+
repeated Substitution title_substitutions = 2;
28+
29+
// Ordered substitutions to apply to push body
30+
repeated Substitution body_substitutions = 3;
31+
32+
// Push notification category
33+
Category category = 4;
34+
enum Category {
35+
DEFAULT = 0;
36+
DEPOSIT_WITHDRAWAL = 1;
37+
BUY_SELL = 2;
38+
GAIN = 3;
39+
CHAT = 4;
40+
CONTACT_JOIN = 5;
41+
}
42+
43+
// Push notification key for grouping pushes. If not set, then no grouping
44+
// is applied.
45+
string group_key = 5 [(validate.rules).string = {
46+
max_len: 4096 // Arbitrary
47+
}];
2448
}
2549

2650
// Navigation within the app upon clicking the push
@@ -32,3 +56,18 @@ message Navigation {
3256
common.v1.PublicKey currency_info = 1;
3357
}
3458
}
59+
60+
message Substitution {
61+
// Fallback string for forwards compatibility
62+
string fallback = 1 [(validate.rules).string = {
63+
min_len: 1
64+
max_len: 4096 // Arbitrary
65+
}];
66+
67+
oneof kind {
68+
option (validate.required) = true;
69+
70+
// Phone number -> contact name or formatted phone number
71+
phone.v1.PhoneNumber contact = 2;
72+
}
73+
}

0 commit comments

Comments
 (0)