Commit fa100049 by DESKTOP-E0VCCBD\zedan

update

parent 4a83b87f
export interface DashboardModel {
period: Period;
summary: Summary[];
monthly_trends: Monthlytrend[];
equipment_distribution: Equipmentdistribution[];
borrow_return_line: Monthlytrend[];
}
export interface Equipmentdistribution {
category: string;
count: number;
}
export interface Monthlytrend {
period: string;
borrowed: number;
returned: number;
}
export interface Summary {
label: string;
value: number;
change: number;
}
export interface Period {
start: string;
end: string;
}
import { Injectable } from '@angular/core';
import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http';
import { map } from 'rxjs';
import { DashboardModel } from '../models/dasbord.model';
@Injectable({
providedIn: 'root'
})
export class DashboardService {
apiBaseUrl = 'http://localhost:8000/admin/admin/dashboard';
constructor(private http: HttpClient) {}
getDashboard(startDate?: string, endDate?: string, projectId?: string) {
let params = new HttpParams();
if (startDate) params = params.set('start_date', startDate);
if (endDate) params = params.set('end_date', endDate);
if (projectId) params = params.set('project_id', projectId);
return this.http.get<DashboardModel>(this.apiBaseUrl, { params });
}
}
import { ClickOutsideDirective } from './click-outside.directive';
describe('ClickOutsideDirective', () => {
it('should create an instance', () => {
const directive = new ClickOutsideDirective();
expect(directive).toBeTruthy();
});
});
import { Directive } from '@angular/core';
@Directive({
selector: '[appClickOutside]',
standalone: true
})
export class ClickOutsideDirective {
constructor() { }
}
File added
File added
File added
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment