feat: wip server folder structure (#4573)
* feat: wip server folder structure * fix: merge * fix: wrong merge * fix: remove unused file * fix: comment * fix: lint * fix: merge * fix: remove console.log * fix: metadata graphql arguments broken
This commit is contained in:
@ -0,0 +1,93 @@
|
||||
import {
|
||||
IsArray,
|
||||
IsBoolean,
|
||||
IsDate,
|
||||
IsJSON,
|
||||
IsNotEmpty,
|
||||
IsNumber,
|
||||
IsNumberString,
|
||||
IsString,
|
||||
Matches,
|
||||
ValidateIf,
|
||||
} from 'class-validator';
|
||||
|
||||
export class FieldMetadataDefaultValueString {
|
||||
@ValidateIf((_object, value) => value !== null)
|
||||
@IsString()
|
||||
value: string | null;
|
||||
}
|
||||
|
||||
export class FieldMetadataDefaultValueJson {
|
||||
@ValidateIf((_object, value) => value !== null)
|
||||
@IsJSON()
|
||||
value: JSON | null;
|
||||
}
|
||||
|
||||
export class FieldMetadataDefaultValueNumber {
|
||||
@ValidateIf((_object, value) => value !== null)
|
||||
@IsNumber()
|
||||
value: number | null;
|
||||
}
|
||||
|
||||
export class FieldMetadataDefaultValueBoolean {
|
||||
@ValidateIf((_object, value) => value !== null)
|
||||
@IsBoolean()
|
||||
value: boolean | null;
|
||||
}
|
||||
|
||||
export class FieldMetadataDefaultValueStringArray {
|
||||
@ValidateIf((_object, value) => value !== null)
|
||||
@IsArray()
|
||||
@IsString({ each: true })
|
||||
value: string[] | null;
|
||||
}
|
||||
|
||||
export class FieldMetadataDefaultValueDateTime {
|
||||
@ValidateIf((_object, value) => value !== null)
|
||||
@IsDate()
|
||||
value: Date | null;
|
||||
}
|
||||
|
||||
export class FieldMetadataDefaultValueLink {
|
||||
@ValidateIf((_object, value) => value !== null)
|
||||
@IsString()
|
||||
label: string | null;
|
||||
|
||||
@ValidateIf((_object, value) => value !== null)
|
||||
@IsString()
|
||||
url: string | null;
|
||||
}
|
||||
|
||||
export class FieldMetadataDefaultValueCurrency {
|
||||
@ValidateIf((_object, value) => value !== null)
|
||||
@IsNumberString()
|
||||
amountMicros: string | null;
|
||||
|
||||
@ValidateIf((_object, value) => value !== null)
|
||||
@IsString()
|
||||
currencyCode: string | null;
|
||||
}
|
||||
|
||||
export class FieldMetadataDefaultValueFullName {
|
||||
@ValidateIf((_object, value) => value !== null)
|
||||
@IsString()
|
||||
firstName: string | null;
|
||||
|
||||
@ValidateIf((_object, value) => value !== null)
|
||||
@IsString()
|
||||
lastName: string | null;
|
||||
}
|
||||
|
||||
export class FieldMetadataDynamicDefaultValueUuid {
|
||||
@Matches('uuid')
|
||||
@IsNotEmpty()
|
||||
@IsString()
|
||||
type: 'uuid';
|
||||
}
|
||||
|
||||
export class FieldMetadataDynamicDefaultValueNow {
|
||||
@Matches('now')
|
||||
@IsNotEmpty()
|
||||
@IsString()
|
||||
type: 'now';
|
||||
}
|
||||
Reference in New Issue
Block a user