Greenstand / Greenstand/treetracker-query-api

Extend the BaseRepository to support: add

Open
#23 0 comments 0 reactions 0 assignees View on GitHub
good first issue Node.js postgresql
Dominant language
TypeScript
Stars
18
Forks
65
PR merge metrics
No merged PRs in 30d

Description

The function is for creating a new entity in the database.

The function signature should like:

```
add(object: T>: T
```

So the subclass can do:

```
TokenRepository.add(token)
```

Possible edge cases:

* Unexpected property: id. (422 HTTP code with error message)
* Maybe there are some cases that database will throw error like, foreign key violation, we should translate this type of exception to : (500, database exception)

---

Some hints:

- Please read our readme for more information/guide/tutorial.
- Here is [an engineering book](https://greenstand.gitbook.io/engineering/) in Greenstand.
- To know more about our organization, visit our [website](https://greenstand.org).
- If you want to join the slack community (some resources need the community member's permission), please leave your email address.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.