Commit 3e413378 authored by nanahira's avatar nanahira

add BooleanColumn and fix things

parent 2707ab0f
...@@ -82,7 +82,7 @@ export const StringColumn = ( ...@@ -82,7 +82,7 @@ export const StringColumn = (
export const IntColumn = ( export const IntColumn = (
type: WithWidthColumnType, type: WithWidthColumnType,
options: PropertyOptions<string, ColumnWithWidthOptions> & { options: PropertyOptions<number, ColumnWithWidthOptions> & {
unsigned?: boolean; unsigned?: boolean;
} = {}, } = {},
): PropertyDecorator => { ): PropertyDecorator => {
...@@ -108,7 +108,7 @@ export const IntColumn = ( ...@@ -108,7 +108,7 @@ export const IntColumn = (
export const FloatColumn = ( export const FloatColumn = (
type: WithPrecisionColumnType, type: WithPrecisionColumnType,
options: PropertyOptions<string, ColumnNumericOptions> & { options: PropertyOptions<number, ColumnNumericOptions> & {
unsigned?: boolean; unsigned?: boolean;
} = {}, } = {},
): PropertyDecorator => { ): PropertyDecorator => {
...@@ -158,6 +158,13 @@ export const EnumColumn = <T>( ...@@ -158,6 +158,13 @@ export const EnumColumn = <T>(
]); ]);
}; };
export const BoolColumn = (options: PropertyOptions<boolean> = {}): PropertyDecorator => MergePropertyDecorators([
Index(),
Column('boolean', columnDecoratorOptions(options)),
validatorDecorator(options),
swaggerDecorator(options, { type: Boolean }),
])
export const NotColumn = ( export const NotColumn = (
options: OpenAPIOptions<any> = {}, options: OpenAPIOptions<any> = {},
): PropertyDecorator => ): PropertyDecorator =>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment