workingGroupsEvents.graphql 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722
  1. type OpeningAddedEvent implements Event @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 implements Event @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 implements Event @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 implements Event @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 implements Event @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 implements Event @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 implements Event @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 implements Event @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 implements Event @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 implements Event @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 implements Event @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 implements Event @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 implements Event @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 implements Event @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 implements Event @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 implements Event @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 BudgetUpdatedEvent implements Event @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. "Amount substracted from / added to the current budget"
  334. budgetChangeAmount: BigInt!
  335. }
  336. type WorkerRewardAccountUpdatedEvent implements Event @entity {
  337. ### GENERIC DATA ###
  338. "(network}-{blockNumber}-{indexInBlock}"
  339. id: ID!
  340. "Hash of the extrinsic which caused the event to be emitted"
  341. inExtrinsic: String
  342. "Blocknumber of the block in which the event was emitted."
  343. inBlock: Int!
  344. "Network the block was produced in"
  345. network: Network!
  346. "Index of event in block from which it was emitted."
  347. indexInBlock: Int!
  348. ### SPECIFIC DATA ###
  349. "Related group"
  350. group: WorkingGroup!
  351. "Related worker"
  352. worker: Worker!
  353. "New reward account"
  354. newRewardAccount: String!
  355. }
  356. type WorkerRewardAmountUpdatedEvent implements Event @entity {
  357. ### GENERIC DATA ###
  358. "(network}-{blockNumber}-{indexInBlock}"
  359. id: ID!
  360. "Hash of the extrinsic which caused the event to be emitted"
  361. inExtrinsic: String
  362. "Blocknumber of the block in which the event was emitted."
  363. inBlock: Int!
  364. "Network the block was produced in"
  365. network: Network!
  366. "Index of event in block from which it was emitted."
  367. indexInBlock: Int!
  368. ### SPECIFIC DATA ###
  369. "Related group"
  370. group: WorkingGroup!
  371. "Related worker"
  372. worker: Worker!
  373. "New worker reward per block"
  374. newRewardPerBlock: BigInt!
  375. }
  376. type UpcomingOpeningAdded @variant {
  377. upcomingOpeningId: ID!
  378. }
  379. type UpcomingOpeningRemoved @variant {
  380. upcomingOpeningId: ID!
  381. }
  382. type WorkingGroupMetadataSet @variant {
  383. "The new metadata snapshot resulting from the update"
  384. metadata: WorkingGroupMetadata!
  385. }
  386. type InvalidActionMetadata @variant {
  387. "Reason why the action metadata was considered invalid"
  388. reason: String!
  389. }
  390. union WorkingGroupMetadataActionResult =
  391. UpcomingOpeningAdded
  392. | UpcomingOpeningRemoved
  393. | WorkingGroupMetadataSet
  394. | InvalidActionMetadata
  395. type StatusTextChangedEvent implements Event @entity {
  396. ### GENERIC DATA ###
  397. "(network}-{blockNumber}-{indexInBlock}"
  398. id: ID!
  399. "Hash of the extrinsic which caused the event to be emitted"
  400. inExtrinsic: String
  401. "Blocknumber of the block in which the event was emitted."
  402. inBlock: Int!
  403. "Network the block was produced in"
  404. network: Network!
  405. "Index of event in block from which it was emitted."
  406. indexInBlock: Int!
  407. ### SPECIFIC DATA ###
  408. "Related group"
  409. group: WorkingGroup!
  410. "Original action metadata as hex string"
  411. metadata: String
  412. "Event result depeding on the metadata action type"
  413. result: WorkingGroupMetadataActionResult!
  414. }
  415. type BudgetSpendingEvent implements Event @entity {
  416. ### GENERIC DATA ###
  417. "(network}-{blockNumber}-{indexInBlock}"
  418. id: ID!
  419. "Hash of the extrinsic which caused the event to be emitted"
  420. inExtrinsic: String
  421. "Blocknumber of the block in which the event was emitted."
  422. inBlock: Int!
  423. "Network the block was produced in"
  424. network: Network!
  425. "Index of event in block from which it was emitted."
  426. indexInBlock: Int!
  427. ### SPECIFIC DATA ###
  428. "Related group"
  429. group: WorkingGroup!
  430. "Reciever account address"
  431. reciever: String!
  432. "Amount beeing spent"
  433. amount: BigInt!
  434. "Optional rationale"
  435. rationale: String
  436. }
  437. enum RewardPaymentType {
  438. "Regular reward payout"
  439. REGULAR
  440. "Payout of previously missed reward"
  441. MISSED
  442. }
  443. type RewardPaidEvent implements Event @entity {
  444. ### GENERIC DATA ###
  445. "(network}-{blockNumber}-{indexInBlock}"
  446. id: ID!
  447. "Hash of the extrinsic which caused the event to be emitted"
  448. inExtrinsic: String
  449. "Blocknumber of the block in which the event was emitted."
  450. inBlock: Int!
  451. "Network the block was produced in"
  452. network: Network!
  453. "Index of event in block from which it was emitted."
  454. indexInBlock: Int!
  455. ### SPECIFIC DATA ###
  456. "Related group"
  457. group: WorkingGroup!
  458. "Related worker"
  459. worker: Worker!
  460. "The account that recieved the reward"
  461. rewardAccount: String!
  462. "Amount recieved"
  463. amount: BigInt!
  464. "Type of the payment (REGULAR/MISSED)"
  465. paymentType: RewardPaymentType!
  466. }
  467. type NewMissedRewardLevelReachedEvent implements Event @entity {
  468. ### GENERIC DATA ###
  469. "(network}-{blockNumber}-{indexInBlock}"
  470. id: ID!
  471. "Hash of the extrinsic which caused the event to be emitted"
  472. inExtrinsic: String
  473. "Blocknumber of the block in which the event was emitted."
  474. inBlock: Int!
  475. "Network the block was produced in"
  476. network: Network!
  477. "Index of event in block from which it was emitted."
  478. indexInBlock: Int!
  479. ### SPECIFIC DATA ###
  480. "Related group"
  481. group: WorkingGroup!
  482. "Related worker"
  483. worker: Worker!
  484. "New missed reward amount"
  485. newMissedRewardAmount: BigInt!
  486. }