from app.models.enums import (
    FloorType,
    Orientation,
    NewApartmentImageTags
)

new_apartment_metadata = {
    'table_name': 'new_apartments',
    'image_tag_options': NewApartmentImageTags,
    'columns': {
        'id': {
            'sql_type': 'SERIAL',
            'type': int,
            'constraints': {'primary_key': True},
        },
        'building_id': {
            'sql_type': 'INTEGER',
            'type': int,
            'constraints': {
                'foreign_key': {
                    'ref_table': 'buildings',
                    'ref_column': 'id'
                },
            },
            'required': True
        },
        'type_id': {
            'sql_type': 'INTEGER',
            'type': int,
            'constraints': {
                'foreign_key': {
                    'ref_table': 'apartment_types',
                    'ref_column': 'id'
                },
            },
            'required': True
        },
        'apartment_number': {
            'sql_type': 'VARCHAR(100)',
            'type': str,
            'constraints': {'max_length': 100},
            'required': True
        },
        'area': {
            'sql_type': 'FLOAT',
            'type': float,
            'constraints': {'sign': 'positive'},
            'required': True
        },
        'floor_type': {
            'sql_type': 'VARCHAR(50)',
            'type': str,
            'constraints': {'enum': FloorType},
            'required': True
        },
        'floor_number': {
            'sql_type': 'INTEGER',
            'type': int,
            'constraints': {'sign': 'positive'},
            'required': True
        },
        'orientation': {
            'sql_type': 'VARCHAR(50)',
            'type': str,
            'constraints': {'enum': Orientation},
        },
        'number_of_terraces': {
            'sql_type': 'INTEGER',
            'type': int,
            'constraints': {'sign': 'positive'},
        },
        'price': {
            'sql_type': 'FLOAT',
            'type': float,
            'constraints': {'sign': 'positive', 'not_empty': True},
        },
        'created_at': {
            'sql_type': 'TIMESTAMP',
            'type': str,
            'constraints': {}
        }

    }
}
