workingGroupsEvents.graphql 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695
  1. type OpeningAddedEvent @entity {
  2. ### GENERIC DATA ###
  3. "(network}-{blockNumber}-{indexInBlock}"
  4. id: ID!
  5. "Hash of the extrinsic which caused the event to be emitted"
  6. inExtrinsic: String
  7. "Blocknumber of the block in which the event was emitted."
  8. inBlock: Int!
  9. "Network the block was produced in"
  10. network: Network!
  11. "Index of event in block from which it was emitted."
  12. indexInBlock: Int!
  13. ### SPECIFIC DATA ###
  14. "Related group"
  15. group: WorkingGroup!
  16. "Related opening"
  17. opening: WorkingGroupOpening!
  18. # Other opening data like: metadata, type, staking policy, reward etc. is immutable, so can be read directly from Opening entity
  19. }
  20. type AppliedOnOpeningEvent @entity {
  21. ### GENERIC DATA ###
  22. "(network}-{blockNumber}-{indexInBlock}"
  23. id: ID!
  24. "Hash of the extrinsic which caused the event to be emitted"
  25. inExtrinsic: String
  26. "Blocknumber of the block in which the event was emitted."
  27. inBlock: Int!
  28. "Network the block was produced in"
  29. network: Network!
  30. "Index of event in block from which it was emitted."
  31. indexInBlock: Int!
  32. ### SPECIFIC DATA ###
  33. "Related group"
  34. group: WorkingGroup!
  35. "Related opening"
  36. opening: WorkingGroupOpening!
  37. "The application that was created"
  38. application: WorkingGroupApplication!
  39. # Same as with opening - application parameters are immutable and can be fetched from Application entity
  40. }
  41. type OpeningFilledEvent @entity {
  42. ### GENERIC DATA ###
  43. "(network}-{blockNumber}-{indexInBlock}"
  44. id: ID!
  45. "Hash of the extrinsic which caused the event to be emitted"
  46. inExtrinsic: String
  47. "Blocknumber of the block in which the event was emitted."
  48. inBlock: Int!
  49. "Network the block was produced in"
  50. network: Network!
  51. "Index of event in block from which it was emitted."
  52. indexInBlock: Int!
  53. ### SPECIFIC DATA ###
  54. "Related group"
  55. group: WorkingGroup!
  56. "Related opening"
  57. opening: WorkingGroupOpening!
  58. "Workers that have been hired as a result of filling the opening"
  59. workersHired: [Worker!] @derivedFrom(field: "entry")
  60. }
  61. type LeaderSetEvent @entity {
  62. ### GENERIC DATA ###
  63. "(network}-{blockNumber}-{indexInBlock}"
  64. id: ID!
  65. "Hash of the extrinsic which caused the event to be emitted"
  66. inExtrinsic: String
  67. "Blocknumber of the block in which the event was emitted."
  68. inBlock: Int!
  69. "Network the block was produced in"
  70. network: Network!
  71. "Index of event in block from which it was emitted."
  72. indexInBlock: Int!
  73. ### SPECIFIC DATA ###
  74. "Related group"
  75. group: WorkingGroup!
  76. # The field must be optional, because at the time the event is emitted the worker does not yet exist
  77. "Related Lead worker"
  78. worker: Worker
  79. }
  80. type WorkerRoleAccountUpdatedEvent @entity {
  81. ### GENERIC DATA ###
  82. "(network}-{blockNumber}-{indexInBlock}"
  83. id: ID!
  84. "Hash of the extrinsic which caused the event to be emitted"
  85. inExtrinsic: String
  86. "Blocknumber of the block in which the event was emitted."
  87. inBlock: Int!
  88. "Network the block was produced in"
  89. network: Network!
  90. "Index of event in block from which it was emitted."
  91. indexInBlock: Int!
  92. ### SPECIFIC DATA ###
  93. "Related group"
  94. group: WorkingGroup!
  95. "Related worker"
  96. worker: Worker!
  97. "New role account"
  98. newRoleAccount: String!
  99. }
  100. type LeaderUnsetEvent @entity {
  101. ### GENERIC DATA ###
  102. "(network}-{blockNumber}-{indexInBlock}"
  103. id: ID!
  104. "Hash of the extrinsic which caused the event to be emitted"
  105. inExtrinsic: String
  106. "Blocknumber of the block in which the event was emitted."
  107. inBlock: Int!
  108. "Network the block was produced in"
  109. network: Network!
  110. "Index of event in block from which it was emitted."
  111. indexInBlock: Int!
  112. ### SPECIFIC DATA ###
  113. "Related group"
  114. group: WorkingGroup!
  115. "A leader that was unset"
  116. leader: Worker!
  117. }
  118. type WorkerExitedEvent @entity {
  119. ### GENERIC DATA ###
  120. "(network}-{blockNumber}-{indexInBlock}"
  121. id: ID!
  122. "Hash of the extrinsic which caused the event to be emitted"
  123. inExtrinsic: String
  124. "Blocknumber of the block in which the event was emitted."
  125. inBlock: Int!
  126. "Network the block was produced in"
  127. network: Network!
  128. "Index of event in block from which it was emitted."
  129. indexInBlock: Int!
  130. ### SPECIFIC DATA ###
  131. "Related group"
  132. group: WorkingGroup!
  133. "Related worker"
  134. worker: Worker!
  135. }
  136. type TerminatedWorkerEvent @entity {
  137. ### GENERIC DATA ###
  138. "(network}-{blockNumber}-{indexInBlock}"
  139. id: ID!
  140. "Hash of the extrinsic which caused the event to be emitted"
  141. inExtrinsic: String
  142. "Blocknumber of the block in which the event was emitted."
  143. inBlock: Int!
  144. "Network the block was produced in"
  145. network: Network!
  146. "Index of event in block from which it was emitted."
  147. indexInBlock: Int!
  148. ### SPECIFIC DATA ###
  149. "Related group"
  150. group: WorkingGroup!
  151. "Related worker"
  152. worker: Worker!
  153. "Slash amount (if any)"
  154. penalty: BigInt
  155. "Optional rationale"
  156. rationale: String
  157. }
  158. type TerminatedLeaderEvent @entity {
  159. ### GENERIC DATA ###
  160. "(network}-{blockNumber}-{indexInBlock}"
  161. id: ID!
  162. "Hash of the extrinsic which caused the event to be emitted"
  163. inExtrinsic: String
  164. "Blocknumber of the block in which the event was emitted."
  165. inBlock: Int!
  166. "Network the block was produced in"
  167. network: Network!
  168. "Index of event in block from which it was emitted."
  169. indexInBlock: Int!
  170. ### SPECIFIC DATA ###
  171. "Related group"
  172. group: WorkingGroup!
  173. "Related worker"
  174. worker: Worker!
  175. "Slash amount (if any)"
  176. penalty: BigInt
  177. "Optional rationale"
  178. rationale: String
  179. }
  180. type WorkerStartedLeavingEvent @entity {
  181. ### GENERIC DATA ###
  182. "(network}-{blockNumber}-{indexInBlock}"
  183. id: ID!
  184. "Hash of the extrinsic which caused the event to be emitted"
  185. inExtrinsic: String
  186. "Blocknumber of the block in which the event was emitted."
  187. inBlock: Int!
  188. "Network the block was produced in"
  189. network: Network!
  190. "Index of event in block from which it was emitted."
  191. indexInBlock: Int!
  192. ### SPECIFIC DATA ###
  193. "Related group"
  194. group: WorkingGroup!
  195. "Related worker"
  196. worker: Worker!
  197. "Optional rationale"
  198. rationale: String
  199. }
  200. type StakeSlashedEvent @entity {
  201. ### GENERIC DATA ###
  202. "(network}-{blockNumber}-{indexInBlock}"
  203. id: ID!
  204. "Hash of the extrinsic which caused the event to be emitted"
  205. inExtrinsic: String
  206. "Blocknumber of the block in which the event was emitted."
  207. inBlock: Int!
  208. "Network the block was produced in"
  209. network: Network!
  210. "Index of event in block from which it was emitted."
  211. indexInBlock: Int!
  212. ### SPECIFIC DATA ###
  213. "Related group"
  214. group: WorkingGroup!
  215. "Related worker"
  216. worker: Worker!
  217. "Balance that was requested to be slashed"
  218. requestedAmount: BigInt!
  219. "Balance that was actually slashed"
  220. slashedAmount: BigInt!
  221. "Optional rationale"
  222. rationale: String
  223. }
  224. type StakeDecreasedEvent @entity {
  225. ### GENERIC DATA ###
  226. "(network}-{blockNumber}-{indexInBlock}"
  227. id: ID!
  228. "Hash of the extrinsic which caused the event to be emitted"
  229. inExtrinsic: String
  230. "Blocknumber of the block in which the event was emitted."
  231. inBlock: Int!
  232. "Network the block was produced in"
  233. network: Network!
  234. "Index of event in block from which it was emitted."
  235. indexInBlock: Int!
  236. ### SPECIFIC DATA ###
  237. "Related group"
  238. group: WorkingGroup!
  239. "Related worker"
  240. worker: Worker!
  241. "The amount of JOY the stake was decreased by"
  242. amount: BigInt!
  243. }
  244. type StakeIncreasedEvent @entity {
  245. ### GENERIC DATA ###
  246. "(network}-{blockNumber}-{indexInBlock}"
  247. id: ID!
  248. "Hash of the extrinsic which caused the event to be emitted"
  249. inExtrinsic: String
  250. "Blocknumber of the block in which the event was emitted."
  251. inBlock: Int!
  252. "Network the block was produced in"
  253. network: Network!
  254. "Index of event in block from which it was emitted."
  255. indexInBlock: Int!
  256. ### SPECIFIC DATA ###
  257. "Related group"
  258. group: WorkingGroup!
  259. "Related worker"
  260. worker: Worker!
  261. "The amount of JOY the stake was increased by"
  262. amount: BigInt!
  263. }
  264. type ApplicationWithdrawnEvent @entity {
  265. ### GENERIC DATA ###
  266. "(network}-{blockNumber}-{indexInBlock}"
  267. id: ID!
  268. "Hash of the extrinsic which caused the event to be emitted"
  269. inExtrinsic: String
  270. "Blocknumber of the block in which the event was emitted."
  271. inBlock: Int!
  272. "Network the block was produced in"
  273. network: Network!
  274. "Index of event in block from which it was emitted."
  275. indexInBlock: Int!
  276. ### SPECIFIC DATA ###
  277. "Related group"
  278. group: WorkingGroup!
  279. "Related application"
  280. application: WorkingGroupApplication!
  281. }
  282. type OpeningCanceledEvent @entity {
  283. ### GENERIC DATA ###
  284. "(network}-{blockNumber}-{indexInBlock}"
  285. id: ID!
  286. "Hash of the extrinsic which caused the event to be emitted"
  287. inExtrinsic: String
  288. "Blocknumber of the block in which the event was emitted."
  289. inBlock: Int!
  290. "Network the block was produced in"
  291. network: Network!
  292. "Index of event in block from which it was emitted."
  293. indexInBlock: Int!
  294. ### SPECIFIC DATA ###
  295. "Related group"
  296. group: WorkingGroup!
  297. "Related opening"
  298. opening: WorkingGroupOpening!
  299. }
  300. type BudgetSetEvent @entity {
  301. ### GENERIC DATA ###
  302. "(network}-{blockNumber}-{indexInBlock}"
  303. id: ID!
  304. "Hash of the extrinsic which caused the event to be emitted"
  305. inExtrinsic: String
  306. "Blocknumber of the block in which the event was emitted."
  307. inBlock: Int!
  308. "Network the block was produced in"
  309. network: Network!
  310. "Index of event in block from which it was emitted."
  311. indexInBlock: Int!
  312. ### SPECIFIC DATA ###
  313. "Related group"
  314. group: WorkingGroup!
  315. "New working group budget"
  316. newBudget: BigInt!
  317. }
  318. type WorkerRewardAccountUpdatedEvent @entity {
  319. ### GENERIC DATA ###
  320. "(network}-{blockNumber}-{indexInBlock}"
  321. id: ID!
  322. "Hash of the extrinsic which caused the event to be emitted"
  323. inExtrinsic: String
  324. "Blocknumber of the block in which the event was emitted."
  325. inBlock: Int!
  326. "Network the block was produced in"
  327. network: Network!
  328. "Index of event in block from which it was emitted."
  329. indexInBlock: Int!
  330. ### SPECIFIC DATA ###
  331. "Related group"
  332. group: WorkingGroup!
  333. "Related worker"
  334. worker: Worker!
  335. "New reward account"
  336. newRewardAccount: String!
  337. }
  338. type WorkerRewardAmountUpdatedEvent @entity {
  339. ### GENERIC DATA ###
  340. "(network}-{blockNumber}-{indexInBlock}"
  341. id: ID!
  342. "Hash of the extrinsic which caused the event to be emitted"
  343. inExtrinsic: String
  344. "Blocknumber of the block in which the event was emitted."
  345. inBlock: Int!
  346. "Network the block was produced in"
  347. network: Network!
  348. "Index of event in block from which it was emitted."
  349. indexInBlock: Int!
  350. ### SPECIFIC DATA ###
  351. "Related group"
  352. group: WorkingGroup!
  353. "Related worker"
  354. worker: Worker!
  355. "New worker reward per block"
  356. newRewardPerBlock: BigInt!
  357. }
  358. type UpcomingOpeningAdded @variant {
  359. upcomingOpeningId: ID!
  360. }
  361. type UpcomingOpeningRemoved @variant {
  362. upcomingOpeningId: ID!
  363. }
  364. type WorkingGroupMetadataSet @variant {
  365. "The new metadata snapshot resulting from the update"
  366. metadata: WorkingGroupMetadata!
  367. }
  368. type InvalidActionMetadata @variant {
  369. "Reason why the action metadata was considered invalid"
  370. reason: String!
  371. }
  372. union WorkingGroupMetadataActionResult =
  373. UpcomingOpeningAdded
  374. | UpcomingOpeningRemoved
  375. | WorkingGroupMetadataSet
  376. | InvalidActionMetadata
  377. type StatusTextChangedEvent @entity {
  378. ### GENERIC DATA ###
  379. "(network}-{blockNumber}-{indexInBlock}"
  380. id: ID!
  381. "Hash of the extrinsic which caused the event to be emitted"
  382. inExtrinsic: String
  383. "Blocknumber of the block in which the event was emitted."
  384. inBlock: Int!
  385. "Network the block was produced in"
  386. network: Network!
  387. "Index of event in block from which it was emitted."
  388. indexInBlock: Int!
  389. ### SPECIFIC DATA ###
  390. "Related group"
  391. group: WorkingGroup!
  392. "Original action metadata as hex string"
  393. metadata: String
  394. "Event result depeding on the metadata action type"
  395. result: WorkingGroupMetadataActionResult!
  396. }
  397. type BudgetSpendingEvent @entity {
  398. ### GENERIC DATA ###
  399. "(network}-{blockNumber}-{indexInBlock}"
  400. id: ID!
  401. "Hash of the extrinsic which caused the event to be emitted"
  402. inExtrinsic: String
  403. "Blocknumber of the block in which the event was emitted."
  404. inBlock: Int!
  405. "Network the block was produced in"
  406. network: Network!
  407. "Index of event in block from which it was emitted."
  408. indexInBlock: Int!
  409. ### SPECIFIC DATA ###
  410. "Related group"
  411. group: WorkingGroup!
  412. "Reciever account address"
  413. reciever: String!
  414. "Amount beeing spent"
  415. amount: BigInt!
  416. "Optional rationale"
  417. rationale: String
  418. }
  419. enum RewardPaymentType {
  420. "Regular reward payout"
  421. REGULAR
  422. "Payout of previously missed reward"
  423. MISSED
  424. }
  425. type RewardPaidEvent @entity {
  426. ### GENERIC DATA ###
  427. "(network}-{blockNumber}-{indexInBlock}"
  428. id: ID!
  429. "Hash of the extrinsic which caused the event to be emitted"
  430. inExtrinsic: String
  431. "Blocknumber of the block in which the event was emitted."
  432. inBlock: Int!
  433. "Network the block was produced in"
  434. network: Network!
  435. "Index of event in block from which it was emitted."
  436. indexInBlock: Int!
  437. ### SPECIFIC DATA ###
  438. "Related group"
  439. group: WorkingGroup!
  440. "Related worker"
  441. worker: Worker!
  442. "The account that recieved the reward"
  443. rewardAccount: String!
  444. "Amount recieved"
  445. amount: BigInt!
  446. "Type of the payment (REGULAR/MISSED)"
  447. type: RewardPaymentType!
  448. }
  449. type NewMissedRewardLevelReachedEvent @entity {
  450. ### GENERIC DATA ###
  451. "(network}-{blockNumber}-{indexInBlock}"
  452. id: ID!
  453. "Hash of the extrinsic which caused the event to be emitted"
  454. inExtrinsic: String
  455. "Blocknumber of the block in which the event was emitted."
  456. inBlock: Int!
  457. "Network the block was produced in"
  458. network: Network!
  459. "Index of event in block from which it was emitted."
  460. indexInBlock: Int!
  461. ### SPECIFIC DATA ###
  462. "Related group"
  463. group: WorkingGroup!
  464. "Related worker"
  465. worker: Worker!
  466. "New missed reward amount"
  467. newMissedRewardAmount: BigInt!
  468. }