-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschema.graphql
131 lines (112 loc) · 2.5 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
#------------------------------
# Task Coordinator
#------------------------------
type TaskState @entity {
id: ID! #Txnhash
round: BigInt!
modelState: String!
createdOn: BigInt!
}
type Task @entity {
id: ID! #taskID
taskId: BigInt!
user: Bytes!
cost: BigInt!
createdOn: BigInt!
currentRound: BigInt!
totalRounds: BigInt!
modelstates: [TaskState!]!
}
#------------------------------
# Hospitals
#------------------------------
type Bill @entity {
id: ID! # txn Hash
from: Bytes! # from hospital address
to: Bytes! # billed address
amount: BigInt! # boolean
}
type UserHospitalBill @entity {
id: ID! # user address
totalBilledAmount: BigInt!
billsCount: BigInt!
bills: [Bill!]!
}
type Hospital @entity {
id: ID! #hospital address
state: Boolean
totalBilledAmount: BigInt!
billsCount: BigInt!
bills: [Bill!]!
}
#------------------------------
# Accessors
#------------------------------
type Approval @entity {
id: ID!
from: Bytes! # address
to: Bytes! # address
state: Boolean! # boolean
}
#------------------------------
# Public Campaigns
#------------------------------
type CampaignHistoryItem @entity {
id: ID! # Txnhash
campaignData: String! # string
createdOn: BigInt! # uint256
donationCount: BigInt! # uint256
amountReceived: BigInt! # uint256
donatorAddresses: [Bytes!]! # addresses
}
type Campaign @entity {
id: ID! # address
campaigner: Bytes! # address
campaignCount: BigInt! # uint256
campaignEnabled: Boolean # boolean TODO
donationCount: BigInt! # uint256
amountReceived: BigInt! # uint256
campaignHistory: [CampaignHistoryItem!]!
}
#------------------------------
# Crowdfunding
#------------------------------
type DonationItem @entity {
id: ID! # txnHash
createdOn: BigInt!
from: Bytes!
amount: BigInt!
}
type Fund @entity {
id: ID! # fundindex
paymentReceiver: Bytes! #address
fundIndex: BigInt!
createdOn: BigInt!
orgName: String!
fundName: String!
donationCount: BigInt! # uint256
amountReceived: BigInt! # uint256
donations: [DonationItem!]! # addresses
}
#------------------------------
# Reports
#------------------------------
type ReportUpdate @entity {
id: ID! #Txnhash
update: String!
}
type ReportItem @entity {
id: ID!
reportIndex : BigInt!
reporter : Bytes!
location : String!
file: String!
details: String!
reportedOn : BigInt!
updates: [ReportUpdate!]!
}
type ReportData @entity {
id: ID! # reportIndex
totalReports: BigInt! #uint256
reports: [ReportItem!]! # stringIds
}