forked from YourJustice-Live/Noosphere
-
Notifications
You must be signed in to change notification settings - Fork 1
/
schema.graphql
152 lines (141 loc) · 4.32 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
type AccountEntity @entity {
id: ID! # account address
avatarNft: AvatarNftEntity!
}
type AvatarNftEntity @entity {
id: ID! # token id
idBigInt: BigInt! # token id which is useful for sorting
owner: String! # account address
type: String! # type to determine that the entity is created by an account or contract
uri: String # metadata uri
uriData: Bytes
uriImage: String
uriFirstName: String
uriLastName: String
uriEmail: String
uriIsEmailNotificationsEnabled: Boolean
reputations: [AvatarNftReputationEntity!]! @derivedFrom(field: "avatarNft")
totalNegativeRating: BigInt!
totalPositiveRating: BigInt!
totalNegativeCases: BigInt! # where avatar is subject and case verdict is made
totalPositiveCases: BigInt! # where avatar is subject and case verdict is made
jurisdictions: [JurisdictionEntity!]! # where avatar is a member
}
type AvatarNftReputationEntity @entity {
id: ID! # combination of token id, jurisdiction id, and domain name
avatarNft: AvatarNftEntity!
jurisdiction: JurisdictionEntity!
domain: String!
negativeRating: BigInt!
positiveRating: BigInt!
}
type JurisdictionEntity @entity {
id: ID! # contract address
address: String # contract address
name: String
uri: String # metadata uri
uriData: Bytes
roles: [JurisdictionRoleEntity!]! @derivedFrom(field: "jurisdiction")
rules: [JurisdictionRuleEntity!]! @derivedFrom(field: "jurisdiction")
rulesCount: Int!
casesCount: Int!
members: [String!]! # avatar nft ids
judges: [String!]! # avatar nft ids
admins: [String!]! # avatar nft ids
membersCount: Int!
}
type JurisdictionRoleEntity @entity {
id: ID! # combination of jurisdiction address and role id
jurisdiction: JurisdictionEntity!
roleId: BigInt!
participants: [String!]! # avatar nft ids
participantsCount: Int!
}
type JurisdictionRuleEntity @entity {
id: ID! # combination of jurisdiction address and rule id
jurisdiction: JurisdictionEntity!
about: ActionEntity!
aboutSubject: String
ruleId: BigInt!
affected: String
uri: String
uriData: Bytes
uriName: String
negation: Boolean
effects: [JurisdictionRuleEffectEntity!]!
effectsBlock: BigInt # number of block where effects were defined
confirmationRuling: String
confirmationEvidence: Boolean
confirmationWitness: BigInt
isPositive: Boolean
isDisabled: Boolean!
}
type JurisdictionRuleEffectEntity @entity {
id: ID! # combination of jurisdiction address, rule id, effect name
rule: JurisdictionRuleEntity!
name: String!
direction: Boolean!
value: Int!
}
type ActionEntity @entity {
id: ID! # guid
subject: String
verb: String
object: String
tool: String
uri: String
uriData: Bytes
rules: [JurisdictionRuleEntity!]! @derivedFrom(field: "about")
}
type CaseEntity @entity {
id: ID! # contract address
name: String
createdDate: BigInt
jurisdiction: JurisdictionEntity!
stage: Int
judgeAssignmentDate: BigInt # date when the first judge was assigned
verdictAuthor: String # avatar nft id
verdictConfirmedRules: [JurisdictionRuleEntity!]
verdictUri: String
verdictUriData: Bytes
cancellationAuthor: String # avatar nft id
cancellationUri: String
cancellationUriData: Bytes
rules: [JurisdictionRuleEntity!]!
posts: [CasePostEntity!]! @derivedFrom(field: "caseEntity")
participants: [String!]! # avatar nft ids
admins: [String!]! # avatar nft ids
subjects: [String!]! # avatar nft ids
plaintiffs: [String!]! # avatar nft ids
judges: [String!]! # avatar nft ids
witnesses: [String!]! # avatar nft ids
affecteds: [String!]! # avatar nft ids
participantsWithConfirmationPosts: [String!]!
nominates: [CaseNominateEntity!]! @derivedFrom(field: "caseEntity")
}
type CasePostEntity @entity {
id: ID! # combination of case address and post transaction address
author: String! # avatar nft id
createdDate: BigInt
caseEntity: CaseEntity!
entityRole: String
uri: String
uriData: Bytes
uriType: String
}
type CaseEventEntity @entity {
id: ID! # combination of case address, event transaction address, event log index
caseEntity: CaseEntity!
createdDate: BigInt!
type: String!
data: Bytes
}
type CaseNominateEntity @entity {
id: ID! # combination of case address and event transaction address
caseEntity: CaseEntity!
createdDate: BigInt!
nominator: AvatarNftEntity!
nominated: AvatarNftEntity!
uri: String
uriData: Bytes
}