repos / hub.go.git


Evgenii Akentev  ·  2024-09-02

contract-entities.go

 1package main
 2
 3type PersonDetails struct {
 4  name string
 5  address string
 6}
 7
 8type DocumentData struct {
 9}
10
11type DeclarationStatus string
12const (
13   Stale DeclarationStatus = "stale"
14   MoneyFrozen = "money_frozen"
15   FilesSent = "files_sent"
16   ViewedByClient = "viewed_by_client"
17)
18
19type ExclusiveRightsClaim struct {
20  author Address
21}
22
23type Copyright struct {
24  address Address
25  author Address
26  owner Address
27  ownerDetails PersonDetails
28  royalty *string
29
30  document DocumentData
31  status DeclarationStatus
32  balance int
33  price *int
34  assignmentHash *string
35  claim *ExclusiveRightsClaim
36
37  initTxLt int
38}
39
40type CopyrightState struct {
41  owner Address
42  ownerDetails PersonDetails
43  claim *ExclusiveRightsClaim
44  assignmentHash *string
45  price *int
46  balance int
47  status DeclarationStatus
48}
49
50func (c Copyright) mkState() *CopyrightState {
51  return &CopyrightState{
52    owner: c.owner,
53    ownerDetails: c.ownerDetails,
54    claim: c.claim,
55    assignmentHash: c.assignmentHash,
56    price: c.price,
57    balance: c.balance,
58    status: c.status,
59  }
60}