entity

package
v0.0.0-...-91fc04f Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Report

type Report struct {
	ServiceID uuid.UUID
	Total     int
}

func (*Report) ToString

func (r *Report) ToString() []string

type Reservation

type Reservation struct {
	gorm.Model
	ID        uuid.UUID `gorm:"type:uuid;primaryKey;unique;index;default:gen_random_uuid()"`
	Amount    uint      `gorm:"type:integer;not null"`
	UserID    uuid.UUID `gorm:"type:uuid;not null"`
	OrderID   uuid.UUID `gorm:"type:uuid;not null;unique"`
	ServiceID uuid.UUID `gorm:"type:uuid;not null"`
	CreatedAt time.Time `gorm:"default:now();not null"`
	UpdatedAt time.Time
	DeletedAt gorm.DeletedAt
}

func (*Reservation) ToReservationRead

func (r *Reservation) ToReservationRead() *dto.ReservationRead

type Transaction

type Transaction struct {
	gorm.Model
	ID        uuid.UUID  `gorm:"type:uuid;primaryKey;unique;index;default:gen_random_uuid()"`
	Type      string     `gorm:"type:transaction_type;not null"`
	Status    string     `gorm:"type:transaction_status;not null"`
	Amount    uint       `gorm:"type:integer;not null"`
	UserID    uuid.UUID  `gorm:"type:uuid;not null"`
	OrderID   *uuid.UUID `gorm:"type:uuid;default:null;unique"`
	ServiceID *uuid.UUID `gorm:"type:uuid;default:null"`
	CreatedAt time.Time  `gorm:"default:now();not null"`
	UpdatedAt time.Time
	DeletedAt gorm.DeletedAt
}

func (*Transaction) ToTransactionRead

func (t *Transaction) ToTransactionRead() *dto.TransactionRead

type User

type User struct {
	gorm.Model
	ID        uuid.UUID `gorm:"type:uuid;primaryKey;unique;index;default:gen_random_uuid()"`
	Balance   uint      `gorm:"type:integer;default:0;not null"`
	CreatedAt time.Time `gorm:"default:now();not null"`
	UpdatedAt time.Time
	DeletedAt gorm.DeletedAt
}

func (*User) ToUserRead

func (u *User) ToUserRead() *dto.UserRead

Jump to

Keyboard shortcuts

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