Skip to content

Commit 17946ac

Browse files
committed
chore(types): add common types
1 parent a506c12 commit 17946ac

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

types/types.go

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package types
2+
3+
type User struct {
4+
ID int `json: "id"`
5+
FirstName string `json: "firstName"`
6+
LastName string `json: "lastName"`
7+
Email string `json: "email"`
8+
Password string `json: "password"`
9+
CreatedAt string `json: "createdAt"`
10+
}
11+
12+
type UserStore interface {
13+
FindByEmail(email string) (*User, error)
14+
FindById(id int) (*User, error)
15+
Create(User) error
16+
}
17+
18+
type RegisterUserPayload struct {
19+
FirstName string `json: "firstName" validate: "required"`
20+
LastName string `json: "lastName" validate: "required"`
21+
Email string `json: "email" validate: "required"`
22+
Password string `json: "password" validate: "required,min=3,max=130"`
23+
}

0 commit comments

Comments
 (0)