This commit is contained in:
2021-09-10 11:59:08 +02:00
parent 554a809ba4
commit 2da6b667bc
25 changed files with 436 additions and 108 deletions

View File

@ -24,6 +24,7 @@ import { CommercialPremise } from './data-objects';
import { Tenancy } from './data-objects';
import { Fee } from './data-objects';
import { TenancyFeeMapping } from './data-objects';
import { AccountEntryCategory } from './data-objects';
import { AccountEntry } from './data-objects';
import { Note } from './data-objects';
@ -421,6 +422,31 @@ export class TenancyFeeMappingService {
}
}
@Injectable({ providedIn: 'root' })
export class AccountEntryCategoryService {
constructor(private messageService: MessageService, private http: HttpClient) { }
async getAccountEntryCategorys(): Promise<AccountEntryCategory[]> {
this.messageService.add(`AccountEntryCategoryService: get data`);
return this.http.get<AccountEntryCategory[]>(`${serviceBaseUrl}/v1/account_entry_categorys`).toPromise()
}
async getAccountEntryCategory(id: number): Promise<AccountEntryCategory> {
this.messageService.add(`AccountEntryCategoryService: get data for ${id}`);
return this.http.get<AccountEntryCategory>(`${serviceBaseUrl}/v1/account_entry_categorys/${id}`).toPromise()
}
async postAccountEntryCategory(item: AccountEntryCategory): Promise<AccountEntryCategory> {
let itemStr: string = JSON.stringify(item, undefined, 4)
this.messageService.add(`AccountEntryCategoryService: post data for ${itemStr}`);
return this.http.post<AccountEntryCategory>(`${serviceBaseUrl}/v1/account_entry_categorys`, item).toPromise()
}
}
@Injectable({ providedIn: 'root' })
@ -450,6 +476,11 @@ export class AccountEntryService {
return this.http.get<AccountEntry[]>(`${serviceBaseUrl}/v1/account_entrys/account/${id}`).toPromise()
}
async getAccountEntrysByAccountEntryCategory(id: number): Promise<AccountEntry[]> {
this.messageService.add(`AccountEntryService: get data by AccountEntryCategory ${id}`);
return this.http.get<AccountEntry[]>(`${serviceBaseUrl}/v1/account_entrys/account_entry_category/${id}`).toPromise()
}
}