Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: production app models #73

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -553,6 +553,21 @@ input DisplayNameInput {
value: DynamicStringInput!
}

type Downtime implements ProductionRecord {
chainId: ID!
duration: Int
id: ID!
note: String
parent: ProductionEntity!
timeline: Timeline!
type: DowntimeType
}

enum DowntimeType {
PLANNED
UNPLANNED
}

scalar Duration

"""
Expand Down Expand Up @@ -933,6 +948,38 @@ type PageInfo {
startCursor: String
}

type Production implements ProductionRecord {
chainId: ID!
duration: Int
id: ID!
note: String
output: Int
parent: ProductionEntity!
timeline: Timeline!
}

union ProductionActivity = Downtime | Production

interface ProductionEntity {
id: ID!
name: String!
}

type ProductionLine implements ProductionEntity {
activity: [ProductionActivity!]
id: ID!
name: String!
}

interface ProductionRecord {
chainId: ID!
duration: Int
id: ID!
note: String
parent: ProductionEntity!
timeline: Timeline!
}

type Query {
"""
For the given Assignable `entity`, returns a connection representing the set
Expand Down Expand Up @@ -1215,6 +1262,17 @@ enum TimeZoneNameOptions {
never
}

type Timeline {
end: Timestamp
start: Timestamp!
}

type Timestamp {
by: Worker
overriddenFrom: Temporal
value: Temporal!
}

scalar URL

type UnassignmentPayload {
Expand Down
57 changes: 57 additions & 0 deletions schema/application/production.schema.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
interface ProductionEntity {
id: ID!
name: String!
}

type ProductionLine implements ProductionEntity {
id: ID!
name: String!
activity: [ProductionActivity!]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should follow the same connection spec we use for other list fields

}

interface ProductionRecord {
id: ID!
chainId: ID!
parent: ProductionEntity!
timeline: Timeline!
duration: Int
note: String
}

type Timeline {
start: Timestamp!
end: Timestamp
}

type Timestamp {
value: Temporal!
overriddenFrom: Temporal
by: Worker
}

type Production implements ProductionRecord {
id: ID!
chainId: ID!
parent: ProductionEntity!
timeline: Timeline!
duration: Int
note: String
output: Int
}

type Downtime implements ProductionRecord {
id: ID!
chainId: ID!
parent: ProductionEntity!
timeline: Timeline!
duration: Int
note: String
type: DowntimeType
}

union ProductionActivity = Production | Downtime

enum DowntimeType {
PLANNED
UNPLANNED
}
4 changes: 4 additions & 0 deletions schema/application/resolvers/Downtime.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import type { DowntimeResolvers } from "./../../__generated__/types.generated";
export const Downtime: DowntimeResolvers = {
/* Implement Downtime resolver logic here */
};
4 changes: 4 additions & 0 deletions schema/application/resolvers/Production.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import type { ProductionResolvers } from "./../../__generated__/types.generated";
export const Production: ProductionResolvers = {
/* Implement Production resolver logic here */
};
4 changes: 4 additions & 0 deletions schema/application/resolvers/ProductionEntity.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import type { ProductionEntityResolvers } from "./../../__generated__/types.generated";
export const ProductionEntity: ProductionEntityResolvers = {
/* Implement ProductionEntity resolver logic here */
};
4 changes: 4 additions & 0 deletions schema/application/resolvers/ProductionLine.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import type { ProductionLineResolvers } from "./../../__generated__/types.generated";
export const ProductionLine: ProductionLineResolvers = {
/* Implement ProductionLine resolver logic here */
};
4 changes: 4 additions & 0 deletions schema/application/resolvers/ProductionRecord.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import type { ProductionRecordResolvers } from "./../../__generated__/types.generated";
export const ProductionRecord: ProductionRecordResolvers = {
/* Implement ProductionRecord resolver logic here */
};
4 changes: 4 additions & 0 deletions schema/application/resolvers/Timeline.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import type { TimelineResolvers } from "./../../__generated__/types.generated";
export const Timeline: TimelineResolvers = {
/* Implement Timeline resolver logic here */
};
4 changes: 4 additions & 0 deletions schema/application/resolvers/Timestamp.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import type { TimestampResolvers } from "./../../__generated__/types.generated";
export const Timestamp: TimestampResolvers = {
/* Implement Timestamp resolver logic here */
};