{
  "slug": "banking-app",
  "runtimes": {
    "node": {
      "frameworks": {
        "express": {
          "databases": {
            "mysql": {
              "orms": {
                "drizzle": {
                  "templates": {
                    "index": {
                      "architectures": {
                        "mvc": {
                          "files": [
                            {
                              "type": "file",
                              "path": "drizzle.config.ts",
                              "content": "import { Config, defineConfig } from \"drizzle-kit\";\n\nexport default defineConfig({\n  out: \"./src/drizzle/migrations\",\n  schema: \"./src/drizzle/index.ts\",\n  dialect: \"mysql\",\n  dbCredentials: {\n    url: process.env.DATABASE_URL!\n  },\n  verbose: true,\n  strict: true\n}) satisfies Config;\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/index.ts",
                              "content": "export * from \"./schemas/user.schema\";\nexport * from \"./schemas/ledger.schema\";\nexport * from \"./schemas/transaction.schema\";\nexport * from \"./schemas/account.schema\";\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/user.schema.ts",
                              "content": "import {\n  mysqlTable,\n  varchar,\n  boolean,\n  timestamp,\n  int,\n  json,\n  uniqueIndex,\n  index,\n  mysqlEnum\n} from \"drizzle-orm/mysql-core\";\nimport { timestamps } from \"./schema.helper\";\n\nexport interface IAvatar {\n  public_id?: string;\n  url: string;\n  size?: number;\n}\n\nexport const users = mysqlTable(\n  \"users\",\n  {\n    id: int(\"id\").primaryKey().autoincrement(),\n    name: varchar(\"name\", { length: 100 }).notNull(),\n    email: varchar(\"email\", { length: 255 }).notNull().unique(),\n    password: varchar(\"password\", { length: 255 }),\n    role: mysqlEnum(\"role\", [\"user\", \"admin\"]).default(\"user\").notNull(),\n\n    provider: mysqlEnum(\"provider\", [\"local\", \"google\", \"github\"])\n      .default(\"local\")\n      .notNull(),\n    providerId: varchar(\"provider_id\", { length: 255 }),\n\n    avatar: json(\"avatar\").$type<IAvatar>(),\n\n    isEmailVerified: boolean(\"is_email_verified\").default(false).notNull(),\n    lastLoginAt: timestamp(\"last_login_at\"),\n    failedLoginAttempts: int(\"failed_login_attempts\").default(0).notNull(),\n    lockUntil: timestamp(\"lock_until\"),\n\n    isDeleted: boolean(\"is_deleted\").default(false).notNull(),\n    deletedAt: timestamp(\"deleted_at\"),\n    reActivateAvailableAt: timestamp(\"re_activate_available_at\"),\n\n    ...timestamps\n  },\n  table => [\n    uniqueIndex(\"email_idx\").on(table.email),\n    index(\"role_idx\").on(table.role),\n    index(\"is_deleted_idx\").on(table.isDeleted)\n  ]\n);\n\n//? User type\nexport type User = typeof users.$inferSelect;\nexport type NewUser = typeof users.$inferInsert;\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/transaction.schema.ts",
                              "content": "import {\n  mysqlTable,\n  varchar,\n  int,\n  mysqlEnum,\n  index,\n  uniqueIndex,\n  decimal\n} from \"drizzle-orm/mysql-core\";\nimport { timestamps } from \"./schema.helper\";\nimport { accounts } from \"./account.schema\";\n\n// Transaction status\nexport const TRANSACTION_STATUS = [\n  \"pending\",\n  \"completed\",\n  \"failed\",\n  \"reversed\"\n] as const;\nexport type TransactionStatus = (typeof TRANSACTION_STATUS)[number];\n\nexport const transactions = mysqlTable(\n  \"transactions\",\n  {\n    id: int(\"id\").primaryKey().autoincrement(),\n    fromAccountId: int(\"from_account_id\")\n      .references(() => accounts.id)\n      .notNull(),\n    toAccountId: int(\"to_account_id\")\n      .references(() => accounts.id)\n      .notNull(),\n    amount: decimal(\"amount\", { precision: 15, scale: 2 }).notNull(),\n    status: mysqlEnum(\"status\", TRANSACTION_STATUS)\n      .default(\"pending\")\n      .notNull(),\n    idempotencyKey: varchar(\"idempotency_key\", { length: 255 })\n      .notNull()\n      .unique(),\n    ...timestamps\n  },\n  table => [\n    index(\"from_account_id_idx\").on(table.fromAccountId),\n    index(\"to_account_id_idx\").on(table.toAccountId),\n    index(\"status_idx\").on(table.status),\n    uniqueIndex(\"idempotency_key_idx\").on(table.idempotencyKey)\n  ]\n);\n\n// Transaction types\nexport type Transaction = typeof transactions.$inferSelect;\nexport type NewTransaction = typeof transactions.$inferInsert;\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/schema.helper.ts",
                              "content": "import { timestamp } from \"drizzle-orm/mysql-core\";\n\nexport const timestamps = {\n  createdAt: timestamp(\"created_at\").defaultNow().notNull(),\n  updatedAt: timestamp(\"updated_at\").defaultNow().onUpdateNow().notNull()\n};\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/relations.ts",
                              "content": "import { relations } from \"drizzle-orm\";\nimport { accounts } from \"./account.schema\";\nimport { transactions } from \"./transaction.schema\";\nimport { ledgers } from \"./ledger.schema\";\nimport { users } from \"./user.schema\";\n\n// User relations\nexport const usersRelations = relations(users, ({ many }) => ({\n  accounts: many(accounts)\n}));\n\n// Account relations\nexport const accountsRelations = relations(accounts, ({ one, many }) => ({\n  user: one(users, {\n    fields: [accounts.userId],\n    references: [users.id]\n  }),\n  ledgers: many(ledgers)\n}));\n\n// Transaction relations\nexport const transactionsRelations = relations(transactions, ({ many }) => ({\n  ledgers: many(ledgers)\n}));\n\n// Ledger relations\nexport const ledgersRelations = relations(ledgers, ({ one }) => ({\n  account: one(accounts, {\n    fields: [ledgers.accountId],\n    references: [accounts.id]\n  }),\n  transaction: one(transactions, {\n    fields: [ledgers.transactionId],\n    references: [transactions.id]\n  })\n}));\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/ledger.schema.ts",
                              "content": "import {\n  mysqlTable,\n  int,\n  mysqlEnum,\n  index,\n  decimal\n} from \"drizzle-orm/mysql-core\";\nimport { timestamps } from \"./schema.helper\";\nimport { accounts } from \"./account.schema\";\nimport { transactions } from \"./transaction.schema\";\n\n// Ledger entry types\nexport const LEDGER_ENTRY_TYPES = [\"debit\", \"credit\"] as const;\nexport type LedgerEntryType = (typeof LEDGER_ENTRY_TYPES)[number];\n\nexport const ledgers = mysqlTable(\n  \"ledgers\",\n  {\n    id: int(\"id\").primaryKey().autoincrement(),\n    accountId: int(\"account_id\")\n      .references(() => accounts.id)\n      .notNull(),\n    transactionId: int(\"transaction_id\")\n      .references(() => transactions.id)\n      .notNull(),\n    entryType: mysqlEnum(\"entry_type\", LEDGER_ENTRY_TYPES).notNull(),\n    amount: decimal(\"amount\", { precision: 15, scale: 2 }).notNull(),\n    ...timestamps\n  },\n  table => [\n    index(\"account_id_idx\").on(table.accountId),\n    index(\"transaction_id_idx\").on(table.transactionId),\n    index(\"entry_type_idx\").on(table.entryType)\n  ]\n);\n\n// Ledger types\nexport type Ledger = typeof ledgers.$inferSelect;\nexport type NewLedger = typeof ledgers.$inferInsert;\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/account.schema.ts",
                              "content": "import {\n  mysqlTable,\n  boolean,\n  int,\n  mysqlEnum,\n  index\n} from \"drizzle-orm/mysql-core\";\nimport { timestamps } from \"./schema.helper\";\nimport { users } from \"./user.schema\";\n\n//? Account types\nexport const ACCOUNT_TYPES = [\"savings\", \"current\"] as const;\nexport type AccountType = (typeof ACCOUNT_TYPES)[number];\n\n//? Account currencies\nexport const ACCOUNT_CURRENCIES = [\"NPR\", \"INR\", \"USD\"] as const;\nexport type AccountCurrency = (typeof ACCOUNT_CURRENCIES)[number];\n\n//? Account status\nexport const ACCOUNT_STATUS = [\"active\", \"frozen\", \"closed\"] as const;\nexport type AccountStatus = (typeof ACCOUNT_STATUS)[number];\n\nexport const accounts = mysqlTable(\n  \"accounts\",\n  {\n    id: int(\"id\").primaryKey().autoincrement(),\n    userId: int(\"user_id\")\n      .references(() => users.id)\n      .notNull(),\n    type: mysqlEnum(\"type\", ACCOUNT_TYPES).notNull(),\n    currency: mysqlEnum(\"currency\", ACCOUNT_CURRENCIES)\n      .default(\"NPR\")\n      .notNull(),\n    status: mysqlEnum(\"status\", ACCOUNT_STATUS).default(\"active\").notNull(),\n    systemAccount: boolean(\"system_account\").default(false).notNull(),\n    ...timestamps\n  },\n  table => [\n    index(\"user_id_idx\").on(table.userId),\n    index(\"status_idx\").on(table.status),\n    index(\"type_idx\").on(table.type)\n  ]\n);\n\n// Account types\nexport type Account = typeof accounts.$inferSelect;\nexport type NewAccount = typeof accounts.$inferInsert;\n"
                            }
                          ]
                        },
                        "feature": {
                          "files": [
                            {
                              "type": "file",
                              "path": "drizzle.config.ts",
                              "content": "import { Config, defineConfig } from \"drizzle-kit\";\n\nexport default defineConfig({\n  out: \"./src/drizzle/migrations\",\n  schema: \"./src/drizzle/index.ts\",\n  dialect: \"mysql\",\n  dbCredentials: {\n    url: process.env.DATABASE_URL!\n  },\n  verbose: true,\n  strict: true\n}) satisfies Config;\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/index.ts",
                              "content": "export * from \"./schemas/user.schema\";\nexport * from \"./schemas/ledger.schema\";\nexport * from \"./schemas/transaction.schema\";\nexport * from \"./schemas/account.schema\";\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/user.schema.ts",
                              "content": "import {\n  mysqlTable,\n  varchar,\n  boolean,\n  timestamp,\n  int,\n  json,\n  uniqueIndex,\n  index,\n  mysqlEnum\n} from \"drizzle-orm/mysql-core\";\nimport { timestamps } from \"./schema.helper\";\n\nexport interface IAvatar {\n  public_id?: string;\n  url: string;\n  size?: number;\n}\n\nexport const users = mysqlTable(\n  \"users\",\n  {\n    id: int(\"id\").primaryKey().autoincrement(),\n    name: varchar(\"name\", { length: 100 }).notNull(),\n    email: varchar(\"email\", { length: 255 }).notNull().unique(),\n    password: varchar(\"password\", { length: 255 }),\n    role: mysqlEnum(\"role\", [\"user\", \"admin\"]).default(\"user\").notNull(),\n\n    provider: mysqlEnum(\"provider\", [\"local\", \"google\", \"github\"])\n      .default(\"local\")\n      .notNull(),\n    providerId: varchar(\"provider_id\", { length: 255 }),\n\n    avatar: json(\"avatar\").$type<IAvatar>(),\n\n    isEmailVerified: boolean(\"is_email_verified\").default(false).notNull(),\n    lastLoginAt: timestamp(\"last_login_at\"),\n    failedLoginAttempts: int(\"failed_login_attempts\").default(0).notNull(),\n    lockUntil: timestamp(\"lock_until\"),\n\n    isDeleted: boolean(\"is_deleted\").default(false).notNull(),\n    deletedAt: timestamp(\"deleted_at\"),\n    reActivateAvailableAt: timestamp(\"re_activate_available_at\"),\n\n    ...timestamps\n  },\n  table => [\n    uniqueIndex(\"email_idx\").on(table.email),\n    index(\"role_idx\").on(table.role),\n    index(\"is_deleted_idx\").on(table.isDeleted)\n  ]\n);\n\n//? User type\nexport type User = typeof users.$inferSelect;\nexport type NewUser = typeof users.$inferInsert;\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/transaction.schema.ts",
                              "content": "import {\n  mysqlTable,\n  varchar,\n  int,\n  mysqlEnum,\n  index,\n  uniqueIndex,\n  decimal\n} from \"drizzle-orm/mysql-core\";\nimport { timestamps } from \"./schema.helper\";\nimport { accounts } from \"./account.schema\";\n\n// Transaction status\nexport const TRANSACTION_STATUS = [\n  \"pending\",\n  \"completed\",\n  \"failed\",\n  \"reversed\"\n] as const;\nexport type TransactionStatus = (typeof TRANSACTION_STATUS)[number];\n\nexport const transactions = mysqlTable(\n  \"transactions\",\n  {\n    id: int(\"id\").primaryKey().autoincrement(),\n    fromAccountId: int(\"from_account_id\")\n      .references(() => accounts.id)\n      .notNull(),\n    toAccountId: int(\"to_account_id\")\n      .references(() => accounts.id)\n      .notNull(),\n    amount: decimal(\"amount\", { precision: 15, scale: 2 }).notNull(),\n    status: mysqlEnum(\"status\", TRANSACTION_STATUS)\n      .default(\"pending\")\n      .notNull(),\n    idempotencyKey: varchar(\"idempotency_key\", { length: 255 })\n      .notNull()\n      .unique(),\n    ...timestamps\n  },\n  table => [\n    index(\"from_account_id_idx\").on(table.fromAccountId),\n    index(\"to_account_id_idx\").on(table.toAccountId),\n    index(\"status_idx\").on(table.status),\n    uniqueIndex(\"idempotency_key_idx\").on(table.idempotencyKey)\n  ]\n);\n\n// Transaction types\nexport type Transaction = typeof transactions.$inferSelect;\nexport type NewTransaction = typeof transactions.$inferInsert;\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/schema.helper.ts",
                              "content": "import { timestamp } from \"drizzle-orm/mysql-core\";\n\nexport const timestamps = {\n  createdAt: timestamp(\"created_at\").defaultNow().notNull(),\n  updatedAt: timestamp(\"updated_at\").defaultNow().onUpdateNow().notNull()\n};\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/relations.ts",
                              "content": "import { relations } from \"drizzle-orm\";\nimport { accounts } from \"./account.schema\";\nimport { transactions } from \"./transaction.schema\";\nimport { ledgers } from \"./ledger.schema\";\nimport { users } from \"./user.schema\";\n\n// User relations\nexport const usersRelations = relations(users, ({ many }) => ({\n  accounts: many(accounts)\n}));\n\n// Account relations\nexport const accountsRelations = relations(accounts, ({ one, many }) => ({\n  user: one(users, {\n    fields: [accounts.userId],\n    references: [users.id]\n  }),\n  ledgers: many(ledgers)\n}));\n\n// Transaction relations\nexport const transactionsRelations = relations(transactions, ({ many }) => ({\n  ledgers: many(ledgers)\n}));\n\n// Ledger relations\nexport const ledgersRelations = relations(ledgers, ({ one }) => ({\n  account: one(accounts, {\n    fields: [ledgers.accountId],\n    references: [accounts.id]\n  }),\n  transaction: one(transactions, {\n    fields: [ledgers.transactionId],\n    references: [transactions.id]\n  })\n}));\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/ledger.schema.ts",
                              "content": "import {\n  mysqlTable,\n  int,\n  mysqlEnum,\n  index,\n  decimal\n} from \"drizzle-orm/mysql-core\";\nimport { timestamps } from \"./schema.helper\";\nimport { accounts } from \"./account.schema\";\nimport { transactions } from \"./transaction.schema\";\n\n// Ledger entry types\nexport const LEDGER_ENTRY_TYPES = [\"debit\", \"credit\"] as const;\nexport type LedgerEntryType = (typeof LEDGER_ENTRY_TYPES)[number];\n\nexport const ledgers = mysqlTable(\n  \"ledgers\",\n  {\n    id: int(\"id\").primaryKey().autoincrement(),\n    accountId: int(\"account_id\")\n      .references(() => accounts.id)\n      .notNull(),\n    transactionId: int(\"transaction_id\")\n      .references(() => transactions.id)\n      .notNull(),\n    entryType: mysqlEnum(\"entry_type\", LEDGER_ENTRY_TYPES).notNull(),\n    amount: decimal(\"amount\", { precision: 15, scale: 2 }).notNull(),\n    ...timestamps\n  },\n  table => [\n    index(\"account_id_idx\").on(table.accountId),\n    index(\"transaction_id_idx\").on(table.transactionId),\n    index(\"entry_type_idx\").on(table.entryType)\n  ]\n);\n\n// Ledger types\nexport type Ledger = typeof ledgers.$inferSelect;\nexport type NewLedger = typeof ledgers.$inferInsert;\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/account.schema.ts",
                              "content": "import {\n  mysqlTable,\n  boolean,\n  int,\n  mysqlEnum,\n  index\n} from \"drizzle-orm/mysql-core\";\nimport { timestamps } from \"./schema.helper\";\nimport { users } from \"./user.schema\";\n\n//? Account types\nexport const ACCOUNT_TYPES = [\"savings\", \"current\"] as const;\nexport type AccountType = (typeof ACCOUNT_TYPES)[number];\n\n//? Account currencies\nexport const ACCOUNT_CURRENCIES = [\"NPR\", \"INR\", \"USD\"] as const;\nexport type AccountCurrency = (typeof ACCOUNT_CURRENCIES)[number];\n\n//? Account status\nexport const ACCOUNT_STATUS = [\"active\", \"frozen\", \"closed\"] as const;\nexport type AccountStatus = (typeof ACCOUNT_STATUS)[number];\n\nexport const accounts = mysqlTable(\n  \"accounts\",\n  {\n    id: int(\"id\").primaryKey().autoincrement(),\n    userId: int(\"user_id\")\n      .references(() => users.id)\n      .notNull(),\n    type: mysqlEnum(\"type\", ACCOUNT_TYPES).notNull(),\n    currency: mysqlEnum(\"currency\", ACCOUNT_CURRENCIES)\n      .default(\"NPR\")\n      .notNull(),\n    status: mysqlEnum(\"status\", ACCOUNT_STATUS).default(\"active\").notNull(),\n    systemAccount: boolean(\"system_account\").default(false).notNull(),\n    ...timestamps\n  },\n  table => [\n    index(\"user_id_idx\").on(table.userId),\n    index(\"status_idx\").on(table.status),\n    index(\"type_idx\").on(table.type)\n  ]\n);\n\n// Account types\nexport type Account = typeof accounts.$inferSelect;\nexport type NewAccount = typeof accounts.$inferInsert;\n"
                            }
                          ]
                        }
                      }
                    },
                    "account": {
                      "architectures": {
                        "mvc": {
                          "files": [
                            {
                              "type": "file",
                              "path": "drizzle.config.ts",
                              "content": "import { Config, defineConfig } from \"drizzle-kit\";\n\nexport default defineConfig({\n  out: \"./src/drizzle/migrations\",\n  schema: \"./src/drizzle/index.ts\",\n  dialect: \"mysql\",\n  dbCredentials: {\n    url: process.env.DATABASE_URL!\n  },\n  verbose: true,\n  strict: true\n}) satisfies Config;\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/index.ts",
                              "content": "export * from \"./schemas/account.schema\";\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/account.schema.ts",
                              "content": "import {\n  mysqlTable,\n  boolean,\n  timestamp,\n  int,\n  mysqlEnum,\n  index\n} from \"drizzle-orm/mysql-core\";\n\nexport const timestamps = {\n  createdAt: timestamp(\"created_at\").defaultNow().notNull(),\n  updatedAt: timestamp(\"updated_at\").defaultNow().onUpdateNow().notNull()\n};\n\n//? Account types\nexport const ACCOUNT_TYPES = [\"savings\", \"current\"] as const;\nexport type AccountType = (typeof ACCOUNT_TYPES)[number];\n\n//? Account currencies\nexport const ACCOUNT_CURRENCIES = [\"NPR\", \"INR\", \"USD\"] as const;\nexport type AccountCurrency = (typeof ACCOUNT_CURRENCIES)[number];\n\n//? Account status\nexport const ACCOUNT_STATUS = [\"active\", \"frozen\", \"closed\"] as const;\nexport type AccountStatus = (typeof ACCOUNT_STATUS)[number];\n\nexport const accounts = mysqlTable(\n  \"accounts\",\n  {\n    id: int(\"id\").primaryKey().autoincrement(),\n    userId: int(\"user_id\")\n      // .references(() => users.id)\n      .notNull(),\n    type: mysqlEnum(\"type\", ACCOUNT_TYPES).notNull(),\n    currency: mysqlEnum(\"currency\", ACCOUNT_CURRENCIES)\n      .default(\"NPR\")\n      .notNull(),\n    status: mysqlEnum(\"status\", ACCOUNT_STATUS).default(\"active\").notNull(),\n    systemAccount: boolean(\"system_account\").default(false).notNull(),\n    ...timestamps\n  },\n  table => [\n    index(\"user_id_idx\").on(table.userId),\n    index(\"status_idx\").on(table.status),\n    index(\"type_idx\").on(table.type)\n  ]\n);\n\n// Account types\nexport type Account = typeof accounts.$inferSelect;\nexport type NewAccount = typeof accounts.$inferInsert;\n"
                            }
                          ]
                        },
                        "feature": {
                          "files": [
                            {
                              "type": "file",
                              "path": "drizzle.config.ts",
                              "content": "import { Config, defineConfig } from \"drizzle-kit\";\n\nexport default defineConfig({\n  out: \"./src/drizzle/migrations\",\n  schema: \"./src/drizzle/index.ts\",\n  dialect: \"mysql\",\n  dbCredentials: {\n    url: process.env.DATABASE_URL!\n  },\n  verbose: true,\n  strict: true\n}) satisfies Config;\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/index.ts",
                              "content": "export * from \"./schemas/account.schema\";\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/account.schema.ts",
                              "content": "import {\n  mysqlTable,\n  boolean,\n  timestamp,\n  int,\n  mysqlEnum,\n  index\n} from \"drizzle-orm/mysql-core\";\n\nexport const timestamps = {\n  createdAt: timestamp(\"created_at\").defaultNow().notNull(),\n  updatedAt: timestamp(\"updated_at\").defaultNow().onUpdateNow().notNull()\n};\n\n//? Account types\nexport const ACCOUNT_TYPES = [\"savings\", \"current\"] as const;\nexport type AccountType = (typeof ACCOUNT_TYPES)[number];\n\n//? Account currencies\nexport const ACCOUNT_CURRENCIES = [\"NPR\", \"INR\", \"USD\"] as const;\nexport type AccountCurrency = (typeof ACCOUNT_CURRENCIES)[number];\n\n//? Account status\nexport const ACCOUNT_STATUS = [\"active\", \"frozen\", \"closed\"] as const;\nexport type AccountStatus = (typeof ACCOUNT_STATUS)[number];\n\nexport const accounts = mysqlTable(\n  \"accounts\",\n  {\n    id: int(\"id\").primaryKey().autoincrement(),\n    userId: int(\"user_id\")\n      // .references(() => users.id)\n      .notNull(),\n    type: mysqlEnum(\"type\", ACCOUNT_TYPES).notNull(),\n    currency: mysqlEnum(\"currency\", ACCOUNT_CURRENCIES)\n      .default(\"NPR\")\n      .notNull(),\n    status: mysqlEnum(\"status\", ACCOUNT_STATUS).default(\"active\").notNull(),\n    systemAccount: boolean(\"system_account\").default(false).notNull(),\n    ...timestamps\n  },\n  table => [\n    index(\"user_id_idx\").on(table.userId),\n    index(\"status_idx\").on(table.status),\n    index(\"type_idx\").on(table.type)\n  ]\n);\n\n// Account types\nexport type Account = typeof accounts.$inferSelect;\nexport type NewAccount = typeof accounts.$inferInsert;\n"
                            }
                          ]
                        }
                      }
                    },
                    "user": {
                      "architectures": {
                        "mvc": {
                          "files": [
                            {
                              "type": "file",
                              "path": "drizzle.config.ts",
                              "content": "import { Config, defineConfig } from \"drizzle-kit\";\n\nexport default defineConfig({\n  out: \"./src/drizzle/migrations\",\n  schema: \"./src/drizzle/index.ts\",\n  dialect: \"mysql\",\n  dbCredentials: {\n    url: process.env.DATABASE_URL!\n  },\n  verbose: true,\n  strict: true\n}) satisfies Config;\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/index.ts",
                              "content": "export * from \"./schemas/user.schema\";\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/user.schema.ts",
                              "content": "import {\n  mysqlTable,\n  varchar,\n  boolean,\n  timestamp,\n  int,\n  json,\n  uniqueIndex,\n  index,\n  mysqlEnum\n} from \"drizzle-orm/mysql-core\";\n\nexport interface IAvatar {\n  public_id?: string;\n  url: string;\n  size?: number;\n}\n\nexport const timestamps = {\n  createdAt: timestamp(\"created_at\").defaultNow().notNull(),\n  updatedAt: timestamp(\"updated_at\").defaultNow().onUpdateNow().notNull()\n};\n\nexport const users = mysqlTable(\n  \"users\",\n  {\n    id: int(\"id\").primaryKey().autoincrement(),\n    name: varchar(\"name\", { length: 100 }).notNull(),\n    email: varchar(\"email\", { length: 255 }).notNull().unique(),\n    password: varchar(\"password\", { length: 255 }),\n    role: mysqlEnum(\"role\", [\"user\", \"admin\"]).default(\"user\").notNull(),\n\n    provider: mysqlEnum(\"provider\", [\"local\", \"google\", \"github\"])\n      .default(\"local\")\n      .notNull(),\n    providerId: varchar(\"provider_id\", { length: 255 }),\n\n    avatar: json(\"avatar\").$type<IAvatar>(),\n\n    isEmailVerified: boolean(\"is_email_verified\").default(false).notNull(),\n    lastLoginAt: timestamp(\"last_login_at\"),\n    failedLoginAttempts: int(\"failed_login_attempts\").default(0).notNull(),\n    lockUntil: timestamp(\"lock_until\"),\n\n    isDeleted: boolean(\"is_deleted\").default(false).notNull(),\n    deletedAt: timestamp(\"deleted_at\"),\n    reActivateAvailableAt: timestamp(\"re_activate_available_at\"),\n\n    ...timestamps\n  },\n  table => [\n    uniqueIndex(\"email_idx\").on(table.email),\n    index(\"role_idx\").on(table.role),\n    index(\"is_deleted_idx\").on(table.isDeleted)\n  ]\n);\n\n//? User type\nexport type User = typeof users.$inferSelect;\nexport type NewUser = typeof users.$inferInsert;\n"
                            }
                          ]
                        },
                        "feature": {
                          "files": [
                            {
                              "type": "file",
                              "path": "drizzle.config.ts",
                              "content": "import { Config, defineConfig } from \"drizzle-kit\";\n\nexport default defineConfig({\n  out: \"./src/drizzle/migrations\",\n  schema: \"./src/drizzle/index.ts\",\n  dialect: \"mysql\",\n  dbCredentials: {\n    url: process.env.DATABASE_URL!\n  },\n  verbose: true,\n  strict: true\n}) satisfies Config;\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/index.ts",
                              "content": "export * from \"./schemas/user.schema\";\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/user.schema.ts",
                              "content": "import {\n  mysqlTable,\n  varchar,\n  boolean,\n  timestamp,\n  int,\n  json,\n  uniqueIndex,\n  index,\n  mysqlEnum\n} from \"drizzle-orm/mysql-core\";\n\nexport interface IAvatar {\n  public_id?: string;\n  url: string;\n  size?: number;\n}\n\nexport const timestamps = {\n  createdAt: timestamp(\"created_at\").defaultNow().notNull(),\n  updatedAt: timestamp(\"updated_at\").defaultNow().onUpdateNow().notNull()\n};\n\nexport const users = mysqlTable(\n  \"users\",\n  {\n    id: int(\"id\").primaryKey().autoincrement(),\n    name: varchar(\"name\", { length: 100 }).notNull(),\n    email: varchar(\"email\", { length: 255 }).notNull().unique(),\n    password: varchar(\"password\", { length: 255 }),\n    role: mysqlEnum(\"role\", [\"user\", \"admin\"]).default(\"user\").notNull(),\n\n    provider: mysqlEnum(\"provider\", [\"local\", \"google\", \"github\"])\n      .default(\"local\")\n      .notNull(),\n    providerId: varchar(\"provider_id\", { length: 255 }),\n\n    avatar: json(\"avatar\").$type<IAvatar>(),\n\n    isEmailVerified: boolean(\"is_email_verified\").default(false).notNull(),\n    lastLoginAt: timestamp(\"last_login_at\"),\n    failedLoginAttempts: int(\"failed_login_attempts\").default(0).notNull(),\n    lockUntil: timestamp(\"lock_until\"),\n\n    isDeleted: boolean(\"is_deleted\").default(false).notNull(),\n    deletedAt: timestamp(\"deleted_at\"),\n    reActivateAvailableAt: timestamp(\"re_activate_available_at\"),\n\n    ...timestamps\n  },\n  table => [\n    uniqueIndex(\"email_idx\").on(table.email),\n    index(\"role_idx\").on(table.role),\n    index(\"is_deleted_idx\").on(table.isDeleted)\n  ]\n);\n\n//? User type\nexport type User = typeof users.$inferSelect;\nexport type NewUser = typeof users.$inferInsert;\n"
                            }
                          ]
                        }
                      }
                    },
                    "transaction": {
                      "architectures": {
                        "mvc": {
                          "files": [
                            {
                              "type": "file",
                              "path": "drizzle.config.ts",
                              "content": "import { Config, defineConfig } from \"drizzle-kit\";\n\nexport default defineConfig({\n  out: \"./src/drizzle/migrations\",\n  schema: \"./src/drizzle/index.ts\",\n  dialect: \"mysql\",\n  dbCredentials: {\n    url: process.env.DATABASE_URL!\n  },\n  verbose: true,\n  strict: true\n}) satisfies Config;\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/index.ts",
                              "content": "export * from \"./schemas/transaction.schema\";\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/transaction.schema.ts",
                              "content": "import {\n  mysqlTable,\n  varchar,\n  timestamp,\n  int,\n  mysqlEnum,\n  index,\n  uniqueIndex,\n  decimal\n} from \"drizzle-orm/mysql-core\";\n\nexport const timestamps = {\n  createdAt: timestamp(\"created_at\").defaultNow().notNull(),\n  updatedAt: timestamp(\"updated_at\").defaultNow().onUpdateNow().notNull()\n};\n\n// Transaction status\nexport const TRANSACTION_STATUS = [\n  \"pending\",\n  \"completed\",\n  \"failed\",\n  \"reversed\"\n] as const;\nexport type TransactionStatus = (typeof TRANSACTION_STATUS)[number];\n\nexport const transactions = mysqlTable(\n  \"transactions\",\n  {\n    id: int(\"id\").primaryKey().autoincrement(),\n    fromAccountId: int(\"from_account_id\")\n      //todo .references(() => accounts.id)\n      .notNull(),\n    toAccountId: int(\"to_account_id\")\n      //todo .references(() => accounts.id)\n      .notNull(),\n    amount: decimal(\"amount\", { precision: 15, scale: 2 }).notNull(),\n    status: mysqlEnum(\"status\", TRANSACTION_STATUS)\n      .default(\"pending\")\n      .notNull(),\n    idempotencyKey: varchar(\"idempotency_key\", { length: 255 })\n      .notNull()\n      .unique(),\n    ...timestamps\n  },\n  table => [\n    index(\"from_account_id_idx\").on(table.fromAccountId),\n    index(\"to_account_id_idx\").on(table.toAccountId),\n    index(\"status_idx\").on(table.status),\n    uniqueIndex(\"idempotency_key_idx\").on(table.idempotencyKey)\n  ]\n);\n\n// Transaction types\nexport type Transaction = typeof transactions.$inferSelect;\nexport type NewTransaction = typeof transactions.$inferInsert;\n"
                            }
                          ]
                        },
                        "feature": {
                          "files": [
                            {
                              "type": "file",
                              "path": "drizzle.config.ts",
                              "content": "import { Config, defineConfig } from \"drizzle-kit\";\n\nexport default defineConfig({\n  out: \"./src/drizzle/migrations\",\n  schema: \"./src/drizzle/index.ts\",\n  dialect: \"mysql\",\n  dbCredentials: {\n    url: process.env.DATABASE_URL!\n  },\n  verbose: true,\n  strict: true\n}) satisfies Config;\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/index.ts",
                              "content": "export * from \"./schemas/transaction.schema\";\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/transaction.schema.ts",
                              "content": "import {\n  mysqlTable,\n  varchar,\n  timestamp,\n  int,\n  mysqlEnum,\n  index,\n  uniqueIndex,\n  decimal\n} from \"drizzle-orm/mysql-core\";\n\nexport const timestamps = {\n  createdAt: timestamp(\"created_at\").defaultNow().notNull(),\n  updatedAt: timestamp(\"updated_at\").defaultNow().onUpdateNow().notNull()\n};\n\n// Transaction status\nexport const TRANSACTION_STATUS = [\n  \"pending\",\n  \"completed\",\n  \"failed\",\n  \"reversed\"\n] as const;\nexport type TransactionStatus = (typeof TRANSACTION_STATUS)[number];\n\nexport const transactions = mysqlTable(\n  \"transactions\",\n  {\n    id: int(\"id\").primaryKey().autoincrement(),\n    fromAccountId: int(\"from_account_id\")\n      //todo .references(() => accounts.id)\n      .notNull(),\n    toAccountId: int(\"to_account_id\")\n      //todo .references(() => accounts.id)\n      .notNull(),\n    amount: decimal(\"amount\", { precision: 15, scale: 2 }).notNull(),\n    status: mysqlEnum(\"status\", TRANSACTION_STATUS)\n      .default(\"pending\")\n      .notNull(),\n    idempotencyKey: varchar(\"idempotency_key\", { length: 255 })\n      .notNull()\n      .unique(),\n    ...timestamps\n  },\n  table => [\n    index(\"from_account_id_idx\").on(table.fromAccountId),\n    index(\"to_account_id_idx\").on(table.toAccountId),\n    index(\"status_idx\").on(table.status),\n    uniqueIndex(\"idempotency_key_idx\").on(table.idempotencyKey)\n  ]\n);\n\n// Transaction types\nexport type Transaction = typeof transactions.$inferSelect;\nexport type NewTransaction = typeof transactions.$inferInsert;\n"
                            }
                          ]
                        }
                      }
                    },
                    "ledger": {
                      "architectures": {
                        "mvc": {
                          "files": [
                            {
                              "type": "file",
                              "path": "drizzle.config.ts",
                              "content": "import { Config, defineConfig } from \"drizzle-kit\";\n\nexport default defineConfig({\n  out: \"./src/drizzle/migrations\",\n  schema: \"./src/drizzle/index.ts\",\n  dialect: \"mysql\",\n  dbCredentials: {\n    url: process.env.DATABASE_URL!\n  },\n  verbose: true,\n  strict: true\n}) satisfies Config;\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/index.ts",
                              "content": "export * from \"./schemas/user.schema\";\nexport * from \"./schemas/ledger.schema\";\nexport * from \"./schemas/transaction.schema\";\nexport * from \"./schemas/account.schema\";\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/user.schema.ts",
                              "content": "import {\n  mysqlTable,\n  varchar,\n  boolean,\n  timestamp,\n  int,\n  json,\n  uniqueIndex,\n  index,\n  mysqlEnum\n} from \"drizzle-orm/mysql-core\";\nimport { timestamps } from \"./schema.helper\";\nimport { relations } from \"drizzle-orm\";\n\nexport interface IAvatar {\n  public_id?: string;\n  url: string;\n  size?: number;\n}\n\nexport const users = mysqlTable(\n  \"users\",\n  {\n    id: int(\"id\").primaryKey().autoincrement(),\n    name: varchar(\"name\", { length: 100 }).notNull(),\n    email: varchar(\"email\", { length: 255 }).notNull().unique(),\n    password: varchar(\"password\", { length: 255 }),\n    role: mysqlEnum(\"role\", [\"user\", \"admin\"]).default(\"user\").notNull(),\n\n    provider: mysqlEnum(\"provider\", [\"local\", \"google\", \"github\"])\n      .default(\"local\")\n      .notNull(),\n    providerId: varchar(\"provider_id\", { length: 255 }),\n\n    avatar: json(\"avatar\").$type<IAvatar>(),\n\n    isEmailVerified: boolean(\"is_email_verified\").default(false).notNull(),\n    lastLoginAt: timestamp(\"last_login_at\"),\n    failedLoginAttempts: int(\"failed_login_attempts\").default(0).notNull(),\n    lockUntil: timestamp(\"lock_until\"),\n\n    isDeleted: boolean(\"is_deleted\").default(false).notNull(),\n    deletedAt: timestamp(\"deleted_at\"),\n    reActivateAvailableAt: timestamp(\"re_activate_available_at\"),\n\n    ...timestamps\n  },\n  table => [\n    uniqueIndex(\"email_idx\").on(table.email),\n    index(\"role_idx\").on(table.role),\n    index(\"is_deleted_idx\").on(table.isDeleted)\n  ]\n);\n\n//? User type\nexport type User = typeof users.$inferSelect;\nexport type NewUser = typeof users.$inferInsert;\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/transaction.schema.ts",
                              "content": "import {\n  mysqlTable,\n  varchar,\n  timestamp,\n  int,\n  mysqlEnum,\n  index,\n  uniqueIndex,\n  decimal\n} from \"drizzle-orm/mysql-core\";\nimport { timestamps } from \"./schema.helper\";\nimport { accounts } from \"./account.schema\";\n\n// Transaction status\nexport const TRANSACTION_STATUS = [\n  \"pending\",\n  \"completed\",\n  \"failed\",\n  \"reversed\"\n] as const;\nexport type TransactionStatus = (typeof TRANSACTION_STATUS)[number];\n\nexport const transactions = mysqlTable(\n  \"transactions\",\n  {\n    id: int(\"id\").primaryKey().autoincrement(),\n    fromAccountId: int(\"from_account_id\")\n      .references(() => accounts.id)\n      .notNull(),\n    toAccountId: int(\"to_account_id\")\n      .references(() => accounts.id)\n      .notNull(),\n    amount: decimal(\"amount\", { precision: 15, scale: 2 }).notNull(),\n    status: mysqlEnum(\"status\", TRANSACTION_STATUS)\n      .default(\"pending\")\n      .notNull(),\n    idempotencyKey: varchar(\"idempotency_key\", { length: 255 })\n      .notNull()\n      .unique(),\n    ...timestamps\n  },\n  table => [\n    index(\"from_account_id_idx\").on(table.fromAccountId),\n    index(\"to_account_id_idx\").on(table.toAccountId),\n    index(\"status_idx\").on(table.status),\n    uniqueIndex(\"idempotency_key_idx\").on(table.idempotencyKey)\n  ]\n);\n\n// Transaction types\nexport type Transaction = typeof transactions.$inferSelect;\nexport type NewTransaction = typeof transactions.$inferInsert;\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/schema.helper.ts",
                              "content": "import { timestamp } from \"drizzle-orm/mysql-core\";\n\nexport const timestamps = {\n  createdAt: timestamp(\"created_at\").defaultNow().notNull(),\n  updatedAt: timestamp(\"updated_at\").defaultNow().onUpdateNow().notNull()\n};\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/relations.ts",
                              "content": "import { relations } from \"drizzle-orm\";\nimport { accounts } from \"./account.schema\";\nimport { transactions } from \"./transaction.schema\";\nimport { ledgers } from \"./ledger.schema\";\nimport { users } from \"./user.schema\";\n\n// User relations\nexport const usersRelations = relations(users, ({ many }) => ({\n  accounts: many(accounts)\n}));\n\n// Account relations\nexport const accountsRelations = relations(accounts, ({ one, many }) => ({\n  user: one(users, {\n    fields: [accounts.userId],\n    references: [users.id]\n  }),\n  ledgers: many(ledgers)\n}));\n\n// Transaction relations\nexport const transactionsRelations = relations(transactions, ({ many }) => ({\n  ledgers: many(ledgers)\n}));\n\n// Ledger relations\nexport const ledgersRelations = relations(ledgers, ({ one }) => ({\n  account: one(accounts, {\n    fields: [ledgers.accountId],\n    references: [accounts.id]\n  }),\n  transaction: one(transactions, {\n    fields: [ledgers.transactionId],\n    references: [transactions.id]\n  })\n}));\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/ledger.schema.ts",
                              "content": "import {\n  mysqlTable,\n  int,\n  mysqlEnum,\n  index,\n  decimal\n} from \"drizzle-orm/mysql-core\";\nimport { timestamps } from \"./schema.helper\";\nimport { accounts } from \"./account.schema\";\nimport { transactions } from \"./transaction.schema\";\n\n// Ledger entry types\nexport const LEDGER_ENTRY_TYPES = [\"debit\", \"credit\"] as const;\nexport type LedgerEntryType = (typeof LEDGER_ENTRY_TYPES)[number];\n\nexport const ledgers = mysqlTable(\n  \"ledgers\",\n  {\n    id: int(\"id\").primaryKey().autoincrement(),\n    accountId: int(\"account_id\")\n      .references(() => accounts.id)\n      .notNull(),\n    transactionId: int(\"transaction_id\")\n      .references(() => transactions.id)\n      .notNull(),\n    entryType: mysqlEnum(\"entry_type\", LEDGER_ENTRY_TYPES).notNull(),\n    amount: decimal(\"amount\", { precision: 15, scale: 2 }).notNull(),\n    ...timestamps\n  },\n  table => [\n    index(\"account_id_idx\").on(table.accountId),\n    index(\"transaction_id_idx\").on(table.transactionId),\n    index(\"entry_type_idx\").on(table.entryType)\n  ]\n);\n\n// Ledger types\nexport type Ledger = typeof ledgers.$inferSelect;\nexport type NewLedger = typeof ledgers.$inferInsert;\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/account.schema.ts",
                              "content": "import {\n  mysqlTable,\n  boolean,\n  int,\n  mysqlEnum,\n  index\n} from \"drizzle-orm/mysql-core\";\nimport { timestamps } from \"./schema.helper\";\nimport { users } from \"./user.schema\";\n\n//? Account types\nexport const ACCOUNT_TYPES = [\"savings\", \"current\"] as const;\nexport type AccountType = (typeof ACCOUNT_TYPES)[number];\n\n//? Account currencies\nexport const ACCOUNT_CURRENCIES = [\"NPR\", \"INR\", \"USD\"] as const;\nexport type AccountCurrency = (typeof ACCOUNT_CURRENCIES)[number];\n\n//? Account status\nexport const ACCOUNT_STATUS = [\"active\", \"frozen\", \"closed\"] as const;\nexport type AccountStatus = (typeof ACCOUNT_STATUS)[number];\n\nexport const accounts = mysqlTable(\n  \"accounts\",\n  {\n    id: int(\"id\").primaryKey().autoincrement(),\n    userId: int(\"user_id\")\n      .references(() => users.id)\n      .notNull(),\n    type: mysqlEnum(\"type\", ACCOUNT_TYPES).notNull(),\n    currency: mysqlEnum(\"currency\", ACCOUNT_CURRENCIES)\n      .default(\"NPR\")\n      .notNull(),\n    status: mysqlEnum(\"status\", ACCOUNT_STATUS).default(\"active\").notNull(),\n    systemAccount: boolean(\"system_account\").default(false).notNull(),\n    ...timestamps\n  },\n  table => [\n    index(\"user_id_idx\").on(table.userId),\n    index(\"status_idx\").on(table.status),\n    index(\"type_idx\").on(table.type)\n  ]\n);\n\n// Account types\nexport type Account = typeof accounts.$inferSelect;\nexport type NewAccount = typeof accounts.$inferInsert;\n"
                            }
                          ]
                        },
                        "feature": {
                          "files": [
                            {
                              "type": "file",
                              "path": "drizzle.config.ts",
                              "content": "import { Config, defineConfig } from \"drizzle-kit\";\n\nexport default defineConfig({\n  out: \"./src/drizzle/migrations\",\n  schema: \"./src/drizzle/index.ts\",\n  dialect: \"mysql\",\n  dbCredentials: {\n    url: process.env.DATABASE_URL!\n  },\n  verbose: true,\n  strict: true\n}) satisfies Config;\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/index.ts",
                              "content": "export * from \"./schemas/user.schema\";\nexport * from \"./schemas/ledger.schema\";\nexport * from \"./schemas/transaction.schema\";\nexport * from \"./schemas/account.schema\";\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/user.schema.ts",
                              "content": "import {\n  mysqlTable,\n  varchar,\n  boolean,\n  timestamp,\n  int,\n  json,\n  uniqueIndex,\n  index,\n  mysqlEnum\n} from \"drizzle-orm/mysql-core\";\nimport { timestamps } from \"./schema.helper\";\nimport { relations } from \"drizzle-orm\";\n\nexport interface IAvatar {\n  public_id?: string;\n  url: string;\n  size?: number;\n}\n\nexport const users = mysqlTable(\n  \"users\",\n  {\n    id: int(\"id\").primaryKey().autoincrement(),\n    name: varchar(\"name\", { length: 100 }).notNull(),\n    email: varchar(\"email\", { length: 255 }).notNull().unique(),\n    password: varchar(\"password\", { length: 255 }),\n    role: mysqlEnum(\"role\", [\"user\", \"admin\"]).default(\"user\").notNull(),\n\n    provider: mysqlEnum(\"provider\", [\"local\", \"google\", \"github\"])\n      .default(\"local\")\n      .notNull(),\n    providerId: varchar(\"provider_id\", { length: 255 }),\n\n    avatar: json(\"avatar\").$type<IAvatar>(),\n\n    isEmailVerified: boolean(\"is_email_verified\").default(false).notNull(),\n    lastLoginAt: timestamp(\"last_login_at\"),\n    failedLoginAttempts: int(\"failed_login_attempts\").default(0).notNull(),\n    lockUntil: timestamp(\"lock_until\"),\n\n    isDeleted: boolean(\"is_deleted\").default(false).notNull(),\n    deletedAt: timestamp(\"deleted_at\"),\n    reActivateAvailableAt: timestamp(\"re_activate_available_at\"),\n\n    ...timestamps\n  },\n  table => [\n    uniqueIndex(\"email_idx\").on(table.email),\n    index(\"role_idx\").on(table.role),\n    index(\"is_deleted_idx\").on(table.isDeleted)\n  ]\n);\n\n//? User type\nexport type User = typeof users.$inferSelect;\nexport type NewUser = typeof users.$inferInsert;\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/transaction.schema.ts",
                              "content": "import {\n  mysqlTable,\n  varchar,\n  timestamp,\n  int,\n  mysqlEnum,\n  index,\n  uniqueIndex,\n  decimal\n} from \"drizzle-orm/mysql-core\";\nimport { timestamps } from \"./schema.helper\";\nimport { accounts } from \"./account.schema\";\n\n// Transaction status\nexport const TRANSACTION_STATUS = [\n  \"pending\",\n  \"completed\",\n  \"failed\",\n  \"reversed\"\n] as const;\nexport type TransactionStatus = (typeof TRANSACTION_STATUS)[number];\n\nexport const transactions = mysqlTable(\n  \"transactions\",\n  {\n    id: int(\"id\").primaryKey().autoincrement(),\n    fromAccountId: int(\"from_account_id\")\n      .references(() => accounts.id)\n      .notNull(),\n    toAccountId: int(\"to_account_id\")\n      .references(() => accounts.id)\n      .notNull(),\n    amount: decimal(\"amount\", { precision: 15, scale: 2 }).notNull(),\n    status: mysqlEnum(\"status\", TRANSACTION_STATUS)\n      .default(\"pending\")\n      .notNull(),\n    idempotencyKey: varchar(\"idempotency_key\", { length: 255 })\n      .notNull()\n      .unique(),\n    ...timestamps\n  },\n  table => [\n    index(\"from_account_id_idx\").on(table.fromAccountId),\n    index(\"to_account_id_idx\").on(table.toAccountId),\n    index(\"status_idx\").on(table.status),\n    uniqueIndex(\"idempotency_key_idx\").on(table.idempotencyKey)\n  ]\n);\n\n// Transaction types\nexport type Transaction = typeof transactions.$inferSelect;\nexport type NewTransaction = typeof transactions.$inferInsert;\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/schema.helper.ts",
                              "content": "import { timestamp } from \"drizzle-orm/mysql-core\";\n\nexport const timestamps = {\n  createdAt: timestamp(\"created_at\").defaultNow().notNull(),\n  updatedAt: timestamp(\"updated_at\").defaultNow().onUpdateNow().notNull()\n};\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/relations.ts",
                              "content": "import { relations } from \"drizzle-orm\";\nimport { accounts } from \"./account.schema\";\nimport { transactions } from \"./transaction.schema\";\nimport { ledgers } from \"./ledger.schema\";\nimport { users } from \"./user.schema\";\n\n// User relations\nexport const usersRelations = relations(users, ({ many }) => ({\n  accounts: many(accounts)\n}));\n\n// Account relations\nexport const accountsRelations = relations(accounts, ({ one, many }) => ({\n  user: one(users, {\n    fields: [accounts.userId],\n    references: [users.id]\n  }),\n  ledgers: many(ledgers)\n}));\n\n// Transaction relations\nexport const transactionsRelations = relations(transactions, ({ many }) => ({\n  ledgers: many(ledgers)\n}));\n\n// Ledger relations\nexport const ledgersRelations = relations(ledgers, ({ one }) => ({\n  account: one(accounts, {\n    fields: [ledgers.accountId],\n    references: [accounts.id]\n  }),\n  transaction: one(transactions, {\n    fields: [ledgers.transactionId],\n    references: [transactions.id]\n  })\n}));\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/ledger.schema.ts",
                              "content": "import {\n  mysqlTable,\n  int,\n  mysqlEnum,\n  index,\n  decimal\n} from \"drizzle-orm/mysql-core\";\nimport { timestamps } from \"./schema.helper\";\nimport { accounts } from \"./account.schema\";\nimport { transactions } from \"./transaction.schema\";\n\n// Ledger entry types\nexport const LEDGER_ENTRY_TYPES = [\"debit\", \"credit\"] as const;\nexport type LedgerEntryType = (typeof LEDGER_ENTRY_TYPES)[number];\n\nexport const ledgers = mysqlTable(\n  \"ledgers\",\n  {\n    id: int(\"id\").primaryKey().autoincrement(),\n    accountId: int(\"account_id\")\n      .references(() => accounts.id)\n      .notNull(),\n    transactionId: int(\"transaction_id\")\n      .references(() => transactions.id)\n      .notNull(),\n    entryType: mysqlEnum(\"entry_type\", LEDGER_ENTRY_TYPES).notNull(),\n    amount: decimal(\"amount\", { precision: 15, scale: 2 }).notNull(),\n    ...timestamps\n  },\n  table => [\n    index(\"account_id_idx\").on(table.accountId),\n    index(\"transaction_id_idx\").on(table.transactionId),\n    index(\"entry_type_idx\").on(table.entryType)\n  ]\n);\n\n// Ledger types\nexport type Ledger = typeof ledgers.$inferSelect;\nexport type NewLedger = typeof ledgers.$inferInsert;\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/account.schema.ts",
                              "content": "import {\n  mysqlTable,\n  boolean,\n  int,\n  mysqlEnum,\n  index\n} from \"drizzle-orm/mysql-core\";\nimport { timestamps } from \"./schema.helper\";\nimport { users } from \"./user.schema\";\n\n//? Account types\nexport const ACCOUNT_TYPES = [\"savings\", \"current\"] as const;\nexport type AccountType = (typeof ACCOUNT_TYPES)[number];\n\n//? Account currencies\nexport const ACCOUNT_CURRENCIES = [\"NPR\", \"INR\", \"USD\"] as const;\nexport type AccountCurrency = (typeof ACCOUNT_CURRENCIES)[number];\n\n//? Account status\nexport const ACCOUNT_STATUS = [\"active\", \"frozen\", \"closed\"] as const;\nexport type AccountStatus = (typeof ACCOUNT_STATUS)[number];\n\nexport const accounts = mysqlTable(\n  \"accounts\",\n  {\n    id: int(\"id\").primaryKey().autoincrement(),\n    userId: int(\"user_id\")\n      .references(() => users.id)\n      .notNull(),\n    type: mysqlEnum(\"type\", ACCOUNT_TYPES).notNull(),\n    currency: mysqlEnum(\"currency\", ACCOUNT_CURRENCIES)\n      .default(\"NPR\")\n      .notNull(),\n    status: mysqlEnum(\"status\", ACCOUNT_STATUS).default(\"active\").notNull(),\n    systemAccount: boolean(\"system_account\").default(false).notNull(),\n    ...timestamps\n  },\n  table => [\n    index(\"user_id_idx\").on(table.userId),\n    index(\"status_idx\").on(table.status),\n    index(\"type_idx\").on(table.type)\n  ]\n);\n\n// Account types\nexport type Account = typeof accounts.$inferSelect;\nexport type NewAccount = typeof accounts.$inferInsert;\n"
                            }
                          ]
                        }
                      }
                    }
                  },
                  "dependencies": {
                    "runtime": [
                      "mysql2",
                      "drizzle-orm"
                    ],
                    "dev": [
                      "drizzle-kit"
                    ]
                  }
                }
              }
            },
            "postgresql": {
              "orms": {
                "drizzle": {
                  "templates": {
                    "index": {
                      "architectures": {
                        "mvc": {
                          "files": [
                            {
                              "type": "file",
                              "path": "drizzle.config.ts",
                              "content": "import { Config, defineConfig } from \"drizzle-kit\";\n\nexport default defineConfig({\n  out: \"./src/drizzle/migrations\",\n  schema: \"./src/drizzle/index.ts\",\n  dialect: \"postgresql\",\n  dbCredentials: {\n    url: process.env.DATABASE_URL!\n  },\n  verbose: true,\n  strict: true\n}) satisfies Config;\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/index.ts",
                              "content": "export * from \"./schemas/user.schema\";\nexport * from \"./schemas/ledger.schema\";\nexport * from \"./schemas/transaction.schema\";\nexport * from \"./schemas/account.schema\";\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/user.schema.ts",
                              "content": "import {\n  pgTable,\n  serial,\n  varchar,\n  boolean,\n  timestamp,\n  integer,\n  jsonb,\n  uniqueIndex,\n  index,\n  pgEnum\n} from \"drizzle-orm/pg-core\";\n\nexport const roleEnum = pgEnum(\"role\", [\"user\", \"admin\"]);\nexport const providerEnum = pgEnum(\"provider\", [\"local\", \"google\", \"github\"]);\n\nexport const timestamps = {\n  createdAt: timestamp(\"created_at\", { mode: \"string\" }).defaultNow().notNull(),\n  updatedAt: timestamp(\"updated_at\", { mode: \"string\" })\n    .defaultNow()\n    .$onUpdate(() => new Date().toISOString())\n    .notNull()\n};\n\nexport interface IAvatar {\n  public_id: string;\n  url: string;\n  size: number;\n}\n\nexport const users = pgTable(\n  \"users\",\n  {\n    id: serial(\"id\").primaryKey(),\n    name: varchar(\"name\", { length: 100 }).notNull(),\n    email: varchar(\"email\", { length: 255 }).notNull().unique(),\n    password: varchar(\"password\", { length: 255 }),\n    role: roleEnum(\"role\").default(\"user\").notNull(),\n\n    // OAuth Provider\n    provider: providerEnum(\"provider\").default(\"local\").notNull(),\n    providerId: varchar(\"provider_id\", { length: 255 }),\n\n    // Profile\n    avatar: jsonb(\"avatar\").$type<IAvatar>(),\n\n    // Auth Metadata\n    isEmailVerified: boolean(\"is_email_verified\").default(false).notNull(),\n    lastLoginAt: timestamp(\"last_login_at\"),\n    failedLoginAttempts: integer(\"failed_login_attempts\").default(0).notNull(),\n    lockUntil: timestamp(\"lock_until\"),\n\n    // Soft Delete\n    isDeleted: boolean(\"is_deleted\").default(false).notNull(),\n    deletedAt: timestamp(\"deleted_at\"),\n    reActivateAvailableAt: timestamp(\"re_activate_available_at\"),\n\n    //? Timestamps\n    ...timestamps\n  },\n  table => [\n    uniqueIndex(\"email_idx\").on(table.email),\n    index(\"provider_idx\").on(table.provider, table.providerId),\n    index(\"role_idx\").on(table.role),\n    index(\"is_deleted_idx\").on(table.isDeleted)\n  ]\n);\n\nexport type User = typeof users.$inferSelect;\nexport type NewUser = typeof users.$inferInsert;\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/transaction.schema.ts",
                              "content": "import {\n  pgTable,\n  varchar,\n  integer,\n  pgEnum,\n  index,\n  uniqueIndex,\n  decimal,\n  serial\n} from \"drizzle-orm/pg-core\";\nimport { timestamps } from \"./schema.helper\";\nimport { accounts } from \"./account.schema\";\n\n// Transaction status\nexport const TRANSACTION_STATUS = [\n  \"pending\",\n  \"completed\",\n  \"failed\",\n  \"reversed\"\n] as const;\n\nconst statusEnum = pgEnum(\"status\", TRANSACTION_STATUS);\n\nexport const transactions = pgTable(\n  \"transactions\",\n  {\n    id: serial(\"id\").primaryKey().notNull(),\n    fromAccountId: serial(\"from_account_id\")\n      .references(() => accounts.id)\n      .notNull(),\n    toAccountId: serial(\"to_account_id\")\n      .references(() => accounts.id)\n      .notNull(),\n    amount: decimal(\"amount\", { precision: 15, scale: 2 }).notNull(),\n    status: statusEnum(\"status\").default(\"pending\").notNull(),\n    idempotencyKey: varchar(\"idempotency_key\", { length: 255 })\n      .notNull()\n      .unique(),\n    ...timestamps\n  },\n  table => [\n    index(\"from_account_id_idx\").on(table.fromAccountId),\n    index(\"to_account_id_idx\").on(table.toAccountId),\n    index(\"status_idx\").on(table.status),\n    uniqueIndex(\"idempotency_key_idx\").on(table.idempotencyKey)\n  ]\n);\n\n// Transaction types\nexport type Transaction = typeof transactions.$inferSelect;\nexport type NewTransaction = typeof transactions.$inferInsert;\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/schema.helper.ts",
                              "content": "import { timestamp } from \"drizzle-orm/pg-core\";\n\nexport const timestamps = {\n  createdAt: timestamp(\"created_at\").defaultNow().notNull(),\n  updatedAt: timestamp(\"updated_at\")\n    .defaultNow()\n    .$onUpdate(() => new Date())\n    .notNull()\n};\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/relations.ts",
                              "content": "import { relations } from \"drizzle-orm\";\nimport { accounts } from \"./account.schema\";\nimport { transactions } from \"./transaction.schema\";\nimport { ledgers } from \"./ledger.schema\";\nimport { users } from \"./user.schema\";\n\n// User relations\nexport const usersRelations = relations(users, ({ many }) => ({\n  accounts: many(accounts)\n}));\n\n// Account relations\nexport const accountsRelations = relations(accounts, ({ one, many }) => ({\n  user: one(users, {\n    fields: [accounts.userId],\n    references: [users.id]\n  }),\n  ledgers: many(ledgers)\n}));\n\n// Transaction relations\nexport const transactionsRelations = relations(transactions, ({ many }) => ({\n  ledgers: many(ledgers)\n}));\n\n// Ledger relations\nexport const ledgersRelations = relations(ledgers, ({ one }) => ({\n  account: one(accounts, {\n    fields: [ledgers.accountId],\n    references: [accounts.id]\n  }),\n  transaction: one(transactions, {\n    fields: [ledgers.transactionId],\n    references: [transactions.id]\n  })\n}));\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/ledger.schema.ts",
                              "content": "import {\n  pgTable,\n  integer,\n  pgEnum,\n  index,\n  decimal,\n  serial\n} from \"drizzle-orm/pg-core\";\nimport { timestamps } from \"./schema.helper\";\nimport { accounts } from \"./account.schema\";\nimport { transactions } from \"./transaction.schema\";\n\n// Ledger entry types\nexport const LEDGER_ENTRY_TYPES = [\"debit\", \"credit\"] as const;\n\nconst entryTypeEnum = pgEnum(\"entry_type\", LEDGER_ENTRY_TYPES);\n\nexport const ledgers = pgTable(\n  \"ledgers\",\n  {\n    id: serial(\"id\").primaryKey().notNull(),\n    accountId: serial(\"account_id\")\n      .references(() => accounts.id)\n      .notNull(),\n    transactionId: serial(\"transaction_id\")\n      .references(() => transactions.id)\n      .notNull(),\n    entryType: entryTypeEnum(\"entry_type\").notNull(),\n    amount: decimal(\"amount\", { precision: 15, scale: 2 }).notNull(),\n    ...timestamps\n  },\n  table => [\n    index(\"account_id_idx\").on(table.accountId),\n    index(\"transaction_id_idx\").on(table.transactionId),\n    index(\"entry_type_idx\").on(table.entryType)\n  ]\n);\n\n// Ledger types\nexport type Ledger = typeof ledgers.$inferSelect;\nexport type NewLedger = typeof ledgers.$inferInsert;\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/account.schema.ts",
                              "content": "import { pgTable, boolean, index, serial, pgEnum } from \"drizzle-orm/pg-core\";\nimport { timestamps } from \"./schema.helper\";\nimport { users } from \"./user.schema\";\n\nexport const ACCOUNT_TYPES = [\"savings\", \"current\"] as const;\nexport const ACCOUNT_CURRENCIES = [\"NPR\", \"INR\", \"USD\"] as const;\nexport const ACCOUNT_STATUS = [\"active\", \"frozen\", \"closed\"] as const;\n\nconst currencyEnum = pgEnum(\"currency\", ACCOUNT_CURRENCIES);\nconst accountTypeEnum = pgEnum(\"type\", ACCOUNT_TYPES);\nconst statusEnum = pgEnum(\"status\", ACCOUNT_STATUS);\n\nexport const accounts = pgTable(\n  \"accounts\",\n  {\n    id: serial(\"id\").primaryKey().notNull(),\n    userId: serial(\"user_id\")\n      .notNull()\n      .references(() => users.id),\n    currency: currencyEnum(\"currency\").notNull().default(\"NPR\"),\n    type: accountTypeEnum(\"type\").notNull().default(\"savings\"),\n    status: statusEnum(\"status\").default(\"active\").notNull(),\n    systemAccount: boolean(\"system_account\").default(false).notNull(),\n    ...timestamps\n  },\n  table => [\n    index(\"user_id_idx\").on(table.userId),\n    index(\"status_idx\").on(table.status),\n    index(\"type_idx\").on(table.type)\n  ]\n);\n\n// Account types\nexport type Account = typeof accounts.$inferSelect;\nexport type NewAccount = typeof accounts.$inferInsert;\n"
                            }
                          ]
                        },
                        "feature": {
                          "files": [
                            {
                              "type": "file",
                              "path": "drizzle.config.ts",
                              "content": "import { Config, defineConfig } from \"drizzle-kit\";\n\nexport default defineConfig({\n  out: \"./src/drizzle/migrations\",\n  schema: \"./src/drizzle/index.ts\",\n  dialect: \"postgresql\",\n  dbCredentials: {\n    url: process.env.DATABASE_URL!\n  },\n  verbose: true,\n  strict: true\n}) satisfies Config;\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/index.ts",
                              "content": "export * from \"./schemas/user.schema\";\nexport * from \"./schemas/ledger.schema\";\nexport * from \"./schemas/transaction.schema\";\nexport * from \"./schemas/account.schema\";\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/user.schema.ts",
                              "content": "import {\n  pgTable,\n  serial,\n  varchar,\n  boolean,\n  timestamp,\n  integer,\n  jsonb,\n  uniqueIndex,\n  index,\n  pgEnum\n} from \"drizzle-orm/pg-core\";\n\nexport const roleEnum = pgEnum(\"role\", [\"user\", \"admin\"]);\nexport const providerEnum = pgEnum(\"provider\", [\"local\", \"google\", \"github\"]);\n\nexport const timestamps = {\n  createdAt: timestamp(\"created_at\", { mode: \"string\" }).defaultNow().notNull(),\n  updatedAt: timestamp(\"updated_at\", { mode: \"string\" })\n    .defaultNow()\n    .$onUpdate(() => new Date().toISOString())\n    .notNull()\n};\n\nexport interface IAvatar {\n  public_id: string;\n  url: string;\n  size: number;\n}\n\nexport const users = pgTable(\n  \"users\",\n  {\n    id: serial(\"id\").primaryKey(),\n    name: varchar(\"name\", { length: 100 }).notNull(),\n    email: varchar(\"email\", { length: 255 }).notNull().unique(),\n    password: varchar(\"password\", { length: 255 }),\n    role: roleEnum(\"role\").default(\"user\").notNull(),\n\n    // OAuth Provider\n    provider: providerEnum(\"provider\").default(\"local\").notNull(),\n    providerId: varchar(\"provider_id\", { length: 255 }),\n\n    // Profile\n    avatar: jsonb(\"avatar\").$type<IAvatar>(),\n\n    // Auth Metadata\n    isEmailVerified: boolean(\"is_email_verified\").default(false).notNull(),\n    lastLoginAt: timestamp(\"last_login_at\"),\n    failedLoginAttempts: integer(\"failed_login_attempts\").default(0).notNull(),\n    lockUntil: timestamp(\"lock_until\"),\n\n    // Soft Delete\n    isDeleted: boolean(\"is_deleted\").default(false).notNull(),\n    deletedAt: timestamp(\"deleted_at\"),\n    reActivateAvailableAt: timestamp(\"re_activate_available_at\"),\n\n    //? Timestamps\n    ...timestamps\n  },\n  table => [\n    uniqueIndex(\"email_idx\").on(table.email),\n    index(\"provider_idx\").on(table.provider, table.providerId),\n    index(\"role_idx\").on(table.role),\n    index(\"is_deleted_idx\").on(table.isDeleted)\n  ]\n);\n\nexport type User = typeof users.$inferSelect;\nexport type NewUser = typeof users.$inferInsert;\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/transaction.schema.ts",
                              "content": "import {\n  pgTable,\n  varchar,\n  integer,\n  pgEnum,\n  index,\n  uniqueIndex,\n  decimal,\n  serial\n} from \"drizzle-orm/pg-core\";\nimport { timestamps } from \"./schema.helper\";\nimport { accounts } from \"./account.schema\";\n\n// Transaction status\nexport const TRANSACTION_STATUS = [\n  \"pending\",\n  \"completed\",\n  \"failed\",\n  \"reversed\"\n] as const;\n\nconst statusEnum = pgEnum(\"status\", TRANSACTION_STATUS);\n\nexport const transactions = pgTable(\n  \"transactions\",\n  {\n    id: serial(\"id\").primaryKey().notNull(),\n    fromAccountId: serial(\"from_account_id\")\n      .references(() => accounts.id)\n      .notNull(),\n    toAccountId: serial(\"to_account_id\")\n      .references(() => accounts.id)\n      .notNull(),\n    amount: decimal(\"amount\", { precision: 15, scale: 2 }).notNull(),\n    status: statusEnum(\"status\").default(\"pending\").notNull(),\n    idempotencyKey: varchar(\"idempotency_key\", { length: 255 })\n      .notNull()\n      .unique(),\n    ...timestamps\n  },\n  table => [\n    index(\"from_account_id_idx\").on(table.fromAccountId),\n    index(\"to_account_id_idx\").on(table.toAccountId),\n    index(\"status_idx\").on(table.status),\n    uniqueIndex(\"idempotency_key_idx\").on(table.idempotencyKey)\n  ]\n);\n\n// Transaction types\nexport type Transaction = typeof transactions.$inferSelect;\nexport type NewTransaction = typeof transactions.$inferInsert;\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/schema.helper.ts",
                              "content": "import { timestamp } from \"drizzle-orm/pg-core\";\n\nexport const timestamps = {\n  createdAt: timestamp(\"created_at\").defaultNow().notNull(),\n  updatedAt: timestamp(\"updated_at\")\n    .defaultNow()\n    .$onUpdate(() => new Date())\n    .notNull()\n};\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/relations.ts",
                              "content": "import { relations } from \"drizzle-orm\";\nimport { accounts } from \"./account.schema\";\nimport { transactions } from \"./transaction.schema\";\nimport { ledgers } from \"./ledger.schema\";\nimport { users } from \"./user.schema\";\n\n// User relations\nexport const usersRelations = relations(users, ({ many }) => ({\n  accounts: many(accounts)\n}));\n\n// Account relations\nexport const accountsRelations = relations(accounts, ({ one, many }) => ({\n  user: one(users, {\n    fields: [accounts.userId],\n    references: [users.id]\n  }),\n  ledgers: many(ledgers)\n}));\n\n// Transaction relations\nexport const transactionsRelations = relations(transactions, ({ many }) => ({\n  ledgers: many(ledgers)\n}));\n\n// Ledger relations\nexport const ledgersRelations = relations(ledgers, ({ one }) => ({\n  account: one(accounts, {\n    fields: [ledgers.accountId],\n    references: [accounts.id]\n  }),\n  transaction: one(transactions, {\n    fields: [ledgers.transactionId],\n    references: [transactions.id]\n  })\n}));\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/ledger.schema.ts",
                              "content": "import {\n  pgTable,\n  integer,\n  pgEnum,\n  index,\n  decimal,\n  serial\n} from \"drizzle-orm/pg-core\";\nimport { timestamps } from \"./schema.helper\";\nimport { accounts } from \"./account.schema\";\nimport { transactions } from \"./transaction.schema\";\n\n// Ledger entry types\nexport const LEDGER_ENTRY_TYPES = [\"debit\", \"credit\"] as const;\n\nconst entryTypeEnum = pgEnum(\"entry_type\", LEDGER_ENTRY_TYPES);\n\nexport const ledgers = pgTable(\n  \"ledgers\",\n  {\n    id: serial(\"id\").primaryKey().notNull(),\n    accountId: serial(\"account_id\")\n      .references(() => accounts.id)\n      .notNull(),\n    transactionId: serial(\"transaction_id\")\n      .references(() => transactions.id)\n      .notNull(),\n    entryType: entryTypeEnum(\"entry_type\").notNull(),\n    amount: decimal(\"amount\", { precision: 15, scale: 2 }).notNull(),\n    ...timestamps\n  },\n  table => [\n    index(\"account_id_idx\").on(table.accountId),\n    index(\"transaction_id_idx\").on(table.transactionId),\n    index(\"entry_type_idx\").on(table.entryType)\n  ]\n);\n\n// Ledger types\nexport type Ledger = typeof ledgers.$inferSelect;\nexport type NewLedger = typeof ledgers.$inferInsert;\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/account.schema.ts",
                              "content": "import { pgTable, boolean, index, serial, pgEnum } from \"drizzle-orm/pg-core\";\nimport { timestamps } from \"./schema.helper\";\nimport { users } from \"./user.schema\";\n\nexport const ACCOUNT_TYPES = [\"savings\", \"current\"] as const;\nexport const ACCOUNT_CURRENCIES = [\"NPR\", \"INR\", \"USD\"] as const;\nexport const ACCOUNT_STATUS = [\"active\", \"frozen\", \"closed\"] as const;\n\nconst currencyEnum = pgEnum(\"currency\", ACCOUNT_CURRENCIES);\nconst accountTypeEnum = pgEnum(\"type\", ACCOUNT_TYPES);\nconst statusEnum = pgEnum(\"status\", ACCOUNT_STATUS);\n\nexport const accounts = pgTable(\n  \"accounts\",\n  {\n    id: serial(\"id\").primaryKey().notNull(),\n    userId: serial(\"user_id\")\n      .notNull()\n      .references(() => users.id),\n    currency: currencyEnum(\"currency\").notNull().default(\"NPR\"),\n    type: accountTypeEnum(\"type\").notNull().default(\"savings\"),\n    status: statusEnum(\"status\").default(\"active\").notNull(),\n    systemAccount: boolean(\"system_account\").default(false).notNull(),\n    ...timestamps\n  },\n  table => [\n    index(\"user_id_idx\").on(table.userId),\n    index(\"status_idx\").on(table.status),\n    index(\"type_idx\").on(table.type)\n  ]\n);\n\n// Account types\nexport type Account = typeof accounts.$inferSelect;\nexport type NewAccount = typeof accounts.$inferInsert;\n"
                            }
                          ]
                        }
                      }
                    },
                    "account": {
                      "architectures": {
                        "mvc": {
                          "files": [
                            {
                              "type": "file",
                              "path": "drizzle.config.ts",
                              "content": "import { Config, defineConfig } from \"drizzle-kit\";\n\nexport default defineConfig({\n  out: \"./src/drizzle/migrations\",\n  schema: \"./src/drizzle/index.ts\",\n  dialect: \"postgresql\",\n  dbCredentials: {\n    url: process.env.DATABASE_URL!\n  },\n  verbose: true,\n  strict: true\n}) satisfies Config;\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/index.ts",
                              "content": "export * from \"./schemas/account.schema\";\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/schema.helper.ts",
                              "content": "import { timestamp } from \"drizzle-orm/pg-core\";\n\nexport const timestamps = {\n  createdAt: timestamp(\"created_at\").defaultNow().notNull(),\n  updatedAt: timestamp(\"updated_at\")\n    .defaultNow()\n    .$onUpdate(() => new Date())\n    .notNull()\n};\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/account.schema.ts",
                              "content": "import { pgTable, boolean, index, serial, pgEnum } from \"drizzle-orm/pg-core\";\nimport { timestamps } from \"./schema.helper\";\n\nexport const ACCOUNT_TYPES = [\"savings\", \"current\"] as const;\nexport const ACCOUNT_CURRENCIES = [\"NPR\", \"INR\", \"USD\"] as const;\nexport const ACCOUNT_STATUS = [\"active\", \"frozen\", \"closed\"] as const;\n\nconst currencyEnum = pgEnum(\"currency\", ACCOUNT_CURRENCIES);\nconst accountTypeEnum = pgEnum(\"type\", ACCOUNT_TYPES);\nconst statusEnum = pgEnum(\"status\", ACCOUNT_STATUS);\n\nexport const accounts = pgTable(\n  \"accounts\",\n  {\n    id: serial(\"id\").primaryKey().notNull(),\n    userId: serial(\"user_id\")\n      // .references(() => users.id),\n      .notNull(),\n    currency: currencyEnum(\"currency\").notNull().default(\"NPR\"),\n    type: accountTypeEnum(\"type\").notNull().default(\"savings\"),\n    status: statusEnum(\"status\").default(\"active\").notNull(),\n    systemAccount: boolean(\"system_account\").default(false).notNull(),\n    ...timestamps\n  },\n  table => [\n    index(\"user_id_idx\").on(table.userId),\n    index(\"status_idx\").on(table.status),\n    index(\"type_idx\").on(table.type)\n  ]\n);\n\n// Account types\nexport type Account = typeof accounts.$inferSelect;\nexport type NewAccount = typeof accounts.$inferInsert;\n"
                            }
                          ]
                        },
                        "feature": {
                          "files": [
                            {
                              "type": "file",
                              "path": "drizzle.config.ts",
                              "content": "import { Config, defineConfig } from \"drizzle-kit\";\n\nexport default defineConfig({\n  out: \"./src/drizzle/migrations\",\n  schema: \"./src/drizzle/index.ts\",\n  dialect: \"postgresql\",\n  dbCredentials: {\n    url: process.env.DATABASE_URL!\n  },\n  verbose: true,\n  strict: true\n}) satisfies Config;\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/index.ts",
                              "content": "export * from \"./schemas/account.schema\";\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/schema.helper.ts",
                              "content": "import { timestamp } from \"drizzle-orm/pg-core\";\n\nexport const timestamps = {\n  createdAt: timestamp(\"created_at\").defaultNow().notNull(),\n  updatedAt: timestamp(\"updated_at\")\n    .defaultNow()\n    .$onUpdate(() => new Date())\n    .notNull()\n};\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/account.schema.ts",
                              "content": "import { pgTable, boolean, index, serial, pgEnum } from \"drizzle-orm/pg-core\";\nimport { timestamps } from \"./schema.helper\";\n\nexport const ACCOUNT_TYPES = [\"savings\", \"current\"] as const;\nexport const ACCOUNT_CURRENCIES = [\"NPR\", \"INR\", \"USD\"] as const;\nexport const ACCOUNT_STATUS = [\"active\", \"frozen\", \"closed\"] as const;\n\nconst currencyEnum = pgEnum(\"currency\", ACCOUNT_CURRENCIES);\nconst accountTypeEnum = pgEnum(\"type\", ACCOUNT_TYPES);\nconst statusEnum = pgEnum(\"status\", ACCOUNT_STATUS);\n\nexport const accounts = pgTable(\n  \"accounts\",\n  {\n    id: serial(\"id\").primaryKey().notNull(),\n    userId: serial(\"user_id\")\n      // .references(() => users.id),\n      .notNull(),\n    currency: currencyEnum(\"currency\").notNull().default(\"NPR\"),\n    type: accountTypeEnum(\"type\").notNull().default(\"savings\"),\n    status: statusEnum(\"status\").default(\"active\").notNull(),\n    systemAccount: boolean(\"system_account\").default(false).notNull(),\n    ...timestamps\n  },\n  table => [\n    index(\"user_id_idx\").on(table.userId),\n    index(\"status_idx\").on(table.status),\n    index(\"type_idx\").on(table.type)\n  ]\n);\n\n// Account types\nexport type Account = typeof accounts.$inferSelect;\nexport type NewAccount = typeof accounts.$inferInsert;\n"
                            }
                          ]
                        }
                      }
                    },
                    "user": {
                      "architectures": {
                        "mvc": {
                          "files": []
                        },
                        "feature": {
                          "files": [
                            {
                              "type": "file",
                              "path": "drizzle.config.ts",
                              "content": "import { Config, defineConfig } from \"drizzle-kit\";\n\nexport default defineConfig({\n  out: \"./src/drizzle/migrations\",\n  schema: \"./src/drizzle/index.ts\",\n  dialect: \"postgresql\",\n  dbCredentials: {\n    url: process.env.DATABASE_URL!\n  },\n  verbose: true,\n  strict: true\n}) satisfies Config;\n"
                            },
                            {
                              "type": "file",
                              "path": "feature/drizzle/index.ts",
                              "content": "export * from \"./schemas/user.schema\";\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/index.ts",
                              "content": "export * from \"./schemas/user.schema\";\n"
                            },
                            {
                              "type": "file",
                              "path": "feature/drizzle/schemas/user.schema.ts",
                              "content": "import {\n  pgTable,\n  serial,\n  varchar,\n  boolean,\n  timestamp,\n  integer,\n  jsonb,\n  uniqueIndex,\n  index,\n  pgEnum\n} from \"drizzle-orm/pg-core\";\n\nexport const roleEnum = pgEnum(\"role\", [\"user\", \"admin\"]);\nexport const providerEnum = pgEnum(\"provider\", [\"local\", \"google\", \"github\"]);\n\nexport const timestamps = {\n  createdAt: timestamp(\"created_at\", { mode: \"string\" }).defaultNow().notNull(),\n  updatedAt: timestamp(\"updated_at\", { mode: \"string\" })\n    .defaultNow()\n    .$onUpdate(() => new Date().toISOString())\n    .notNull()\n};\n\nexport interface IAvatar {\n  public_id: string;\n  url: string;\n  size: number;\n}\n\nexport const users = pgTable(\n  \"users\",\n  {\n    id: serial(\"id\").primaryKey(),\n    name: varchar(\"name\", { length: 100 }).notNull(),\n    email: varchar(\"email\", { length: 255 }).notNull().unique(),\n    password: varchar(\"password\", { length: 255 }),\n    role: roleEnum(\"role\").default(\"user\").notNull(),\n\n    // OAuth Provider\n    provider: providerEnum(\"provider\").default(\"local\").notNull(),\n    providerId: varchar(\"provider_id\", { length: 255 }),\n\n    // Profile\n    avatar: jsonb(\"avatar\").$type<IAvatar>(),\n\n    // Auth Metadata\n    isEmailVerified: boolean(\"is_email_verified\").default(false).notNull(),\n    lastLoginAt: timestamp(\"last_login_at\"),\n    failedLoginAttempts: integer(\"failed_login_attempts\").default(0).notNull(),\n    lockUntil: timestamp(\"lock_until\"),\n\n    // Soft Delete\n    isDeleted: boolean(\"is_deleted\").default(false).notNull(),\n    deletedAt: timestamp(\"deleted_at\"),\n    reActivateAvailableAt: timestamp(\"re_activate_available_at\"),\n\n    //? Timestamps\n    ...timestamps\n  },\n  table => [\n    uniqueIndex(\"email_idx\").on(table.email),\n    index(\"provider_idx\").on(table.provider, table.providerId),\n    index(\"role_idx\").on(table.role),\n    index(\"is_deleted_idx\").on(table.isDeleted)\n  ]\n);\n\nexport type User = typeof users.$inferSelect;\nexport type NewUser = typeof users.$inferInsert;\n"
                            },
                            {
                              "type": "file",
                              "path": "feature/drizzle/schemas/schema.helper.ts",
                              "content": "import { timestamp } from \"drizzle-orm/pg-core\";\n\nexport const timestamps = {\n  createdAt: timestamp(\"created_at\").defaultNow().notNull(),\n  updatedAt: timestamp(\"updated_at\")\n    .defaultNow()\n    .$onUpdate(() => new Date())\n    .notNull()\n};\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/user.schema.ts",
                              "content": "import {\n  pgTable,\n  serial,\n  varchar,\n  boolean,\n  timestamp,\n  integer,\n  jsonb,\n  uniqueIndex,\n  index,\n  pgEnum\n} from \"drizzle-orm/pg-core\";\n\nexport const roleEnum = pgEnum(\"role\", [\"user\", \"admin\"]);\nexport const providerEnum = pgEnum(\"provider\", [\"local\", \"google\", \"github\"]);\n\nexport const timestamps = {\n  createdAt: timestamp(\"created_at\", { mode: \"string\" }).defaultNow().notNull(),\n  updatedAt: timestamp(\"updated_at\", { mode: \"string\" })\n    .defaultNow()\n    .$onUpdate(() => new Date().toISOString())\n    .notNull()\n};\n\nexport interface IAvatar {\n  public_id: string;\n  url: string;\n  size: number;\n}\n\nexport const users = pgTable(\n  \"users\",\n  {\n    id: serial(\"id\").primaryKey(),\n    name: varchar(\"name\", { length: 100 }).notNull(),\n    email: varchar(\"email\", { length: 255 }).notNull().unique(),\n    password: varchar(\"password\", { length: 255 }),\n    role: roleEnum(\"role\").default(\"user\").notNull(),\n\n    // OAuth Provider\n    provider: providerEnum(\"provider\").default(\"local\").notNull(),\n    providerId: varchar(\"provider_id\", { length: 255 }),\n\n    // Profile\n    avatar: jsonb(\"avatar\").$type<IAvatar>(),\n\n    // Auth Metadata\n    isEmailVerified: boolean(\"is_email_verified\").default(false).notNull(),\n    lastLoginAt: timestamp(\"last_login_at\"),\n    failedLoginAttempts: integer(\"failed_login_attempts\").default(0).notNull(),\n    lockUntil: timestamp(\"lock_until\"),\n\n    // Soft Delete\n    isDeleted: boolean(\"is_deleted\").default(false).notNull(),\n    deletedAt: timestamp(\"deleted_at\"),\n    reActivateAvailableAt: timestamp(\"re_activate_available_at\"),\n\n    //? Timestamps\n    ...timestamps\n  },\n  table => [\n    uniqueIndex(\"email_idx\").on(table.email),\n    index(\"provider_idx\").on(table.provider, table.providerId),\n    index(\"role_idx\").on(table.role),\n    index(\"is_deleted_idx\").on(table.isDeleted)\n  ]\n);\n\nexport type User = typeof users.$inferSelect;\nexport type NewUser = typeof users.$inferInsert;\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/schema.helper.ts",
                              "content": "import { timestamp } from \"drizzle-orm/pg-core\";\n\nexport const timestamps = {\n  createdAt: timestamp(\"created_at\").defaultNow().notNull(),\n  updatedAt: timestamp(\"updated_at\")\n    .defaultNow()\n    .$onUpdate(() => new Date())\n    .notNull()\n};\n"
                            }
                          ]
                        }
                      }
                    },
                    "transaction": {
                      "architectures": {
                        "mvc": {
                          "files": [
                            {
                              "type": "file",
                              "path": "drizzle.config.ts",
                              "content": "import { Config, defineConfig } from \"drizzle-kit\";\n\nexport default defineConfig({\n  out: \"./src/drizzle/migrations\",\n  schema: \"./src/drizzle/index.ts\",\n  dialect: \"postgresql\",\n  dbCredentials: {\n    url: process.env.DATABASE_URL!\n  },\n  verbose: true,\n  strict: true\n}) satisfies Config;\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/index.ts",
                              "content": "export * from \"./schemas/transaction.schema\";\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/transaction.schema.ts",
                              "content": "import {\n  pgTable,\n  varchar,\n  integer,\n  pgEnum,\n  index,\n  uniqueIndex,\n  decimal,\n  serial\n} from \"drizzle-orm/pg-core\";\nimport { timestamps } from \"./schema.helper\";\n\n// Transaction status\nexport const TRANSACTION_STATUS = [\n  \"pending\",\n  \"completed\",\n  \"failed\",\n  \"reversed\"\n] as const;\n\nconst statusEnum = pgEnum(\"status\", TRANSACTION_STATUS);\n\nexport const transactions = pgTable(\n  \"transactions\",\n  {\n    id: serial(\"id\").primaryKey().notNull(),\n    fromAccountId: serial(\"from_account_id\")\n      // .references(() => accounts.id)\n      .notNull(),\n    toAccountId: serial(\"to_account_id\")\n      // .references(() => accounts.id)\n      .notNull(),\n    amount: decimal(\"amount\", { precision: 15, scale: 2 }).notNull(),\n    status: statusEnum(\"status\").default(\"pending\").notNull(),\n    idempotencyKey: varchar(\"idempotency_key\", { length: 255 })\n      .notNull()\n      .unique(),\n    ...timestamps\n  },\n  table => [\n    index(\"from_account_id_idx\").on(table.fromAccountId),\n    index(\"to_account_id_idx\").on(table.toAccountId),\n    index(\"status_idx\").on(table.status),\n    uniqueIndex(\"idempotency_key_idx\").on(table.idempotencyKey)\n  ]\n);\n\n// Transaction types\nexport type Transaction = typeof transactions.$inferSelect;\nexport type NewTransaction = typeof transactions.$inferInsert;\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/schema.helper.ts",
                              "content": "import { timestamp } from \"drizzle-orm/pg-core\";\n\nexport const timestamps = {\n  createdAt: timestamp(\"created_at\").defaultNow().notNull(),\n  updatedAt: timestamp(\"updated_at\")\n    .defaultNow()\n    .$onUpdate(() => new Date())\n    .notNull()\n};\n"
                            }
                          ]
                        },
                        "feature": {
                          "files": [
                            {
                              "type": "file",
                              "path": "drizzle.config.ts",
                              "content": "import { Config, defineConfig } from \"drizzle-kit\";\n\nexport default defineConfig({\n  out: \"./src/drizzle/migrations\",\n  schema: \"./src/drizzle/index.ts\",\n  dialect: \"postgresql\",\n  dbCredentials: {\n    url: process.env.DATABASE_URL!\n  },\n  verbose: true,\n  strict: true\n}) satisfies Config;\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/index.ts",
                              "content": "export * from \"./schemas/transaction.schema\";\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/transaction.schema.ts",
                              "content": "import {\n  pgTable,\n  varchar,\n  integer,\n  pgEnum,\n  index,\n  uniqueIndex,\n  decimal,\n  serial\n} from \"drizzle-orm/pg-core\";\nimport { timestamps } from \"./schema.helper\";\n\n// Transaction status\nexport const TRANSACTION_STATUS = [\n  \"pending\",\n  \"completed\",\n  \"failed\",\n  \"reversed\"\n] as const;\n\nconst statusEnum = pgEnum(\"status\", TRANSACTION_STATUS);\n\nexport const transactions = pgTable(\n  \"transactions\",\n  {\n    id: serial(\"id\").primaryKey().notNull(),\n    fromAccountId: serial(\"from_account_id\")\n      // .references(() => accounts.id)\n      .notNull(),\n    toAccountId: serial(\"to_account_id\")\n      // .references(() => accounts.id)\n      .notNull(),\n    amount: decimal(\"amount\", { precision: 15, scale: 2 }).notNull(),\n    status: statusEnum(\"status\").default(\"pending\").notNull(),\n    idempotencyKey: varchar(\"idempotency_key\", { length: 255 })\n      .notNull()\n      .unique(),\n    ...timestamps\n  },\n  table => [\n    index(\"from_account_id_idx\").on(table.fromAccountId),\n    index(\"to_account_id_idx\").on(table.toAccountId),\n    index(\"status_idx\").on(table.status),\n    uniqueIndex(\"idempotency_key_idx\").on(table.idempotencyKey)\n  ]\n);\n\n// Transaction types\nexport type Transaction = typeof transactions.$inferSelect;\nexport type NewTransaction = typeof transactions.$inferInsert;\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/schema.helper.ts",
                              "content": "import { timestamp } from \"drizzle-orm/pg-core\";\n\nexport const timestamps = {\n  createdAt: timestamp(\"created_at\").defaultNow().notNull(),\n  updatedAt: timestamp(\"updated_at\")\n    .defaultNow()\n    .$onUpdate(() => new Date())\n    .notNull()\n};\n"
                            }
                          ]
                        }
                      }
                    },
                    "ledger": {
                      "architectures": {
                        "mvc": {
                          "files": [
                            {
                              "type": "file",
                              "path": "drizzle.config.ts",
                              "content": "import { Config, defineConfig } from \"drizzle-kit\";\n\nexport default defineConfig({\n  out: \"./src/drizzle/migrations\",\n  schema: \"./src/drizzle/index.ts\",\n  dialect: \"postgresql\",\n  dbCredentials: {\n    url: process.env.DATABASE_URL!\n  },\n  verbose: true,\n  strict: true\n}) satisfies Config;\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/index.ts",
                              "content": "export * from \"./schemas/ledger.schema\";\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/schema.helper.ts",
                              "content": "import { timestamp } from \"drizzle-orm/pg-core\";\n\nexport const timestamps = {\n  createdAt: timestamp(\"created_at\").defaultNow().notNull(),\n  updatedAt: timestamp(\"updated_at\")\n    .defaultNow()\n    .$onUpdate(() => new Date())\n    .notNull()\n};\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/ledger.schema.ts",
                              "content": "import {\n  pgTable,\n  integer,\n  pgEnum,\n  index,\n  decimal,\n  serial\n} from \"drizzle-orm/pg-core\";\nimport { timestamps } from \"./schema.helper\";\n\n// Ledger entry types\nexport const LEDGER_ENTRY_TYPES = [\"debit\", \"credit\"] as const;\n\nconst entryTypeEnum = pgEnum(\"entry_type\", LEDGER_ENTRY_TYPES);\n\nexport const ledgers = pgTable(\n  \"ledgers\",\n  {\n    id: serial(\"id\").primaryKey().notNull(),\n    accountId: serial(\"account_id\")\n      // .references(() => accounts.id)\n      .notNull(),\n    transactionId: serial(\"transaction_id\")\n      // .references(() => transactions.id)\n      .notNull(),\n    entryType: entryTypeEnum(\"entry_type\").notNull(),\n    amount: decimal(\"amount\", { precision: 15, scale: 2 }).notNull(),\n    ...timestamps\n  },\n  table => [\n    index(\"account_id_idx\").on(table.accountId),\n    index(\"transaction_id_idx\").on(table.transactionId),\n    index(\"entry_type_idx\").on(table.entryType)\n  ]\n);\n\n// Ledger types\nexport type Ledger = typeof ledgers.$inferSelect;\nexport type NewLedger = typeof ledgers.$inferInsert;\n"
                            }
                          ]
                        },
                        "feature": {
                          "files": [
                            {
                              "type": "file",
                              "path": "drizzle.config.ts",
                              "content": "import { Config, defineConfig } from \"drizzle-kit\";\n\nexport default defineConfig({\n  out: \"./src/drizzle/migrations\",\n  schema: \"./src/drizzle/index.ts\",\n  dialect: \"postgresql\",\n  dbCredentials: {\n    url: process.env.DATABASE_URL!\n  },\n  verbose: true,\n  strict: true\n}) satisfies Config;\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/index.ts",
                              "content": "export * from \"./schemas/ledger.schema\";\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/schema.helper.ts",
                              "content": "import { timestamp } from \"drizzle-orm/pg-core\";\n\nexport const timestamps = {\n  createdAt: timestamp(\"created_at\").defaultNow().notNull(),\n  updatedAt: timestamp(\"updated_at\")\n    .defaultNow()\n    .$onUpdate(() => new Date())\n    .notNull()\n};\n"
                            },
                            {
                              "type": "file",
                              "path": "src/drizzle/schemas/ledger.schema.ts",
                              "content": "import {\n  pgTable,\n  integer,\n  pgEnum,\n  index,\n  decimal,\n  serial\n} from \"drizzle-orm/pg-core\";\nimport { timestamps } from \"./schema.helper\";\n\n// Ledger entry types\nexport const LEDGER_ENTRY_TYPES = [\"debit\", \"credit\"] as const;\n\nconst entryTypeEnum = pgEnum(\"entry_type\", LEDGER_ENTRY_TYPES);\n\nexport const ledgers = pgTable(\n  \"ledgers\",\n  {\n    id: serial(\"id\").primaryKey().notNull(),\n    accountId: serial(\"account_id\")\n      // .references(() => accounts.id)\n      .notNull(),\n    transactionId: serial(\"transaction_id\")\n      // .references(() => transactions.id)\n      .notNull(),\n    entryType: entryTypeEnum(\"entry_type\").notNull(),\n    amount: decimal(\"amount\", { precision: 15, scale: 2 }).notNull(),\n    ...timestamps\n  },\n  table => [\n    index(\"account_id_idx\").on(table.accountId),\n    index(\"transaction_id_idx\").on(table.transactionId),\n    index(\"entry_type_idx\").on(table.entryType)\n  ]\n);\n\n// Ledger types\nexport type Ledger = typeof ledgers.$inferSelect;\nexport type NewLedger = typeof ledgers.$inferInsert;\n"
                            }
                          ]
                        }
                      }
                    }
                  },
                  "dependencies": {
                    "runtime": [
                      "pg",
                      "drizzle-orm"
                    ],
                    "dev": [
                      "drizzle-kit",
                      "@types/pg"
                    ]
                  }
                }
              }
            },
            "mongodb": {
              "orms": {
                "mongoose": {
                  "templates": {
                    "index": {
                      "architectures": {
                        "mvc": {
                          "files": [
                            {
                              "type": "file",
                              "path": "src/types/user.d.ts",
                              "content": "import { Request } from \"express\";\nimport { OTP_TYPES } from \"../constants/auth\";\nimport { IAccount } from \"./account\";\n\nexport type OTPType = (typeof OTP_TYPES)[number];\n\nexport interface UserRequest extends Request {\n  user?: {\n    _id?: string | undefined;\n    role?: \"user\" | \"admin\" | undefined;\n  };\n}\n\nexport interface IUser {\n  _id: string;\n  name: string;\n  email: string;\n  password?: string;\n  role: \"user\" | \"admin\";\n  isEmailVerified: boolean;\n  lastLoginAt?: Date;\n  failedLoginAttempts: number;\n  lockUntil?: Date;\n  avatar?: {\n    url: string;\n    publicId: string;\n    size: number;\n  };\n  provider: \"local\" | \"google\" | \"github\";\n  providerId?: string;\n  isDeleted: boolean;\n  deletedAt?: Date;\n  reActivateAvailableAt?: Date;\n  createdAt: Date;\n  updatedAt: Date;\n}\n\nexport type UserProfile = Pick<\n  IUser,\n  \"_id\" | \"name\" | \"email\" | \"avatar\" | \"role\" | \"isEmailVerified\"\n> & {\n  accounts?: IAccount[];\n};\n"
                            },
                            {
                              "type": "file",
                              "path": "src/types/account.d.ts",
                              "content": "import {\n  ACCOUNT_CURRENCIES,\n  ACCOUNT_STATUS,\n  ACCOUNT_TYPES,\n  LEDGER_ENTRY_TYPES,\n  TRANSACTION_STATUS\n} from \"../constants/account\";\n\nexport type AccountType = (typeof ACCOUNT_TYPES)[number];\n\nexport type AccountCurrency = (typeof ACCOUNT_CURRENCIES)[number];\n\nexport type AccountStatus = (typeof ACCOUNT_STATUS)[number];\n\nexport type TransactionStatus = (typeof TRANSACTION_STATUS)[number];\n\nexport type LedgerEntryType = (typeof LEDGER_ENTRY_TYPES)[number];\n\nexport interface IAccount {\n  _id: string;\n  type: string;\n  currency: string;\n  status: string;\n  createdAt?: string;\n  updatedAt?: string;\n}\n\nexport interface IPagination {\n  page: number;\n  limit: number;\n  total: number;\n  pages: number;\n}\n"
                            },
                            {
                              "type": "file",
                              "path": "src/models/user.model.ts",
                              "content": "import mongoose, { Document, Model, Schema } from \"mongoose\";\n\nexport interface IAvatar {\n  public_id: string;\n  url: string;\n  size: number;\n}\n\nexport interface IUser extends Document {\n  _id: mongoose.Types.ObjectId;\n  name: string;\n  email: string;\n  password?: string;\n  role: \"user\" | \"admin\";\n  isEmailVerified: boolean;\n  lastLoginAt?: Date;\n  failedLoginAttempts: number;\n  lockUntil?: Date;\n  avatar?: IAvatar;\n\n  provider: \"local\" | \"google\" | \"github\";\n  providerId?: string;\n\n  isDeleted: boolean;\n  deletedAt?: Date | null;\n  reActivateAvailableAt?: Date | null;\n\n  createdAt: Date;\n  updatedAt: Date;\n}\n\nconst userSchema = new Schema<IUser>(\n  {\n    name: {\n      type: String,\n      required: [true, \"Name is required\"],\n      trim: true\n    },\n    email: {\n      type: String,\n      required: [true, \"Email is required\"],\n      unique: true,\n      lowercase: true,\n      trim: true\n    },\n    password: {\n      type: String,\n      select: false,\n      default: null\n    },\n    provider: {\n      type: String,\n      enum: [\"local\", \"google\", \"github\"],\n      default: \"local\"\n    },\n    providerId: {\n      type: String,\n      default: null\n    },\n    role: {\n      type: String,\n      enum: [\"user\", \"admin\"],\n      default: \"user\"\n    },\n    avatar: {\n      public_id: String,\n      url: String,\n      size: Number\n    },\n    isEmailVerified: {\n      type: Boolean,\n      default: false\n    },\n    lastLoginAt: {\n      type: Date\n    },\n    failedLoginAttempts: {\n      type: Number,\n      required: true,\n      default: 0\n    },\n    lockUntil: {\n      type: Date\n    },\n    isDeleted: {\n      type: Boolean,\n      default: false\n    },\n    deletedAt: {\n      type: Date,\n      default: null\n    },\n    reActivateAvailableAt: {\n      type: Date,\n      default: null\n    }\n  },\n  {\n    timestamps: true\n  }\n);\n\n// Performance Indexes\nuserSchema.index({ provider: 1, providerId: 1 }); // Quick lookup for OAuth\nuserSchema.index({ role: 1 });\nuserSchema.index({ isDeleted: 1 }); // Optimized for soft-delete queries\n\nconst User: Model<IUser> =\n  mongoose.models.User || mongoose.model<IUser>(\"User\", userSchema);\n\nexport default User;\n"
                            },
                            {
                              "type": "file",
                              "path": "src/models/transaction.model.ts",
                              "content": "import { Schema, model, Types } from \"mongoose\";\nimport { TRANSACTION_STATUS } from \"../constants/account\";\nimport { TransactionStatus } from \"../types/account\";\n\nexport interface ITransaction {\n  _id: Types.ObjectId;\n\n  fromAccountId: Types.ObjectId;\n  toAccountId: Types.ObjectId;\n\n  amount: number;\n  status: TransactionStatus;\n  idempotencyKey: string;\n\n  createdAt: Date;\n  updatedAt: Date;\n}\n\nconst TransactionSchema = new Schema<ITransaction>(\n  {\n    fromAccountId: {\n      type: Schema.Types.ObjectId,\n      ref: \"Account\",\n      required: true,\n      index: true\n    },\n    toAccountId: {\n      type: Schema.Types.ObjectId,\n      ref: \"Account\",\n      required: true,\n      index: true\n    },\n    amount: {\n      type: Number,\n      required: true\n    },\n    status: {\n      type: String,\n      enum: TRANSACTION_STATUS,\n      default: \"pending\"\n    },\n    idempotencyKey: {\n      type: String,\n      required: true,\n      unique: true,\n      index: true\n    }\n  },\n  { timestamps: true }\n);\n\n//? indexes\nTransactionSchema.index({ fromAccountId: 1, toAccountId: 1 });\nconst Transaction = model<ITransaction>(\"Transaction\", TransactionSchema);\n\nexport default Transaction;\n"
                            },
                            {
                              "type": "file",
                              "path": "src/models/ledger.model.ts",
                              "content": "import { Schema, model, Types } from \"mongoose\";\nimport { LedgerEntryType } from \"../types/account\";\nimport { LEDGER_ENTRY_TYPES } from \"../constants/account\";\n\nexport interface ILedger {\n  _id: Types.ObjectId;\n\n  accountId: Types.ObjectId;\n  transactionId: Types.ObjectId;\n  entryType: LedgerEntryType;\n  amount: number;\n\n  createdAt: Date;\n  updatedAt: Date;\n}\n\nconst LedgerSchema = new Schema<ILedger>(\n  {\n    accountId: {\n      type: Schema.Types.ObjectId,\n      ref: \"Account\",\n      index: true,\n      immutable: true\n    },\n    transactionId: {\n      type: Schema.Types.ObjectId,\n      ref: \"Transaction\",\n      index: true,\n      immutable: true\n    },\n    entryType: {\n      type: String,\n      enum: LEDGER_ENTRY_TYPES,\n      required: true,\n      immutable: true\n    },\n    amount: {\n      type: Number,\n      required: true,\n      immutable: true\n    }\n  },\n  { timestamps: true }\n);\n\nLedgerSchema.index({ accountId: 1, transactionId: 1 });\n\nfunction preventLedgerUpdate() {\n  throw new Error(\"Ledger cannot be updated\");\n}\n\n//? Pre hooks to prevent ledger update\nLedgerSchema.pre(\"findOneAndDelete\", preventLedgerUpdate);\nLedgerSchema.pre(\"findOneAndReplace\", preventLedgerUpdate);\nLedgerSchema.pre(\"findOneAndUpdate\", preventLedgerUpdate);\nLedgerSchema.pre(\"updateOne\", preventLedgerUpdate);\nLedgerSchema.pre(\"updateMany\", preventLedgerUpdate);\nLedgerSchema.pre(\"deleteMany\", preventLedgerUpdate);\nLedgerSchema.pre(\"deleteOne\", preventLedgerUpdate);\n\nexport const Ledger = model<ILedger>(\"Ledger\", LedgerSchema);\n"
                            },
                            {
                              "type": "file",
                              "path": "src/models/account.model.ts",
                              "content": "import { Schema, model, Types } from \"mongoose\";\nimport {\n  ACCOUNT_CURRENCIES,\n  ACCOUNT_STATUS,\n  ACCOUNT_TYPES\n} from \"../constants/account\";\nimport { AccountCurrency, AccountStatus, AccountType } from \"../types/account\";\n\nexport interface IAccount {\n  _id: Types.ObjectId;\n  userId: Types.ObjectId;\n  type: AccountType;\n  currency: AccountCurrency;\n  status: AccountStatus;\n\n  systemAccount: boolean;\n\n  createdAt: Date;\n  updatedAt: Date;\n}\n\nconst AccountSchema = new Schema<IAccount>(\n  {\n    userId: {\n      type: Schema.Types.ObjectId,\n      ref: \"User\",\n      required: true,\n      index: true\n    },\n    type: {\n      type: String,\n      enum: ACCOUNT_TYPES,\n      required: true\n    },\n    currency: {\n      type: String,\n      enum: ACCOUNT_CURRENCIES,\n      default: \"NPR\"\n    },\n    status: {\n      type: String,\n      enum: ACCOUNT_STATUS,\n      default: \"active\",\n      index: true\n    },\n    systemAccount: {\n      type: Boolean,\n      default: false,\n      select: false,\n      immutable: true\n    }\n  },\n  { timestamps: true }\n);\n\nconst Account = model<IAccount>(\"Account\", AccountSchema);\n\nexport default Account;\n"
                            },
                            {
                              "type": "file",
                              "path": "src/constants/auth.ts",
                              "content": "export const OTP_MAX_ATTEMPTS = 5;\n\nexport const OTP_TYPES = [\n  \"signin\",\n  \"email-verification\",\n  \"password-reset\",\n  \"password-change\"\n] as const;\n\nexport const NEXT_OTP_DELAY = 1 * 60 * 1000; // 1 minute\n\nexport const LOGIN_MAX_ATTEMPTS = 5 as const;\n\nexport const OTP_CODE_LENGTH = 6 as const;\n\nexport const OTP_EXPIRES_IN = 5 * 60 * 1000; // 5 minutes\n\nexport const LOCK_TIME_MS = 24 * 60 * 60 * 1000; // 24 hours\n\nexport const ACCESS_TOKEN_EXPIRY = 15 * 60 * 1000; // 15 minutes\n\nexport const REFRESH_TOKEN_EXPIRY = 7 * 24 * 60 * 60 * 1000; // 7 days\n\nexport const RESET_PASSWORD_TOKEN_EXPIRY = 5 * 60 * 1000; // 5 minutes\n\nexport const REACTIVATION_AVAILABLE_AT = 24 * 60 * 60 * 1000; // 24 hours\n"
                            },
                            {
                              "type": "file",
                              "path": "src/constants/account.ts",
                              "content": "export const ACCOUNT_TYPES = [\"savings\", \"current\"] as const;\n\nexport const ACCOUNT_CURRENCIES = [\"NPR\", \"INR\", \"USD\"] as const;\n\nexport const ACCOUNT_STATUS = [\"active\", \"frozen\", \"closed\"] as const;\n\nexport const TRANSACTION_STATUS = [\n  \"pending\",\n  \"completed\",\n  \"failed\",\n  \"reversed\"\n] as const;\n\nexport const LEDGER_ENTRY_TYPES = [\"debit\", \"credit\"] as const;\n"
                            }
                          ]
                        },
                        "feature": {
                          "files": [
                            {
                              "type": "file",
                              "path": "src/modules/transaction/transaction.model.ts",
                              "content": "import { Schema, model, Types } from \"mongoose\";\nimport { TransactionStatus } from \"../account/account.types\";\nimport { TRANSACTION_STATUS } from \"../account/account.constants\";\n\nexport interface ITransaction {\n  _id: Types.ObjectId;\n\n  fromAccountId: Types.ObjectId;\n  toAccountId: Types.ObjectId;\n\n  amount: number;\n  status: TransactionStatus;\n  idempotencyKey: string;\n\n  createdAt: Date;\n  updatedAt: Date;\n}\n\nconst TransactionSchema = new Schema<ITransaction>(\n  {\n    fromAccountId: {\n      type: Schema.Types.ObjectId,\n      ref: \"Account\",\n      required: true,\n      index: true\n    },\n    toAccountId: {\n      type: Schema.Types.ObjectId,\n      ref: \"Account\",\n      required: true,\n      index: true\n    },\n    amount: {\n      type: Number,\n      required: true\n    },\n    status: {\n      type: String,\n      enum: TRANSACTION_STATUS,\n      default: \"pending\"\n    },\n    idempotencyKey: {\n      type: String,\n      required: true,\n      unique: true,\n      index: true\n    }\n  },\n  { timestamps: true }\n);\n\nTransactionSchema.index({ fromAccountId: 1, toAccountId: 1 });\nconst Transaction = model<ITransaction>(\"Transaction\", TransactionSchema);\n\nexport default Transaction;\n"
                            },
                            {
                              "type": "file",
                              "path": "src/modules/ledger/ledger.model.ts",
                              "content": "import { Schema, model, Types } from \"mongoose\";\nimport { LedgerEntryType } from \"../account/account.types\";\nimport { LEDGER_ENTRY_TYPES } from \"../account/account.constants\";\n\nexport interface ILedger {\n  _id: Types.ObjectId;\n\n  accountId: Types.ObjectId;\n  transactionId: Types.ObjectId;\n  entryType: LedgerEntryType;\n  amount: number;\n\n  createdAt: Date;\n  updatedAt: Date;\n}\n\nconst LedgerSchema = new Schema<ILedger>(\n  {\n    accountId: {\n      type: Schema.Types.ObjectId,\n      ref: \"Account\",\n      index: true,\n      immutable: true\n    },\n    transactionId: {\n      type: Schema.Types.ObjectId,\n      ref: \"Transaction\",\n      index: true,\n      immutable: true\n    },\n    entryType: {\n      type: String,\n      enum: LEDGER_ENTRY_TYPES,\n      required: true,\n      immutable: true\n    },\n    amount: {\n      type: Number,\n      required: true,\n      immutable: true\n    }\n  },\n  { timestamps: true }\n);\n\nLedgerSchema.index({ accountId: 1, transactionId: 1 });\n\nfunction preventLedgerUpdate() {\n  throw new Error(\"Ledger cannot be updated\");\n}\n\n//? Pre hooks to prevent ledger update\nLedgerSchema.pre(\"findOneAndDelete\", preventLedgerUpdate);\nLedgerSchema.pre(\"findOneAndReplace\", preventLedgerUpdate);\nLedgerSchema.pre(\"findOneAndUpdate\", preventLedgerUpdate);\nLedgerSchema.pre(\"updateOne\", preventLedgerUpdate);\nLedgerSchema.pre(\"updateMany\", preventLedgerUpdate);\nLedgerSchema.pre(\"deleteMany\", preventLedgerUpdate);\nLedgerSchema.pre(\"deleteOne\", preventLedgerUpdate);\n\nexport const Ledger = model<ILedger>(\"Ledger\", LedgerSchema);\n"
                            },
                            {
                              "type": "file",
                              "path": "src/modules/account/account.types.ts",
                              "content": "import {\n  ACCOUNT_CURRENCIES,\n  ACCOUNT_STATUS,\n  ACCOUNT_TYPES,\n  LEDGER_ENTRY_TYPES,\n  TRANSACTION_STATUS\n} from \"./account.constants\";\n\nexport type AccountType = (typeof ACCOUNT_TYPES)[number];\n\nexport type AccountCurrency = (typeof ACCOUNT_CURRENCIES)[number];\n\nexport type AccountStatus = (typeof ACCOUNT_STATUS)[number];\n\nexport type TransactionStatus = (typeof TRANSACTION_STATUS)[number];\n\nexport type LedgerEntryType = (typeof LEDGER_ENTRY_TYPES)[number];\n\nexport interface IAccount {\n  _id: string;\n  type: string;\n  currency: string;\n  status: string;\n  createdAt?: string;\n  updatedAt?: string;\n}\n\nexport interface IPagination {\n  page: number;\n  limit: number;\n  total: number;\n  pages: number;\n}\n"
                            },
                            {
                              "type": "file",
                              "path": "src/modules/account/account.model.ts",
                              "content": "import { Schema, model, Types } from \"mongoose\";\nimport {\n  ACCOUNT_CURRENCIES,\n  ACCOUNT_STATUS,\n  ACCOUNT_TYPES\n} from \"./account.constants\";\nimport { AccountCurrency, AccountStatus, AccountType } from \"./account.types\";\n\nexport interface IAccount {\n  _id: Types.ObjectId;\n  userId: Types.ObjectId;\n  type: AccountType;\n  currency: AccountCurrency;\n  status: AccountStatus;\n\n  systemAccount: boolean;\n\n  createdAt: Date;\n  updatedAt: Date;\n}\n\nconst AccountSchema = new Schema<IAccount>(\n  {\n    userId: {\n      type: Schema.Types.ObjectId,\n      ref: \"User\",\n      required: true,\n      index: true\n    },\n    type: {\n      type: String,\n      enum: ACCOUNT_TYPES,\n      required: true\n    },\n    currency: {\n      type: String,\n      enum: ACCOUNT_CURRENCIES,\n      default: \"NPR\"\n    },\n    status: {\n      type: String,\n      enum: ACCOUNT_STATUS,\n      default: \"active\",\n      index: true\n    },\n    systemAccount: {\n      type: Boolean,\n      default: false,\n      select: false,\n      immutable: true\n    }\n  },\n  { timestamps: true }\n);\n\nconst Account = model<IAccount>(\"Account\", AccountSchema);\n\nexport default Account;\n"
                            },
                            {
                              "type": "file",
                              "path": "src/modules/account/account.constants.ts",
                              "content": "export const ACCOUNT_TYPES = [\"savings\", \"current\"] as const;\n\nexport const ACCOUNT_CURRENCIES = [\"NPR\", \"INR\", \"USD\"] as const;\n\nexport const ACCOUNT_STATUS = [\"active\", \"frozen\", \"closed\"] as const;\n\nexport const TRANSACTION_STATUS = [\n  \"pending\",\n  \"completed\",\n  \"failed\",\n  \"reversed\"\n] as const;\n\nexport const LEDGER_ENTRY_TYPES = [\"debit\", \"credit\"] as const;\n"
                            },
                            {
                              "type": "file",
                              "path": "src/modules/auth/user.model.ts",
                              "content": "import mongoose, { Document, Model, Schema } from \"mongoose\";\n\nexport interface IAvatar {\n  public_id: string;\n  url: string;\n  size: number;\n}\n\nexport interface IUser extends Document {\n  _id: mongoose.Types.ObjectId;\n  name: string;\n  email: string;\n  password?: string;\n  role: \"user\" | \"admin\";\n  isEmailVerified: boolean;\n  lastLoginAt?: Date;\n  failedLoginAttempts: number;\n  lockUntil?: Date;\n  avatar?: IAvatar;\n\n  provider: \"local\" | \"google\" | \"github\";\n  providerId?: string;\n\n  isDeleted: boolean;\n  deletedAt?: Date | null;\n  reActivateAvailableAt?: Date | null;\n\n  createdAt: Date;\n  updatedAt: Date;\n}\n\nconst userSchema = new Schema<IUser>(\n  {\n    name: {\n      type: String,\n      required: [true, \"Name is required\"],\n      trim: true\n    },\n    email: {\n      type: String,\n      required: [true, \"Email is required\"],\n      unique: true,\n      lowercase: true,\n      trim: true\n    },\n    password: {\n      type: String,\n      select: false,\n      default: null\n    },\n    provider: {\n      type: String,\n      enum: [\"local\", \"google\", \"github\"],\n      default: \"local\"\n    },\n    providerId: {\n      type: String,\n      default: null\n    },\n    role: {\n      type: String,\n      enum: [\"user\", \"admin\"],\n      default: \"user\"\n    },\n    avatar: {\n      public_id: String,\n      url: String,\n      size: Number\n    },\n    isEmailVerified: {\n      type: Boolean,\n      default: false\n    },\n    lastLoginAt: {\n      type: Date\n    },\n    failedLoginAttempts: {\n      type: Number,\n      required: true,\n      default: 0\n    },\n    lockUntil: {\n      type: Date\n    },\n    isDeleted: {\n      type: Boolean,\n      default: false\n    },\n    deletedAt: {\n      type: Date,\n      default: null\n    },\n    reActivateAvailableAt: {\n      type: Date,\n      default: null\n    }\n  },\n  {\n    timestamps: true\n  }\n);\n\n// Performance Indexes\nuserSchema.index({ provider: 1, providerId: 1 }); // Quick lookup for OAuth\nuserSchema.index({ role: 1 });\nuserSchema.index({ isDeleted: 1 }); // Optimized for soft-delete queries\n\nconst User: Model<IUser> =\n  mongoose.models.User || mongoose.model<IUser>(\"User\", userSchema);\n\nexport default User;\n"
                            },
                            {
                              "type": "file",
                              "path": "src/modules/auth/auth.types.ts",
                              "content": "import { IAccount } from \"../account/account.types\";\n\nexport interface IUser {\n  _id: string;\n  name: string;\n  email: string;\n  password?: string;\n  role: \"user\" | \"admin\";\n  isEmailVerified: boolean;\n  lastLoginAt?: Date;\n  failedLoginAttempts: number;\n  lockUntil?: Date;\n  avatar?: {\n    url: string;\n    publicId: string;\n    size: number;\n  };\n  provider: \"local\" | \"google\" | \"github\";\n  providerId?: string;\n  isDeleted: boolean;\n  deletedAt?: Date;\n  reActivateAvailableAt?: Date;\n  createdAt: Date;\n  updatedAt: Date;\n}\n\nexport type UserProfile = Pick<\n  IUser,\n  \"_id\" | \"name\" | \"email\" | \"avatar\" | \"role\" | \"isEmailVerified\"\n> & {\n  accounts?: IAccount[];\n};\n"
                            },
                            {
                              "type": "file",
                              "path": "src/modules/auth/auth.constants.ts",
                              "content": "export const LOGIN_MAX_ATTEMPTS = 5 as const;\n\nexport const LOCK_TIME_MS = 24 * 60 * 60 * 1000; // 24 hours\n\nexport const ACCESS_TOKEN_EXPIRY = 15 * 60 * 1000; // 15 minutes\n\nexport const REFRESH_TOKEN_EXPIRY = 7 * 24 * 60 * 60 * 1000; // 7 days\n\nexport const RESET_PASSWORD_TOKEN_EXPIRY = 5 * 60 * 1000; // 5 minutes\n\nexport const REACTIVATION_AVAILABLE_AT = 24 * 60 * 60 * 1000; // 24 hours\n"
                            }
                          ]
                        }
                      }
                    },
                    "account": {
                      "architectures": {
                        "mvc": {
                          "files": [
                            {
                              "type": "file",
                              "path": "src/types/account.d.ts",
                              "content": "import {\n  ACCOUNT_CURRENCIES,\n  ACCOUNT_STATUS,\n  ACCOUNT_TYPES,\n  LEDGER_ENTRY_TYPES,\n  TRANSACTION_STATUS\n} from \"../constants/account\";\n\nexport type AccountType = (typeof ACCOUNT_TYPES)[number];\n\nexport type AccountCurrency = (typeof ACCOUNT_CURRENCIES)[number];\n\nexport type AccountStatus = (typeof ACCOUNT_STATUS)[number];\n\nexport type TransactionStatus = (typeof TRANSACTION_STATUS)[number];\n\nexport type LedgerEntryType = (typeof LEDGER_ENTRY_TYPES)[number];\n\nexport interface IAccount {\n  _id: string;\n  type: string;\n  currency: string;\n  status: string;\n  createdAt?: string;\n  updatedAt?: string;\n}\n\nexport interface IPagination {\n  page: number;\n  limit: number;\n  total: number;\n  pages: number;\n}\n"
                            },
                            {
                              "type": "file",
                              "path": "src/models/account.model.ts",
                              "content": "import { Schema, model, Types } from \"mongoose\";\nimport {\n  ACCOUNT_CURRENCIES,\n  ACCOUNT_STATUS,\n  ACCOUNT_TYPES\n} from \"../constants/account\";\nimport { AccountCurrency, AccountStatus, AccountType } from \"../types/account\";\n\nexport interface IAccount {\n  _id: Types.ObjectId;\n  userId: Types.ObjectId;\n  type: AccountType;\n  currency: AccountCurrency;\n  status: AccountStatus;\n\n  systemAccount: boolean;\n\n  createdAt: Date;\n  updatedAt: Date;\n}\n\nconst AccountSchema = new Schema<IAccount>(\n  {\n    userId: {\n      type: Schema.Types.ObjectId,\n      ref: \"User\",\n      required: true,\n      index: true\n    },\n    type: {\n      type: String,\n      enum: ACCOUNT_TYPES,\n      required: true\n    },\n    currency: {\n      type: String,\n      enum: ACCOUNT_CURRENCIES,\n      default: \"NPR\"\n    },\n    status: {\n      type: String,\n      enum: ACCOUNT_STATUS,\n      default: \"active\",\n      index: true\n    },\n    systemAccount: {\n      type: Boolean,\n      default: false,\n      select: false,\n      immutable: true\n    }\n  },\n  { timestamps: true }\n);\n\nconst Account = model<IAccount>(\"Account\", AccountSchema);\n\nexport default Account;\n"
                            },
                            {
                              "type": "file",
                              "path": "src/constants/account.ts",
                              "content": "export const ACCOUNT_TYPES = [\"savings\", \"current\"] as const;\n\nexport const ACCOUNT_CURRENCIES = [\"NPR\", \"INR\", \"USD\"] as const;\n\nexport const ACCOUNT_STATUS = [\"active\", \"frozen\", \"closed\"] as const;\n\nexport const TRANSACTION_STATUS = [\n  \"pending\",\n  \"completed\",\n  \"failed\",\n  \"reversed\"\n] as const;\n\nexport const LEDGER_ENTRY_TYPES = [\"debit\", \"credit\"] as const;\n"
                            }
                          ]
                        },
                        "feature": {
                          "files": [
                            {
                              "type": "file",
                              "path": "src/modules/account/account.types.ts",
                              "content": "import {\n  ACCOUNT_CURRENCIES,\n  ACCOUNT_STATUS,\n  ACCOUNT_TYPES,\n  LEDGER_ENTRY_TYPES,\n  TRANSACTION_STATUS\n} from \"./account.constants\";\n\nexport type AccountType = (typeof ACCOUNT_TYPES)[number];\n\nexport type AccountCurrency = (typeof ACCOUNT_CURRENCIES)[number];\n\nexport type AccountStatus = (typeof ACCOUNT_STATUS)[number];\n\nexport type TransactionStatus = (typeof TRANSACTION_STATUS)[number];\n\nexport type LedgerEntryType = (typeof LEDGER_ENTRY_TYPES)[number];\n\nexport interface IAccount {\n  _id: string;\n  type: string;\n  currency: string;\n  status: string;\n  createdAt?: string;\n  updatedAt?: string;\n}\n\nexport interface IPagination {\n  page: number;\n  limit: number;\n  total: number;\n  pages: number;\n}\n"
                            },
                            {
                              "type": "file",
                              "path": "src/modules/account/account.model.ts",
                              "content": "import { Schema, model, Types } from \"mongoose\";\nimport {\n  ACCOUNT_CURRENCIES,\n  ACCOUNT_STATUS,\n  ACCOUNT_TYPES\n} from \"./account.constants\";\nimport { AccountCurrency, AccountStatus, AccountType } from \"./account.types\";\n\nexport interface IAccount {\n  _id: Types.ObjectId;\n  userId: Types.ObjectId;\n  type: AccountType;\n  currency: AccountCurrency;\n  status: AccountStatus;\n\n  systemAccount: boolean;\n\n  createdAt: Date;\n  updatedAt: Date;\n}\n\nconst AccountSchema = new Schema<IAccount>(\n  {\n    userId: {\n      type: Schema.Types.ObjectId,\n      ref: \"User\",\n      required: true,\n      index: true\n    },\n    type: {\n      type: String,\n      enum: ACCOUNT_TYPES,\n      required: true\n    },\n    currency: {\n      type: String,\n      enum: ACCOUNT_CURRENCIES,\n      default: \"NPR\"\n    },\n    status: {\n      type: String,\n      enum: ACCOUNT_STATUS,\n      default: \"active\",\n      index: true\n    },\n    systemAccount: {\n      type: Boolean,\n      default: false,\n      select: false,\n      immutable: true\n    }\n  },\n  { timestamps: true }\n);\n\nconst Account = model<IAccount>(\"Account\", AccountSchema);\n\nexport default Account;\n"
                            },
                            {
                              "type": "file",
                              "path": "src/modules/account/account.constants.ts",
                              "content": "export const ACCOUNT_TYPES = [\"savings\", \"current\"] as const;\n\nexport const ACCOUNT_CURRENCIES = [\"NPR\", \"INR\", \"USD\"] as const;\n\nexport const ACCOUNT_STATUS = [\"active\", \"frozen\", \"closed\"] as const;\n\nexport const TRANSACTION_STATUS = [\n  \"pending\",\n  \"completed\",\n  \"failed\",\n  \"reversed\"\n] as const;\n\nexport const LEDGER_ENTRY_TYPES = [\"debit\", \"credit\"] as const;\n"
                            }
                          ]
                        }
                      }
                    },
                    "user": {
                      "architectures": {
                        "mvc": {
                          "files": [
                            {
                              "type": "file",
                              "path": "src/types/user.d.ts",
                              "content": "import { Request } from \"express\";\nimport { OTP_TYPES } from \"../constants/auth\";\n\nexport type OTPType = (typeof OTP_TYPES)[number];\n\nexport interface UserRequest extends Request {\n  user?: {\n    _id?: string | undefined;\n    role?: \"user\" | \"admin\" | undefined;\n  };\n}\n\nexport interface IUser {\n  _id: string;\n  name: string;\n  email: string;\n  password?: string;\n  role: \"user\" | \"admin\";\n  isEmailVerified: boolean;\n  lastLoginAt?: Date;\n  failedLoginAttempts: number;\n  lockUntil?: Date;\n  avatar?: {\n    url: string;\n    publicId: string;\n    size: number;\n  };\n  provider: \"local\" | \"google\" | \"github\";\n  providerId?: string;\n  isDeleted: boolean;\n  deletedAt?: Date;\n  reActivateAvailableAt?: Date;\n  createdAt: Date;\n  updatedAt: Date;\n}\n\ninterface IAccount {\n  _id: string;\n  type: string;\n  currency: string;\n  status: string;\n  createdAt?: string;\n  updatedAt?: string;\n}\n\nexport type UserProfile = Pick<\n  IUser,\n  \"_id\" | \"name\" | \"email\" | \"avatar\" | \"role\" | \"isEmailVerified\"\n> & {\n  accounts?: IAccount[];\n};\n"
                            },
                            {
                              "type": "file",
                              "path": "src/models/user.model.ts",
                              "content": "import mongoose, { Document, Model, Schema } from \"mongoose\";\n\nexport interface IAvatar {\n  public_id: string;\n  url: string;\n  size: number;\n}\n\nexport interface IUser extends Document {\n  _id: mongoose.Types.ObjectId;\n  name: string;\n  email: string;\n  password?: string;\n  role: \"user\" | \"admin\";\n  isEmailVerified: boolean;\n  lastLoginAt?: Date;\n  failedLoginAttempts: number;\n  lockUntil?: Date;\n  avatar?: IAvatar;\n\n  provider: \"local\" | \"google\" | \"github\";\n  providerId?: string;\n\n  isDeleted: boolean;\n  deletedAt?: Date | null;\n  reActivateAvailableAt?: Date | null;\n\n  createdAt: Date;\n  updatedAt: Date;\n}\n\nconst userSchema = new Schema<IUser>(\n  {\n    name: {\n      type: String,\n      required: [true, \"Name is required\"],\n      trim: true\n    },\n    email: {\n      type: String,\n      required: [true, \"Email is required\"],\n      unique: true,\n      lowercase: true,\n      trim: true\n    },\n    password: {\n      type: String,\n      select: false,\n      default: null\n    },\n    provider: {\n      type: String,\n      enum: [\"local\", \"google\", \"github\"],\n      default: \"local\"\n    },\n    providerId: {\n      type: String,\n      default: null\n    },\n    role: {\n      type: String,\n      enum: [\"user\", \"admin\"],\n      default: \"user\"\n    },\n    avatar: {\n      public_id: String,\n      url: String,\n      size: Number\n    },\n    isEmailVerified: {\n      type: Boolean,\n      default: false\n    },\n    lastLoginAt: {\n      type: Date\n    },\n    failedLoginAttempts: {\n      type: Number,\n      required: true,\n      default: 0\n    },\n    lockUntil: {\n      type: Date\n    },\n    isDeleted: {\n      type: Boolean,\n      default: false\n    },\n    deletedAt: {\n      type: Date,\n      default: null\n    },\n    reActivateAvailableAt: {\n      type: Date,\n      default: null\n    }\n  },\n  {\n    timestamps: true\n  }\n);\n\n// Performance Indexes\nuserSchema.index({ provider: 1, providerId: 1 }); // Quick lookup for OAuth\nuserSchema.index({ role: 1 });\nuserSchema.index({ isDeleted: 1 }); // Optimized for soft-delete queries\n\nconst User: Model<IUser> =\n  mongoose.models.User || mongoose.model<IUser>(\"User\", userSchema);\n\nexport default User;\n"
                            },
                            {
                              "type": "file",
                              "path": "src/constants/auth.ts",
                              "content": "export const OTP_MAX_ATTEMPTS = 5;\n\nexport const OTP_TYPES = [\n  \"signin\",\n  \"email-verification\",\n  \"password-reset\",\n  \"password-change\"\n] as const;\n\nexport const NEXT_OTP_DELAY = 1 * 60 * 1000; // 1 minute\n\nexport const LOGIN_MAX_ATTEMPTS = 5 as const;\n\nexport const OTP_CODE_LENGTH = 6 as const;\n\nexport const OTP_EXPIRES_IN = 5 * 60 * 1000; // 5 minutes\n\nexport const LOCK_TIME_MS = 24 * 60 * 60 * 1000; // 24 hours\n\nexport const ACCESS_TOKEN_EXPIRY = 15 * 60 * 1000; // 15 minutes\n\nexport const REFRESH_TOKEN_EXPIRY = 7 * 24 * 60 * 60 * 1000; // 7 days\n\nexport const RESET_PASSWORD_TOKEN_EXPIRY = 5 * 60 * 1000; // 5 minutes\n\nexport const REACTIVATION_AVAILABLE_AT = 24 * 60 * 60 * 1000; // 24 hours\n"
                            }
                          ]
                        },
                        "feature": {
                          "files": [
                            {
                              "type": "file",
                              "path": "src/modules/auth/user.model.ts",
                              "content": "import mongoose, { Document, Model, Schema } from \"mongoose\";\n\nexport interface IAvatar {\n  public_id: string;\n  url: string;\n  size: number;\n}\n\nexport interface IUser extends Document {\n  _id: mongoose.Types.ObjectId;\n  name: string;\n  email: string;\n  password?: string;\n  role: \"user\" | \"admin\";\n  isEmailVerified: boolean;\n  lastLoginAt?: Date;\n  failedLoginAttempts: number;\n  lockUntil?: Date;\n  avatar?: IAvatar;\n\n  provider: \"local\" | \"google\" | \"github\";\n  providerId?: string;\n\n  isDeleted: boolean;\n  deletedAt?: Date | null;\n  reActivateAvailableAt?: Date | null;\n\n  createdAt: Date;\n  updatedAt: Date;\n}\n\nconst userSchema = new Schema<IUser>(\n  {\n    name: {\n      type: String,\n      required: [true, \"Name is required\"],\n      trim: true\n    },\n    email: {\n      type: String,\n      required: [true, \"Email is required\"],\n      unique: true,\n      lowercase: true,\n      trim: true\n    },\n    password: {\n      type: String,\n      select: false,\n      default: null\n    },\n    provider: {\n      type: String,\n      enum: [\"local\", \"google\", \"github\"],\n      default: \"local\"\n    },\n    providerId: {\n      type: String,\n      default: null\n    },\n    role: {\n      type: String,\n      enum: [\"user\", \"admin\"],\n      default: \"user\"\n    },\n    avatar: {\n      public_id: String,\n      url: String,\n      size: Number\n    },\n    isEmailVerified: {\n      type: Boolean,\n      default: false\n    },\n    lastLoginAt: {\n      type: Date\n    },\n    failedLoginAttempts: {\n      type: Number,\n      required: true,\n      default: 0\n    },\n    lockUntil: {\n      type: Date\n    },\n    isDeleted: {\n      type: Boolean,\n      default: false\n    },\n    deletedAt: {\n      type: Date,\n      default: null\n    },\n    reActivateAvailableAt: {\n      type: Date,\n      default: null\n    }\n  },\n  {\n    timestamps: true\n  }\n);\n\n// Performance Indexes\nuserSchema.index({ provider: 1, providerId: 1 }); // Quick lookup for OAuth\nuserSchema.index({ role: 1 });\nuserSchema.index({ isDeleted: 1 }); // Optimized for soft-delete queries\n\nconst User: Model<IUser> =\n  mongoose.models.User || mongoose.model<IUser>(\"User\", userSchema);\n\nexport default User;\n"
                            },
                            {
                              "type": "file",
                              "path": "src/modules/auth/auth.types.ts",
                              "content": "export interface IUser {\n  _id: string;\n  name: string;\n  email: string;\n  password?: string;\n  role: \"user\" | \"admin\";\n  isEmailVerified: boolean;\n  lastLoginAt?: Date;\n  failedLoginAttempts: number;\n  lockUntil?: Date;\n  avatar?: {\n    url: string;\n    publicId: string;\n    size: number;\n  };\n  provider: \"local\" | \"google\" | \"github\";\n  providerId?: string;\n  isDeleted: boolean;\n  deletedAt?: Date;\n  reActivateAvailableAt?: Date;\n  createdAt: Date;\n  updatedAt: Date;\n}\n\ninterface IAccount {\n  _id: string;\n  type: string;\n  currency: string;\n  status: string;\n  createdAt?: string;\n  updatedAt?: string;\n}\n\nexport type UserProfile = Pick<\n  IUser,\n  \"_id\" | \"name\" | \"email\" | \"avatar\" | \"role\" | \"isEmailVerified\"\n> & {\n  accounts?: IAccount[];\n};\n"
                            },
                            {
                              "type": "file",
                              "path": "src/modules/auth/auth.constants.ts",
                              "content": "export const LOGIN_MAX_ATTEMPTS = 5 as const;\n\nexport const LOCK_TIME_MS = 24 * 60 * 60 * 1000; // 24 hours\n\nexport const ACCESS_TOKEN_EXPIRY = 15 * 60 * 1000; // 15 minutes\n\nexport const REFRESH_TOKEN_EXPIRY = 7 * 24 * 60 * 60 * 1000; // 7 days\n\nexport const RESET_PASSWORD_TOKEN_EXPIRY = 5 * 60 * 1000; // 5 minutes\n\nexport const REACTIVATION_AVAILABLE_AT = 24 * 60 * 60 * 1000; // 24 hours\n"
                            }
                          ]
                        }
                      }
                    },
                    "transaction": {
                      "architectures": {
                        "mvc": {
                          "files": [
                            {
                              "type": "file",
                              "path": "src/models/transaction.model.ts",
                              "content": "import { Schema, model, Types } from \"mongoose\";\n\nexport const TRANSACTION_STATUS = [\n  \"pending\",\n  \"completed\",\n  \"failed\",\n  \"reversed\"\n] as const;\nexport type TransactionStatus = (typeof TRANSACTION_STATUS)[number];\n\nexport interface ITransaction {\n  _id: Types.ObjectId;\n\n  fromAccountId: Types.ObjectId;\n  toAccountId: Types.ObjectId;\n\n  amount: number;\n  status: TransactionStatus;\n  idempotencyKey: string;\n\n  createdAt: Date;\n  updatedAt: Date;\n}\n\nconst TransactionSchema = new Schema<ITransaction>(\n  {\n    fromAccountId: {\n      type: Schema.Types.ObjectId,\n      ref: \"Account\",\n      required: true,\n      index: true\n    },\n    toAccountId: {\n      type: Schema.Types.ObjectId,\n      ref: \"Account\",\n      required: true,\n      index: true\n    },\n    amount: {\n      type: Number,\n      required: true\n    },\n    status: {\n      type: String,\n      enum: TRANSACTION_STATUS,\n      default: \"pending\"\n    },\n    idempotencyKey: {\n      type: String,\n      required: true,\n      unique: true,\n      index: true\n    }\n  },\n  { timestamps: true }\n);\n\n//? indexes\nTransactionSchema.index({ fromAccountId: 1, toAccountId: 1 });\nconst Transaction = model<ITransaction>(\"Transaction\", TransactionSchema);\n\nexport default Transaction;\n"
                            }
                          ]
                        },
                        "feature": {
                          "files": [
                            {
                              "type": "file",
                              "path": "src/modules/transaction/transaction.model.ts",
                              "content": "import { Schema, model, Types } from \"mongoose\";\n\nexport const TRANSACTION_STATUS = [\n  \"pending\",\n  \"completed\",\n  \"failed\",\n  \"reversed\"\n] as const;\nexport type TransactionStatus = (typeof TRANSACTION_STATUS)[number];\n\nexport interface ITransaction {\n  _id: Types.ObjectId;\n\n  fromAccountId: Types.ObjectId;\n  toAccountId: Types.ObjectId;\n\n  amount: number;\n  status: TransactionStatus;\n  idempotencyKey: string;\n\n  createdAt: Date;\n  updatedAt: Date;\n}\n\nconst TransactionSchema = new Schema<ITransaction>(\n  {\n    fromAccountId: {\n      type: Schema.Types.ObjectId,\n      ref: \"Account\",\n      required: true,\n      index: true\n    },\n    toAccountId: {\n      type: Schema.Types.ObjectId,\n      ref: \"Account\",\n      required: true,\n      index: true\n    },\n    amount: {\n      type: Number,\n      required: true\n    },\n    status: {\n      type: String,\n      enum: TRANSACTION_STATUS,\n      default: \"pending\"\n    },\n    idempotencyKey: {\n      type: String,\n      required: true,\n      unique: true,\n      index: true\n    }\n  },\n  { timestamps: true }\n);\n\nTransactionSchema.index({ fromAccountId: 1, toAccountId: 1 });\nconst Transaction = model<ITransaction>(\"Transaction\", TransactionSchema);\n\nexport default Transaction;\n"
                            }
                          ]
                        }
                      }
                    },
                    "ledger": {
                      "architectures": {
                        "mvc": {
                          "files": [
                            {
                              "type": "file",
                              "path": "src/models/ledger.model.ts",
                              "content": "import { Schema, model, Types } from \"mongoose\";\n\nconst LEDGER_ENTRY_TYPES = [\"debit\", \"credit\"] as const;\ntype LedgerEntryType = (typeof LEDGER_ENTRY_TYPES)[number];\n\nexport interface ILedger {\n  _id: Types.ObjectId;\n\n  accountId: Types.ObjectId;\n  transactionId: Types.ObjectId;\n  entryType: LedgerEntryType;\n  amount: number;\n\n  createdAt: Date;\n  updatedAt: Date;\n}\n\nconst LedgerSchema = new Schema<ILedger>(\n  {\n    accountId: {\n      type: Schema.Types.ObjectId,\n      ref: \"Account\",\n      index: true,\n      immutable: true\n    },\n    transactionId: {\n      type: Schema.Types.ObjectId,\n      ref: \"Transaction\",\n      index: true,\n      immutable: true\n    },\n    entryType: {\n      type: String,\n      enum: LEDGER_ENTRY_TYPES,\n      required: true,\n      immutable: true\n    },\n    amount: {\n      type: Number,\n      required: true,\n      immutable: true\n    }\n  },\n  { timestamps: true }\n);\n\nLedgerSchema.index({ accountId: 1, transactionId: 1 });\n\nfunction preventLedgerUpdate() {\n  throw new Error(\"Ledger cannot be updated\");\n}\n\n//? Pre hooks to prevent ledger update\nLedgerSchema.pre(\"findOneAndDelete\", preventLedgerUpdate);\nLedgerSchema.pre(\"findOneAndReplace\", preventLedgerUpdate);\nLedgerSchema.pre(\"findOneAndUpdate\", preventLedgerUpdate);\nLedgerSchema.pre(\"updateOne\", preventLedgerUpdate);\nLedgerSchema.pre(\"updateMany\", preventLedgerUpdate);\nLedgerSchema.pre(\"deleteMany\", preventLedgerUpdate);\nLedgerSchema.pre(\"deleteOne\", preventLedgerUpdate);\n\nexport const Ledger = model<ILedger>(\"Ledger\", LedgerSchema);\n"
                            }
                          ]
                        },
                        "feature": {
                          "files": [
                            {
                              "type": "file",
                              "path": "src/modules/ledger/ledger.model.ts",
                              "content": "import { Schema, model, Types } from \"mongoose\";\n\nconst LEDGER_ENTRY_TYPES = [\"debit\", \"credit\"] as const;\n\ntype LedgerEntryType = (typeof LEDGER_ENTRY_TYPES)[number];\n\nexport interface ILedger {\n  _id: Types.ObjectId;\n\n  accountId: Types.ObjectId;\n  transactionId: Types.ObjectId;\n  entryType: LedgerEntryType;\n  amount: number;\n\n  createdAt: Date;\n  updatedAt: Date;\n}\n\nconst LedgerSchema = new Schema<ILedger>(\n  {\n    accountId: {\n      type: Schema.Types.ObjectId,\n      ref: \"Account\",\n      index: true,\n      immutable: true\n    },\n    transactionId: {\n      type: Schema.Types.ObjectId,\n      ref: \"Transaction\",\n      index: true,\n      immutable: true\n    },\n    entryType: {\n      type: String,\n      enum: LEDGER_ENTRY_TYPES,\n      required: true,\n      immutable: true\n    },\n    amount: {\n      type: Number,\n      required: true,\n      immutable: true\n    }\n  },\n  { timestamps: true }\n);\n\nLedgerSchema.index({ accountId: 1, transactionId: 1 });\n\nfunction preventLedgerUpdate() {\n  throw new Error(\"Ledger cannot be updated\");\n}\n\n//? Pre hooks to prevent ledger update\nLedgerSchema.pre(\"findOneAndDelete\", preventLedgerUpdate);\nLedgerSchema.pre(\"findOneAndReplace\", preventLedgerUpdate);\nLedgerSchema.pre(\"findOneAndUpdate\", preventLedgerUpdate);\nLedgerSchema.pre(\"updateOne\", preventLedgerUpdate);\nLedgerSchema.pre(\"updateMany\", preventLedgerUpdate);\nLedgerSchema.pre(\"deleteMany\", preventLedgerUpdate);\nLedgerSchema.pre(\"deleteOne\", preventLedgerUpdate);\n\nexport const Ledger = model<ILedger>(\"Ledger\", LedgerSchema);\n"
                            }
                          ]
                        }
                      }
                    }
                  },
                  "dependencies": {
                    "runtime": [
                      "mongoose"
                    ],
                    "dev": []
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
