mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-15 04:10:32 +00:00
fix: passing number format to reports
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { Type } from 'class-transformer';
|
||||
import { Transform, Type } from 'class-transformer';
|
||||
import {
|
||||
IsBoolean,
|
||||
IsEnum,
|
||||
@@ -7,6 +7,7 @@ import {
|
||||
IsPositive,
|
||||
} from 'class-validator';
|
||||
import { ApiPropertyOptional } from '@nestjs/swagger';
|
||||
import { parseBoolean } from '@/utils/parse-boolean';
|
||||
|
||||
export class NumberFormatQueryDto {
|
||||
@ApiPropertyOptional({
|
||||
@@ -24,6 +25,7 @@ export class NumberFormatQueryDto {
|
||||
example: false,
|
||||
})
|
||||
@IsBoolean()
|
||||
@Transform(({ value }) => parseBoolean(value, false))
|
||||
@IsOptional()
|
||||
readonly divideOn1000: boolean;
|
||||
|
||||
@@ -32,6 +34,7 @@ export class NumberFormatQueryDto {
|
||||
example: true,
|
||||
})
|
||||
@IsBoolean()
|
||||
@Transform(({ value }) => parseBoolean(value, false))
|
||||
@IsOptional()
|
||||
readonly showZero: boolean;
|
||||
|
||||
|
||||
@@ -81,6 +81,7 @@ export class CashFlowStatementQueryDto extends FinancialSheetBranchesQueryDto {
|
||||
})
|
||||
@ValidateNested()
|
||||
@Type(() => NumberFormatQueryDto)
|
||||
@IsOptional()
|
||||
numberFormat: NumberFormatQueryDto;
|
||||
|
||||
@ApiProperty({
|
||||
|
||||
@@ -32,7 +32,7 @@ export class InventoryItemDetailsQueryDto {
|
||||
@ApiPropertyOptional({
|
||||
description: 'Number format for the inventory item details',
|
||||
})
|
||||
numberFormat: INumberFormatQuery;
|
||||
numberFormat: NumberFormatQueryDto;
|
||||
|
||||
@Transform(({ value }) => parseBoolean(value, false))
|
||||
@IsBoolean()
|
||||
|
||||
@@ -7,11 +7,13 @@ import {
|
||||
IsEnum,
|
||||
IsOptional,
|
||||
IsString,
|
||||
ValidateNested,
|
||||
} from 'class-validator';
|
||||
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
|
||||
import { Transform, Type } from 'class-transformer';
|
||||
import { ToNumber } from '@/common/decorators/Validators';
|
||||
import { parseBoolean } from '@/utils/parse-boolean';
|
||||
import { NumberFormatQueryDto } from '@/modules/BankingTransactions/dtos/NumberFormatQuery.dto';
|
||||
|
||||
export class ProfitLossSheetQueryDto extends FinancialSheetBranchesQueryDto {
|
||||
@IsString()
|
||||
@@ -30,8 +32,10 @@ export class ProfitLossSheetQueryDto extends FinancialSheetBranchesQueryDto {
|
||||
toDate: moment.MomentInput;
|
||||
|
||||
@ApiProperty({ description: 'Number format configuration' })
|
||||
@Type(() => Object)
|
||||
numberFormat: INumberFormatQuery;
|
||||
@ValidateNested()
|
||||
@Type(() => NumberFormatQueryDto)
|
||||
@IsOptional()
|
||||
numberFormat: NumberFormatQueryDto;
|
||||
|
||||
@IsBoolean()
|
||||
@Transform(({ value }) => parseBoolean(value, false))
|
||||
|
||||
Reference in New Issue
Block a user