Skip to content

Instantly share code, notes, and snippets.

@vitiko
Created February 20, 2019 21:35
Show Gist options
  • Save vitiko/1db5b5836814cbf6c5feb13fcd6f348c to your computer and use it in GitHub Desktop.
Save vitiko/1db5b5836814cbf6c5feb13fcd6f348c to your computer and use it in GitHub Desktop.
Commercial paper state mapping
var (
// State mappings
StateMappings = m.StateMappings{}.
//key namespace will be <`CommercialPaper`, Issuer, PaperNumber>
Add(&schema.CommercialPaper{}, m.PKeySchema(&schema.CommercialPaperId{}))
// EventMappings
EventMappings = m.EventMappings{}.
// event name will be `IssueCommercialPaper`, payload - same as issue payload
Add(&schema.IssueCommercialPaper{}).
Add(&schema.BuyCommercialPaper{}).
Add(&schema.RedeemCommercialPaper{})
)
@uraldav
Copy link

uraldav commented Jul 14, 2021

with imports it will more understandable what is the 'm'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment