[web] Convert models and self-referential test files to ESM (#29521)

from overleaf/ar-models-es-conversion

GitOrigin-RevId: a92ab8342c0f3e23155eacc0570458fc910c3d71
This commit is contained in:
Andrew Rumble
2025-11-13 09:06:13 +00:00
committed by Copybot
parent 59aab0878d
commit 7c9fea64ac
202 changed files with 804 additions and 846 deletions
@@ -0,0 +1,19 @@
import mongoose from '../infrastructure/Mongoose.js'
const { Schema } = mongoose
const Usage = new Schema({
usage: { type: Number },
periodStart: { type: Date },
})
export const UserFeatureUsageSchema = new Schema({
features: {
aiErrorAssistant: Usage,
aiWorkbench: Usage,
},
})
export const UserFeatureUsage = mongoose.model(
'UserFeatureUsage',
UserFeatureUsageSchema
)