database

package
v0.0.0-...-391e2c1 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CollateralGurantee

type CollateralGurantee struct {
	Name  string
	Desc  string
	Value string
}

type Comunication

type Comunication struct {
	Name   string `json:"name"`
	Status bool   `json:"status"`
}

type Correction

type Correction struct {
	Name             string `json:"name"`
	Value            int    `json:"value"`
	CorrectionStatus string `json:"correctionStatus"`
}

type DB

type DB struct {
	*sqlx.DB
}

func New

func New(dsn string, automigrate bool) (*DB, error)

func (*DB) GetUser

func (db *DB) GetUser(id int) (*User, error)

func (*DB) GetUserByEmail

func (db *DB) GetUserByEmail(email string) (*User, error)

func (*DB) InsertDebtor

func (db *DB) InsertDebtor(fiscalDocument, name, email, typeOfDebtor, postalCode, city, uf, number, complement string) (string, error)

func (*DB) InsertUser

func (db *DB) InsertUser(email, hashedPassword string) (int, error)

func (*DB) UpdateUserHashedPassword

func (db *DB) UpdateUserHashedPassword(id int, hashedPassword string) error

type Debt

type Debt struct {
	Id             string               `json:"id"`
	Debtor         []Debtor             `json:"debtor"`
	Origin         string               `json:"origin"`
	DocumentID     string               `json:"documentId"`
	ExpirationDate time.Time            `json:"expirationDate"`
	OriginalValue  int                  `json:"originalValue"`
	Fee            Fee                  `json:"fee"`
	Interest       Interest             `json:"interest"`
	OtherCharges   []OtherCharges       `json:"otherCharges"`
	PresentValue   int                  `json:"presentValue"`
	Collateral     []CollateralGurantee `json:"collateral"`
	Correction     Correction           `json:"correction"`
}

type Debtor

type Debtor struct {
	Id             string `db:"id"`
	FiscalDocument string `db:"fiscal_document"`
	Name           string `db:"name"`
	Email          string `db:"email"`
	TypeOfDebtor   string `db:"type_of_debtor"`
	PostalCode     string `db:"postal_code"`
	City           string `db:"city"`
	Uf             string `db:"uf"`
	Street         string `db:"street"`
	Number         string `db:"number"`
	Complement     string `db:"complement"`
}

type Fee

type Fee struct {
	Name        string `json:"name"`
	ChargerType string `json:"chargerType"`
	Value       int    `json:"value"`
}

type Interest

type Interest struct {
	Name        string `json:"name"`
	ChargerType string `json:"chargerType"`
	Value       int    `json:"value"`
}

type OtherCharges

type OtherCharges struct {
	Name        string `json:"name"`
	ChargerType string `json:"chargerType"`
	Value       int    `json:"value"`
}

type Payments

type Payments struct {
	Name   string `json:"name"`
	Status bool   `json:"status"`
}

type Propose

type Propose struct {
	Id              string         `json:"id"`
	Debt            Debt           `json:"debt"`
	Date            time.Time      `json:"date"`
	Status          Status         `json:"status"`
	ProposeValue    int            `json:"proposeValue"`
	ExpirationDate  interface{}    `json:"expirationDate"`
	PaymentDeadline int            `json:"paymentDeadline"`
	Payments        []Payments     `json:"payments"`
	Comunication    []Comunication `json:"comunication"`
}

type Status

type Status struct {
	UpdatedAt time.Time `json:"updatedAt"`
	Situation string    `json:"situation"`
}

type User

type User struct {
	ID             int       `db:"id"`
	Created        time.Time `db:"created"`
	Email          string    `db:"email"`
	HashedPassword string    `db:"hashed_password"`
}

Jump to

Keyboard shortcuts

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