File size: 1,270 Bytes
3f70c4e
 
 
 
6596fcc
 
3f70c4e
 
 
6596fcc
 
 
 
 
 
 
3f70c4e
 
 
 
 
 
 
 
 
 
 
 
6596fcc
 
 
 
 
 
 
 
3f70c4e
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package models

import (
	"time"

	uuid "github.com/satori/go.uuid"
)

type Account struct {
	Id              uint      `gorm:"primaryKey" json:"id"`
	UUID            uuid.UUID `gorm:"type:uuid" json:"uuid" `
	Email           string    `gorm:"uniqueIndex" json:"email"`
	Password        string    `json:"password"`
	IsEmailVerified bool      `json:"is_email_verified"`
	CreatedAt       time.Time `json:"created_at"`
	DeletedAt       time.Time `json:"deleted_at"`
}

type AccountDetails struct {
	IDDetail    uint      `gorm:"primaryKey" json:"id_detail"`
	IDAccount   uint      `json:"id_account"`
	Province    string    `json:"province"`
	City        string    `json:"city"`
	Institution string    `json:"institution"`
	UpdatedAt   time.Time `json:"updated_at"`
	DeletedAt   time.Time `json:"deleted_at"`
}

type EmailVerification struct {
	Id        int       `gorm:"primaryKey" json:"id"`
	AccountId int       `json:"account_id"`
	UUID      uuid.UUID `gorm:"type:uuid" json:"uuid" `
	CreatedAt time.Time `json:"created_at"`
	ExpiredAt time.Time `json:"expired_at"`
}

// Gorm table name settings
func (Account) TableName() string        { return "account" }
func (AccountDetails) TableName() string { return "account_details" }