Skip to content
This repository has been archived by the owner on Nov 7, 2019. It is now read-only.

Commit

Permalink
Merge pull request #4 from josecoelho96/dev/extra-commands
Browse files Browse the repository at this point in the history
Dev/extra commands
  • Loading branch information
josecoelho96 authored Sep 24, 2018
2 parents f4d305a + ef32ba7 commit f54fa52
Show file tree
Hide file tree
Showing 8 changed files with 1,864 additions and 10 deletions.
35 changes: 28 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,29 +29,50 @@ Used to list all details of a team. The `team-id` must be provided.
### View user details
`/detalhes-participante <@user|user-id>`
Used to list details of a participant. The `@user` or `user-id` must be provided.
### List last user transactions
`/meus-movimentos <qty>`
List user transactions. If the user has a team, list his last `qty` transactions. If the current user doesn't have a team, an error message appears stating how to join a team.
### Change user role/add to staff
`/alterar-permissoes <@user> <admin|staff|remover>`
Changes the permissions of `user`, adding it to the staff crew if it wasn't on it yet. If the `remover` option is selected, the user is removed from the staff team.
### List staff elements
`/ver-staff`
List all elements in staff, along with their role and their ID. Only accessible to staff elements.
### Hackerboy
```./hackerboy <money-change> <description>``` \
Can only be performed by admins. Used to change all teams balances, either to give them money or to remove it.
### Team Hackerboy
```./hackerboy-equipa <team-id> <money-change> <description>``` \
Can only be performed by admins. Used to change a team balance, either to give it money or to remove it.
### List given user transactions
`/transacoes-participante @user|user-id <qty>`
Lists the last `qty` transactions made/received by `@user`
### List given team transactions
`/transacoes-equipa <team-id> <qty>`
Lists the last `qty` transactions made/received by users in team with id `team-id`
### List all transactions
`/transacoes-todas <qty>`
Lists the last `qty` transactions made/received in the entire application.

## Current features:
- Request origin verification/validation
- Roles/Permissions

## To be added
```./bug <money-change> <description>``` \
Can only be performed by admins. Used to change all teams balances.

```./tornar-admin <@user>``` \
Can only be performed by admins. Used to make `@user` an admin.
## Commands to add
- TBD

## Features to add
- Auto add users to channels
- Report logs to channel
- Report money receival on buy operation
- Error codes
- Single user transactions listing

## Problems found
- How to create first admin.
- Implementation: Log levels aren't well defined.
- IDs are not being verified as unique.
- Users are only added to users table on join team commands, should be done always, but on every request will make this slow.
Possible solution: Create new comand?

## Bug list
- ...
Expand Down
9 changes: 9 additions & 0 deletions db/init/create.sql
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,13 @@ CREATE TABLE IF NOT EXISTS permissions (
created_at TIMESTAMP DEFAULT NOW(),
user_id UUID,
staff_function TEXT
)

CREATE TABLE IF NOT EXISTS rewards (
id SERIAL PRIMARY KEY,
created_at TIMESTAMP DEFAULT NOW(),
given_by UUID,
amount NUMERIC(10, 4),
destination TEXT,
description TEXT
)
Loading

0 comments on commit f54fa52

Please sign in to comment.