membership.graphql 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. type AvatarObject @variant {
  2. "The avatar data object"
  3. avatarObject: StorageDataObject!
  4. }
  5. type AvatarUri @variant {
  6. "The avatar URL"
  7. avatarUri: String!
  8. }
  9. union Avatar = AvatarObject | AvatarUri
  10. type MemberMetadata @entity {
  11. "Member's name"
  12. name: String
  13. "Avatar data object"
  14. avatar: Avatar
  15. "Short text chosen by member to share information about themselves"
  16. about: String
  17. }
  18. type MembershipEntryPaid @variant {
  19. "The event the membership was bought in"
  20. # Must be optional because of member.entry <=> membershipBoughtEvent.newMember cross relationship
  21. membershipBoughtEvent: MembershipBoughtEvent
  22. }
  23. type MembershipEntryInvited @variant {
  24. "The event the member was invited in"
  25. # Must be optional because of member.entry <=> memberInvitedEvent.newMember cross relationship
  26. memberInvitedEvent: MemberInvitedEvent
  27. }
  28. type MembershipEntryGenesis @variant {
  29. phantom: Int
  30. }
  31. union MembershipEntryMethod = MembershipEntryPaid | MembershipEntryInvited | MembershipEntryGenesis
  32. "Stored information about a registered user"
  33. type Membership @entity {
  34. "MemberId: runtime identifier for a user"
  35. id: ID!
  36. "The unique handle chosen by member"
  37. handle: String! @unique @fulltext(query: "membersByHandle")
  38. "Member's metadata"
  39. metadata: MemberMetadata!
  40. "Member's controller account id"
  41. controllerAccount: String!
  42. "Member's root account id"
  43. rootAccount: String!
  44. "How the member was registered"
  45. entry: MembershipEntryMethod!
  46. "Whether member has been verified by membership working group."
  47. isVerified: Boolean!
  48. "Staking accounts bounded to membership."
  49. boundAccounts: [String!]
  50. "Current count of invites left to send."
  51. inviteCount: Int!
  52. "All members invited by this member."
  53. invitees: [Membership!] @derivedFrom(field: "invitedBy")
  54. "A member that invited this member (if any)"
  55. invitedBy: Membership
  56. "All members referred by this member"
  57. referredMembers: [Membership!] @derivedFrom(field: "referredBy")
  58. "A member that referred this member (if any)"
  59. referredBy: Membership
  60. "Whether member is founding member."
  61. isFoundingMember: Boolean!
  62. "Whether member is elected in the current council."
  63. isCouncilMember: Boolean!
  64. "Member's working group roles (current and past)"
  65. roles: [Worker!] @derivedFrom(field: "membership")
  66. # Required for ProposalDiscussionWhitelist->members Many-to-Many relationship
  67. "List of proposal thread whitelists the member is part of"
  68. whitelistedIn: [ProposalDiscussionWhitelist!] @derivedFrom(field: "members")
  69. # Required for BountyEntrantWhitelist->members Many-to-Many relationship
  70. "List of bounty entrant whitelists the member is part of"
  71. whitelistedInBounties: [BountyEntrantWhitelist!] @derivedFrom(field: "members")
  72. "Content channels the member owns"
  73. channels: [Channel!] @derivedFrom(field: "ownerMember")
  74. "List of channels the member has collaborator access to"
  75. collaboratorInChannels: [Channel!] @derivedFrom(field: "collaborators")
  76. # Council & Referendum relations
  77. #"Council reward payment made received by the member."
  78. #budgetPayments: [BudgetPayment!] @derivedFrom(field: "member")
  79. "Candidacies announced by this member."
  80. councilCandidacies: [Candidate!] @derivedFrom(field: "member")
  81. "Elected councils' memberships of the member."
  82. councilMembers: [CouncilMember!] @derivedFrom(field: "member")
  83. "Auctions in which is this user whitelisted to participate"
  84. whitelistedInAuctions: [Auction!]! @derivedFrom(field: "whitelistedMembers")
  85. "NFTs owned by this member"
  86. ownedNfts: [OwnedNft!]! @derivedFrom(field: "ownerMember")
  87. }
  88. type MembershipSystemSnapshot @entity {
  89. "The snapshot block number"
  90. snapshotBlock: Int!
  91. "Initial invitation count of a new member."
  92. defaultInviteCount: Int!
  93. "Current price to buy a membership."
  94. membershipPrice: BigInt!
  95. "Percentage of tokens diverted to invitor."
  96. referralCut: Int!
  97. "The initial, locked, balance credited to controller account of invitee."
  98. invitedInitialBalance: BigInt!
  99. }