model

package
v0.0.0-...-4c15c94 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RoleActionRead   = "READ"
	RoleActionWrite  = "WRITE"
	RoleActionUpdate = "UPDATE"
	RoleActionDelete = "DELETE"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Document

type Document struct {
	gorm.Model
	Xid         string
	User        *User
	UserID      uint
	LoanID      uint
	Loan        *Loan
	Type        string
	Description string
	Url         string
	Status      DocumentStatus
	Note        string
}

func (*Document) BeforeCreate

func (d *Document) BeforeCreate(tx *gorm.DB) error

type DocumentStatus

type DocumentStatus string
const (
	DocumentStatusPendingReview DocumentStatus = "PENDING_REVIEW"
	DocumentStatusDeclined      DocumentStatus = "DECLINED"
	DocumentStatusApproved      DocumentStatus = "APPROVED"
)

type DocumentType

type DocumentType string
const (
	DocumentTypeOwnAsset                DocumentType = "OWN_ASSET"
	DocumentTypeSignatureAcknowledgment DocumentType = "SIGNATURE_ACKNOWLEDGMENT"
	DocumentTypeTwoGuarantees           DocumentType = "TWO_GUARANTEES"
	DocumentTypeLastInvoice             DocumentType = "LAST_INVOICE"
)

type Loan

type Loan struct {
	gorm.Model
	Xid               string
	Amount            int
	TotalInstallments int
	RequirementType   string
	Status            LoanStatus
	Observation       string
	User              *User
	UserID            uint
	Rate              float64
	TotalGuarantees   uint
	TotalCoBorrowers  uint
}

func (*Loan) BeforeCreate

func (u *Loan) BeforeCreate(tx *gorm.DB) error

type LoanStatus

type LoanStatus string
const (
	LoanStatusRegister            LoanStatus = "REGISTERED"
	LoanStatusPendingRequirements LoanStatus = "PENDING_REQUIREMENTS"
	LoanStatusPendingPreApproved  LoanStatus = "PENDING_PRE_APPROVED"
	LoanStatusPendingRejected     LoanStatus = "REJECTED"
	LoanStatusHasObservation      LoanStatus = "HAS_OBSERVATION"
	LoanStatusClientSigned        LoanStatus = "CLIENT_SIGNED"
	LoanStatusPreApproved         LoanStatus = "PRE_APPROVED"
	LoanStatusApproved            LoanStatus = "APPROVED"
	LoanStatusRunning             LoanStatus = "RUNNING"
)

type LoanType

type LoanType struct {
	gorm.Model
	Xid            string
	Name           string
	Rate           string
	MaxInstallment int
	MinInstallment int
}

func (*LoanType) BeforeCreate

func (u *LoanType) BeforeCreate(tx *gorm.DB) error

type Requirement

type Requirement struct {
	RequirementType RequirementType `json:"requirementType"`
	Title           string          `json:"title"`
	Description     string          `json:"description"`
	Status          bool            `json:"status"`
	DocumentStatus  DocumentStatus  `gorm:"-"`
}

type RequirementType

type RequirementType string
const (
	RequirementTypeClientDocumentPhotoFront RequirementType = "CLIENT_DOCUMENT_PHOTO_FRONT"
	RequirementTypeClientDocumentPhotoBack  RequirementType = "CLIENT_DOCUMENT_PHOTO_BACK"
	RequirementTypeLastInvoicePhoto         RequirementType = "LAST_INVOICE_PHOTO"
	RequirementTypeGuaranteeDocumentPhoto   RequirementType = "GUARANTEE_DOCUMENT_PHOTO"
	RequirementTypeOwnAssetPhoto            RequirementType = "OWN_ASSET_PHOTO"
	RequirementTypeGuaranteeName            RequirementType = "GUARANTEE_NAME"
	RequirementTypeGuaranteeCI              RequirementType = "GUARANTEE_CI"
	RequirementTypeCoBorrowerName           RequirementType = "CO_BORROWER_NAME"
	RequirementTypeCoBorrowerCI             RequirementType = "CO_BORROWER_CI"
)

type RoleAction

type RoleAction string

type Session

type Session struct {
	gorm.Model
	Token  string
	UserID uint
}

type SessionOtpCode

type SessionOtpCode struct {
	gorm.Model
	User   *User
	UserID uint
	Code   string
}

type TimelineState

type TimelineState struct {
	ID          string
	Status      TimelineStatus `json:"status"`
	Label       string
	Title       string
	Description string
}

type TimelineStatus

type TimelineStatus string
const (
	TimelineStatusDone     TimelineStatus = "DONE"
	TimelineStatusPending  TimelineStatus = "PENDING"
	TimelineStatusRejected TimelineStatus = "REJECTED"
)

type User

type User struct {
	gorm.Model
	Xid              string
	Email            string
	Name             string
	Phone            string
	IdentifierNumber string
	Role             string
	Password         string
	Disable          bool
}

func (*User) BeforeCreate

func (u *User) BeforeCreate(tx *gorm.DB) error

Jump to

Keyboard shortcuts

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