chore: initial commit of HouseholdBudgetBook (backend, frontend, desktop)
This commit is contained in:
commit
4a5db3f1f9
167 files changed
+21732
No files matched your search
@@ -0,0 +1,145 @@
|
||||
package model
|
||||
|
||||
type Transaction struct {
|
||||
ID int64 `json:"id"`
|
||||
Type string `json:"type"`
|
||||
Amount int64 `json:"amount"`
|
||||
CategoryID *int64 `json:"category_id"`
|
||||
AccountID *int64 `json:"account_id"`
|
||||
ToAccountID *int64 `json:"to_account_id"`
|
||||
MemberID *int64 `json:"member_id"`
|
||||
Date string `json:"date"`
|
||||
Description string `json:"description"`
|
||||
Counterparty string `json:"counterparty"`
|
||||
ImportBatchID *int64 `json:"import_batch_id"`
|
||||
CreatedAt string `json:"created_at"`
|
||||
UpdatedAt string `json:"updated_at"`
|
||||
}
|
||||
|
||||
type TransactionListItem struct {
|
||||
ID int64 `json:"id"`
|
||||
Type string `json:"type"`
|
||||
Amount int64 `json:"amount"`
|
||||
CategoryID *int64 `json:"category_id"`
|
||||
CategoryName string `json:"category_name"`
|
||||
CategoryIsActive bool `json:"category_is_active"`
|
||||
AccountID *int64 `json:"account_id"`
|
||||
AccountName string `json:"account_name"`
|
||||
ToAccountID *int64 `json:"to_account_id"`
|
||||
ToAccountName string `json:"to_account_name"`
|
||||
MemberID *int64 `json:"member_id"`
|
||||
MemberName string `json:"member_name"`
|
||||
Date string `json:"date"`
|
||||
Description string `json:"description"`
|
||||
Counterparty string `json:"counterparty"`
|
||||
ImportBatchID *int64 `json:"import_batch_id"`
|
||||
ImportFilename string `json:"import_filename"`
|
||||
CreatedAt string `json:"created_at"`
|
||||
UpdatedAt string `json:"updated_at"`
|
||||
}
|
||||
|
||||
type CreateTransactionRequest struct {
|
||||
Type string `json:"type"`
|
||||
Amount int64 `json:"amount"`
|
||||
CategoryID *int64 `json:"category_id,omitempty"`
|
||||
AccountID *int64 `json:"account_id,omitempty"`
|
||||
ToAccountID *int64 `json:"to_account_id,omitempty"`
|
||||
MemberID *int64 `json:"member_id,omitempty"`
|
||||
Date string `json:"date"`
|
||||
Description string `json:"description"`
|
||||
Counterparty string `json:"counterparty"`
|
||||
}
|
||||
|
||||
type UpdateTransactionRequest struct {
|
||||
Type *string `json:"type,omitempty"`
|
||||
Amount *int64 `json:"amount,omitempty"`
|
||||
CategoryID NullableInt64 `json:"category_id,omitempty"`
|
||||
AccountID NullableInt64 `json:"account_id,omitempty"`
|
||||
ToAccountID NullableInt64 `json:"to_account_id,omitempty"`
|
||||
MemberID NullableInt64 `json:"member_id,omitempty"`
|
||||
Date *string `json:"date,omitempty"`
|
||||
Description *string `json:"description,omitempty"`
|
||||
Counterparty *string `json:"counterparty,omitempty"`
|
||||
}
|
||||
|
||||
type TransactionListRequest struct {
|
||||
Month string
|
||||
CategoryID *int64
|
||||
Type string
|
||||
Keyword string
|
||||
DateFrom string
|
||||
DateTo string
|
||||
MemberID *int64
|
||||
AccountID *int64
|
||||
ImportBatchID *int64
|
||||
Page int
|
||||
PageSize int
|
||||
}
|
||||
|
||||
type TransactionListResponse struct {
|
||||
Items []TransactionListItem `json:"items"`
|
||||
Total int `json:"total"`
|
||||
Page int `json:"page"`
|
||||
PageSize int `json:"page_size"`
|
||||
}
|
||||
|
||||
type ImportTransactionsRequest struct {
|
||||
Filename string
|
||||
Content []byte
|
||||
SourceKind string // cmb_debit / cmb_credit / alipay / wechat
|
||||
BankName string
|
||||
CardType string
|
||||
AccountID *int64
|
||||
CategoryOverrides map[string]int64
|
||||
}
|
||||
|
||||
type ImportTransactionsResult struct {
|
||||
ImportedCount int `json:"imported_count"`
|
||||
SkippedCount int `json:"skipped_count"`
|
||||
AccountID int64 `json:"account_id"`
|
||||
ImportBatchID int64 `json:"import_batch_id"`
|
||||
Items []TransactionListItem `json:"items"`
|
||||
}
|
||||
|
||||
// ImportPreviewItem 导入预览中的一条解析结果(尚未写入数据库)。
|
||||
type ImportPreviewItem struct {
|
||||
SourceKey string `json:"source_key"`
|
||||
Type string `json:"type"`
|
||||
Amount int64 `json:"amount"`
|
||||
Date string `json:"date"`
|
||||
Description string `json:"description"`
|
||||
Counterparty string `json:"counterparty"`
|
||||
CategoryName string `json:"category_name"`
|
||||
CategoryID int64 `json:"category_id"`
|
||||
CategoryReason string `json:"category_reason"`
|
||||
Status string `json:"status"` // new | duplicate_database | duplicate_file
|
||||
}
|
||||
|
||||
type ImportPreviewResult struct {
|
||||
TotalCount int `json:"total_count"`
|
||||
NewCount int `json:"new_count"`
|
||||
DuplicateCount int `json:"duplicate_count"`
|
||||
AccountName string `json:"account_name"`
|
||||
WillCreateAccount bool `json:"will_create_account"`
|
||||
Items []ImportPreviewItem `json:"items"`
|
||||
}
|
||||
|
||||
type DeleteTransactionsRequest struct {
|
||||
IDs []int64 `json:"ids"`
|
||||
}
|
||||
|
||||
type DeleteTransactionsResult struct {
|
||||
DeletedCount int64 `json:"deleted_count"`
|
||||
}
|
||||
|
||||
type ImportBatch struct {
|
||||
ID int64 `json:"id"`
|
||||
Filename string `json:"filename"`
|
||||
BankName string `json:"bank_name"`
|
||||
CardType string `json:"card_type"`
|
||||
AccountID *int64 `json:"account_id"`
|
||||
AccountName string `json:"account_name"`
|
||||
ImportedCount int `json:"imported_count"`
|
||||
SkippedCount int `json:"skipped_count"`
|
||||
CreatedAt string `json:"created_at"`
|
||||
}
|
||||
Reference in new issue
Block a user