export const FRONT_APPS_CONTAINER = '@apps';
export const FRONT_TYPES_PATH = '@src/app/aurora.types';
export const APP_CONTAINER = '@app';
export const API_CONTAINER = '@api';
export const DASHBOARD_CONTAINER = 'app/domains/admin/bounded-contexts';
export const ADMIN_CONTAINER = 'app/domains/admin';
export const DASHBOARD_TRANSLATIONS = 'public/i18n';
export const AURORA_CORE_COMMON = '@aurorajs.dev/core-common';
export const AURORA_CORE_BACK = '@aurorajs.dev/core-back';
export const AURORA_CORE_FRONT = '@aurorajs.dev/core-front';
export const AURORA_LOCAL_PACKAGE = '@aurora';
export const SCHEMA_DEFINITION_EXTENSION = '.aurora.yaml';
export const CONFIG_YAML_VERSION = '0.0.1';
export const LOCK_JSON_VERSION = '0.1.0';
export const TIMESTAMP_FIELDS = ['createdAt', 'updatedAt', 'deletedAt'];
export const DELETED_AT_FIELD = ['deletedAt'];
/** SHA1 hashes of sentinel lines used to mark generator-ignored files. */
export const FILE_TAGS = {
    ignoredFile: '8ca93fe73cc6e48cde17e74342122d3b86210ff5',
    ignoredGraphQLFile: '03b1aa4e5de61b13327591869a4c96d5f82de70c',
    ignoredHtmlFile: '4e6c548816bc0b2087633182f1e7e0f75ecba428',
};
export const SKIP_DIRECTORIES = ['node_modules', 'dist', 'coverage', 'cliter'];
export const ALLOWED_RENDER_EXTENSIONS = [
    '.ts',
    '.js',
    '.json',
    '.graphql',
    '.env',
    '.md',
    '.txt',
    '.htm',
    '.html',
    '.yaml',
];
export const AVOID_OVERWRITING_FILES = [
    'backend/@app/index.ts',
    'backend/@api/__bounded_context_name__.module.ts',
    'frontend/module/__bounded_context_name__.navigation.ts',
    'frontend/module/__bounded_context_name__.module.ts',
    'frontend/module/__bounded_context_name__.routes.ts',
    'frontend/module/index.ts',
    'frontend/module-translations/en.json',
    'frontend/module-translations/es.json',
];
/** Maps PropertyType → JavaScript/TypeScript type string */
export const JAVASCRIPT_TYPES = {
    array: 'string[]',
    bigint: 'number',
    blob: 'string',
    'blob.long': 'string',
    'blob.medium': 'string',
    'blob.tiny': 'string',
    boolean: 'boolean',
    char: 'string',
    date: 'string',
    decimal: 'number',
    encrypted: 'string',
    enum: 'string',
    float: 'number',
    id: 'string',
    int: 'number',
    json: 'any',
    jsonb: 'any',
    manyToMany: 'string[]',
    password: 'string',
    smallint: 'number',
    text: 'string',
    timestamp: 'string',
    varchar: 'string',
};
/** Maps PropertyType → JavaScript model type (Buffer for blobs) */
export const JAVASCRIPT_MODEL_TYPES = {
    array: 'string[]',
    bigint: 'number',
    blob: 'Buffer',
    'blob.long': 'Buffer',
    'blob.medium': 'Buffer',
    'blob.tiny': 'Buffer',
    boolean: 'boolean',
    char: 'string',
    date: 'string',
    decimal: 'number',
    encrypted: 'string',
    enum: 'string',
    float: 'number',
    id: 'string',
    int: 'number',
    json: 'any',
    jsonb: 'any',
    manyToMany: 'string[]',
    password: 'string',
    smallint: 'number',
    text: 'string',
    timestamp: 'string',
    varchar: 'string',
};
/** Maps PropertyType → Swagger decorator type */
export const SWAGGER_TYPES = {
    array: 'Array',
    bigint: 'Number',
    blob: 'String',
    'blob.long': 'String',
    'blob.medium': 'String',
    'blob.tiny': 'String',
    boolean: 'Boolean',
    char: 'String',
    date: 'String',
    decimal: 'Number',
    encrypted: 'String',
    enum: 'String',
    float: 'Number',
    id: 'String',
    int: 'Number',
    json: 'Object',
    jsonb: 'Object',
    manyToMany: '[String]',
    password: 'String',
    smallint: 'Number',
    text: 'String',
    timestamp: 'String',
    varchar: 'String',
};
/** Maps PropertyType → GraphQL type string */
export const GRAPHQL_TYPES = {
    bigint: 'GraphQLInt',
    blob: 'GraphQLString',
    'blob.long': 'GraphQLString',
    'blob.medium': 'GraphQLString',
    'blob.tiny': 'GraphQLString',
    boolean: 'GraphQLBoolean',
    char: 'GraphQLString',
    date: 'GraphQLISODateTime',
    decimal: 'GraphQLFloat',
    encrypted: 'GraphQLString',
    enum: 'GraphQLString',
    float: 'GraphQLFloat',
    id: 'ID',
    int: 'GraphQLInt',
    json: 'JSON',
    jsonb: 'JSON',
    manyToMany: '[ID]',
    password: 'GraphQLString',
    smallint: 'GraphQLInt',
    text: 'GraphQLString',
    timestamp: 'GraphQLTimestamp',
    varchar: 'GraphQLString',
};
/** Maps PropertyType → dashboard column data type */
export const DASHBOARD_COLUMN_TYPES = {
    array: 'STRING',
    bigint: 'NUMBER',
    blob: 'BINARY',
    'blob.long': 'BINARY',
    'blob.medium': 'BINARY',
    'blob.tiny': 'BINARY',
    boolean: 'BOOLEAN',
    char: 'STRING',
    date: 'DATE',
    decimal: 'NUMBER',
    encrypted: 'STRING',
    enum: 'ENUM',
    float: 'NUMBER',
    id: 'STRING',
    int: 'NUMBER',
    json: 'JSON',
    jsonb: 'JSONB',
    manyToMany: '',
    password: 'STRING',
    smallint: 'NUMBER',
    text: 'STRING',
    timestamp: 'TIMESTAMP',
    varchar: 'STRING',
};
/** Whether a PropertyType supports unaccent search */
export const UNACCENT_MAP = {
    array: false,
    bigint: false,
    blob: false,
    'blob.long': false,
    'blob.medium': false,
    'blob.tiny': false,
    boolean: false,
    char: true,
    date: false,
    decimal: false,
    encrypted: false,
    enum: false,
    float: false,
    id: false,
    int: false,
    json: true,
    jsonb: true,
    manyToMany: false,
    password: false,
    smallint: false,
    text: true,
    timestamp: false,
    varchar: true,
};
/** Whether a PropertyType value needs quotes in generated code */
export const QUOTATION_TYPES = {
    bigint: false,
    blob: true,
    'blob.long': true,
    'blob.medium': true,
    'blob.tiny': true,
    boolean: false,
    char: true,
    date: true,
    decimal: false,
    encrypted: true,
    enum: false,
    float: false,
    id: true,
    int: false,
    json: false,
    jsonb: false,
    password: true,
    smallint: false,
    text: true,
    timestamp: true,
    varchar: true,
};
/** Default lengths per PropertyType */
export const DEFAULT_TYPE_LENGTH = {
    bigint: 20,
    char: 127,
    id: 36,
    int: 10,
    password: 255,
    smallint: 6,
    varchar: 255,
};
function getPropertyStringEnumOptions(property) {
    const options = property.enumOptions ?? property.arrayOptions?.enumOptions;
    return options?.map((o) => `'${o.trim().toUpperCase()}'`).join(',') ?? '';
}
export const SEQUELIZE_TYPES = {
    array(param) {
        const opts = param;
        return `DataTypes.ARRAY(${SEQUELIZE_TYPES[opts.type](opts)})`;
    },
    bigint: () => 'DataTypes.BIGINT',
    blob: () => 'DataTypes.BLOB',
    'blob.long': () => "DataTypes.BLOB('long')",
    'blob.medium': () => "DataTypes.BLOB('medium')",
    'blob.tiny': () => "DataTypes.BLOB('tiny')",
    boolean: () => 'DataTypes.BOOLEAN',
    char: (length) => `DataTypes.CHAR(${String(length)})`,
    date: () => 'DataTypes.DATE',
    decimal: (decimals) => `DataTypes.DECIMAL(${decimals.join(',')})`,
    encrypted: () => 'DataTypes.TEXT',
    enum: (prop) => `DataTypes.ENUM(${getPropertyStringEnumOptions(prop)})`,
    float: () => 'DataTypes.FLOAT',
    id: () => 'DataTypes.UUID',
    int: () => 'DataTypes.INTEGER',
    json: () => 'DataTypes.JSON',
    jsonb: () => 'DataTypes.JSONB',
    password: (length) => `DataTypes.STRING(${String(length)})`,
    smallint: () => 'DataTypes.SMALLINT',
    text: () => 'DataTypes.TEXT',
    timestamp: () => 'DataTypes.DATE',
    varchar(prop) {
        const p = prop;
        return `DataTypes.STRING(${p.maxLength ? String(p.maxLength) : ''})`;
    },
};
export const DTO_TYPES = {
    array: (property) => `${DTO_TYPES[property.arrayOptions.type]()}[]`,
    bigint: () => 'number',
    blob: () => 'string',
    'blob.long': () => 'string',
    'blob.medium': () => 'string',
    'blob.tiny': () => 'string',
    boolean: () => 'boolean',
    char: () => 'string',
    date: () => 'string',
    decimal: () => 'number',
    encrypted: () => 'string',
    enum: () => 'string',
    float: () => 'number',
    id: () => 'string',
    int: () => 'number',
    json: () => 'any',
    jsonb: () => 'any',
    manyToMany: () => 'string[]',
    password: () => 'string',
    smallint: () => 'number',
    text: () => 'string',
    timestamp: () => 'string',
    varchar: () => 'string',
};
export const BACK_PACKAGES = [
    {
        name: 'Authorization Code',
        packageFolder: 'authorization-code',
    },
    {
        members: ['iam', 'o-auth'],
        name: 'Identity (IAM + OAuth)',
        packageFolder: 'identity',
    },
];
export const FRONT_PACKAGES = [
    {
        members: ['iam', 'o-auth'],
        name: 'Identity (IAM + OAuth)',
        packageFolder: 'identity',
    },
];
export const PROPERTY_TYPE = {
    ARRAY: 'array',
    BIGINT: 'bigint',
    BLOB: 'blob',
    BOOLEAN: 'boolean',
    CHAR: 'char',
    DATE: 'date',
    DECIMAL: 'decimal',
    ENCRYPTED: 'encrypted',
    ENUM: 'enum',
    FLOAT: 'float',
    ID: 'id',
    INT: 'int',
    JSON: 'json',
    JSONB: 'jsonb',
    PASSWORD: 'password',
    RELATIONSHIP: 'relationship',
    SMALLINT: 'smallint',
    TEXT: 'text',
    TIMESTAMP: 'timestamp',
    VARCHAR: 'varchar',
};
export const RELATIONSHIP_TYPE = {
    MANY_TO_MANY: 'many-to-many',
    MANY_TO_ONE: 'many-to-one',
    NONE: 'none',
    ONE_TO_MANY: 'one-to-many',
    ONE_TO_ONE: 'one-to-one',
};
export const GENDER = {
    FEMININE: 'feminine',
    MASCULINE: 'masculine',
};
export const DETAIL_MODE = {
    DIALOG: 'dialog',
    VIEW: 'view',
};
