123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335 |
- type WorkerStatusActive @variant {
- # No additional information needed
- _phantom: Int
- }
- type WorkerStatusLeaving @variant {
- "Related event emitted on leaving initialization"
- workerStartedLeavingEvent: WorkerStartedLeavingEvent!
- }
- type WorkerStatusLeft @variant {
- "Related event emitted on leaving initialization"
- workerStartedLeavingEvent: WorkerStartedLeavingEvent!
- "Related event emitted once the worker has exited the role (after the unstaking period)"
- workerExitedEvent: WorkerExitedEvent!
- }
- type WorkerStatusTerminated @variant {
- "Related event emitted on worker termination"
- terminatedWorkerEvent: TerminatedWorkerEvent!
- }
- union WorkerStatus = WorkerStatusActive | WorkerStatusLeaving | WorkerStatusLeft | WorkerStatusTerminated
- # Working Groups
- type Worker @entity {
- "Worker id ({workingGroupName}-{workerId})"
- id: ID!
- "WorkerId in specific working group module"
- runtimeId: Int!
- "The group that the worker belongs to"
- group: WorkingGroup!
- # This exposes internal Hydra value related to `group`. It will be internally set and updated by Hydra.
- # See https://github.com/Joystream/joystream/pull/3043 for more info.
- "The id the group that the worker belongs to"
- groupId: ID!
- "Worker membership"
- membership: Membership!
- "Worker's role account"
- roleAccount: String!
- "Worker's reward account"
- rewardAccount: String!
- "Worker's staking account"
- stakeAccount: String!
- "Current worker status"
- status: WorkerStatus!
- "Whether the worker is also the working group lead"
- isLead: Boolean!
- "Whether the worker is currently active"
- isActive: Boolean!
- "Current role stake (in JOY)"
- stake: BigInt!
- "Current reward per block"
- rewardPerBlock: BigInt!
- "The reward amount the worker is currently missing (due to empty working group budget)"
- missingRewardAmount: BigInt
- "All related reward payouts"
- payouts: [RewardPaidEvent!] @derivedFrom(field: "worker")
- "All related stake slashes"
- slashes: [StakeSlashedEvent!] @derivedFrom(field: "worker")
- "The event that caused the worker to be hired"
- entry: OpeningFilledEvent!
- "Related worker entry application"
- application: WorkingGroupApplication!
- "Worker's storage data"
- storage: String
- "Forum categories managed by the worker (required for many-to-many relationship with ForumCategory)"
- managedForumCategories: [ForumCategory!] @derivedFrom(field: "moderators")
- }
- type WorkingGroupMetadata @entity {
- "Working group status"
- status: String
- "Working group status message"
- statusMessage: String
- "Working group about text"
- about: String
- "Working group description text"
- description: String
- "Event the working group metadata was set in"
- setInEvent: StatusTextChangedEvent!
- "Related group"
- group: WorkingGroup!
- }
- type WorkingGroup @entity {
- "Working group id (currently === name)"
- id: ID!
- "Working group name"
- name: String! @unique
- "Working group current metadata"
- metadata: WorkingGroupMetadata
- "Current working group leader"
- leader: Worker
- "Workers that currently belong to the group or belonged to the group in the past"
- workers: [Worker!] @derivedFrom(field: "group")
- "All openings related to this group"
- openings: [WorkingGroupOpening!] @derivedFrom(field: "group")
- "Current working group budget (JOY)"
- budget: BigInt!
- }
- type OpeningStatusCancelled @variant {
- "Related event emitted on opening cancellation"
- openingCanceledEvent: OpeningCanceledEvent!
- }
- type OpeningStatusOpen @variant {
- # No additional information needed
- _phantom: Int
- }
- type OpeningStatusFilled @variant {
- "Related event emitted after filling the opening"
- openingFilledEvent: OpeningFilledEvent!
- }
- union WorkingGroupOpeningStatus = OpeningStatusOpen | OpeningStatusFilled | OpeningStatusCancelled
- enum WorkingGroupOpeningType {
- REGULAR
- LEADER
- }
- type WorkingGroupOpeningMetadata @entity {
- "Whether the originally provided metadata was valid"
- originallyValid: Boolean!
- "Opening title"
- title: String
- "Opening short description"
- shortDescription: String
- "Opening description (md-formatted)"
- description: String
- "Expected max. number of applicants that will be hired"
- hiringLimit: Int
- "Expected time when the opening will close"
- expectedEnding: DateTime
- "Md-formatted text explaining the application process"
- applicationDetails: String
- "List of questions that should be answered during application"
- applicationFormQuestions: [ApplicationFormQuestion!] @derivedFrom(field: "openingMetadata")
- }
- type WorkingGroupOpening @entity {
- "Opening id ({workingGroupName}-{openingId})"
- id: ID!
- "OpeningId in specific working group module"
- runtimeId: Int!
- "Related working group"
- group: WorkingGroup!
- "List of opening applications"
- applications: [WorkingGroupApplication!] @derivedFrom(field: "opening")
- "Type of the opening (Leader/Regular)"
- type: WorkingGroupOpeningType!
- "Current opening status"
- status: WorkingGroupOpeningStatus!
- "Opening metadata"
- metadata: WorkingGroupOpeningMetadata!
- "Min. application/role stake amount"
- stakeAmount: BigInt!
- "Role stake unstaking period in blocks"
- unstakingPeriod: Int!
- "Initial workers' reward per block"
- rewardPerBlock: BigInt!
- "Event the opening was created in"
- createdInEvent: OpeningAddedEvent! @derivedFrom(field: "opening")
- "Time of opening creation"
- createdAt: DateTime!
- }
- type UpcomingWorkingGroupOpening @entity {
- "Event the upcoming opening was created in"
- createdInEvent: StatusTextChangedEvent!
- "Related working group"
- group: WorkingGroup!
- "Expected opening start time"
- expectedStart: DateTime
- "Expected min. application/role stake amount"
- stakeAmount: BigInt
- "Expected reward per block"
- rewardPerBlock: BigInt
- "Opening metadata"
- metadata: WorkingGroupOpeningMetadata!
- }
- type ApplicationStatusPending @variant {
- # No additional information needed
- _phantom: Int
- }
- type ApplicationStatusAccepted @variant {
- "Related OpeningFilled event"
- openingFilledEvent: OpeningFilledEvent!
- }
- type ApplicationStatusRejected @variant {
- "Related OpeningFilled event"
- openingFilledEvent: OpeningFilledEvent!
- }
- type ApplicationStatusCancelled @variant {
- "Related OpeningCanceled event"
- openingCanceledEvent: OpeningCanceledEvent!
- }
- type ApplicationStatusWithdrawn @variant {
- "Related ApplicationWithdrawn event"
- applicationWithdrawnEvent: ApplicationWithdrawnEvent!
- }
- union WorkingGroupApplicationStatus =
- ApplicationStatusPending
- | ApplicationStatusAccepted
- | ApplicationStatusRejected
- | ApplicationStatusWithdrawn
- | ApplicationStatusCancelled
- type WorkingGroupApplication @entity {
- "Application id ({workingGroupName}-{applicationId})"
- id: ID!
- "ApplicationId in specific working group module"
- runtimeId: Int!
- "Related working group opening"
- opening: WorkingGroupOpening!
- "Applicant's membership"
- applicant: Membership!
- "Application stake"
- stake: BigInt!
- "Applicant's initial role account"
- roleAccount: String!
- "Applicant's initial reward account"
- rewardAccount: String!
- "Applicant's initial staking account"
- stakingAccount: String!
- "Answers to application form questions"
- answers: [ApplicationFormQuestionAnswer!] @derivedFrom(field: "application")
- "Current application status"
- status: WorkingGroupApplicationStatus!
- "Event the application was created in"
- createdInEvent: AppliedOnOpeningEvent! @derivedFrom(field: "application")
- }
- type ApplicationFormQuestionAnswer @entity {
- "Related application"
- application: WorkingGroupApplication!
- "The question beeing answered"
- question: ApplicationFormQuestion!
- "Applicant's answer"
- answer: String!
- }
- enum ApplicationFormQuestionType {
- TEXT
- TEXTAREA
- }
- type ApplicationFormQuestion @entity {
- "Related opening metadata"
- openingMetadata: WorkingGroupOpeningMetadata!
- "The question itself"
- question: String
- "Type of the question (UI answer input type)"
- type: ApplicationFormQuestionType!
- "Index of the question"
- index: Int!
- }
|