refactor: rename Recipient to Person, remove username, add userId FK

This commit is contained in:
2026-06-16 10:04:24 +02:00
parent befe1f3f82
commit d67f31cf54
27 changed files with 751 additions and 628 deletions
@@ -2,7 +2,7 @@ import { afterAll, beforeAll, beforeEach, describe, expect, it } from "vitest"
import type { PrismaClient } from "@/generated/prisma/client"
import {
createTestItem,
createTestRecipient,
createTestPerson,
createTestUser,
} from "../helpers/factories"
import {
@@ -80,7 +80,7 @@ describe("asset use-cases", () => {
it("creates an assigned asset with assignment and ASSIGNMENT movement", async () => {
const actor = await createTestUser(prisma)
const recipient = await createTestRecipient(prisma)
const recipient = await createTestPerson(prisma)
const item = await createTestItem(prisma, { stock: 0 })
const result = await createAssetUseCase({
@@ -133,7 +133,7 @@ describe("asset use-cases", () => {
it("moves an available asset to assigned and back to available", async () => {
const actor = await createTestUser(prisma)
const recipient = await createTestRecipient(prisma)
const recipient = await createTestPerson(prisma)
const item = await createTestItem(prisma, { stock: 0 })
const created = await createAssetUseCase({
@@ -230,7 +230,7 @@ describe("asset use-cases", () => {
it("returns an active assignment without restoring stock when an assigned asset moves to a terminal status", async () => {
const actor = await createTestUser(prisma)
const recipient = await createTestRecipient(prisma)
const recipient = await createTestPerson(prisma)
const item = await createTestItem(prisma, { stock: 0 })
const created = await createAssetUseCase({