diff --git a/.env.example b/.env.example index d4f19a8..b9f5260 100644 --- a/.env.example +++ b/.env.example @@ -6,6 +6,7 @@ DB_PORT= APP_PORT= GRACEFULL_TIMEOUT= +SALT_SECURITY= REDIS_HOST= REDIS_USERNAME= diff --git a/README.md b/README.md index 2d40cfe..dccb153 100644 --- a/README.md +++ b/README.md @@ -97,9 +97,21 @@ DB_USER=your_db_user DB_PASSWORD=your_db_password DB_NAME=your_db_name DB_PORT=3306 # or 5432, depending on your DB type + +APP_PORT=3000 # example +GRACEFULL_TIMEOUT=10 #example +SALT_SECURITY=your_secret_security + Make sure to replace the values with your actual database details. ``` +## Migrate the Database Using `make migrate` + +Before running your application, let's setup your database first. +```bash +make migrate +``` + ## Build the Binary Using `make build` Run the following command to build your project. The binary will be placed in the `bin` folder. diff --git a/cmd/gorm/main.go b/cmd/gorm/main.go index d1387de..9286110 100644 --- a/cmd/gorm/main.go +++ b/cmd/gorm/main.go @@ -28,6 +28,7 @@ func main() { var temp subscribeplandomain.SubscribePlan if err := db.Where("code = ?", "basic").First(&temp).Error; err != nil { + log.Print("seeding basic subscribe plan") db.Create(&subscribeplandomain.SubscribePlan{ ID: uuid.NewString(), Code: "basic", diff --git a/internal/domain/auth/register.go b/internal/domain/auth/register.go index fb04006..ccb26d1 100644 --- a/internal/domain/auth/register.go +++ b/internal/domain/auth/register.go @@ -18,10 +18,12 @@ type User struct { type RegisterStaffReq struct { Email string `json:"email" validate:"required"` Password string `json:"password" validate:"required"` + Username string `json:"username" validate:"required"` } type Staff struct { ID string `json:"id"` - Email string `json:"email" validate:"required"` - Password string `json:"password" validate:"required"` + Email string `json:"email"` + Password string `json:"password"` + Username string `json:"username"` } diff --git a/openapi.yml b/openapi.yml index c410cf8..b0656b2 100644 --- a/openapi.yml +++ b/openapi.yml @@ -71,9 +71,12 @@ paths: format: email password: type: string + username: + type: string required: - email - password + - username responses: "201": description: Staff member created @@ -191,8 +194,6 @@ paths: required: - email - password - - subscribe_plan_id - - phone responses: "201": description: User created