models

package
v0.0.0-...-4035bb8 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2024 License: MIT Imports: 4 Imported by: 2

Documentation

Index

Constants

View Source
const (
	SortAscending  = `asc`
	SortDescending = `desc`
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Amount

type Amount struct {
	Value     float64 `json:"value"`
	Rupiah    string  `json:"rupiah"`
	Terbilang string  `json:"terbilang"`
}

type Asset

type Asset struct {
	Url  string `bson:"url" json:"url"`
	Name string `bson:"name" json:"name"`
}

type Audit

type Audit struct {
	Id          string    `bson:"_id,omitempty" json:"id"`
	CreatedBy   *User     `bson:"created_by,omitempty" json:"created_by"`
	CreatedDate time.Time `bson:"created_date,omitempty" json:"created_date"`
	UpdatedBy   *User     `bson:"updated_by,omitempty" json:"updated_by"`
	UpdatedDate time.Time `bson:"updated_date,omitempty" json:"updated_date"`
	Version     uint64    `bson:"version,omitempty" json:"version"`
	Delete      bool      `bson:"delete" json:"delete"`
}

type Client

type Client struct {
	Id         string `bson:"id" json:"id"`
	Name       string `bson:"name" json:"name"`
	ClientIp   string `bson:"client_ip" json:"client_ip"`
	ClientCode string `bson:"client_code" json:"client_code"`
}

type Coordinate

type Coordinate struct {
	Latitude  float64 `bson:"latitude" json:"latitude" form:"latitude" binding:"required"`
	Longitude float64 `bson:"longitude" json:"longitude" form:"longitude" binding:"required"`
}

func (Coordinate) ToCoordinates

func (c Coordinate) ToCoordinates() []float64

func (Coordinate) ToReversedString

func (c Coordinate) ToReversedString() string

func (Coordinate) ToString

func (c Coordinate) ToString() string

type Distance

type Distance struct {
	Meters     int     `json:"meters,omitempty" bson:"meters"`
	Kilometers float64 `json:"kilometers,omitempty" bson:"kilometers"`
}

type Duration

type Duration struct {
	Seconds float64 `json:"seconds" bson:"seconds"`
	Minutes float64 `json:"minutes" bson:"minutes"`
	Hours   float64 `json:"hours" bson:"hours"`
}

type Filter

type Filter struct {
	Sort []Sort
	Page int64
	Size int64
}

type Paging

type Paging struct {
	Page        int64  `json:"page,default=1" form:"page,default=1"`
	ItemPerPage int64  `json:"item_per_page,default=10" form:"item_per_page,default=10"`
	SortBy      string `json:"sort_by" form:"sort_by"`
}

func (Paging) BuildSortField

func (p Paging) BuildSortField() (sorts []Sort)

func (Paging) ToFilter

func (p Paging) ToFilter() Filter

type PagingResponse

type PagingResponse struct {
	Page        int64 `json:"page"`
	TotalPage   int64 `json:"total_page"`
	ItemPerPage int64 `json:"item_per_page"`
	TotalItem   int64 `json:"total_item"`
}

type Sort

type Sort struct {
	FieldName string
	By        string
}

func (Sort) BuildSortBy

func (s Sort) BuildSortBy() int

type TagAmount

type TagAmount struct {
	Tag    string `json:"tag"`
	Amount Amount `json:"amount"`
}

type TransactionRequest

type TransactionRequest struct {
	CustomerReferenceNumber string                `json:"customer_reference_number" form:"customer_reference_number" binding:"required"`
	ClientDateTime          dateProperty.DateTime `json:"client_date_time" form:"client_date_time" binding:"required"`
}

type User

type User struct {
	Identity string `bson:"identity,omitempty" json:"identity,omitempty"`
	Username string `bson:"username,omitempty" json:"username,omitempty"`
	FullName string `bson:"full_name,omitempty" json:"full_name,omitempty"`
}

func (User) ToUserResponse

func (u User) ToUserResponse() UserResponse

type UserRequest

type UserRequest struct {
	Identity string `bson:"identity,omitempty" json:"identity,omitempty"`
	Username string `bson:"username,omitempty" json:"username,omitempty"`
	FullName string `bson:"full_name,omitempty" json:"full_name,omitempty"`
}

func (UserRequest) ToUser

func (u UserRequest) ToUser() User

type UserResponse

type UserResponse struct {
	Identity string `bson:"identity,omitempty" json:"identity,omitempty"`
	Username string `bson:"username,omitempty" json:"username,omitempty"`
	FullName string `bson:"full_name,omitempty" json:"full_name,omitempty"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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