This repository has been archived by the owner on Nov 8, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 51
/
payload.proto
37 lines (31 loc) · 1.67 KB
/
payload.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
syntax = "proto3";
option go_package = "github.com/s7techlab/cckit/examples/cpaper_extended/schema";
package examples.cpaper_extended.schema;
import "google/protobuf/timestamp.proto";
import "mwitkow/go-proto-validators/validator.proto";
// IssueCommercialPaper event
message IssueCommercialPaper {
string issuer = 1 [(validator.field) = {string_not_empty : true}];
string paper_number = 2 [(validator.field) = {string_not_empty : true}];
google.protobuf.Timestamp issue_date = 3 [(validator.field) = {msg_exists : true}];
google.protobuf.Timestamp maturity_date = 4 [(validator.field) = {msg_exists : true}];
int32 face_value = 5 [(validator.field) = {int_gt : 0}];
// external_id - another unique constraint
string external_id = 6 [(validator.field) = {string_not_empty : true}];
}
// BuyCommercialPaper event
message BuyCommercialPaper {
string issuer = 1 [(validator.field) = {string_not_empty : true}];
string paper_number = 2 [(validator.field) = {string_not_empty : true}];
string current_owner = 3 [(validator.field) = {string_not_empty : true}];
string new_owner = 4 [(validator.field) = {string_not_empty : true}];
int32 price = 5 [(validator.field) = {int_gt : 0}];
google.protobuf.Timestamp purchase_date = 6 [(validator.field) = {msg_exists : true}];
}
// RedeemCommercialPaper event
message RedeemCommercialPaper {
string issuer = 1 [(validator.field) = {string_not_empty : true}];
string paper_number = 2 [(validator.field) = {string_not_empty : true}];
string redeeming_owner = 3 [(validator.field) = {string_not_empty : true}];
google.protobuf.Timestamp redeem_date = 4 [(validator.field) = {msg_exists : true}];
}