model

package
v0.0.0-...-fb81480 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2024 License: MIT Imports: 0 Imported by: 0

Documentation

Overview

Package model defines the data structures used for parsing and handling JSON input and output, including user data, wallet operations, and other domain-specific entities.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Currency

type Currency struct {
	// USD is the exchange rate for USD.
	USD float64 `db:"usd" json:"USD"`

	// RUB is the exchange rate for RUB.
	RUB float64 `db:"rub" json:"RUB"`

	// EUR is the exchange rate for EUR.
	EUR float64 `db:"eur" json:"EUR"`
}

Currency represents the current exchange rates for different currencies.

type Exchange

type Exchange struct {
	// UserId is the identifier of the user initiating the exchange.
	UserId int

	// FromCurrency is the currency that the user is exchanging from (e.g., USD).
	FromCurrency string `json:"from_currency" binding:"required"`

	// ToCurrency is the currency that the user is exchanging to (e.g., EUR).
	ToCurrency string `json:"to_currency" binding:"required"`

	// Amount is the amount of money to be exchanged.
	Amount float64 `json:"amount" binding:"required"`
}

Exchange represents the data for a currency exchange transaction.

type LogUser

type LogUser struct {
	// Username is the user's login name.
	Username string `json:"username" binding:"required"`

	// Password is the user's password for authentication.
	Password string `json:"password" binding:"required"`
}

LogUser represents the login data for a user (typically used for authentication).

type Operation

type Operation struct {
	// UserId is the identifier of the user performing the operation.
	UserId int

	// Amount is the amount involved in the operation (e.g., the amount to be deposited or withdrawn).
	Amount float64 `json:"amount" binding:"required"`

	// Currency is the type of currency involved in the operation (e.g., USD, EUR).
	Currency string `json:"currency" binding:"required"`
}

Operation represents a financial transaction involving a user's wallet, such as a deposit or withdrawal.

type User

type User struct {
	// Id is the unique identifier of the user in the system.
	Id int

	// Username is the user's chosen name for logging in.
	Username string `json:"username" binding:"required"`

	// Password is the user's encrypted password for secure authentication.
	Password string `json:"password" binding:"required"`

	// Email is the user's email address.
	Email string `json:"email" binding:"required"`
}

User represents a user in the system, including their personal information and credentials.

Jump to

Keyboard shortcuts

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