import { DynamoEasyConfig } from '../../../config/dynamo-easy-config';
import { MomentType } from '../../../mapper/type/moment.type';
import { initOrUpdateProperty } from '../property/property.decorator';
export function Date() {
    return (target, propertyKey) => {
        if (typeof propertyKey === 'string') {
            // check the global config to decide which dat type we should use
            let dateType;
            switch (DynamoEasyConfig.config.dateType) {
                case 'default':
                    dateType = Date;
                    break;
                case 'moment':
                    dateType = MomentType;
                    break;
            }
            const typeInfo = {
                type: dateType,
                isCustom: true,
            };
            initOrUpdateProperty({ typeInfo }, target, propertyKey);
        }
    };
}
//# sourceMappingURL=date.decorator.js.map