mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-18 13:50:31 +00:00
refactor(nestjs): auth module
This commit is contained in:
@@ -4,7 +4,7 @@ import { IAPAgingSummaryQuery } from './APAgingSummary.types';
|
||||
import { AcceptType } from '@/constants/accept-type';
|
||||
import { Response } from 'express';
|
||||
import { ApiOperation, ApiTags } from '@nestjs/swagger';
|
||||
import { PublicRoute } from '@/modules/Auth/Jwt.guard';
|
||||
import { PublicRoute } from '@/modules/Auth/guards/Jwt.local';
|
||||
|
||||
@Controller('reports/payable-aging-summary')
|
||||
@ApiTags('reports')
|
||||
|
||||
@@ -4,7 +4,7 @@ import { Query, Res } from '@nestjs/common';
|
||||
import { ARAgingSummaryApplication } from './ARAgingSummaryApplication';
|
||||
import { AcceptType } from '@/constants/accept-type';
|
||||
import { Response } from 'express';
|
||||
import { PublicRoute } from '@/modules/Auth/Jwt.guard';
|
||||
import { PublicRoute } from '@/modules/Auth/guards/Jwt.local';
|
||||
import { ApiOperation, ApiTags } from '@nestjs/swagger';
|
||||
|
||||
@Controller('reports/receivable-aging-summary')
|
||||
|
||||
@@ -3,7 +3,7 @@ import { Controller, Get, Headers, Query, Res } from '@nestjs/common';
|
||||
import { ICashFlowStatementQuery } from './Cashflow.types';
|
||||
import { AcceptType } from '@/constants/accept-type';
|
||||
import { CashflowSheetApplication } from './CashflowSheetApplication';
|
||||
import { PublicRoute } from '@/modules/Auth/Jwt.guard';
|
||||
import { PublicRoute } from '@/modules/Auth/guards/Jwt.local';
|
||||
import { ApiOperation, ApiResponse, ApiTags } from '@nestjs/swagger';
|
||||
|
||||
@Controller('reports/cashflow-statement')
|
||||
|
||||
@@ -4,7 +4,7 @@ import { Controller, Get, Headers, Query, Res } from '@nestjs/common';
|
||||
import { ICustomerBalanceSummaryQuery } from './CustomerBalanceSummary.types';
|
||||
import { CustomerBalanceSummaryApplication } from './CustomerBalanceSummaryApplication';
|
||||
import { AcceptType } from '@/constants/accept-type';
|
||||
import { PublicRoute } from '@/modules/Auth/Jwt.guard';
|
||||
import { PublicRoute } from '@/modules/Auth/guards/Jwt.local';
|
||||
|
||||
@Controller('/reports/customer-balance-summary')
|
||||
@ApiTags('reports')
|
||||
|
||||
@@ -4,7 +4,7 @@ import { Controller, Get, Headers, Query, Res } from '@nestjs/common';
|
||||
import { IGeneralLedgerSheetQuery } from './GeneralLedger.types';
|
||||
import { GeneralLedgerApplication } from './GeneralLedgerApplication';
|
||||
import { AcceptType } from '@/constants/accept-type';
|
||||
import { PublicRoute } from '@/modules/Auth/Jwt.guard';
|
||||
import { PublicRoute } from '@/modules/Auth/guards/Jwt.local';
|
||||
|
||||
@Controller('/reports/general-ledger')
|
||||
@ApiTags('reports')
|
||||
|
||||
@@ -3,7 +3,7 @@ import { InventoryItemDetailsApplication } from './InventoryItemDetailsApplicati
|
||||
import { IInventoryDetailsQuery } from './InventoryItemDetails.types';
|
||||
import { AcceptType } from '@/constants/accept-type';
|
||||
import { Response } from 'express';
|
||||
import { PublicRoute } from '@/modules/Auth/Jwt.guard';
|
||||
import { PublicRoute } from '@/modules/Auth/guards/Jwt.local';
|
||||
import { ApiOperation, ApiTags } from '@nestjs/swagger';
|
||||
|
||||
@Controller('reports/inventory-item-details')
|
||||
|
||||
@@ -4,7 +4,7 @@ import { Controller, Get, Headers, Query, Res } from '@nestjs/common';
|
||||
import { InventoryValuationSheetApplication } from './InventoryValuationSheetApplication';
|
||||
import { IInventoryValuationReportQuery } from './InventoryValuationSheet.types';
|
||||
import { AcceptType } from '@/constants/accept-type';
|
||||
import { PublicRoute } from '@/modules/Auth/Jwt.guard';
|
||||
import { PublicRoute } from '@/modules/Auth/guards/Jwt.local';
|
||||
|
||||
@Controller('reports/inventory-valuation')
|
||||
@PublicRoute()
|
||||
|
||||
@@ -4,7 +4,7 @@ import { Response } from 'express';
|
||||
import { AcceptType } from '@/constants/accept-type';
|
||||
import { JournalSheetApplication } from './JournalSheetApplication';
|
||||
import { ApiOperation, ApiResponse, ApiTags } from '@nestjs/swagger';
|
||||
import { PublicRoute } from '@/modules/Auth/Jwt.guard';
|
||||
import { PublicRoute } from '@/modules/Auth/guards/Jwt.local';
|
||||
|
||||
@Controller('/reports/journal')
|
||||
@ApiTags('reports')
|
||||
|
||||
@@ -3,7 +3,7 @@ import { Controller, Get, Headers, Query, Res } from '@nestjs/common';
|
||||
import { IProfitLossSheetQuery } from './ProfitLossSheet.types';
|
||||
import { ProfitLossSheetApplication } from './ProfitLossSheetApplication';
|
||||
import { AcceptType } from '@/constants/accept-type';
|
||||
import { PublicRoute } from '@/modules/Auth/Jwt.guard';
|
||||
import { PublicRoute } from '@/modules/Auth/guards/Jwt.local';
|
||||
import { ApiOperation, ApiResponse, ApiTags } from '@nestjs/swagger';
|
||||
|
||||
@Controller('/reports/profit-loss-sheet')
|
||||
|
||||
@@ -3,7 +3,7 @@ import { Controller, Get, Headers, Query, Res } from '@nestjs/common';
|
||||
import { PurchasesByItemsApplication } from './PurchasesByItemsApplication';
|
||||
import { IPurchasesByItemsReportQuery } from './types/PurchasesByItems.types';
|
||||
import { AcceptType } from '@/constants/accept-type';
|
||||
import { PublicRoute } from '@/modules/Auth/Jwt.guard';
|
||||
import { PublicRoute } from '@/modules/Auth/guards/Jwt.local';
|
||||
import {
|
||||
ApiOperation,
|
||||
ApiResponse,
|
||||
|
||||
@@ -3,7 +3,7 @@ import { SalesTaxLiabilitySummaryQuery } from './SalesTaxLiability.types';
|
||||
import { AcceptType } from '@/constants/accept-type';
|
||||
import { SalesTaxLiabilitySummaryApplication } from './SalesTaxLiabilitySummaryApplication';
|
||||
import { Response } from 'express';
|
||||
import { PublicRoute } from '@/modules/Auth/Jwt.guard';
|
||||
import { PublicRoute } from '@/modules/Auth/guards/Jwt.local';
|
||||
import { ApiOperation, ApiResponse, ApiTags } from '@nestjs/swagger';
|
||||
|
||||
@Controller('/reports/sales-tax-liability-summary')
|
||||
|
||||
@@ -4,7 +4,7 @@ import { ITransactionsByCustomersFilter } from './TransactionsByCustomer.types';
|
||||
import { TransactionsByCustomerApplication } from './TransactionsByCustomersApplication';
|
||||
import { AcceptType } from '@/constants/accept-type';
|
||||
import { Response } from 'express';
|
||||
import { PublicRoute } from '@/modules/Auth/Jwt.guard';
|
||||
import { PublicRoute } from '@/modules/Auth/guards/Jwt.local';
|
||||
|
||||
@Controller('/reports/transactions-by-customers')
|
||||
@ApiTags('reports')
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Controller, Get, Query } from '@nestjs/common';
|
||||
import { TransactionsByReferenceApplication } from './TransactionsByReferenceApplication';
|
||||
import { ITransactionsByReferenceQuery } from './TransactionsByReference.types';
|
||||
import { PublicRoute } from '@/modules/Auth/Jwt.guard';
|
||||
import { PublicRoute } from '@/modules/Auth/guards/Jwt.local';
|
||||
import { ApiOperation, ApiResponse, ApiTags } from '@nestjs/swagger';
|
||||
|
||||
@Controller('reports/transactions-by-reference')
|
||||
|
||||
@@ -4,7 +4,7 @@ import { AcceptType } from '@/constants/accept-type';
|
||||
import { Response } from 'express';
|
||||
import { TransactionsByVendorApplication } from './TransactionsByVendorApplication';
|
||||
import { ApiOperation, ApiResponse, ApiTags } from '@nestjs/swagger';
|
||||
import { PublicRoute } from '@/modules/Auth/Jwt.guard';
|
||||
import { PublicRoute } from '@/modules/Auth/guards/Jwt.local';
|
||||
|
||||
@Controller('/reports/transactions-by-vendors')
|
||||
@ApiTags('reports')
|
||||
|
||||
@@ -1,17 +1,11 @@
|
||||
import {
|
||||
Controller,
|
||||
Get,
|
||||
Headers,
|
||||
Query,
|
||||
Res,
|
||||
} from '@nestjs/common';
|
||||
import { Controller, Get, Headers, Query, Res } from '@nestjs/common';
|
||||
import { ApiOperation, ApiResponse, ApiTags } from '@nestjs/swagger';
|
||||
import { castArray } from 'lodash';
|
||||
import { Response } from 'express';
|
||||
import { ITrialBalanceSheetQuery } from './TrialBalanceSheet.types';
|
||||
import { AcceptType } from '@/constants/accept-type';
|
||||
import { TrialBalanceSheetApplication } from './TrialBalanceSheetApplication';
|
||||
import { PublicRoute } from '@/modules/Auth/Jwt.guard';
|
||||
import { PublicRoute } from '@/modules/Auth/guards/Jwt.local';
|
||||
|
||||
@Controller('reports/trial-balance-sheet')
|
||||
@ApiTags('reports')
|
||||
@@ -35,9 +29,8 @@ export class TrialBalanceSheetController {
|
||||
};
|
||||
// Retrieves in json table format.
|
||||
if (acceptHeader.includes(AcceptType.ApplicationJsonTable)) {
|
||||
const { table, meta, query } = await this.trialBalanceSheetApp.table(
|
||||
filter,
|
||||
);
|
||||
const { table, meta, query } =
|
||||
await this.trialBalanceSheetApp.table(filter);
|
||||
return res.status(200).send({ table, meta, query });
|
||||
// Retrieves in xlsx format
|
||||
} else if (acceptHeader.includes(AcceptType.ApplicationXlsx)) {
|
||||
@@ -66,9 +59,8 @@ export class TrialBalanceSheetController {
|
||||
res.send(pdfContent);
|
||||
// Retrieves in json format.
|
||||
} else {
|
||||
const { data, query, meta } = await this.trialBalanceSheetApp.sheet(
|
||||
filter,
|
||||
);
|
||||
const { data, query, meta } =
|
||||
await this.trialBalanceSheetApp.sheet(filter);
|
||||
return res.status(200).send({ data, query, meta });
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ import { VendorBalanceSummaryApplication } from './VendorBalanceSummaryApplicati
|
||||
import { Response } from 'express';
|
||||
import { AcceptType } from '@/constants/accept-type';
|
||||
import { ApiOperation, ApiResponse, ApiTags } from '@nestjs/swagger';
|
||||
import { PublicRoute } from '@/modules/Auth/Jwt.guard';
|
||||
import { PublicRoute } from '@/modules/Auth/guards/Jwt.local';
|
||||
|
||||
@Controller('/reports/vendor-balance-summary')
|
||||
@ApiTags('reports')
|
||||
|
||||
Reference in New Issue
Block a user