proposals.graphql 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364
  1. "The final proposal status is not yet decided, the council can still submit votes that may impact the outcome."
  2. type ProposalStatusDeciding @variant {
  3. "Related ProposalStatusUpdatedEvent"
  4. proposalStatusUpdatedEvent: ProposalStatusUpdatedEvent
  5. }
  6. "The proposal is awaiting execution until the specified trigger block, or GRACING_LIMIT blocks since start of period if no trigger was provided."
  7. type ProposalStatusGracing @variant {
  8. "Related ProposalStatusUpdatedEvent"
  9. proposalStatusUpdatedEvent: ProposalStatusUpdatedEvent
  10. }
  11. "The proposal was approved by current council, but requires further approvals to satisfy CONSTITUTIONALITY requirement. Transitions to Deciding stage when next council is elected."
  12. type ProposalStatusDormant @variant {
  13. "Related ProposalStatusUpdatedEvent"
  14. proposalStatusUpdatedEvent: ProposalStatusUpdatedEvent
  15. }
  16. "Was halted by sudo or by council through veto-proposal. "
  17. type ProposalStatusVetoed @variant {
  18. "Related ProposalDecisionMadeEvent event"
  19. proposalDecisionMadeEvent: ProposalDecisionMadeEvent
  20. }
  21. "The proposal was successfully executed"
  22. type ProposalStatusExecuted @variant {
  23. "Related ProposalExecutedEvent"
  24. proposalExecutedEvent: ProposalExecutedEvent
  25. }
  26. "The proposal executution has failed."
  27. type ProposalStatusExecutionFailed @variant {
  28. "Related ProposalExecutedEvent"
  29. proposalExecutedEvent: ProposalExecutedEvent
  30. "The runtime execution error message"
  31. errorMessage: String!
  32. }
  33. "The proposal was rejected and the associated stake was slashed."
  34. type ProposalStatusSlashed @variant {
  35. "Related ProposalDecisionMadeEvent"
  36. proposalDecisionMadeEvent: ProposalDecisionMadeEvent
  37. }
  38. "The proposal was rejected."
  39. type ProposalStatusRejected @variant {
  40. "Related ProposalDecisionMadeEvent"
  41. proposalDecisionMadeEvent: ProposalDecisionMadeEvent
  42. }
  43. "The proposal didn't recieve enough votes and the voting period has expired."
  44. type ProposalStatusExpired @variant {
  45. "Related ProposalDecisionMadeEvent"
  46. proposalDecisionMadeEvent: ProposalDecisionMadeEvent
  47. }
  48. "The proposal was cancelled by the original proposer."
  49. type ProposalStatusCancelled @variant {
  50. "The related ProposalCancelledEvent"
  51. canelledInEvent: ProposalCancelledEvent
  52. }
  53. "The proposal was canceled by the runtime (for example, due to runtime upgrade). No cancellation fee was applied."
  54. type ProposalStatusCanceledByRuntime @variant {
  55. "Related ProposalDecisionMadeEvent"
  56. proposalDecisionMadeEvent: ProposalDecisionMadeEvent
  57. }
  58. "Intermediate / pending proposal status, the final status is still to be determined"
  59. union ProposalIntermediateStatus = ProposalStatusDeciding | ProposalStatusGracing | ProposalStatusDormant
  60. "Proposal status after the voting stage has finished for the current council."
  61. union ProposalDecisionStatus = # Approved:
  62. ProposalStatusDormant
  63. | ProposalStatusGracing # Not approved:
  64. | ProposalStatusVetoed
  65. | ProposalStatusSlashed
  66. | ProposalStatusRejected
  67. | ProposalStatusExpired
  68. | ProposalStatusCancelled
  69. | ProposalStatusCanceledByRuntime
  70. "Statuses representing approved proposal post-execution result"
  71. union ProposalExecutionStatus = ProposalStatusExecuted | ProposalStatusExecutionFailed
  72. "All valid proposal statuses"
  73. union ProposalStatus = # Intermediate statuses:
  74. ProposalStatusDeciding
  75. | ProposalStatusGracing
  76. | ProposalStatusDormant # Final statuses:
  77. | ProposalStatusVetoed
  78. | ProposalStatusExecuted
  79. | ProposalStatusExecutionFailed
  80. | ProposalStatusSlashed
  81. | ProposalStatusRejected
  82. | ProposalStatusExpired
  83. | ProposalStatusCancelled
  84. | ProposalStatusCanceledByRuntime
  85. type Proposal @entity {
  86. "Proposal's runtime id"
  87. id: ID!
  88. "Proposal title"
  89. title: String! @fulltext(query: "proposalsByTitle")
  90. "Proposal description"
  91. description: String! @fulltext(query: "proposalsByDescription")
  92. "Proposal details depending on proposal type"
  93. details: ProposalDetails!
  94. "Staking account with proposal stake (in case a stake is required)"
  95. stakingAccount: String
  96. "Proposal creator"
  97. creator: Membership!
  98. "The event the proposal was created in"
  99. createdInEvent: ProposalCreatedEvent! @derivedFrom(field: "proposal")
  100. "Exact block number the proposal is supposed to be executed at (if specified)"
  101. exactExecutionBlock: Int
  102. "Proposal's discussion thread"
  103. discussionThread: ProposalDiscussionThread! @derivedFrom(field: "proposal")
  104. "How many prior councils have already approved the proposal (starts with 0)"
  105. councilApprovals: Int!
  106. "List of proposal (intermediate) status update events (to Deciding, Dormand or Gracing status)"
  107. proposalStatusUpdates: [ProposalStatusUpdatedEvent!] @derivedFrom(field: "proposal")
  108. "List of proposal votes (in form of ProposalVotedEvents)"
  109. votes: [ProposalVotedEvent!] @derivedFrom(field: "proposal")
  110. "Current proposal status"
  111. status: ProposalStatus!
  112. # Additional fileds to avoid the need for complex filtering through status variant relations:
  113. "Number of the block the current status was set at"
  114. statusSetAtBlock: Int!
  115. "Time the current status was set at (based on block timestamp)"
  116. statusSetAtTime: DateTime!
  117. }
  118. type SignalProposalDetails @variant {
  119. "Signal proposal content"
  120. text: String!
  121. }
  122. type RuntimeUpgradeProposalDetails @variant {
  123. "Runtime upgrade WASM bytecode"
  124. wasmBytecode: Bytes!
  125. }
  126. type FundingRequestDestination @entity {
  127. "Amount of funds requested"
  128. amount: BigInt!
  129. "Destination account"
  130. account: String!
  131. "The list that this funding request destination is part of"
  132. list: FundingRequestDestinationsList!
  133. }
  134. # We need to have additional intermediate FundingRequestDestinationsList entity,
  135. # because varaints don't directly support One-to-Many relationships
  136. type FundingRequestDestinationsList @entity {
  137. # Prevents "GraphQLError: Input Object type FundingRequestDestinationsListUpdateInput must define one or more fields."
  138. _phantom: Int
  139. "List of funding request destinations"
  140. destinations: [FundingRequestDestination!] @derivedFrom(field: "list")
  141. }
  142. type FundingRequestProposalDetails @variant {
  143. # Workaround for lack of direct One-to-Many relationships
  144. "Related list of funding request destinations"
  145. destinationsList: FundingRequestDestinationsList!
  146. }
  147. type SetMaxValidatorCountProposalDetails @variant {
  148. "The new (propsed) max. number of active validators"
  149. newMaxValidatorCount: Int!
  150. }
  151. type CreateWorkingGroupLeadOpeningProposalDetails @variant {
  152. "The opening metadata"
  153. metadata: WorkingGroupOpeningMetadata!
  154. "Min. application / role stake amount"
  155. stakeAmount: BigInt!
  156. "Role stake unstaking period in blocks"
  157. unstakingPeriod: Int!
  158. "Initial workers' reward per block"
  159. rewardPerBlock: BigInt!
  160. "Related working group"
  161. group: WorkingGroup!
  162. }
  163. type FillWorkingGroupLeadOpeningProposalDetails @variant {
  164. "Lead opening to to be filled"
  165. opening: WorkingGroupOpening!
  166. "Selected successful application"
  167. application: WorkingGroupApplication!
  168. }
  169. type UpdateWorkingGroupBudgetProposalDetails @variant {
  170. "Amount to increase / decrease the working group budget by (will be decudted from / appended to council budget accordingly)"
  171. amount: BigInt!
  172. "Related working group"
  173. group: WorkingGroup!
  174. }
  175. type DecreaseWorkingGroupLeadStakeProposalDetails @variant {
  176. "The lead that should be affected"
  177. lead: Worker!
  178. "Amount to decrease the stake by"
  179. amount: BigInt!
  180. }
  181. type SlashWorkingGroupLeadProposalDetails @variant {
  182. "The lead that should be affected"
  183. lead: Worker!
  184. "Amount to slash the stake by"
  185. amount: BigInt!
  186. }
  187. type SetWorkingGroupLeadRewardProposalDetails @variant {
  188. "The lead that should be affected"
  189. lead: Worker!
  190. "Lead's new (proposed) reward per block"
  191. newRewardPerBlock: BigInt!
  192. }
  193. type TerminateWorkingGroupLeadProposalDetails @variant {
  194. "Lead that's supposed to be terminated"
  195. lead: Worker!
  196. "Optionally - the amount to slash the lead's stake by"
  197. slashingAmount: BigInt
  198. }
  199. type AmendConstitutionProposalDetails @variant {
  200. "New (proposed) constitution text (md-formatted)"
  201. text: String!
  202. }
  203. type CancelWorkingGroupLeadOpeningProposalDetails @variant {
  204. "Opening to be cancelled"
  205. opening: WorkingGroupOpening!
  206. }
  207. type SetMembershipPriceProposalDetails @variant {
  208. "New (proposed) membership price"
  209. newPrice: BigInt!
  210. }
  211. type SetCouncilBudgetIncrementProposalDetails @variant {
  212. "New (proposed) amount the council budget should be increased by per each budget period"
  213. newAmount: BigInt!
  214. }
  215. type SetCouncilorRewardProposalDetails @variant {
  216. "New (proposed) council members' reward per block"
  217. newRewardPerBlock: BigInt!
  218. }
  219. type SetInitialInvitationBalanceProposalDetails @variant {
  220. "The new (proposed) initial balance credited to controller account of an invitee (locked for transaction fee payments only)"
  221. newInitialInvitationBalance: BigInt!
  222. }
  223. type SetInitialInvitationCountProposalDetails @variant {
  224. "The new (proposed) initial invitations count for paid memberships"
  225. newInitialInvitationsCount: Int!
  226. }
  227. type SetMembershipLeadInvitationQuotaProposalDetails @variant {
  228. "The new (proposed) membership working group lead invitation quota"
  229. newLeadInvitationQuota: Int!
  230. }
  231. type SetReferralCutProposalDetails @variant {
  232. "The new (proposed) percentage of tokens diverted to referrer (from referred member's membership price)."
  233. newReferralCut: Int!
  234. }
  235. type CreateBlogPostProposalDetails @variant {
  236. "Blog post title"
  237. title: String!
  238. "Blog post content (md-formatted)"
  239. body: String!
  240. }
  241. type EditBlogPostProposalDetails @variant {
  242. "The related blog post"
  243. # TODO: Change to relationship once Blog module is supported
  244. blogPost: ID!
  245. "The new blog post title (if should be updated)"
  246. newTitle: String
  247. "The new blog post body (if should be updated)"
  248. newBody: String
  249. }
  250. type LockBlogPostProposalDetails @variant {
  251. "The blog post that should be locked"
  252. # TODO: Change to relationship once Blog module is supported
  253. blogPost: ID!
  254. }
  255. type UnlockBlogPostProposalDetails @variant {
  256. "The blog post that should be unlocked"
  257. # TODO: Change to relationship once Blog module is supported
  258. blogPost: ID!
  259. }
  260. type VetoProposalDetails @variant {
  261. "Proposal to be vetoed"
  262. proposal: Proposal!
  263. }
  264. union ProposalDetails =
  265. SignalProposalDetails
  266. | RuntimeUpgradeProposalDetails
  267. | FundingRequestProposalDetails
  268. | SetMaxValidatorCountProposalDetails
  269. | CreateWorkingGroupLeadOpeningProposalDetails
  270. | FillWorkingGroupLeadOpeningProposalDetails
  271. | UpdateWorkingGroupBudgetProposalDetails
  272. | DecreaseWorkingGroupLeadStakeProposalDetails
  273. | SlashWorkingGroupLeadProposalDetails
  274. | SetWorkingGroupLeadRewardProposalDetails
  275. | TerminateWorkingGroupLeadProposalDetails
  276. | AmendConstitutionProposalDetails
  277. | CancelWorkingGroupLeadOpeningProposalDetails
  278. | SetMembershipPriceProposalDetails
  279. | SetCouncilBudgetIncrementProposalDetails
  280. | SetCouncilorRewardProposalDetails
  281. | SetInitialInvitationBalanceProposalDetails
  282. | SetInitialInvitationCountProposalDetails
  283. | SetMembershipLeadInvitationQuotaProposalDetails
  284. | SetReferralCutProposalDetails
  285. | CreateBlogPostProposalDetails
  286. | EditBlogPostProposalDetails
  287. | LockBlogPostProposalDetails
  288. | UnlockBlogPostProposalDetails
  289. | VetoProposalDetails