entities

package
v0.0.0-...-40743d7 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2018 License: MIT Imports: 3 Imported by: 1

Documentation

Index

Constants

View Source
const (
	ReminderMarkerStatePlanned   ReminderMarkerState = "planned"
	ReminderMarkerStateProcessed ReminderMarkerState = "processed"
	ReminderMarkerStateDeleted   ReminderMarkerState = "deleted"

	AccountTypeCash     AccountType = "cash"
	AccountTypeCcard    AccountType = "ccard"
	AccountTypeChecking AccountType = "checking"
	AccountTypeLoan     AccountType = "loan"
	AccountTypeDeposit  AccountType = "deposit"
	AccountTypeEmoney   AccountType = "emoney"
	AccountTypeDebt     AccountType = "debt"

	DateIntervalDay   DateInterval = "day"
	DateIntervalWeek  DateInterval = "week"
	DateIntervalMonth DateInterval = "month"
	DateIntervalYear  DateInterval = "year"

	AccountEndDateOffsetDay   AccountEndDateOffset = AccountEndDateOffset(DateIntervalDay)
	AccountEndDateOffsetWeek  AccountEndDateOffset = AccountEndDateOffset(DateIntervalWeek)
	AccountEndDateOffsetMonth AccountEndDateOffset = AccountEndDateOffset(DateIntervalMonth)
	AccountEndDateOffsetYear  AccountEndDateOffset = AccountEndDateOffset(DateIntervalYear)

	AccountPayoffIntervalMonth AccountPayoffInterval = AccountPayoffInterval(DateIntervalMonth)
	AccountPayoffIntervalYear  AccountPayoffInterval = AccountPayoffInterval(DateIntervalYear)

	ReminderIntervalDay   ReminderInterval = ReminderInterval(DateIntervalDay)
	ReminderIntervalWeek  ReminderInterval = ReminderInterval(DateIntervalWeek)
	ReminderIntervalMonth ReminderInterval = ReminderInterval(DateIntervalMonth)
	ReminderIntervalYear  ReminderInterval = ReminderInterval(DateIntervalYear)

	BudgetMonthTag = "00000000-0000-0000-0000-000000000000"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	Id         AccountId
	Changed    Timestamp
	User       UserId
	Role       *UserId
	Instrument *InstrumentId
	Company    *CompanyId
	Type       AccountType
	Title      string
	SyncID     []string

	Balance      *float64
	StartBalance *float64
	CreditLimit  *float64

	InBalance        bool
	Savings          *bool
	EnableCorrection bool
	EnableSMS        bool
	Archive          bool

	// Для счетов с типом отличных от 'loan' и 'deposit' в  этих полях можно ставить null
	Capitalization        *bool
	Percent               *float64
	StartDate             *Date
	EndDateOffset         *int
	EndDateOffsetInterval *AccountEndDateOffset
	PayoffStep            *int
	PayoffInterval        *AccountPayoffInterval
}

func (*Account) TouchChanged

func (e *Account) TouchChanged()

type AccountEndDateOffset

type AccountEndDateOffset DateInterval

type AccountId

type AccountId ObjectId

type AccountPayoffInterval

type AccountPayoffInterval DateInterval

type AccountType

type AccountType string

type Budget

type Budget struct {
	Id      ReminderMarkerId
	Changed Timestamp
	User    UserId

	Tag *TagId

	Date Date

	Income      Value
	IncomeLock  bool
	Outcome     Value
	OutcomeLock bool
}

func (*Budget) TouchChanged

func (e *Budget) TouchChanged()

type Company

type Company struct {
	Id        CompanyId
	Changed   Timestamp
	Title     string
	FullTitle string
	Www       string
	Country   string
}

type CompanyId

type CompanyId int

type Date

type Date string

format 'yyyy-MM-dd'

type DateInterval

type DateInterval string

type Diff

type Diff struct {
	CurrentClientTimestamp Timestamp `json:"currentClientTimestamp"`
	ServerTimestamp        Timestamp `json:"serverTimestamp"`

	ForceFetch []ObjectClass `json:"forceFetch"`

	Instrument     []Instrument     `json:"instrument"`
	Company        []Company        `json:"company"`
	User           []User           `json:"user"`
	Account        []Account        `json:"account"`
	Tag            []Tag            `json:"tag"`
	Merchant       []Merchant       `json:"merchant"`
	Budget         []Instrument     `json:"budget"`
	Reminder       []Reminder       `json:"reminder"`
	ReminderMarker []ReminderMarker `json:"reminderMarker"`
	Transaction    []Transaction    `json:"instrument"`
}

type Instrument

