@bit-ui-libs/common
Version:
This library was generated with [Nx](https://nx.dev).
43 lines (37 loc) • 1.06 kB
text/typescript
import { BaseService, BaseServiceOptions } from '../api/services/base-service';
import { FilterParams, PagedResponse, SubjectTypeEnum, WeatherData } from '../common';
export enum EEventStatus {
Initialized = 'INITIALIZED',
Uploading = 'UPLOADING',
Completed = 'COMPLETED',
ForVerification = 'FOR_VERIFICATION',
Verified = 'VERIFIED',
}
export interface Event {
id: string;
deviceId: string;
appName: string;
deviceDate: string;
subjectType: SubjectTypeEnum;
eventTypeId: string;
createdBy: string;
latitude: number;
longitude: number;
meanSeaLevel: number;
ipAddress: string;
status: EEventStatus;
eventDate: string;
createdAt: string;
weather: WeatherData;
}
export class EventService extends BaseService {
constructor(opts: BaseServiceOptions) {
super(opts);
}
getEventById(eventId?: string) {
return this.get<Event>(`${this.apiUrl}/core-events/v1/events/${eventId}`);
}
searchEvents(req?: FilterParams) {
return this.get<PagedResponse<Event>>(`${this.apiUrl}/core-events/v1/events`, req);
}
}