templating api

This commit is contained in:
2026-06-19 22:20:43 -07:00
parent 08d7a80f56
commit 84f894c356
110 changed files with 12432 additions and 0 deletions
+15
View File
@@ -0,0 +1,15 @@
import { BuildOptions, DeepPartial, Factory } from "fishery"
import { Model } from "@sequelize/core"
// Must keep type signature in sync with fishery's Factory type
// See api/node_modules/fishery/dist/factory.d.ts
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export class BaseFactory<T extends Model, I = any, C = T> extends Factory<T, I, C> {
// See https://thoughtbot.github.io/factory_bot/ref/build-strategies.html#attributes_for
attributesFor(params?: DeepPartial<T>, options?: BuildOptions<T, I>): T {
const model = this.build(params, options)
return model.dataValues
}
}
export default BaseFactory