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

DMP-71: Add list staffs API #71

Merged
merged 4 commits into from
Jun 10, 2021
Merged
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
56 changes: 56 additions & 0 deletions docs/specs/71-add-list-staffs-api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
---
author: Prnyself <https://github.com/Prnyself>
status: draft
updated_at: 2021-05-19
---

# DMP-71: Add list staffs API

## Background

When creating a task, we should choose on which staff the task run. For now, we have already inserted staffID into DB,
so we should support an `listStaffs` API for frontend to list all available staffs.

## Propose

So, I propose to design the list staff API to be called by the front-end, whose definition is as follows:

```graphql
type Query {
staffs: [Staff!]!
}

type Staff {
id: String!
}
```

For now, we only record staff ID, and more information will be added in the future.

In this way, when `createTask` is called, the `staffID` could be filled by the result of `listStaffs`.

## Rationale

The `createTask` input is defined as follows:

```graphql
input CreateTask {
name: String!
type: TaskType!
storages: [StorageInput!]!
options: [PairInput!]!
staffs: [StaffInput!]!
}

input StaffInput {
id: String!
}
```

## Compatibility

None

## Implementation

Most of the work would be done by the author of this proposal.