import { Validators } from '@angular/forms'

export class CategoryField {
    constructor(
        public name: string,
        public validators = [],
        public type: string = 'string',
        public defaultValue?: string,
        public inTable: boolean = true
    ) {}
}

export const categoryFields: CategoryField[] = [
    new CategoryField('name', [Validators.required]),
    new CategoryField('description', [Validators.required]),
    new CategoryField('group', [Validators.required, Validators.maxLength(4), Validators.minLength(4)]),
    new CategoryField('minor_group_1', [Validators.required, Validators.maxLength(4), Validators.minLength(4)]),
    new CategoryField('minor_group_2', [Validators.required, Validators.maxLength(4), Validators.minLength(4)], 'string', '----'),
    new CategoryField('status', [Validators.required, Validators.maxLength(1), Validators.minLength(1)], 'string', 'E'),
    //new CategoryField('auto_import', [], 'boolean'),
    new CategoryField('gis_type', [Validators.required, Validators.pattern('^(Point|Line|Polygon)$')], 'string', 'Point'),
    new CategoryField('long_name'),
    new CategoryField('symbol', [Validators.maxLength(1), Validators.minLength(1)], 'string'),
    new CategoryField('mapbox_type_custom', [], 'string', '', false),
    new CategoryField('mapbox_paint', [], 'string', '', false),
    new CategoryField('mapbox_layout', [], 'string', '', false),
    new CategoryField('viewable_role', [], 'string', '', false),
    new CategoryField('extra', [], 'string', '', false),
]
