github.com/s7techlab/cckit@v0.10.5/examples/cpaper_extended/schema/payload.proto (about)

     1  syntax = "proto3";
     2  
     3  option go_package = "github.com/s7techlab/cckit/examples/cpaper_extended/schema";
     4  package examples.cpaper_extended.schema;
     5  
     6  import "google/protobuf/timestamp.proto";
     7  import "mwitkow/go-proto-validators/validator.proto";
     8  
     9  // IssueCommercialPaper event
    10  message IssueCommercialPaper {
    11      string issuer = 1 [(validator.field) = {string_not_empty : true}];
    12      string paper_number = 2 [(validator.field) = {string_not_empty : true}];
    13      google.protobuf.Timestamp issue_date = 3 [(validator.field) = {msg_exists : true}];
    14      google.protobuf.Timestamp maturity_date = 4 [(validator.field) = {msg_exists : true}];
    15      int32 face_value = 5 [(validator.field) = {int_gt : 0}];
    16  
    17      // external_id - another unique constraint
    18      string external_id = 6 [(validator.field) = {string_not_empty : true}];
    19  }
    20  
    21  // BuyCommercialPaper event
    22  message BuyCommercialPaper {
    23      string issuer = 1 [(validator.field) = {string_not_empty : true}];
    24      string paper_number = 2 [(validator.field) = {string_not_empty : true}];
    25      string current_owner = 3 [(validator.field) = {string_not_empty : true}];
    26      string new_owner = 4 [(validator.field) = {string_not_empty : true}];
    27      int32 price = 5 [(validator.field) = {int_gt : 0}];
    28      google.protobuf.Timestamp purchase_date = 6 [(validator.field) = {msg_exists : true}];
    29  }
    30  
    31  // RedeemCommercialPaper event
    32  message RedeemCommercialPaper {
    33      string issuer = 1 [(validator.field) = {string_not_empty : true}];
    34      string paper_number = 2 [(validator.field) = {string_not_empty : true}];
    35      string redeeming_owner = 3 [(validator.field) = {string_not_empty : true}];
    36      google.protobuf.Timestamp redeem_date = 4 [(validator.field) = {msg_exists : true}];
    37  }