models

package
v0.0.0-...-f046a2d Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DB *gorm.DB
View Source
var DestinationDB *gorm.DB
View Source
var SourceDB *gorm.DB

Functions

func ConnectToDatabase

func ConnectToDatabase()

func ConnectToDestinationDatabase

func ConnectToDestinationDatabase()

func ConnectToSourceDatabase

func ConnectToSourceDatabase()

func ExportData

func ExportData(c *gin.Context)

func Migration

func Migration(c *gin.Context)

func TransferData

func TransferData(c *gin.Context)

Types

type Credits

type Credits struct {
	ID           string `json:"id" gorm:"primary_key"`
	Product      string `json:"product"`
	CapitalPrice int    `json:"capital_price"`
	SellingPrice int    `json:"selling_price"`
	Cicilan      int    `json:"cicilan"`
	Periode      string `json:"periode"`
	PayEvery     string `json:"pay_every"`

	// foreign key
	IDCustomer string    `json:"id_customer"`
	Customer   Customers `json:"customer" gorm:"references:IDCustomer"`
	IDUser     string    `json:"id_user"`
	User       Users     `json:"user" gorm:"references:IDUser"`

	// status
	CreatedAt time.Time `json:"created_at"`
	IsDeleted bool      `json:"is_deleted"`
}

type Customers

type Customers struct {
	ID              string `json:"id" gorm:"primary_key"`
	Name            string `json:"name"`
	Phone           string `json:"phone"`
	Address         string `json:"address"`
	RemainingCredit int    `json:"remaining_credit"`
	Note            string `json:"note"`

	// foreign key
	IDUser string `json:"id_user"`
	User   Users  `json:"user" gorm:"references:IDUser"`

	// status
	CreatedAt time.Time `json:"created_at"`
	IsDeleted bool      `json:"is_deleted"`
}

type OtherTransaction

type OtherTransaction struct {
	ID          string `json:"id" gorm:"primary_key"`
	Transaction string `json:"transaction"`
	Amount      int    `json:"amount"`
	IsDebit     string `json:"is_debit"`

	// status
	CreatedAt time.Time `json:"created_at"`
	IsDeleted bool      `json:"is_deleted"`
}

type Payments

type Payments struct {
	ID string `json:"id" gorm:"primary_key"`

	// foreign key
	IDCredit string  `json:"id_credit"`
	Credit   Credits `json:"credits" gorm:"references:IDCredits"`

	// status
	CreatedAt time.Time `json:"created_at"`
	IsDeleted bool      `json:"is_deleted"`
}

type Profiles

type Profiles struct {
	ID   string `json:"id" gorm:"primary_key"`
	Name string `json:"name"`

	// foreign key
	IDUser string `json:"id_user"`
	User   Users  `json:"user" gorm:"references:IDUser"`

	// status
	CreatedAt time.Time `json:"created_at"`
	IsDeleted bool      `json:"is_deleted"`
}

type Tokens

type Tokens struct {
	ID    string `json:"id" gorm:"primary_key"`
	Token int    `json:"token"`
}

type Users

type Users struct {
	ID       string `json:"id" gorm:"primary_key"`
	Phone    string `json:"phone"`
	Password string `json:"password"`
	Role     string `json:"role"`
	IsActive bool   `json:"is_active"`
}

type Wallets

type Wallets struct {
	ID     string `json:"id" gorm:"primary_key"`
	Amount int    `json:"amount"`

	// foreign key
	IDUser string `json:"id_user"`
	User   Users  `json:"user" gorm:"references:IDUser"`
}

Jump to

Keyboard shortcuts

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