https://github.com/aasumitro/posbe
:rocket: WIP: Example Point of Sales
https://github.com/aasumitro/posbe
point-of-sales
Last synced: 3 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 (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-04-16T23:10:30.000Z (3 months ago)
- Last Synced: 2025-04-21T18:52:07.343Z (3 months ago)
- Topics: point-of-sales
- Language: Go
- Homepage:
- Size: 1010 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 7
-
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).
https://copperchips.com/understanding-resolving-problem-dual-api-calling-reactjs/
https://refine.dev/docs/guides-concepts/data-fetching/#updating-data