added backend and 2 endpoints fetch

This commit is contained in:
wt committed 2025-07-30 00:01:45 +07:00
1 parent 7c6db3dfbd
commit ca99cfcf6d
56 files changed
+344 -29

No files matched your search

@@ -0,0 +1,33 @@
package category
import "backend/model"
func GetAllCategories() ([]model.Category, error) {
return []model.Category{
{
ID: "1",
Title: "Electronics",
Icon: "😀",
},
{
ID: "2",
Title: "Clothing",
Icon: "😁",
},
{
ID: "3",
Title: "Books",
Icon: "😂",
Subcategories: []model.Subcategory{
{
ID: "1",
Title: "Fiction",
},
{
ID: "2",
Title: "Non-Fiction",
},
},
},
}, nil
}
@@ -0,0 +1,30 @@
package operation
import "backend/model"
func GetAllOperation() ([]model.Operation, error) {
return []model.Operation{
{
ID: "1",
Title: "Operation 1",
Amount: 100,
Category: "Category 1",
SubCategory: model.Subcategory{
ID: "1",
Title: "subcategory",
},
Date: "2022-01-01T00:00:00Z",
Type: "income",
Icon: "😀",
},
{
ID: "2",
Title: "Operation 2",
Amount: 200,
Category: "Category 2",
Date: "2022-01-02T00:00:00Z",
Type: "expense",
Icon: "😂",
},
}, nil
}