-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* proposal: Add list staffs API Signed-off-by: Prnyself <[email protected]> * assign dmp number Signed-off-by: Prnyself <[email protected]>
- Loading branch information
Showing
1 changed file
with
56 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |