Skip to content

Commit

Permalink
DMP-71: Add list staffs API (#71)
Browse files Browse the repository at this point in the history
* proposal: Add list staffs API

Signed-off-by: Prnyself <[email protected]>

* assign dmp number

Signed-off-by: Prnyself <[email protected]>
  • Loading branch information
Prnyself authored Jun 10, 2021
1 parent 569906d commit 41f7406
Showing 1 changed file with 56 additions and 0 deletions.
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.

0 comments on commit 41f7406

Please sign in to comment.