Proper model layer

This commit is contained in:
2025-08-08 12:54:42 +01:00
parent f0ca0051b6
commit e76261d5d5
31 changed files with 1098 additions and 968 deletions
+18
View File
@@ -0,0 +1,18 @@
package models
import repo "expenses/expenses/db/repository"
func MapRepoCategory(rc repo.Category) Category {
return Category{
CategoryID: rc.CategoryID,
CategoryName: rc.CategoryName,
}
}
func MapRepoCategories(rc []repo.Category) []Category {
categories := make([]Category, len(rc))
for k, cat := range rc {
categories[k] = MapRepoCategory(cat)
}
return categories
}