import { api } from '@/lib/api' import type { BankAccountResponse, BankAccountType, CashAccountTypeDto, CreateBankAccountRequest, CreateCashAccountRequest, } from '@/types/payments' export const bankAccounts = { list: (accountType?: BankAccountType) => api .get('/bank-accounts', { params: accountType ? { accountType } : undefined, }) .then(r => r.data), createBank: (body: CreateBankAccountRequest) => api.post('/bank-accounts', body).then(r => r.data), createCash: (body: CreateCashAccountRequest) => api.post('/cash-accounts', body).then(r => r.data), updateCash: (id: string, accountName: string) => api.put(`/cash-accounts/${id}`, { accountName }).then(r => r.data), setCashStatus: (id: string, isActive: boolean) => api.patch(`/cash-accounts/${id}/status`, { isActive }).then(r => r.data), deleteCash: (id: string) => api.delete(`/cash-accounts/${id}`), cashAccountTypes: () => api.get('/cash-account-types').then(r => r.data), }