type Instrument struct {
	Id         InstrumentId
	Changed    Timestamp
	Title      string
	ShortTitle string
	Symbol     string
	Rate       float64
}

type InstrumentId

type InstrumentId int

type Latitude

type Latitude float64

>= -90 && <= 90

type Longitude

type Longitude float64

>= -180 && <= 180

type Merchant

type Merchant struct {
	Id      MerchantId
	Changed Timestamp
	User    UserId
	Title   string
}

func (*Merchant) TouchChanged

func (e *Merchant) TouchChanged()

type MerchantId

type MerchantId ObjectId

type ObjectClass

type ObjectClass string
const (
	//ObjectClassInstrument     ObjectClass = "Instrument"
	//ObjectClassCompany        ObjectClass = "Company"
	//ObjectClassUser           ObjectClass = "User"
	ObjectClassAccount        ObjectClass = "Account"
	ObjectClassTag            ObjectClass = "Tag"
	ObjectClassMerchant       ObjectClass = "Merchant"
	ObjectClassBudget         ObjectClass = "Budget"
	ObjectClassReminder       ObjectClass = "Reminder"
	ObjectClassReminderMarker ObjectClass = "ReminderMarker"
	ObjectClassTransaction    ObjectClass = "Transaction"
)

type ObjectId

type ObjectId string

type Reminder

type Reminder struct {
	Id      ReminderId
	Changed Timestamp
	User    UserId

	IncomeInstrument  InstrumentId
	IncomeAccount     AccountId
	Income            Value
	OutcomeInstrument InstrumentId
	OutcomeAccount    AccountId
	Outcome           Value

	Tag      *[]TagId
	Merchant *MerchantId
	Payee    *string
	Comment  *string

	Interval  *ReminderInterval
	Step      *int
	Points    []int
	StartDate Date
	EndDate   *Date
	Notify    bool
}

func (*Reminder) TouchChanged

func (e *Reminder) TouchChanged()

type ReminderId

type ReminderId ObjectId

type ReminderInterval

type ReminderInterval DateInterval

type ReminderMarker

type ReminderMarker struct {
	Id      ReminderMarkerId
	Changed Timestamp
	User    UserId

	IncomeInstrument  InstrumentId
	IncomeAccount     AccountId
	Income            Value
	OutcomeInstrument InstrumentId
	OutcomeAccount    AccountId
	Outcome           Value

	Tag      *[]TagId
	Merchant *MerchantId
	Payee    *string
	Comment  *string

	Date Date

	Reminder ReminderId
	State    ReminderMarkerState

	Notify bool
}

func (*ReminderMarker) TouchChanged

func (e *ReminderMarker) TouchChanged()

type ReminderMarkerId

type ReminderMarkerId ObjectId

type ReminderMarkerState

type ReminderMarkerState string

type Tag

type Tag struct {
	Id      TagId
	Changed Timestamp
	User    UserId

	Title   string
	Parent  *TagId
	Icon    *string
	Picture *string
	Color   *int

	ShowIncome    bool
	ShowOutcome   bool
	BudgetIncome  bool
	BudgetOutcome bool
	Required      *bool
}

func (*Tag) TouchChanged

func (e *Tag) TouchChanged()

type TagId

type TagId ObjectId

type Timestamp

type Timestamp string

func GetCurrentTimestamp

func GetCurrentTimestamp() Timestamp

type Transaction

type Transaction struct {
	Id      TransactionId
	Changed Timestamp
	Created Timestamp
	User    UserId
	Deleted bool
	Hold    *bool

	IncomeInstrument  InstrumentId
	IncomeAccount     AccountId
	Income            Value
	OutcomeInstrument InstrumentId
	OutcomeAccount    AccountId
	Outcome           Value

	Tag           *[]TagId
	Merchant      *MerchantId
	Payee         *string
	OriginalPayee *string
	Comment       *string

	Date Date

	Mcc *int

	QrCode *string //  qrCode

	ReminderMarker *ReminderMarkerId

	OpIncome            *Value
	OpIncomeInstrument  *InstrumentId
	OpOutcome           *Value
	OpOutcomeInstrument *InstrumentId

	Latitude  *Latitude
	Longitude *Longitude
}

func (*Transaction) TouchChanged

func (e *Transaction) TouchChanged()

type TransactionId

type TransactionId ObjectId

type User

type User struct {
	Id       UserId
	Changed  Timestamp
	Login    *string
	Currency InstrumentId
	Parent   *UserId
}

type UserEntity

type UserEntity interface {
	TouchChanged()
}

type UserId

type UserId int

type Value

type Value float64

>= 0

Jump to

Keyboard shortcuts

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