domain

package
v0.0.0-...-56ff5f7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 29, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CategoryKunjungan

type CategoryKunjungan struct {
	gorm.Model
	Name        string `json:"name" form:"name"`
	Description string `json:"description" form:"description"`
}

type Kunjungan

type Kunjungan struct {
	gorm.Model
	UserID     uint              `json:"user_id" form:"user_id" validate:"required"`
	Doctor     string            `json:"doctor" from:"doctor" validate:"required"`
	Type       uint              `json:"type" form:"type"`
	PenyakitID []uint            `json:"penyakit_id" form:"penyakit_id" validate:"required"`
	User       User              `json:"user" gorm:"foreignKey:UserID;references:ID"`
	Penyakit   []Penyakit        `json:"penyakit" gorm:"foreignKey:PenyakitID;references:ID"`
	Category   CategoryKunjungan `json:"category" form:"category" gorm:"foreignKey:Type;references:ID"`
}

type Obat

type Obat struct {
	gorm.Model
	Name         string     `json:"name" form:"name"`
	Description  string     `json:"description" form:"description"`
	Price        int32      `json:"price" form:"price"`
	QtyOn        uint8      `json:"qty_on" form:"qty_on"`
	QtyAvailable uint8      `json:"qty_available" form:"qty_available"`
	QtyReserved  uint8      `json:"qty_reversed" form:"qty_reversed"`
	Composition  string     `json:"composition"`
	Penyakit     []Penyakit `json:"penyakit" form:"penyakit" gorm:"many2many:list_penyakit"`
}

type Penyakit

type Penyakit struct {
	gorm.Model
	Name        string `json:"name" form:"name"`
	Description string `json:"desc" form:"desc"`
	ObatID      []uint `json:"obat_id" form:"obat_id"`
	Obat        []Obat `json:"obat" form:"obat" gorm:"foreignKey:ObatID;reference:ID;many2many:resep"`
}

type Reported

type Reported struct {
	ID         primitive.ObjectID `json:"_id,omitempty" bson:"_id,omitempty"`
	Pengunjung string             `json:"pengunjung" bson:"pengunjung"`
	Category   string             `json:"category" form:"category"`
	Age        int                `json:"age" bson:"age"`
	Address    string             `json:"address" bson:"address"`
	CreateAt   time.Time          `json:"create_at" bson:"create_at"`
	UpdateAt   time.Time          `json:"update_at" bson:"update_at"`
}

type Role

type Role struct {
	gorm.Model
	Name         string `json:"name"`
	Descriptions string `json:"desc"`
}

type User

type User struct {
	gorm.Model
	FName    string    `json:"fname" form:"fname"`
	LName    string    `json:"lname" form:"lname"`
	Email    string    `json:"email" form:"email"`
	TTL      time.Time `json:"ttl" form:"ttl"`
	Password string    `json:"password" form:"password"`
	Address  string    `json:"address" form:"address"`
	Age      int       `json:"age" form:"age"`
	RoleID   uint      `json:"role_id" form:"role_id"`
	Role     Role      `json:"role" form:"role" gorm:"foreignKey:RoleID;references:ID"`
}

type UserLogin

type UserLogin struct {
	FName    string `json:"fname" form:"fname"`
	LName    string `json:"lname" form:"lname"`
	Email    string `json:"email" form:"email" validate:"required,email"`
	Password string `json:"password" form:"password" validate:"required"`
}

type UserRegister

type UserRegister struct {
	FName    string    `json:"fname" form:"fname" validate:"required"`
	LName    string    `json:"lname" form:"lname" validate:"required"`
	Email    string    `json:"email" form:"email" validate:"required,email"`
	TTL      time.Time `json:"ttl" form:"ttl" validate:"required"`
	Age      int       `json:"age" form:"age" validate:"required"`
	Password string    `json:"password" form:"password" validate:"required,min=8"`
	Address  string    `json:"address" form:"address" validate:"required"`
	RoleID   uint      `json:"role_id" form:"role_id" validate:"required"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL