Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/aasumitro/posbe
:rocket: WIP: Example Point of Sales
https://github.com/aasumitro/posbe
point-of-sales
Last synced: 2 months ago
JSON representation
:rocket: WIP: Example Point of Sales
- Host: GitHub
- URL: https://github.com/aasumitro/posbe
- Owner: aasumitro
- License: other
- Created: 2022-11-22T13:36:42.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-08-23T05:57:23.000Z (5 months ago)
- Last Synced: 2024-08-23T06:53:20.347Z (5 months ago)
- Topics: point-of-sales
- Language: Go
- Homepage:
- Size: 438 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Point of Sales
### Authentication
The important part here is in the Login function where we set that sacred JWT Token in a Cookie.
so wee dont need Bearer token in our authorization header.
### Create Mocks
#### Required tools:
- [Mockery](https://github.com/vektra/mockery)#### How to use
```bash
mockery
--dir=internal/account/repository/mysql
--name=RoleSqlRepository
--filename=role_sql_repository.go
--output=domain/mocks --outpkg=mocks
```more info read the [docs](https://pkg.go.dev/github.com/stretchr/testify/mock).
### Database Migration
#### Required tools:
- [Golang Migrate](https://github.com/golang-migrate/migrate)#### How to use
- Add new migration
```bash
migrate create -ext sql -dir db/migrations example_table
```
- Run Migration`POSTGRESQL_URL: 'postgresql://postgres:@localhost:5432/posbe?sslmode=disable'`
- set version (dirty state) (version: -1 before last migrate)
```bash
migrate -database ${PG_DSN} -path db/migrations force ${VERSION}
```
- up
```bash
migrate -database ${PG_DSN} -path db/migrations up
```
- down
```bash
migrate -database ${PG_DSN} -path db/migrations down
```
more info read the [docs](https://pkg.go.dev/github.com/golang-migrate/migrate/v4).