feat(1099): frontend models, API services, and permission module entry

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Chris Chen
2026-06-25 17:26:57 -07:00
parent 8cb6245560
commit bf247726e1
4 changed files with 126 additions and 0 deletions
@@ -0,0 +1,42 @@
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { Observable } from 'rxjs';
import { ApiConfigService } from '../../../core/services/api-config.service';
import {
Payee1099ListItem, Payee1099, SavePayee1099Request,
} from '../models/payee1099.model';
@Injectable({ providedIn: 'root' })
export class Payee1099ApiService {
private readonly endpoint: string;
constructor(private http: HttpClient, apiConfig: ApiConfigService) {
this.endpoint = apiConfig.getApiUrl('payee-1099');
}
getAll(includeInactive = false): Observable<Payee1099ListItem[]> {
return this.http.get<Payee1099ListItem[]>(this.endpoint, {
params: { includeInactive: String(includeInactive) },
});
}
getById(id: number): Observable<Payee1099> {
return this.http.get<Payee1099>(`${this.endpoint}/${id}`);
}
create(req: SavePayee1099Request): Observable<{ id: number }> {
return this.http.post<{ id: number }>(this.endpoint, req);
}
update(id: number, req: SavePayee1099Request): Observable<void> {
return this.http.put<void>(`${this.endpoint}/${id}`, req);
}
delete(id: number): Observable<void> {
return this.http.delete<void>(`${this.endpoint}/${id}`);
}
revealTin(id: number): Observable<{ tin: string | null }> {
return this.http.get<{ tin: string | null }>(`${this.endpoint}/${id}/tin`);
}
}