mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 13:20:31 +00:00
46 lines
901 B
TypeScript
46 lines
901 B
TypeScript
import {
|
|
IsInt,
|
|
IsIn,
|
|
IsOptional,
|
|
IsArray,
|
|
ValidateNested,
|
|
IsString,
|
|
IsNumber,
|
|
} from 'class-validator';
|
|
import { Type } from 'class-transformer';
|
|
import { ToNumber } from '@/common/decorators/Validators';
|
|
import { LandedCostTransactionType } from '../types/BillLandedCosts.types';
|
|
|
|
export class AllocateBillLandedCostItemDto {
|
|
@IsInt()
|
|
@ToNumber()
|
|
entryId: number;
|
|
|
|
@IsNumber()
|
|
@ToNumber()
|
|
cost: number;
|
|
}
|
|
|
|
export class AllocateBillLandedCostDto {
|
|
@IsInt()
|
|
@ToNumber()
|
|
transactionId: number;
|
|
|
|
@IsIn(['Expense', 'Bill'])
|
|
transactionType: LandedCostTransactionType;
|
|
|
|
@IsInt()
|
|
transactionEntryId: number;
|
|
|
|
@IsIn(['value', 'quantity'])
|
|
allocationMethod: string;
|
|
|
|
@IsOptional()
|
|
@IsString()
|
|
description?: string | null;
|
|
|
|
@IsArray()
|
|
@ValidateNested({ each: true })
|
|
@Type(() => AllocateBillLandedCostItemDto)
|
|
items: AllocateBillLandedCostItemDto[];
|
|
} |