Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -147,37 +147,37 @@
"countly-sdk-react-native-bridge": "^25.4.0",
"date-fns": "^4.1.0",
"dompurify": "^3.3.1",
"expo": "^54.0.33",
"expo": "~54.0.34",
"expo-application": "~7.0.8",
"expo-asset": "~12.0.12",
"expo-asset": "~12.0.13",
"expo-audio": "~1.1.1",
"expo-auth-session": "~7.0.10",
"expo-auth-session": "~7.0.11",
"expo-av": "~16.0.8",
"expo-build-properties": "~1.0.10",
"expo-constants": "~18.0.13",
"expo-crypto": "~15.0.8",
"expo-dev-client": "~6.0.20",
"expo-crypto": "~15.0.9",
"expo-dev-client": "~6.0.21",
"expo-device": "~8.0.10",
"expo-document-picker": "~14.0.8",
"expo-file-system": "~19.0.21",
"expo-file-system": "~19.0.22",
"expo-font": "~14.0.11",
"expo-image": "~3.0.11",
"expo-image-manipulator": "~14.0.8",
"expo-image-picker": "~17.0.10",
"expo-image-picker": "~17.0.11",
"expo-keep-awake": "~15.0.8",
"expo-linking": "~8.0.11",
"expo-linking": "~8.0.12",
"expo-localization": "~17.0.8",
"expo-location": "~19.0.8",
"expo-navigation-bar": "~5.0.10",
"expo-notifications": "~0.32.16",
"expo-notifications": "~0.32.17",
"expo-router": "~6.0.23",
"expo-screen-orientation": "~9.0.8",
"expo-screen-orientation": "~9.0.9",
"expo-sharing": "~14.0.8",
"expo-splash-screen": "~31.0.13",
"expo-status-bar": "~3.0.9",
"expo-system-ui": "~6.0.9",
"expo-task-manager": "~14.0.9",
"expo-web-browser": "~15.0.10",
"expo-web-browser": "~15.0.11",
"geojson": "~0.5.0",
"he": "^1.2.0",
"i18next": "~23.14.0",
Expand Down
11 changes: 11 additions & 0 deletions src/api/calls/calls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ import { type ActiveCallsResult } from '@/models/v4/calls/activeCallsResult';
import { type CallExtraDataResult } from '@/models/v4/calls/callExtraDataResult';
import { type CallResult } from '@/models/v4/calls/callResult';
import { type SaveCallResult } from '@/models/v4/calls/saveCallResult';
import { type ScheduledCallsResult } from '@/models/v4/calls/scheduledCallsResult';

import { createApiEndpoint } from '../common/client';

const callsApi = createApiEndpoint('/Calls/GetActiveCalls');
const pendingScheduledCallsApi = createApiEndpoint('/Calls/GetAllPendingScheduledCalls');
const getCallApi = createApiEndpoint('/Calls/GetCall');
const getCallExtraDataApi = createApiEndpoint('/Calls/GetCallExtraData');
const createCallApi = createApiEndpoint('/Calls/SaveCall');
Expand All @@ -18,6 +20,11 @@ export const getCalls = async () => {
return response.data;
};

export const getPendingScheduledCalls = async () => {
const response = await pendingScheduledCallsApi.get<ScheduledCallsResult>({ _t: Date.now() });
return response.data;
};

export const getCallExtraData = async (callId: string) => {
const response = await getCallExtraDataApi.get<CallExtraDataResult>({
callId: encodeURIComponent(callId),
Expand Down Expand Up @@ -55,6 +62,7 @@ export interface CreateCallRequest {
externalId?: string;
referenceId?: string;
scheduledOn?: string;
destinationPoiId?: number | null;
}

export interface UpdateCallRequest {
Expand All @@ -80,6 +88,7 @@ export interface UpdateCallRequest {
linkedCallId?: string;
externalId?: string;
referenceId?: string;
destinationPoiId?: number | null;
}

export interface CloseCallRequest {
Expand Down Expand Up @@ -117,6 +126,7 @@ export const createCall = async (callData: CreateCallRequest) => {
Nature: callData.nature,
Note: callData.note || '',
Address: callData.address || '',
DestinationPoiId: callData.destinationPoiId ?? null,
Geolocation: `${callData.latitude?.toString() || ''},${callData.longitude?.toString() || ''}`,
Priority: callData.priority,
Type: callData.type || '',
Expand Down Expand Up @@ -166,6 +176,7 @@ export const updateCall = async (callData: UpdateCallRequest) => {
Nature: callData.nature,
Note: callData.note || '',
Address: callData.address || '',
DestinationPoiId: callData.destinationPoiId ?? null,
Geolocation: `${callData.latitude?.toString() || ''},${callData.longitude?.toString() || ''}`,
Priority: callData.priority,
Type: callData.type || '',
Expand Down
11 changes: 10 additions & 1 deletion src/api/dispatch/dispatch.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
import { createApiEndpoint } from '@/api/common/client';

Check failure on line 1 in src/api/dispatch/dispatch.ts

View workflow job for this annotation

GitHub Actions / test

Run autofix to sort these imports!
import { type NewCallFormResult } from '@/models/v4/dispatch/newCallFormResult';
import { type GetSetUnitStateResult } from '@/models/v4/dispatch/getSetUnitStateResult';

const getSetUnitStateApi = createApiEndpoint('/Dispatch/GetSetUnitState');
const getNewCallDataApi = createApiEndpoint('/Dispatch/GetNewCallData');
const getSetUnitStateApi = createApiEndpoint('/Dispatch/GetSetUnitStatusData');

export const getNewCallData = async () => {
const response = await getNewCallDataApi.get<NewCallFormResult>();
return response.data;
};

export const getSetUnitState = async (unitId: string) => {
const response = await getSetUnitStateApi.get<GetSetUnitStateResult>({
unitId: unitId,
});
return response.data;
};

export const getSetUnitStatusData = getSetUnitState;
36 changes: 34 additions & 2 deletions src/api/mapping/mapping.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
import { type GetMapDataAndMarkersResult } from '@/models/v4/mapping/getMapDataAndMarkersResult';

Check failure on line 1 in src/api/mapping/mapping.ts

View workflow job for this annotation

GitHub Actions / test

Run autofix to sort these imports!
import { type GetMapLayersResult } from '@/models/v4/mapping/getMapLayersResult';
import { type PoiResult } from '@/models/v4/mapping/poiResult';
import { type PoiTypesResult } from '@/models/v4/mapping/poiTypesResult';
import { type PoisResult } from '@/models/v4/mapping/poisResult';

import { createApiEndpoint } from '../common/client';
import { api, createApiEndpoint } from '../common/client';

const getMayLayersApi = createApiEndpoint('/Mapping/GetMayLayers');

const getMapDataAndMarkersApi = createApiEndpoint('/Mapping/GetMapDataAndMarkers');
const getPoiTypesApi = createApiEndpoint('/Mapping/GetPoiTypes');
const getPoisApi = createApiEndpoint('/Mapping/GetPois');

export const getMapDataAndMarkers = async (signal?: AbortSignal) => {
const response = await getMapDataAndMarkersApi.get<GetMapDataAndMarkersResult>(undefined, signal);
Expand All @@ -21,3 +25,31 @@
);
return response.data;
};

export interface GetPoisOptions {
poiTypeId?: number;
destinationOnly?: boolean;
}

export const getPoiTypes = async (signal?: AbortSignal) => {
const response = await getPoiTypesApi.get<PoiTypesResult>(undefined, signal);
return response.data;
};

export const getPois = async (options: GetPoisOptions = {}, signal?: AbortSignal) => {
const response = await getPoisApi.get<PoisResult>(
{
...(typeof options.poiTypeId === 'number' ? { poiTypeId: options.poiTypeId } : {}),
...(typeof options.destinationOnly === 'boolean' ? { destinationOnly: options.destinationOnly } : {}),
},
signal
);
return response.data;
};

export const getPoi = async (poiId: number, signal?: AbortSignal) => {
const response = await api.get<PoiResult>(`/Mapping/GetPoi/${encodeURIComponent(poiId.toString())}`, {
signal,
});
return response.data;
};
33 changes: 16 additions & 17 deletions src/api/personnel/personnelStatuses.ts
Original file line number Diff line number Diff line change
@@ -1,26 +1,25 @@
import { type GetCurrentStatusResult } from '@/models/v4/personnelStatuses/getCurrentStatusResult';

Check failure on line 1 in src/api/personnel/personnelStatuses.ts

View workflow job for this annotation

GitHub Actions / test

Run autofix to sort these imports!
import { type SavePersonStatusInput } from '@/models/v4/personnelStatuses/savePersonStatusInput';
import { type SavePersonStatusResult } from '@/models/v4/personnelStatuses/savePersonStatusResult';
import { type SavePersonsStatusesInput } from '@/models/v4/personnelStatuses/savePersonsStatusesInput';
import { type SavePersonsStatusesResult } from '@/models/v4/personnelStatuses/savePersonsStatusesResult';

import { createApiEndpoint } from '../common/client';

interface SavePersonsStatusesInput {
UserIds: string[];
Type: string;
RespondingTo: string;
TimestampUtc: string;
Timestamp: string;
Note: string;
Latitude: string;
Longitude: string;
Accuracy: string;
Altitude: string;
AltitudeAccuracy: string;
Speed: string;
Heading: string;
EventId: string;
}

const getCurrentStatusApi = createApiEndpoint('/PersonnelStatuses/GetCurrentStatus');
const savePersonStatusApi = createApiEndpoint('/PersonnelStatuses/SavePersonStatus');
const savePersonsStatusesApi = createApiEndpoint('/PersonnelStatuses/SavePersonsStatuses');

export const getCurrentStatus = async () => {
const response = await getCurrentStatusApi.get<GetCurrentStatusResult>();
return response.data;
};

export const savePersonStatus = async (input: SavePersonStatusInput) => {
const response = await savePersonStatusApi.post<SavePersonStatusResult>(input);
return response.data;
};

export const savePersonsStatuses = async (input: SavePersonsStatusesInput) => {
const response = await savePersonsStatusesApi.post<SavePersonsStatusesResult>(input);
return response.data;
Expand Down
Loading
Loading