-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathschema.graphql
163 lines (154 loc) Β· 3.74 KB
/
schema.graphql
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
"""
Work on the mappings later.
β
- DONE β - NOT DONE
β
β mapping(uint256 => address[]) TicketPremiumsKey;
β
β mapping(uint256 => address[]) TicketInvestmentsKey;
β
β mapping(address => uint256[]) BuyerTicketsKey;
β
β mapping(address => uint256[]) InvestorTicketsKey;
β
β mapping(uint256 => HFEntity.Ticket) TicketsMap;
β
β mapping(uint256 => mapping(address => HFEntity.Premium)) TicketPremiumsMap;
β
β mapping(uint256 => mapping(address => HFEntity.Investment)) TicketInvestmentsMap;
β
β mapping(address => mapping(uint256 => bool)) InvestorTicketsExist;
β
β mapping(address => mapping(uint256 => bool)) BuyerTicketsExist;
β
β mapping(uint256 => uint256) TicketClaimKey;
β
β mapping(uint256 => HFEntity.Claim) ClaimsMap;
β
β mapping(uint256 => address) ClaimOwnerMap;
β
β mapping(uint256 => address) ClaimOracleMap;
β
β mapping(uint256 => HFEntity.NFT) TicketNFTMap;
β
β mapping(bytes32 => IHFBidProcess) bidProcesses;
β
β mapping(uint256=>bool) pendingRequests;
β
β mapping(address => bool) tokenMap;
β
β mapping(uint256 => HFOracleInterface) private ClaimOracleInstance;
"""
type User @entity {
id: ID!
investments: [Investment!]! @derivedFrom(field: "investor")
premiums: [Premium!] @derivedFrom(field: "buyer")
tickets: [Ticket!] @derivedFrom(field: "buyer")
donations: [Donation!] @derivedFrom(field: "donor")
transactions: [Transaction!] @derivedFrom(field: "user")
}
"""
Ticket detail information: HFEntity.sol
"""
type Ticket @entity {
id: ID!
buyer: User!
ticketId: BigInt!
bidProcessType: String!
claimAmount: BigInt!
premiumDonation: BigInt!
premiumAmount: BigInt!
authorizedAmount: BigInt!
donatedAmount: BigInt!
marginRatio: BigInt!
ticketName: String! @search(by: [fullText])
ticketStatus: Int!
closingDate: BigInt!
startDate: BigInt!
endDate: BigInt!
selectedBidding: Investment
nft: NFT
claim: Claim
premium: Premium
investments: [Investment!]!
}
"""
Investment detail information: HFEntity.sol
"""
type Investment @entity {
id: ID!
ticketId: BigInt!
ticket: Ticket!
investor: User!
askingAmount: BigInt!
earning: BigInt!
bidProcessType: String!
ticketName: String!
tookPremium: Boolean
reimbursedInvest: Boolean
removed: Boolean
expiredInvestAmount: BigInt!
askingExpireDate: BigInt!
investDate: BigInt!
selected: Boolean!
createdAt: BigInt!
}
"""
Premium detail information: HFEntity.sol
"""
type Premium @entity {
id: ID!
ticket: Ticket!
buyer: User!
askingClaimAmount: BigInt!
askingPremiumAmount: BigInt!
bidProcessType: String!
ticketName: String!
reimbursedPremium: Boolean!
}
"""
Claim detail information: HFEntity.sol
"""
type Claim @entity {
id: ID!
claimId: BigInt!
ticket: Ticket!
round: BigInt!
claimStatus: Int!
condition: ClaimCondition!
isApproved: Boolean!
lastDecisionDate: BigInt!
oracleData: BigInt!
roundStartDate: BigInt!
}
"""
ClaimCondition detail information: HFEntity.sol
"""
type ClaimCondition @entity {
id: ID!
claimType: String!
claimConstraints: [String!]!
claimParameters: [String!]!
claims: [Claim!]! @derivedFrom(field: "condition")
}
"""
JuryResult detail information: HFEntity.sol
"""
type JuryResult @entity {
id: ID!
accept: Int!
reject: Int!
}
"""
NFT detail information: HFEntity.sol
"""
type NFT @entity {
id: ID!
tokenId: BigInt!
tokenContract: String
tokenType: Int
tokenUri: String
}
"""
Donation detail information: HFEntity.sol
"""
type Donation @entity {
id: ID!
ticket: Ticket!
donor: User!
amount: BigInt!
option: String!
refunded: Boolean
}
type Transaction @entity {
id: ID!
hash: String!
user: User!
amount: BigInt!
currency: String
timestamp: BigInt!
type: String!
ticket: Ticket!
status: Int!
}