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