Documentation ¶
Index ¶
- func CheckOperationCashType(cashType string) bool
- func CheckOperationSource(source string) bool
- func CheckOperationStatus(status string) bool
- func CheckOperationType(operationType string) bool
- type Account
- type Analytics
- type AnalyticsBalance
- type BalanaceAndMonth
- type Bill
- type BillByDay
- type Category
- type CategoryListFilters
- type FullAnalytics
- type History
- type InputAccountTokenHeader
- type InputBillBalanceByDays
- type InputCreateCategory
- type InputCreateEditAccount
- type InputCreateEditBill
- type InputCreateFromRex
- type InputCreateOperation
- type InputDeleteOperationsForOrder
- type InputEditCategory
- type InputEditOperation
- type InputGetHistoryList
- type InputGetList
- type InputGetListCategory
- type InputGetListOperations
- type InputGetVehicleAnalytics
- type InputGinHeader
- type InputListBill
- type InputRecreateOperationsForOrder
- type MiniBill
- type MiniOperation
- type OneMonthFullAnalytics
- type Operation
- type OperationListFilters
- type OperationWithSaldo
- type Pagination
- type ResponceRex
- type ResponceRexListCategories
- type ResponceRexListOperations
- type RestRespone
- type RexCategory
- type RexOperation
- type RexPaginationCategories
- type RexPaginationOperation
- type SubAnalytics
- type VehicleAnalytics
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckOperationCashType ¶
func CheckOperationSource ¶
func CheckOperationStatus ¶
func CheckOperationType ¶
Types ¶
type Analytics ¶
type Analytics struct { FullBalance float64 `json:"full_balance"` FullCredit float64 `json:"full_credit"` FullDebit float64 `json:"full_debit"` CashBalance float64 `json:"cash_balance"` CashCredit float64 `json:"cash_credit"` CashDebit float64 `json:"cash_debit"` SettlementBalance float64 `json:"settlement_balance"` SettlementCredit float64 `json:"settlement_credit"` SettlementDebit float64 `json:"settlement_debit"` DayPaymentsCredit float64 `json:"day_payments_credit"` FineCredit float64 `json:"fine_credit"` OtherCredit float64 `json:"other_credit"` NumberOfOperations int64 `json:"number_of_operations"` BalanceByDays map[string]AnalyticsBalance `json:"balance_by_days"` //YYYY-MM-DD BalanceByMonths map[string]AnalyticsBalance `json:"balance_by_months"` //YYYY-MM }
type AnalyticsBalance ¶
type BalanaceAndMonth ¶
type Bill ¶
type Bill struct { ID int64 `json:"id" gorm:"primarykey"` UID string `json:"uid" gorm:"not null"` ExtID int64 `json:"ext_id"` AccountsID int64 `json:"accounts_id" gorm:"not null"` Code string `json:"code" gorm:"not null"` Name string `json:"name" gorm:"not null"` CashType string `json:"cash_type" gorm:"default:SETTLEMENT"` Balance float64 `json:"balance" gorm:"-"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` DeletedAt gorm.DeletedAt `json:"deleted_at" gorm:"index" swaggertype:"string"` }
type Category ¶
type Category struct { ID int64 `json:"id" gorm:"primarykey"` UID string `json:"uid" gorm:"not null"` ExtID int64 `json:"ext_id"` AccountsID int64 `json:"accounts_id" gorm:"not null"` ParentID int64 `json:"parent_id"` OperationType string `json:"operation_type" gorm:"not null"` Name string `json:"name" gorm:"not null"` Description string `json:"description"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` DeletedAt gorm.DeletedAt `json:"deleted_at" gorm:"index" swaggertype:"string"` }
type CategoryListFilters ¶
type CategoryListFilters struct {
OperationType *string `json:"operation_type"`
}
type FullAnalytics ¶
type FullAnalytics struct {
Months map[string]OneMonthFullAnalytics `json:"months"`
}
type History ¶
type History struct { ID int64 `json:"id" gorm:"primarykey"` AccountsID int64 `json:"accounts_id"` SourceTable string `json:"source_table" gorm:"index"` SourceID int64 `json:"source_id" gorm:"index"` OperationType string `json:"operation_type"` After datatypes.JSON `json:"after"` Before datatypes.JSON `json:"before"` UserID int64 `json:"user_id"` UserData interface{} `json:"user_data" gorm:"-"` CreatedAt time.Time `json:"created_at"` }
type InputAccountTokenHeader ¶
type InputAccountTokenHeader struct {
Token string `header:"Token"`
}
type InputBillBalanceByDays ¶
type InputCreateCategory ¶
type InputCreateEditAccount ¶
type InputCreateEditBill ¶
type InputCreateFromRex ¶
type InputCreateFromRex struct { ID int64 `json:"id"` CategoryID int64 `json:"category_id"` UserID int64 `json:"users_id"` UID string `json:"uid"` Description string `json:"description"` Amount string `json:"amount"` Date string `json:"date"` RentUserID int64 `json:"rent_users_id"` Deposit bool `json:"deposit"` CashType string `json:"cash_type"` VehicleID int64 `json:"vehicles_id"` Status string `json:"status"` AchiveAt string `json:"archive_at"` }
type InputCreateOperation ¶
type InputCreateOperation struct { ExtID *int64 `json:"ext_id"` CategoriesID *int64 `json:"categories_id"` RelationsUIDs *[]string `json:"relations_uids"` RelationsSources *[]string `json:"relations_sources" example:"vehicle|user|ransom_order|rent_order|bill"` FromUID *string `json:"from_uid"` FromSource *string `json:"from_source" example:"vehicle|user|ransom_order|rent_order|bill"` ToUID string `json:"to_uid"` ToSource string `json:"to_source" example:"vehicle|user|ransom_order|rent_order|bill"` Amount float64 `json:"amount"` Description *string `json:"description"` Date *time.Time `json:"date"` Deposit *bool `json:"deposit"` CashType string `json:"cash_type" example:"CASH|SETTLEMENT"` Status string `json:"status" example:"FAILED|SUCCESS|DEFAULT"` ToBillsID *int64 `json:"to_bills_id"` FromBillsID *int64 `json:"from_bills_id"` }
type InputEditCategory ¶
type InputEditOperation ¶
type InputEditOperation struct { ExtID *int64 `json:"ext_id"` CategoriesID *int64 `json:"categories_id"` RelationsUIDs *[]string `json:"relations_uids"` RelationsSources *[]string `json:"relations_sources" example:"vehicle|user|ransom_order|rent_order|bill"` FromUID *string `json:"from_uid"` FromSource *string `json:"from_source" example:"vehicle|user|ransom_order|rent_order|bill"` ToUID *string `json:"to_uid"` ToSource *string `json:"to_source" example:"vehicle|user|ransom_order|rent_order|bill"` Amount *float64 `json:"amount"` Description *string `json:"description"` Date *time.Time `json:"date"` Deposit *bool `json:"deposit"` CashType *string `json:"cash_type" example:"CASH|SETTLEMENT"` Status *string `json:"status" example:"FAILED|SUCCESS|DEFAULT"` ToBillsID *int64 `json:"to_bills_id"` FromBillsID *int64 `json:"from_bills_id"` }
type InputGetHistoryList ¶
type InputGetList ¶
type InputGetListCategory ¶
type InputGetListOperations ¶
type InputGetVehicleAnalytics ¶
type InputGetVehicleAnalytics struct {
OrderUIDs *[]string
}
type InputGinHeader ¶
type InputGinHeader struct {
Authorization string `header:"Authorization"`
}
type InputListBill ¶
type InputRecreateOperationsForOrder ¶
type InputRecreateOperationsForOrder struct { OrderUID string `json:"order_uid"` UserUID string `json:"user_uid"` VehicleUID string `json:"vehicle_uid"` DateStart string `json:"date_start"` DateEnd *string `json:"date_end"` Description string `json:"description"` Amount float64 `json:"amount"` OrderType string `json:"order_type"` }
type MiniBill ¶
type MiniBill struct { Amount float64 `json:"amount"` Deposit float64 `json:"deposit"` DaysOfDelay uint64 `json:"days_of_delay"` DayPaymentsAmount float64 `json:"day_payments_amount"` DaysOfDelayAmount float64 `json:"days_of_delay_amount"` Residual float64 `json:"residual"` RentDebitAmount float64 `json:"rent_debit_amount"` }
type MiniOperation ¶
type OneMonthFullAnalytics ¶
type Operation ¶
type Operation struct { ID int64 `json:"id" gorm:"primarykey"` UID string `json:"uid" gorm:"not null,index"` ExtID int64 `json:"ext_id"` AccountsID int64 `json:"accounts_id" gorm:"not null"` CategoriesID int64 `json:"categories_id"` RelationsUIDs datatypes.JSON `json:"relations_uids" swaggertype:"string"` RelationsSources datatypes.JSON `json:"relations_sources" swaggertype:"string"` FromUID string `json:"from_uid"` FromSource string `json:"from_source"` ToUID string `json:"to_uid"` ToSource string `json:"to_source"` Amount float64 `json:"amount" gorm:"not null"` Description string `json:"description"` Date time.Time `json:"date" gorm:"not null"` Deposit bool `json:"deposit" gorm:"not null"` CashType string `json:"cash_type"` Status string `json:"status"` CreateUsersID int64 `json:"create_users_id"` ToBillsID *int64 `json:"to_bills_id"` FromBillsID *int64 `json:"from_bills_id"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` DeletedAt gorm.DeletedAt `json:"deleted_at" gorm:"index" swaggertype:"string"` }
type OperationListFilters ¶
type OperationListFilters struct { CashType *string `json:"cash_type" example:"SETTLEMENT|CASH"` BillCashType *string `json:"bill_cash_type" example:"SETTLEMENT|CASH"` AmountType *string `json:"amount_type" example:"credit|debit"` RelationsUIDs *[]string `json:"relations_uids"` OrRelationsUIDs *[]string `json:"or_relations_uids"` DateStart *string `json:"date_start" example:"YYYY-MM-DD"` DateEnd *string `json:"date_end" example:"YYYY-MM-DD"` CreatedAtStart *string `json:"created_at_start" example:"YYYY-MM-DD"` CreatedAtEnd *string `json:"created_at_end" example:"YYYY-MM-DD"` CategoriesID *int64 `json:"categories_id"` InCategoriesID *[]int64 `json:"in_categories_id"` ToUID *string `json:"to_uid"` InToUIDs *[]string `json:"in_to_uids"` Deposit *bool `json:"deposit"` WithoutCache *bool `json:"without_cache"` SearchUID *string `json:"search_uid"` ToUIDAndRelations *string `json:"to_uid_and_relations"` Search *string `json:"search"` WithoutCategoriesIDs *[]int64 `json:"without_categories_ids"` ToBillsID *int64 `json:"to_bills_id"` ToSource *string `json:"to_source"` MisleadingDate *bool `json:"misleading_date"` GroupBy *string `json:"group_by"` }
type OperationWithSaldo ¶
type Pagination ¶
type ResponceRex ¶
type ResponceRexListCategories ¶
type ResponceRexListCategories struct { Payload RexPaginationCategories `json:"payload"` Message string `json:"message"` Code string `json:"code"` Status int `json:"status"` }
type ResponceRexListOperations ¶
type ResponceRexListOperations struct { Payload RexPaginationOperation `json:"payload"` Message string `json:"message"` Code string `json:"code"` Status int `json:"status"` }
type RestRespone ¶
type RestRespone struct { Message string `json:"message"` Payload interface{} `json:"payload"` }
type RexCategory ¶
type RexOperation ¶
type RexOperation struct { ID int64 `json:"id"` CategoryID int64 `json:"category_id"` UsersID int64 `json:"users_id"` UID string `json:"uid"` Description string `json:"description"` Amount string `json:"amount"` Date string `json:"date"` CashflowBoxesID int64 `json:"cashflow_boxes_id"` CashType string `json:"cash_type"` RentUsersID int64 `json:"rent_users_id"` Deposit bool `json:"deposit"` VehiclesID int64 `json:"vehicles_id"` FromUsersID int64 `json:"from_users_id"` ToUsersID int64 `json:"to_users_id"` Status string `json:"status"` AchiveAt string `json:"archive_at"` }
type RexPaginationCategories ¶
type RexPaginationCategories struct { Items []RexCategory `json:"items"` TotalPages uint64 `json:"total_pages"` TotalItems uint64 `json:"total_items"` }
type RexPaginationOperation ¶
type RexPaginationOperation struct { Items []RexOperation `json:"items"` TotalPages uint64 `json:"total_pages"` TotalItems uint64 `json:"total_items"` }
type SubAnalytics ¶
type SubAnalytics struct { FullBalance float64 `json:"full_balance"` FullCredit float64 `json:"full_credit"` FullDebit float64 `json:"full_debit"` CashBalance float64 `json:"cash_balance"` CashCredit float64 `json:"cash_credit"` CashDebit float64 `json:"cash_debit"` SettlementBalance float64 `json:"settlement_balance"` SettlementCredit float64 `json:"settlement_credit"` SettlementDebit float64 `json:"settlement_debit"` DayPaymentsCredit float64 `json:"day_payments_credit"` FineCredit float64 `json:"fine_credit"` OtherCredit float64 `json:"other_credit"` }
type VehicleAnalytics ¶
type VehicleAnalytics struct { BuyDate string `json:"buy_date"` //- находим операцию с категорией ext_id = 14 и берем date операции //// VehicleAmount float64 `json:"vehicle_amount"` // - находим операции с категорией ext_id = 14 и берем amount операции //// Deposit float64 `json:"deposit"` //- все операции по машине в deposit = true //// DaysCount uint64 `json:"days_count"` //- количество дней по операциям с категорией ext_id = 8 Result float64 `json:"result"` //- (сумма всех операций в категориях ext_id IN (10,48,57) AND parent_id{ext_id} IN (49,54,58)) минус (сумма всех операций в категориях ext_id IN (14,16,17,20,21) AND parent_id{ext_id} IN (15,19,23) //// MetaVehicleAmount float64 `json:"meta_vehicle_amount"` //- current.vehicleAmount + current.repairCreditAmount + current.otherCreditAmount TrackerInstallAmount float64 `json:"tracker_install_amount"` //[16] TrackerMonthAmount float64 `json:"tracker_month_amount"` //[17] RegistrationAmount float64 `json:"registration_amount"` // [20], RepairCreditAmount float64 `json:"repair_credit_amount"` // [21], OtherCreditAmount float64 `json:"other_credit_amount"` // [23], VehicleTaxAmount float64 `json:"vehicle_tax_amount"` // [19], TotalCreditAmount float64 `json:"total_credit_amount"` // [14, 16, 17, 20, 21], // = 14 ~ 2000, 17 ~ 1000 = 3000 RentDebitAmount float64 `json:"rent_debit_amount"` // [10], InitialPaymentAmount float64 `json:"initial_payment_amount"` // [48], CategoryMandatoryPaymentAmount float64 `json:"category_mandatory_payment_amount"` // [49], RepairDebitAmount float64 `json:"repair_debit_amount"` // [57], TotalDebitAmount float64 `json:"total_debit_amount"` // [10, 48, 57], DayPaymentsAmount float64 `json:"day_payments_amount"` // [8], //CATEGORIES_PARENTS_IDS ParentsOsagoAndDkAmount float64 `json:"parents_osago_and_dk_amount"` // [15], ParentsTotalCreditAmount float64 `json:"parents_total_credit_amount"` // [15, 19, 23], // = 15 ~ 200, 23 ~ 3000 = 3200 ParentsMandatoryPaymentAmount float64 `json:"parents_mandatory_payment_amount"` // [49, 54], ParentsOtherDebitAmount float64 `json:"parents_other_debit_amount"` // [58], ParentsTotalDebitAmount float64 `json:"parents_total_debit_amount"` // [49, 54, 58], }
Source Files ¶
- account.go
- analytics.go
- bill.go
- category.go
- history.go
- input_bill.go
- input_create_edit_account.go
- input_create_edit_category.go
- input_create_from_rex.go
- input_create_operation.go
- input_get_analytics.go
- input_get_list.go
- input_gin_header.go
- input_recreate_operations_for_order.go
- operation.go
- responce_rex.go
- rest_response.go
Click to show internal directories.
Click to hide internal directories.