scaffold expense list

This commit is contained in:
Joe Arndt 2026-02-12 23:41:54 -06:00
parent 7bb21f8796
commit 0bf8bd6c9c
22 changed files with 258 additions and 133 deletions

View file

@ -0,0 +1,32 @@
import { Injectable } from '@angular/core';
import { SubCategory } from './sub-category.service';
import { Category } from './category.service';
import { Merchant } from './merchant.service';
import { Tag } from './tag.service';
import { HttpService } from './http.service';
@Injectable({
providedIn: 'root',
})
export class ExpenseService {
public static readonly EXPENSE_PATH = 'http://localhost:3000/common-cents/expenses';
public constructor(private readonly http: HttpService) { }
public async getExpenses(): Promise<Expense[]> {
return this.http.get<Expense[]>(ExpenseService.EXPENSE_PATH);
}
}
export interface Expense {
id: string;
year: string;
month: string;
day: string;
cents: number;
description?: string;
category: Category;
subCategory?: SubCategory;
merchant?: Merchant;
tags: Tag[];
}