mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-18 13:50:31 +00:00
refactor: dtos validation
This commit is contained in:
@@ -25,12 +25,12 @@ export class CreateAccountDTO {
|
||||
|
||||
@IsString()
|
||||
@MinLength(3)
|
||||
@MaxLength(255) // Assuming DATATYPES_LENGTH.STRING is 255
|
||||
@MaxLength(255)
|
||||
accountType: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
@MaxLength(65535) // Assuming DATATYPES_LENGTH.TEXT is 65535
|
||||
@MaxLength(65535)
|
||||
description?: string;
|
||||
|
||||
@IsOptional()
|
||||
|
||||
@@ -18,6 +18,13 @@ import { TenantModelProxy } from '../System/models/TenantBaseModel';
|
||||
|
||||
@Injectable()
|
||||
export class CreateAccountService {
|
||||
/**
|
||||
* @param {TenantModelProxy<typeof Account>} accountModel - The account model proxy.
|
||||
* @param {EventEmitter2} eventEmitter - The event emitter.
|
||||
* @param {UnitOfWork} uow - The unit of work.
|
||||
* @param {CommandAccountValidators} validator - The command account validators.
|
||||
* @param {TenancyContext} tenancyContext - The tenancy context.
|
||||
*/
|
||||
constructor(
|
||||
@Inject(Account.name)
|
||||
private readonly accountModel: TenantModelProxy<typeof Account>,
|
||||
|
||||
Reference in New Issue
Block a user