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

Commit

Permalink
feat: sync registration fields and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tonklaw committed Jul 6, 2023
1 parent 1a1cbe8 commit fee50f3
Show file tree
Hide file tree
Showing 6 changed files with 273 additions and 164 deletions.
8 changes: 8 additions & 0 deletions database/seeds/1655751437484-user.seed.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package seed

import (
"math/rand"
"strconv"
"time"

Expand All @@ -26,6 +27,9 @@ func (s Seed) UserSeed1655751437484() error {
FoodRestriction: faker.Word(),
AllergyMedicine: faker.Word(),
Disease: faker.Word(),
EmerPhone: faker.Phonenumber(),
EmerRelation: faker.Word(),
WantBottle: getBool(),
}
err := s.db.Create(&usr).Error

Expand All @@ -47,3 +51,7 @@ func getTitle() string {
title := faker.Word()
return title[0:min(10, len(title))]
}

func getBool() bool {
return rand.Intn(2) == 0
}
3 changes: 3 additions & 0 deletions internal/entity/user/user.model.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ type User struct {
FoodRestriction string `json:"food_restriction" gorm:"type:text"`
AllergyMedicine string `json:"allergy_medicine" gorm:"type:text"`
Disease string `json:"disease" gorm:"type:text"`
EmerPhone string `json:"emer_phone" gorm:"type:text"`
EmerRelation string `json:"emer_relation" gorm:"type:text"`
WantBottle bool `json:"wants_bottle" gorm:"type:boolean"`
CanSelectBaan *bool `json:"can_select_baan"`
IsVerify *bool `json:"is_verify"`
IsGotTicket *bool `json:"is_got_ticket"`
Expand Down
Loading

0 comments on commit fee50f3

Please sign in to comment.