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! }