Fix form keyboard issues and sticky footers in agent screens

This commit is contained in:
Abin Toppo
2026-05-26 16:34:05 +05:30
commit 9ac5e95d52
410 changed files with 86650 additions and 0 deletions
@@ -0,0 +1,72 @@
import type { Beneficiary } from '../../../types/app';
import { demoBeneficiaries } from '../../../constants/mockData';
import { endpoints } from '../../../services/api/endpoints';
import { apiClient } from '../../../services/api/apiClient';
import { baseApi } from '../../../services/api/baseApi';
import { resolveWithMock } from '../../../services/api/serviceHelpers';
export interface BankTransferRequest {
beneficiaryId: string;
amount: number;
transferType: 'IMPS' | 'NEFT' | 'RTGS';
remarks?: string;
sourceAccountId: string;
}
export interface BankTransferResponse {
referenceId: string;
status: 'Process_Success' | 'Process_Pending';
}
export const paymentsApi = baseApi.injectEndpoints({
endpoints: (builder) => ({
getBeneficiaries: builder.query<Beneficiary[], void>({
queryFn: () =>
resolveWithMock({
mockData: demoBeneficiaries,
request: async () => {
// Real API implementation
// const response = await apiClient.get<Beneficiary[]>('/beneficiaries');
// return response.data;
return [] as Beneficiary[];
},
}),
providesTags: ['Payments'],
}),
addBeneficiary: builder.mutation<Beneficiary, Partial<Beneficiary>>({
queryFn: (newBen) =>
resolveWithMock({
mockData: {
id: `ben_${Date.now()}`,
name: newBen.name || 'Unknown',
bankName: newBen.bankName || 'Unknown Bank',
accountMasked: newBen.accountMasked || 'xxxx0000',
favorite: false,
} as Beneficiary,
request: async () => {
// const response = await apiClient.post('/beneficiaries/add', newBen);
// return response.data;
return {} as Beneficiary;
}
}),
invalidatesTags: ['Payments'],
}),
submitBankTransfer: builder.mutation<BankTransferResponse, BankTransferRequest>({
queryFn: (req) =>
resolveWithMock({
mockData: () => ({
referenceId: `${req.transferType}${Date.now()}`,
status: req.transferType === 'NEFT' ? 'Process_Pending' : 'Process_Success',
}),
request: async () => {
// const response = await apiClient.post<BankTransferResponse>('/transactions/transfer', req);
// return response.data;
return { referenceId: '', status: 'Process_Success' };
},
}),
invalidatesTags: ['Payments', 'Transactions'],
}),
}),
});
export const { useGetBeneficiariesQuery, useAddBeneficiaryMutation, useSubmitBankTransferMutation } = paymentsApi;