init
This commit is contained in:
28
src/models/Budget.ts
Normal file
28
src/models/Budget.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
import {Transaction} from "@/models/Transaction";
|
||||
import {Category, CategorySetting} from "@/models/Category";
|
||||
|
||||
export class BudgetInfo {
|
||||
budget: Budget
|
||||
plannedExpenses: [Transaction]
|
||||
plannedIncomes: [Transaction]
|
||||
transactions: [Transaction]
|
||||
transactionCategoriesSums: []
|
||||
totalIncomes: number
|
||||
totalExpenses: number
|
||||
chartData: [[]]
|
||||
unplannedCategories: [BudgetCategory]
|
||||
}
|
||||
|
||||
|
||||
export class Budget {
|
||||
id: number
|
||||
name: string
|
||||
dateFrom: Date
|
||||
dateTo: Date
|
||||
createdAt: Date
|
||||
}
|
||||
|
||||
export class BudgetCategory {
|
||||
category: Category;
|
||||
categorySetting: CategorySetting
|
||||
}
|
||||
38
src/models/Category.ts
Normal file
38
src/models/Category.ts
Normal file
@@ -0,0 +1,38 @@
|
||||
export class CategoryType {
|
||||
code: string;
|
||||
name: string;
|
||||
}
|
||||
|
||||
export class CategorySettingType {
|
||||
code: string;
|
||||
name: string;
|
||||
}
|
||||
|
||||
|
||||
export class Category {
|
||||
id: number = null;
|
||||
type: CategoryType;
|
||||
name: string;
|
||||
description: string;
|
||||
icon: string;
|
||||
|
||||
constructor(type: CategoryType, name: string, description: string, icon: string,) {
|
||||
this.type = type;
|
||||
this.name = name;
|
||||
this.description = description;
|
||||
this.icon = icon;
|
||||
}
|
||||
|
||||
// Метод, который возвращает краткое описание
|
||||
getSummary(): string {
|
||||
return `${this.name}: ${this.description}`;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
export class CategorySetting {
|
||||
type: CategorySettingType
|
||||
settingValue: number
|
||||
value: number
|
||||
}
|
||||
11
src/models/Recurrent.ts
Normal file
11
src/models/Recurrent.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import {Category} from "@/models/Category";
|
||||
|
||||
export class RecurrentPayment {
|
||||
public id: number;
|
||||
public atDay: number;
|
||||
public category: Category;
|
||||
public name: string;
|
||||
public description: string;
|
||||
public amount: number;
|
||||
public createdAt: Date;
|
||||
}
|
||||
24
src/models/Transaction.ts
Normal file
24
src/models/Transaction.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import {Category} from "@/models/Category";
|
||||
|
||||
export class Transaction {
|
||||
id: number;
|
||||
transactionType: TransactionType;
|
||||
category: Category;
|
||||
comment: string;
|
||||
date: Date;
|
||||
amount: number
|
||||
isDone: boolean;
|
||||
}
|
||||
|
||||
export class TransactionCategoriesSum{
|
||||
category: Category;
|
||||
sum: number
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
export class TransactionType {
|
||||
code: string;
|
||||
name: string;
|
||||
}
|
||||
Reference in New Issue
Block a user