mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-21 15:20:34 +00:00
chore: fix typing
This commit is contained in:
@@ -49,7 +49,7 @@ export default class GetCashflowAccounts extends BaseController {
|
|||||||
* @param {NextFunction} next
|
* @param {NextFunction} next
|
||||||
*/
|
*/
|
||||||
private getCashflowTransaction = async (
|
private getCashflowTransaction = async (
|
||||||
req: Request,
|
req: Request<{ transactionId: number }>,
|
||||||
res: Response,
|
res: Response,
|
||||||
next: NextFunction
|
next: NextFunction
|
||||||
) => {
|
) => {
|
||||||
@@ -76,13 +76,17 @@ export default class GetCashflowAccounts extends BaseController {
|
|||||||
* @param {NextFunction} next
|
* @param {NextFunction} next
|
||||||
*/
|
*/
|
||||||
private async getMatchedTransactions(
|
private async getMatchedTransactions(
|
||||||
req: Request<{ transactionId: number }>,
|
req: Request<
|
||||||
|
{ transactionId: number },
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
{ uncategorizeTransactionsIds: Array<number> }
|
||||||
|
>,
|
||||||
res: Response,
|
res: Response,
|
||||||
next: NextFunction
|
next: NextFunction
|
||||||
) {
|
) {
|
||||||
const { tenantId } = req;
|
const { tenantId } = req;
|
||||||
const uncategorizeTransactionsIds: Array<number> =
|
const uncategorizeTransactionsIds = req.query.uncategorizeTransactionsIds;
|
||||||
req.query.uncategorizeTransactionsIds;
|
|
||||||
const filter = this.matchedQueryData(req) as GetMatchedTransactionsFilter;
|
const filter = this.matchedQueryData(req) as GetMatchedTransactionsFilter;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -167,7 +167,7 @@ export default class NewCashflowTransactionController extends BaseController {
|
|||||||
* @param {NextFunction} next
|
* @param {NextFunction} next
|
||||||
*/
|
*/
|
||||||
private revertCategorizedCashflowTransaction = async (
|
private revertCategorizedCashflowTransaction = async (
|
||||||
req: Request,
|
req: Request<{ id: number }>,
|
||||||
res: Response,
|
res: Response,
|
||||||
next: NextFunction
|
next: NextFunction
|
||||||
) => {
|
) => {
|
||||||
@@ -280,7 +280,7 @@ export default class NewCashflowTransactionController extends BaseController {
|
|||||||
* @param {NextFunction} next
|
* @param {NextFunction} next
|
||||||
*/
|
*/
|
||||||
public getUncategorizedCashflowTransactions = async (
|
public getUncategorizedCashflowTransactions = async (
|
||||||
req: Request,
|
req: Request<{ id: number }>,
|
||||||
res: Response,
|
res: Response,
|
||||||
next: NextFunction
|
next: NextFunction
|
||||||
) => {
|
) => {
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ export abstract class GetMatchedTransactionsByType {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Creates the common matched transaction.
|
||||||
* @param {number} tenantId
|
* @param {number} tenantId
|
||||||
* @param {Array<number>} uncategorizedTransactionIds
|
* @param {Array<number>} uncategorizedTransactionIds
|
||||||
* @param {IMatchTransactionDTO} matchTransactionDTO
|
* @param {IMatchTransactionDTO} matchTransactionDTO
|
||||||
|
|||||||
@@ -54,7 +54,8 @@ export class MatchBankTransactions {
|
|||||||
const uncategorizedTransactions =
|
const uncategorizedTransactions =
|
||||||
await UncategorizedCashflowTransaction.query()
|
await UncategorizedCashflowTransaction.query()
|
||||||
.whereIn('id', uncategorizedTransactionIds)
|
.whereIn('id', uncategorizedTransactionIds)
|
||||||
.withGraphFetched('matchedBankTransactions');
|
.withGraphFetched('matchedBankTransactions')
|
||||||
|
.throwIfNotFound();
|
||||||
|
|
||||||
// Validates the uncategorized transaction is not already matched.
|
// Validates the uncategorized transaction is not already matched.
|
||||||
validateUncategorizedTransactionsNotMatched(uncategorizedTransactions);
|
validateUncategorizedTransactionsNotMatched(uncategorizedTransactions);
|
||||||
|
|||||||
Reference in New Issue
Block a user