Skip to content

Instantly share code, notes, and snippets.

@bfagundez
Created January 24, 2019 21:10
Show Gist options
  • Save bfagundez/68d7f0878c9a3ae09f94d9683940ee62 to your computer and use it in GitHub Desktop.
Save bfagundez/68d7f0878c9a3ae09f94d9683940ee62 to your computer and use it in GitHub Desktop.
type User {
id: ID! @unique
sub: String! @unique
username: String
createdAt: DateTime!
updatedAt: DateTime!
email: String! @unique
name: String!
timezone: String @default(value: "America/Los_Angeles")
avatar: File @relation(name: "AvatarOwner", onDelete: CASCADE)
isAdmin: Boolean
disabled: Boolean
org: Organization @relation(name: "OrgUsers")
}
type File {
id: ID! @unique
name: String
size: Int
secret: String @unique
contentType: String
createdAt: DateTime!
updatedAt: DateTime!
url: String
title: String
}
type Organization {
id: ID! @unique
createdAt: DateTime!
updatedAt: DateTime!
name: String!
mission: String
image: File
users: [User!]! @relation(name: "OrgUsers")
outcomes: [Outcome!]! @relation(name: "OrgOutcomes")
}
type Outcome {
id: ID! @unique
createdAt: DateTime!
updatedAt: DateTime!
name: String!
description: String
indicators: [Indicator!]! @relation(name: "OutcomeIndicators", onDelete: CASCADE)
org: Organization @relation(name: "OrgOutcomes")
}
enum IndicatorType {
NUMBER
PERCENT
CURRENCY
SCALE
RATIO
}
enum IndicatorStatus {
IN_PROGRESS
COMPLETE
}
type Indicator {
id: ID! @unique
createdAt: DateTime!
updatedAt: DateTime!
outcome: Outcome! @relation(name: "OutcomeIndicators")
name: String!
type: IndicatorType!
baseline: Float!
target: Float!
startDate: DateTime
completeDate: DateTime
status: IndicatorStatus!
progressUpdates: [ProgressUpdate!]! @relation(name: "IndicatorProgressUpdates", onDelete: CASCADE)
statusUpdates: [StatusUpdate!]! @relation(name: "IndicatorStatusUpdates", onDelete: CASCADE)
}
type ProgressUpdate {
id: ID! @unique
createdAt: DateTime!
updatedAt: DateTime!
indicator: Indicator! @relation(name: "IndicatorProgressUpdates")
value: Float!
date: DateTime!
files: [File!]!
}
type StatusUpdate {
id: ID! @unique
createdAt: DateTime!
updatedAt: DateTime!
indicator: Indicator! @relation(name: "IndicatorStatusUpdates")
description: String!
sentiment: Int!
date: DateTime!
files: [File!]!
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment