chore: Remove legacy MWH modules (#7213)

* chore: Remove legacy MWH modules

* chore: Add stock-location deps
This commit is contained in:
Oli Juhl
2024-05-02 20:07:42 +02:00
committed by GitHub
parent 8f776489a3
commit e78362c000
92 changed files with 23 additions and 4443 deletions
@@ -0,0 +1,17 @@
import { SqlEntityManager } from "@mikro-orm/postgresql"
import { Invite } from "@models"
import { CreateInviteDTO } from "../../../types/dist"
export const createInvites = async (
manager: SqlEntityManager,
inviteData: (CreateInviteDTO & { id?: string })[]
) => {
const invites: Invite[] = []
for (const invite of inviteData) {
const inv = manager.create(Invite, invite)
invites.push(inv)
}
await manager.persistAndFlush(invites)
}
@@ -0,0 +1,17 @@
import { SqlEntityManager } from "@mikro-orm/postgresql"
import { User } from "@models"
import { CreateUserDTO } from "../../../types/dist"
export const createUsers = async (
manager: SqlEntityManager,
userData: (CreateUserDTO & { id?: string })[]
) => {
const users: User[] = []
for (const user of userData) {
const usr = manager.create(User, user)
users.push(usr)
}
await manager.persistAndFlush(users)
}