-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
182 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,55 @@ | ||
# Contributing to Dundie Project | ||
|
||
Summary of project | ||
|
||
## Guidelines | ||
|
||
- Backwards compatibility. | ||
- Multiplatform. | ||
- Python 3 only. | ||
|
||
## Code of Conduct | ||
|
||
- Be gentle. | ||
|
||
## How to contribute | ||
|
||
### Fork repository | ||
|
||
- Click fork buttom on [github repository](https://github.com/vmagueta/dundie-rewards) | ||
|
||
### Clone to local dev environment | ||
|
||
```bash | ||
git clone https://github.com/vmagueta/dundie-rewards | ||
... | ||
``` | ||
|
||
### Prepare virtual env | ||
|
||
```bash | ||
cd dundie-rewards | ||
make virtualenv | ||
make install | ||
``` | ||
|
||
### Coding style | ||
|
||
- This projects follows PEP8. | ||
|
||
### Run tests | ||
|
||
```bash | ||
make test | ||
# or | ||
make watch | ||
``` | ||
|
||
### Commit rules | ||
|
||
- We follow conventional commit messages. ex: `[bugfix] reason #issue` | ||
- We required signed commits. | ||
|
||
### Pull Request Rulls | ||
|
||
- We required all tests to be passing. |
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,16 @@ | ||
# How to install | ||
|
||
## Official installation | ||
|
||
```py | ||
pip install dundie | ||
``` | ||
|
||
|
||
## Install from source | ||
|
||
```bash | ||
git clone https://github.com/vmagueta/dundie-rewards | ||
cd dundie-rewards | ||
make install | ||
``` |
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,68 @@ | ||
# How to use | ||
|
||
|
||
## Load data | ||
|
||
Having a file `people.csv` with the following format: | ||
|
||
```csv | ||
Jim Halpert, Sales, Salesman, [email protected] | ||
Dwight Schrute, Sales, Manager, [email protected] | ||
Gabe Lewis, Director, Manager, [email protected] | ||
``` | ||
|
||
Run `dundie load` command | ||
|
||
```py | ||
dundie load people.csv | ||
``` | ||
|
||
## Viewing data | ||
|
||
### Viewing all information | ||
|
||
```bash | ||
$ dundie show | ||
Report | ||
┏━━━━━━━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━━━━━━━━┳━━━━━━━━━┳━━━━━━━━━━━━━━━━━┓ | ||
┃ name ┃ dept ┃ role ┃ email ┃ balance ┃ last_movement ┃ | ||
┡━━━━━━━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━━━━━━━━╇━━━━━━━━━╇━━━━━━━━━━━━━━━━━┩ | ||
│ Jim Halpert │ Sales │ Salesman │ jim@dundlermif… │ 3000 │ 2022-03-15T13:… │ | ||
│ Dwight Schrute │ Sales │ Manager │ schrute@dundle… │ 2400 │ 2022-03-15T13:… │ | ||
│ Gabe Lewis │ Director │ Manager │ glewis@dundler… │ 500 │ 2022-03-15T13:… │ | ||
└────────────────┴──────────┴──────────┴─────────────────┴─────────┴─────────────────┘ | ||
``` | ||
|
||
### Filtering | ||
|
||
Available filters are `--dept` and `--email` | ||
|
||
```bash | ||
dundie show --dept=Sales | ||
Report | ||
┏━━━━━━━━━━━━━━━━┳━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━┳━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━┓ | ||
┃ name ┃ dept ┃ role ┃ email ┃ balance ┃ last_movement ┃ | ||
┡━━━━━━━━━━━━━━━━╇━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━╇━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━┩ | ||
│ Jim Halpert │ Sales │ Salesman │ jim@dundlermiff… │ 3000 │ 2022-03-15T13:44… │ | ||
│ Dwight Schrute │ Sales │ Manager │ schrute@dundler… │ 2400 │ 2022-03-15T13:43… │ | ||
└────────────────┴───────┴──────────┴──────────────────┴─────────┴───────────────────┘ | ||
``` | ||
|
||
> **NOTE** passing `--output=file.json` will save a json file with the results. | ||
## Adding points | ||
|
||
An admin user can easily add points to any user or dept. | ||
|
||
```bash | ||
dundie add 100 [email protected] | ||
Report | ||
┏━━━━━━━━━━━━━┳━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━┓ | ||
┃ name ┃ dept ┃ role ┃ email ┃ balance ┃ last_movement ┃ | ||
┡━━━━━━━━━━━━━╇━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━┩ | ||
│ Jim Halpert │ Sales │ Salesman │ jim@dundlermiffli… │ 3100 │ 2022-03-15T17:14:… │ | ||
└─────────────┴───────┴──────────┴────────────────────┴─────────┴────────────────────┘ | ||
|
||
``` | ||
|
||
Available selectors are `--email` and `--dept` |
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 |
---|---|---|
@@ -1 +1,4 @@ | ||
# Documentation for dundie | ||
|
||
This project offers `dundie` CLI to manage | ||
Dunder Mifflin Reward Points. |
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,33 @@ | ||
# Future plans | ||
|
||
Some features are not ready yet but on the roadmap for next version. | ||
|
||
[Issues](https://github.com/vmagueta/dundie-rewards/issues) | ||
|
||
## Commands | ||
|
||
- `load` | ||
- `show` | ||
- `add` | ||
- `transfer` | ||
- `history` | ||
|
||
## Password protection | ||
|
||
All the commands will require e-mail and password, and then will | ||
check on the `users` table to validate the authentication. | ||
|
||
## Role Based Access Control | ||
|
||
Users that has `admin` = `True` on the `users` table will be able to | ||
run the commands: `load`, `add` for other users access is denied. | ||
|
||
The `show` command will allow filtering by `dept` and `email` for admins | ||
but for other users will default to `--email=user_email` so the user | ||
can see only his own report. | ||
|
||
The `transfer` command will allow user to send points from his own account | ||
to any other and will be password protected. | ||
|
||
The `history` command allow user to see his own movements, admin users can | ||
pass `--email=` and see anyone else movements. |
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,3 @@ | ||
site_name: Dundie Rewards CLI | ||
theme: | ||
name: readthedocs |
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