diff --git a/AGENTS.md b/AGENTS.md index d5f2ab1..662e364 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -99,18 +99,35 @@ We use `bun:test` for testing. - Fixes must be iterated until **no check causes any other check to fail**. - Do **not** submit intermediate states where some checks pass and others fail, even temporarily. -## Prisma Configuration +## Prisma Configuration & Migrations - Schema: `prisma/schema.prisma` - Generated Client: `src/generated/prisma` - Config: `prisma.config.ts` (Required for Prisma 7+) - Adapter: We use `@prisma/adapter-libsql` for SQLite compatibility with Bun. -- Migration Requirement: Whenever the Prisma schema is modified, you must also generate a corresponding migration file using Prisma Migrate (e.g., prisma migrate dev) and ensure the migration is committed. + +### Migration Workflow + +Whenever you modify the `prisma/schema.prisma` file, you **must** generate a corresponding migration file. + +**Do not create migration SQL files manually.** + +Instead, follow this workflow: +1. Ensure you have a local SQLite database configured (e.g., via `.env` setting `DATABASE_URL="file:./dev.db"`). +2. Run the migration command: + ```bash + bun x prisma migrate dev --name + ``` + This command will automatically: + - Detect changes in `schema.prisma`. + - Generate the SQL migration file in `prisma/migrations/`. + - Apply the changes to your local development database. + - Regenerate the Prisma Client. ### Commands - Generate Client: `bun --bun run prisma generate` -- Push Schema to DB: `bun --bun run prisma db push` +- Push Schema to DB (Prototyping only): `bun --bun run prisma db push` ## Environment Variables diff --git a/prisma/migrations/20260211084954_add_outfit_model/migration.sql b/prisma/migrations/20260211084954_add_outfit_model/migration.sql new file mode 100644 index 0000000..7bd8d8f --- /dev/null +++ b/prisma/migrations/20260211084954_add_outfit_model/migration.sql @@ -0,0 +1,18 @@ +-- CreateTable +CREATE TABLE "outfits" ( + "id" TEXT NOT NULL PRIMARY KEY, + "name" TEXT NOT NULL, + "prompt" TEXT, + "created_at" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updated_at" DATETIME NOT NULL +); + +-- CreateTable +CREATE TABLE "outfit_equipments" ( + "outfit_id" TEXT NOT NULL, + "equipment_id" TEXT NOT NULL, + + PRIMARY KEY ("outfit_id", "equipment_id"), + CONSTRAINT "outfit_equipments_outfit_id_fkey" FOREIGN KEY ("outfit_id") REFERENCES "outfits" ("id") ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT "outfit_equipments_equipment_id_fkey" FOREIGN KEY ("equipment_id") REFERENCES "equipments" ("id") ON DELETE CASCADE ON UPDATE CASCADE +); diff --git a/prisma/schema.prisma b/prisma/schema.prisma index 39d4534..2d4f44f 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -56,6 +56,7 @@ model Equipment { // Relations image Asset @relation(fields: [imageId], references: [id]) generations GenerationEquipment[] + outfits OutfitEquipment[] @@index([category, subCategory]) @@map("equipments") @@ -88,6 +89,30 @@ model GenerationEquipment { @@map("generation_equipments") } +model Outfit { + id String @id + name String + prompt String? + createdAt DateTime @default(now()) @map("created_at") + updatedAt DateTime @updatedAt @map("updated_at") + + // Relations + equipments OutfitEquipment[] + + @@map("outfits") +} + +model OutfitEquipment { + outfitId String @map("outfit_id") + equipmentId String @map("equipment_id") + + outfit Outfit @relation(fields: [outfitId], references: [id], onDelete: Cascade) + equipment Equipment @relation(fields: [equipmentId], references: [id], onDelete: Cascade) + + @@id([outfitId, equipmentId]) + @@map("outfit_equipments") +} + model Setting { key String @id value String diff --git a/src/api/outfit.test.ts b/src/api/outfit.test.ts new file mode 100644 index 0000000..41e0ab4 --- /dev/null +++ b/src/api/outfit.test.ts @@ -0,0 +1,88 @@ +import { describe, it, expect, mock, afterEach } from 'bun:test' + +const mockOutfitService = { + listOutfits: mock(), + createOutfit: mock(), + updateOutfit: mock(), + deleteOutfit: mock(), +} + +mock.module('../service/outfit', () => ({ + outfitService: mockOutfitService, +})) + +describe('Outfit API', () => { + afterEach(() => { + mockOutfitService.listOutfits.mockClear() + mockOutfitService.createOutfit.mockClear() + mockOutfitService.updateOutfit.mockClear() + mockOutfitService.deleteOutfit.mockClear() + }) + + it('GET / should list outfits', async () => { + const { default: outfit } = await import(`./outfit?v=${Date.now()}`) + mockOutfitService.listOutfits.mockResolvedValue([]) + + const req = new Request('http://localhost/', { + method: 'GET', + }) + + const res = await outfit.fetch(req) + expect(res.status).toBe(200) + expect(mockOutfitService.listOutfits).toHaveBeenCalled() + }) + + it('POST / should create outfit', async () => { + const { default: outfit } = await import(`./outfit?v=${Date.now()}`) + mockOutfitService.createOutfit.mockResolvedValue({ id: '1' }) + + const req = new Request('http://localhost/', { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify({ + name: 'New Outfit', + equipmentIds: ['eq1'], + }), + }) + + const res = await outfit.fetch(req) + expect(res.status).toBe(200) + expect(mockOutfitService.createOutfit).toHaveBeenCalledWith({ + name: 'New Outfit', + equipmentIds: ['eq1'], + prompt: undefined, + }) + }) + + it('PUT /:id should update outfit', async () => { + const { default: outfit } = await import(`./outfit?v=${Date.now()}`) + mockOutfitService.updateOutfit.mockResolvedValue({ id: '1' }) + + const req = new Request('http://localhost/1', { + method: 'PUT', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify({ + name: 'Updated Outfit', + }), + }) + + const res = await outfit.fetch(req) + expect(res.status).toBe(200) + expect(mockOutfitService.updateOutfit).toHaveBeenCalledWith('1', { + name: 'Updated Outfit', + }) + }) + + it('DELETE /:id should delete outfit', async () => { + const { default: outfit } = await import(`./outfit?v=${Date.now()}`) + mockOutfitService.deleteOutfit.mockResolvedValue({ id: '1' }) + + const req = new Request('http://localhost/1', { + method: 'DELETE', + }) + + const res = await outfit.fetch(req) + expect(res.status).toBe(200) + expect(mockOutfitService.deleteOutfit).toHaveBeenCalledWith('1') + }) +}) diff --git a/src/api/outfit.ts b/src/api/outfit.ts new file mode 100644 index 0000000..14369c3 --- /dev/null +++ b/src/api/outfit.ts @@ -0,0 +1,48 @@ +import { Hono } from 'hono' +import { zValidator } from '@hono/zod-validator' +import { z } from 'zod' +import { outfitService } from '../service/outfit' + +const app = new Hono() + +// Define schemas for validation +const listSchema = z.object({ + equipmentId: z.string().optional(), +}) + +const createSchema = z.object({ + name: z.string().min(1), + prompt: z.string().optional(), + equipmentIds: z.array(z.string()), +}) + +const updateSchema = z.object({ + name: z.string().optional(), + prompt: z.string().optional(), + equipmentIds: z.array(z.string()).optional(), +}) + +const route = app + .get('/', zValidator('query', listSchema), async (c) => { + const { equipmentId } = c.req.valid('query') + const result = await outfitService.listOutfits(equipmentId) + return c.json(result) + }) + .post('/', zValidator('json', createSchema), async (c) => { + const data = c.req.valid('json') + const result = await outfitService.createOutfit(data) + return c.json(result) + }) + .put('/:id', zValidator('json', updateSchema), async (c) => { + const id = c.req.param('id') + const data = c.req.valid('json') + const result = await outfitService.updateOutfit(id, data) + return c.json(result) + }) + .delete('/:id', async (c) => { + const id = c.req.param('id') + await outfitService.deleteOutfit(id) + return c.json({ success: true }) + }) + +export default route diff --git a/src/generated/prisma/browser.ts b/src/generated/prisma/browser.ts index 2b6030e..f548f6b 100644 --- a/src/generated/prisma/browser.ts +++ b/src/generated/prisma/browser.ts @@ -42,6 +42,16 @@ export type Generation = Prisma.GenerationModel * */ export type GenerationEquipment = Prisma.GenerationEquipmentModel +/** + * Model Outfit + * + */ +export type Outfit = Prisma.OutfitModel +/** + * Model OutfitEquipment + * + */ +export type OutfitEquipment = Prisma.OutfitEquipmentModel /** * Model Setting * diff --git a/src/generated/prisma/client.ts b/src/generated/prisma/client.ts index 461fe2e..d973e5e 100644 --- a/src/generated/prisma/client.ts +++ b/src/generated/prisma/client.ts @@ -64,6 +64,16 @@ export type Generation = Prisma.GenerationModel * */ export type GenerationEquipment = Prisma.GenerationEquipmentModel +/** + * Model Outfit + * + */ +export type Outfit = Prisma.OutfitModel +/** + * Model OutfitEquipment + * + */ +export type OutfitEquipment = Prisma.OutfitEquipmentModel /** * Model Setting * diff --git a/src/generated/prisma/internal/class.ts b/src/generated/prisma/internal/class.ts index e8267ab..a0af395 100644 --- a/src/generated/prisma/internal/class.ts +++ b/src/generated/prisma/internal/class.ts @@ -20,7 +20,7 @@ const config: runtime.GetPrismaClientConfig = { "clientVersion": "7.3.0", "engineVersion": "9d6ad21cbbceab97458517b147a6a09ff43aa735", "activeProvider": "sqlite", - "inlineSchema": "// This is your Prisma schema file,\n// learn more about it in the docs: https://pris.ly/d/prisma-schema\n\ngenerator client {\n provider = \"prisma-client\"\n output = \"../src/generated/prisma\"\n engineType = \"client\"\n runtime = \"bun\"\n}\n\ndatasource db {\n provider = \"sqlite\"\n}\n\nmodel Asset {\n id String @id\n name String\n type String\n path String\n createdAt DateTime @default(now()) @map(\"created_at\")\n updatedAt DateTime @updatedAt @map(\"updated_at\")\n\n // Relations\n characters Character[]\n equipments Equipment[]\n generations Generation[]\n\n @@map(\"assets\")\n}\n\nmodel Character {\n id String @id\n name String\n description String?\n imageId String @map(\"image_id\")\n createdAt DateTime @default(now()) @map(\"created_at\")\n updatedAt DateTime @updatedAt @map(\"updated_at\")\n\n // Relations\n image Asset @relation(fields: [imageId], references: [id])\n generations Generation[]\n\n @@map(\"characters\")\n}\n\nmodel Equipment {\n id String @id\n name String\n description String\n category String\n subCategory String? @map(\"sub_category\")\n imageId String @map(\"image_id\")\n createdAt DateTime @default(now()) @map(\"created_at\")\n updatedAt DateTime @updatedAt @map(\"updated_at\")\n\n // Relations\n image Asset @relation(fields: [imageId], references: [id])\n generations GenerationEquipment[]\n\n @@index([category, subCategory])\n @@map(\"equipments\")\n}\n\nmodel Generation {\n id String @id\n characterId String @map(\"character_id\")\n imageId String @map(\"image_id\")\n userPrompt String? @map(\"user_prompt\")\n createdAt DateTime @default(now()) @map(\"created_at\")\n updatedAt DateTime @updatedAt @map(\"updated_at\")\n\n // Relations\n character Character @relation(fields: [characterId], references: [id])\n image Asset @relation(fields: [imageId], references: [id])\n equipments GenerationEquipment[]\n\n @@map(\"generations\")\n}\n\nmodel GenerationEquipment {\n generationId String @map(\"generation_id\")\n equipmentId String @map(\"equipment_id\")\n\n generation Generation @relation(fields: [generationId], references: [id])\n equipment Equipment @relation(fields: [equipmentId], references: [id])\n\n @@id([generationId, equipmentId])\n @@map(\"generation_equipments\")\n}\n\nmodel Setting {\n key String @id\n value String\n\n createdAt DateTime @default(now()) @map(\"created_at\")\n updatedAt DateTime @updatedAt @map(\"updated_at\")\n\n @@map(\"settings\")\n}\n", + "inlineSchema": "// This is your Prisma schema file,\n// learn more about it in the docs: https://pris.ly/d/prisma-schema\n\ngenerator client {\n provider = \"prisma-client\"\n output = \"../src/generated/prisma\"\n engineType = \"client\"\n runtime = \"bun\"\n}\n\ndatasource db {\n provider = \"sqlite\"\n}\n\nmodel Asset {\n id String @id\n name String\n type String\n path String\n createdAt DateTime @default(now()) @map(\"created_at\")\n updatedAt DateTime @updatedAt @map(\"updated_at\")\n\n // Relations\n characters Character[]\n equipments Equipment[]\n generations Generation[]\n\n @@map(\"assets\")\n}\n\nmodel Character {\n id String @id\n name String\n description String?\n imageId String @map(\"image_id\")\n createdAt DateTime @default(now()) @map(\"created_at\")\n updatedAt DateTime @updatedAt @map(\"updated_at\")\n\n // Relations\n image Asset @relation(fields: [imageId], references: [id])\n generations Generation[]\n\n @@map(\"characters\")\n}\n\nmodel Equipment {\n id String @id\n name String\n description String\n category String\n subCategory String? @map(\"sub_category\")\n imageId String @map(\"image_id\")\n createdAt DateTime @default(now()) @map(\"created_at\")\n updatedAt DateTime @updatedAt @map(\"updated_at\")\n\n // Relations\n image Asset @relation(fields: [imageId], references: [id])\n generations GenerationEquipment[]\n outfits OutfitEquipment[]\n\n @@index([category, subCategory])\n @@map(\"equipments\")\n}\n\nmodel Generation {\n id String @id\n characterId String @map(\"character_id\")\n imageId String @map(\"image_id\")\n userPrompt String? @map(\"user_prompt\")\n createdAt DateTime @default(now()) @map(\"created_at\")\n updatedAt DateTime @updatedAt @map(\"updated_at\")\n\n // Relations\n character Character @relation(fields: [characterId], references: [id])\n image Asset @relation(fields: [imageId], references: [id])\n equipments GenerationEquipment[]\n\n @@map(\"generations\")\n}\n\nmodel GenerationEquipment {\n generationId String @map(\"generation_id\")\n equipmentId String @map(\"equipment_id\")\n\n generation Generation @relation(fields: [generationId], references: [id])\n equipment Equipment @relation(fields: [equipmentId], references: [id])\n\n @@id([generationId, equipmentId])\n @@map(\"generation_equipments\")\n}\n\nmodel Outfit {\n id String @id\n name String\n prompt String?\n createdAt DateTime @default(now()) @map(\"created_at\")\n updatedAt DateTime @updatedAt @map(\"updated_at\")\n\n // Relations\n equipments OutfitEquipment[]\n\n @@map(\"outfits\")\n}\n\nmodel OutfitEquipment {\n outfitId String @map(\"outfit_id\")\n equipmentId String @map(\"equipment_id\")\n\n outfit Outfit @relation(fields: [outfitId], references: [id], onDelete: Cascade)\n equipment Equipment @relation(fields: [equipmentId], references: [id], onDelete: Cascade)\n\n @@id([outfitId, equipmentId])\n @@map(\"outfit_equipments\")\n}\n\nmodel Setting {\n key String @id\n value String\n\n createdAt DateTime @default(now()) @map(\"created_at\")\n updatedAt DateTime @updatedAt @map(\"updated_at\")\n\n @@map(\"settings\")\n}\n", "runtimeDataModel": { "models": {}, "enums": {}, @@ -28,7 +28,7 @@ const config: runtime.GetPrismaClientConfig = { } } -config.runtimeDataModel = JSON.parse("{\"models\":{\"Asset\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"type\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"path\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\",\"dbName\":\"created_at\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\",\"dbName\":\"updated_at\"},{\"name\":\"characters\",\"kind\":\"object\",\"type\":\"Character\",\"relationName\":\"AssetToCharacter\"},{\"name\":\"equipments\",\"kind\":\"object\",\"type\":\"Equipment\",\"relationName\":\"AssetToEquipment\"},{\"name\":\"generations\",\"kind\":\"object\",\"type\":\"Generation\",\"relationName\":\"AssetToGeneration\"}],\"dbName\":\"assets\"},\"Character\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"description\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"imageId\",\"kind\":\"scalar\",\"type\":\"String\",\"dbName\":\"image_id\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\",\"dbName\":\"created_at\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\",\"dbName\":\"updated_at\"},{\"name\":\"image\",\"kind\":\"object\",\"type\":\"Asset\",\"relationName\":\"AssetToCharacter\"},{\"name\":\"generations\",\"kind\":\"object\",\"type\":\"Generation\",\"relationName\":\"CharacterToGeneration\"}],\"dbName\":\"characters\"},\"Equipment\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"description\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"category\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"subCategory\",\"kind\":\"scalar\",\"type\":\"String\",\"dbName\":\"sub_category\"},{\"name\":\"imageId\",\"kind\":\"scalar\",\"type\":\"String\",\"dbName\":\"image_id\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\",\"dbName\":\"created_at\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\",\"dbName\":\"updated_at\"},{\"name\":\"image\",\"kind\":\"object\",\"type\":\"Asset\",\"relationName\":\"AssetToEquipment\"},{\"name\":\"generations\",\"kind\":\"object\",\"type\":\"GenerationEquipment\",\"relationName\":\"EquipmentToGenerationEquipment\"}],\"dbName\":\"equipments\"},\"Generation\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"characterId\",\"kind\":\"scalar\",\"type\":\"String\",\"dbName\":\"character_id\"},{\"name\":\"imageId\",\"kind\":\"scalar\",\"type\":\"String\",\"dbName\":\"image_id\"},{\"name\":\"userPrompt\",\"kind\":\"scalar\",\"type\":\"String\",\"dbName\":\"user_prompt\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\",\"dbName\":\"created_at\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\",\"dbName\":\"updated_at\"},{\"name\":\"character\",\"kind\":\"object\",\"type\":\"Character\",\"relationName\":\"CharacterToGeneration\"},{\"name\":\"image\",\"kind\":\"object\",\"type\":\"Asset\",\"relationName\":\"AssetToGeneration\"},{\"name\":\"equipments\",\"kind\":\"object\",\"type\":\"GenerationEquipment\",\"relationName\":\"GenerationToGenerationEquipment\"}],\"dbName\":\"generations\"},\"GenerationEquipment\":{\"fields\":[{\"name\":\"generationId\",\"kind\":\"scalar\",\"type\":\"String\",\"dbName\":\"generation_id\"},{\"name\":\"equipmentId\",\"kind\":\"scalar\",\"type\":\"String\",\"dbName\":\"equipment_id\"},{\"name\":\"generation\",\"kind\":\"object\",\"type\":\"Generation\",\"relationName\":\"GenerationToGenerationEquipment\"},{\"name\":\"equipment\",\"kind\":\"object\",\"type\":\"Equipment\",\"relationName\":\"EquipmentToGenerationEquipment\"}],\"dbName\":\"generation_equipments\"},\"Setting\":{\"fields\":[{\"name\":\"key\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"value\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\",\"dbName\":\"created_at\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\",\"dbName\":\"updated_at\"}],\"dbName\":\"settings\"}},\"enums\":{},\"types\":{}}") +config.runtimeDataModel = JSON.parse("{\"models\":{\"Asset\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"type\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"path\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\",\"dbName\":\"created_at\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\",\"dbName\":\"updated_at\"},{\"name\":\"characters\",\"kind\":\"object\",\"type\":\"Character\",\"relationName\":\"AssetToCharacter\"},{\"name\":\"equipments\",\"kind\":\"object\",\"type\":\"Equipment\",\"relationName\":\"AssetToEquipment\"},{\"name\":\"generations\",\"kind\":\"object\",\"type\":\"Generation\",\"relationName\":\"AssetToGeneration\"}],\"dbName\":\"assets\"},\"Character\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"description\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"imageId\",\"kind\":\"scalar\",\"type\":\"String\",\"dbName\":\"image_id\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\",\"dbName\":\"created_at\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\",\"dbName\":\"updated_at\"},{\"name\":\"image\",\"kind\":\"object\",\"type\":\"Asset\",\"relationName\":\"AssetToCharacter\"},{\"name\":\"generations\",\"kind\":\"object\",\"type\":\"Generation\",\"relationName\":\"CharacterToGeneration\"}],\"dbName\":\"characters\"},\"Equipment\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"description\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"category\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"subCategory\",\"kind\":\"scalar\",\"type\":\"String\",\"dbName\":\"sub_category\"},{\"name\":\"imageId\",\"kind\":\"scalar\",\"type\":\"String\",\"dbName\":\"image_id\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\",\"dbName\":\"created_at\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\",\"dbName\":\"updated_at\"},{\"name\":\"image\",\"kind\":\"object\",\"type\":\"Asset\",\"relationName\":\"AssetToEquipment\"},{\"name\":\"generations\",\"kind\":\"object\",\"type\":\"GenerationEquipment\",\"relationName\":\"EquipmentToGenerationEquipment\"},{\"name\":\"outfits\",\"kind\":\"object\",\"type\":\"OutfitEquipment\",\"relationName\":\"EquipmentToOutfitEquipment\"}],\"dbName\":\"equipments\"},\"Generation\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"characterId\",\"kind\":\"scalar\",\"type\":\"String\",\"dbName\":\"character_id\"},{\"name\":\"imageId\",\"kind\":\"scalar\",\"type\":\"String\",\"dbName\":\"image_id\"},{\"name\":\"userPrompt\",\"kind\":\"scalar\",\"type\":\"String\",\"dbName\":\"user_prompt\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\",\"dbName\":\"created_at\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\",\"dbName\":\"updated_at\"},{\"name\":\"character\",\"kind\":\"object\",\"type\":\"Character\",\"relationName\":\"CharacterToGeneration\"},{\"name\":\"image\",\"kind\":\"object\",\"type\":\"Asset\",\"relationName\":\"AssetToGeneration\"},{\"name\":\"equipments\",\"kind\":\"object\",\"type\":\"GenerationEquipment\",\"relationName\":\"GenerationToGenerationEquipment\"}],\"dbName\":\"generations\"},\"GenerationEquipment\":{\"fields\":[{\"name\":\"generationId\",\"kind\":\"scalar\",\"type\":\"String\",\"dbName\":\"generation_id\"},{\"name\":\"equipmentId\",\"kind\":\"scalar\",\"type\":\"String\",\"dbName\":\"equipment_id\"},{\"name\":\"generation\",\"kind\":\"object\",\"type\":\"Generation\",\"relationName\":\"GenerationToGenerationEquipment\"},{\"name\":\"equipment\",\"kind\":\"object\",\"type\":\"Equipment\",\"relationName\":\"EquipmentToGenerationEquipment\"}],\"dbName\":\"generation_equipments\"},\"Outfit\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"prompt\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\",\"dbName\":\"created_at\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\",\"dbName\":\"updated_at\"},{\"name\":\"equipments\",\"kind\":\"object\",\"type\":\"OutfitEquipment\",\"relationName\":\"OutfitToOutfitEquipment\"}],\"dbName\":\"outfits\"},\"OutfitEquipment\":{\"fields\":[{\"name\":\"outfitId\",\"kind\":\"scalar\",\"type\":\"String\",\"dbName\":\"outfit_id\"},{\"name\":\"equipmentId\",\"kind\":\"scalar\",\"type\":\"String\",\"dbName\":\"equipment_id\"},{\"name\":\"outfit\",\"kind\":\"object\",\"type\":\"Outfit\",\"relationName\":\"OutfitToOutfitEquipment\"},{\"name\":\"equipment\",\"kind\":\"object\",\"type\":\"Equipment\",\"relationName\":\"EquipmentToOutfitEquipment\"}],\"dbName\":\"outfit_equipments\"},\"Setting\":{\"fields\":[{\"name\":\"key\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"value\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\",\"dbName\":\"created_at\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\",\"dbName\":\"updated_at\"}],\"dbName\":\"settings\"}},\"enums\":{},\"types\":{}}") async function decodeBase64AsWasm(wasmBase64: string): Promise { const { Buffer } = await import('node:buffer') @@ -226,6 +226,26 @@ export interface PrismaClient< */ get generationEquipment(): Prisma.GenerationEquipmentDelegate; + /** + * `prisma.outfit`: Exposes CRUD operations for the **Outfit** model. + * Example usage: + * ```ts + * // Fetch zero or more Outfits + * const outfits = await prisma.outfit.findMany() + * ``` + */ + get outfit(): Prisma.OutfitDelegate; + + /** + * `prisma.outfitEquipment`: Exposes CRUD operations for the **OutfitEquipment** model. + * Example usage: + * ```ts + * // Fetch zero or more OutfitEquipments + * const outfitEquipments = await prisma.outfitEquipment.findMany() + * ``` + */ + get outfitEquipment(): Prisma.OutfitEquipmentDelegate; + /** * `prisma.setting`: Exposes CRUD operations for the **Setting** model. * Example usage: diff --git a/src/generated/prisma/internal/prismaNamespace.ts b/src/generated/prisma/internal/prismaNamespace.ts index b2e817b..df3a583 100644 --- a/src/generated/prisma/internal/prismaNamespace.ts +++ b/src/generated/prisma/internal/prismaNamespace.ts @@ -389,6 +389,8 @@ export const ModelName = { Equipment: 'Equipment', Generation: 'Generation', GenerationEquipment: 'GenerationEquipment', + Outfit: 'Outfit', + OutfitEquipment: 'OutfitEquipment', Setting: 'Setting' } as const @@ -405,7 +407,7 @@ export type TypeMap + fields: Prisma.OutfitFieldRefs + operations: { + findUnique: { + args: Prisma.OutfitFindUniqueArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findUniqueOrThrow: { + args: Prisma.OutfitFindUniqueOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findFirst: { + args: Prisma.OutfitFindFirstArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findFirstOrThrow: { + args: Prisma.OutfitFindFirstOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findMany: { + args: Prisma.OutfitFindManyArgs + result: runtime.Types.Utils.PayloadToResult[] + } + create: { + args: Prisma.OutfitCreateArgs + result: runtime.Types.Utils.PayloadToResult + } + createMany: { + args: Prisma.OutfitCreateManyArgs + result: BatchPayload + } + createManyAndReturn: { + args: Prisma.OutfitCreateManyAndReturnArgs + result: runtime.Types.Utils.PayloadToResult[] + } + delete: { + args: Prisma.OutfitDeleteArgs + result: runtime.Types.Utils.PayloadToResult + } + update: { + args: Prisma.OutfitUpdateArgs + result: runtime.Types.Utils.PayloadToResult + } + deleteMany: { + args: Prisma.OutfitDeleteManyArgs + result: BatchPayload + } + updateMany: { + args: Prisma.OutfitUpdateManyArgs + result: BatchPayload + } + updateManyAndReturn: { + args: Prisma.OutfitUpdateManyAndReturnArgs + result: runtime.Types.Utils.PayloadToResult[] + } + upsert: { + args: Prisma.OutfitUpsertArgs + result: runtime.Types.Utils.PayloadToResult + } + aggregate: { + args: Prisma.OutfitAggregateArgs + result: runtime.Types.Utils.Optional + } + groupBy: { + args: Prisma.OutfitGroupByArgs + result: runtime.Types.Utils.Optional[] + } + count: { + args: Prisma.OutfitCountArgs + result: runtime.Types.Utils.Optional | number + } + } + } + OutfitEquipment: { + payload: Prisma.$OutfitEquipmentPayload + fields: Prisma.OutfitEquipmentFieldRefs + operations: { + findUnique: { + args: Prisma.OutfitEquipmentFindUniqueArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findUniqueOrThrow: { + args: Prisma.OutfitEquipmentFindUniqueOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findFirst: { + args: Prisma.OutfitEquipmentFindFirstArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findFirstOrThrow: { + args: Prisma.OutfitEquipmentFindFirstOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findMany: { + args: Prisma.OutfitEquipmentFindManyArgs + result: runtime.Types.Utils.PayloadToResult[] + } + create: { + args: Prisma.OutfitEquipmentCreateArgs + result: runtime.Types.Utils.PayloadToResult + } + createMany: { + args: Prisma.OutfitEquipmentCreateManyArgs + result: BatchPayload + } + createManyAndReturn: { + args: Prisma.OutfitEquipmentCreateManyAndReturnArgs + result: runtime.Types.Utils.PayloadToResult[] + } + delete: { + args: Prisma.OutfitEquipmentDeleteArgs + result: runtime.Types.Utils.PayloadToResult + } + update: { + args: Prisma.OutfitEquipmentUpdateArgs + result: runtime.Types.Utils.PayloadToResult + } + deleteMany: { + args: Prisma.OutfitEquipmentDeleteManyArgs + result: BatchPayload + } + updateMany: { + args: Prisma.OutfitEquipmentUpdateManyArgs + result: BatchPayload + } + updateManyAndReturn: { + args: Prisma.OutfitEquipmentUpdateManyAndReturnArgs + result: runtime.Types.Utils.PayloadToResult[] + } + upsert: { + args: Prisma.OutfitEquipmentUpsertArgs + result: runtime.Types.Utils.PayloadToResult + } + aggregate: { + args: Prisma.OutfitEquipmentAggregateArgs + result: runtime.Types.Utils.Optional + } + groupBy: { + args: Prisma.OutfitEquipmentGroupByArgs + result: runtime.Types.Utils.Optional[] + } + count: { + args: Prisma.OutfitEquipmentCountArgs + result: runtime.Types.Utils.Optional | number + } + } + } Setting: { payload: Prisma.$SettingPayload fields: Prisma.SettingFieldRefs @@ -947,6 +1097,25 @@ export const GenerationEquipmentScalarFieldEnum = { export type GenerationEquipmentScalarFieldEnum = (typeof GenerationEquipmentScalarFieldEnum)[keyof typeof GenerationEquipmentScalarFieldEnum] +export const OutfitScalarFieldEnum = { + id: 'id', + name: 'name', + prompt: 'prompt', + createdAt: 'createdAt', + updatedAt: 'updatedAt' +} as const + +export type OutfitScalarFieldEnum = (typeof OutfitScalarFieldEnum)[keyof typeof OutfitScalarFieldEnum] + + +export const OutfitEquipmentScalarFieldEnum = { + outfitId: 'outfitId', + equipmentId: 'equipmentId' +} as const + +export type OutfitEquipmentScalarFieldEnum = (typeof OutfitEquipmentScalarFieldEnum)[keyof typeof OutfitEquipmentScalarFieldEnum] + + export const SettingScalarFieldEnum = { key: 'key', value: 'value', @@ -1099,6 +1268,8 @@ export type GlobalOmitConfig = { equipment?: Prisma.EquipmentOmit generation?: Prisma.GenerationOmit generationEquipment?: Prisma.GenerationEquipmentOmit + outfit?: Prisma.OutfitOmit + outfitEquipment?: Prisma.OutfitEquipmentOmit setting?: Prisma.SettingOmit } diff --git a/src/generated/prisma/internal/prismaNamespaceBrowser.ts b/src/generated/prisma/internal/prismaNamespaceBrowser.ts index dad148d..daee7ec 100644 --- a/src/generated/prisma/internal/prismaNamespaceBrowser.ts +++ b/src/generated/prisma/internal/prismaNamespaceBrowser.ts @@ -56,6 +56,8 @@ export const ModelName = { Equipment: 'Equipment', Generation: 'Generation', GenerationEquipment: 'GenerationEquipment', + Outfit: 'Outfit', + OutfitEquipment: 'OutfitEquipment', Setting: 'Setting' } as const @@ -130,6 +132,25 @@ export const GenerationEquipmentScalarFieldEnum = { export type GenerationEquipmentScalarFieldEnum = (typeof GenerationEquipmentScalarFieldEnum)[keyof typeof GenerationEquipmentScalarFieldEnum] +export const OutfitScalarFieldEnum = { + id: 'id', + name: 'name', + prompt: 'prompt', + createdAt: 'createdAt', + updatedAt: 'updatedAt' +} as const + +export type OutfitScalarFieldEnum = (typeof OutfitScalarFieldEnum)[keyof typeof OutfitScalarFieldEnum] + + +export const OutfitEquipmentScalarFieldEnum = { + outfitId: 'outfitId', + equipmentId: 'equipmentId' +} as const + +export type OutfitEquipmentScalarFieldEnum = (typeof OutfitEquipmentScalarFieldEnum)[keyof typeof OutfitEquipmentScalarFieldEnum] + + export const SettingScalarFieldEnum = { key: 'key', value: 'value', diff --git a/src/generated/prisma/models.ts b/src/generated/prisma/models.ts index b5a3af4..4e54c9e 100644 --- a/src/generated/prisma/models.ts +++ b/src/generated/prisma/models.ts @@ -13,5 +13,7 @@ export type * from './models/Character.ts' export type * from './models/Equipment.ts' export type * from './models/Generation.ts' export type * from './models/GenerationEquipment.ts' +export type * from './models/Outfit.ts' +export type * from './models/OutfitEquipment.ts' export type * from './models/Setting.ts' export type * from './commonInputTypes.ts' \ No newline at end of file diff --git a/src/generated/prisma/models/Equipment.ts b/src/generated/prisma/models/Equipment.ts index 4300672..8a488b7 100644 --- a/src/generated/prisma/models/Equipment.ts +++ b/src/generated/prisma/models/Equipment.ts @@ -208,6 +208,7 @@ export type EquipmentWhereInput = { updatedAt?: Prisma.DateTimeFilter<"Equipment"> | Date | string image?: Prisma.XOR generations?: Prisma.GenerationEquipmentListRelationFilter + outfits?: Prisma.OutfitEquipmentListRelationFilter } export type EquipmentOrderByWithRelationInput = { @@ -221,6 +222,7 @@ export type EquipmentOrderByWithRelationInput = { updatedAt?: Prisma.SortOrder image?: Prisma.AssetOrderByWithRelationInput generations?: Prisma.GenerationEquipmentOrderByRelationAggregateInput + outfits?: Prisma.OutfitEquipmentOrderByRelationAggregateInput } export type EquipmentWhereUniqueInput = Prisma.AtLeast<{ @@ -237,6 +239,7 @@ export type EquipmentWhereUniqueInput = Prisma.AtLeast<{ updatedAt?: Prisma.DateTimeFilter<"Equipment"> | Date | string image?: Prisma.XOR generations?: Prisma.GenerationEquipmentListRelationFilter + outfits?: Prisma.OutfitEquipmentListRelationFilter }, "id"> export type EquipmentOrderByWithAggregationInput = { @@ -277,6 +280,7 @@ export type EquipmentCreateInput = { updatedAt?: Date | string image: Prisma.AssetCreateNestedOneWithoutEquipmentsInput generations?: Prisma.GenerationEquipmentCreateNestedManyWithoutEquipmentInput + outfits?: Prisma.OutfitEquipmentCreateNestedManyWithoutEquipmentInput } export type EquipmentUncheckedCreateInput = { @@ -289,6 +293,7 @@ export type EquipmentUncheckedCreateInput = { createdAt?: Date | string updatedAt?: Date | string generations?: Prisma.GenerationEquipmentUncheckedCreateNestedManyWithoutEquipmentInput + outfits?: Prisma.OutfitEquipmentUncheckedCreateNestedManyWithoutEquipmentInput } export type EquipmentUpdateInput = { @@ -301,6 +306,7 @@ export type EquipmentUpdateInput = { updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string image?: Prisma.AssetUpdateOneRequiredWithoutEquipmentsNestedInput generations?: Prisma.GenerationEquipmentUpdateManyWithoutEquipmentNestedInput + outfits?: Prisma.OutfitEquipmentUpdateManyWithoutEquipmentNestedInput } export type EquipmentUncheckedUpdateInput = { @@ -313,6 +319,7 @@ export type EquipmentUncheckedUpdateInput = { createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string generations?: Prisma.GenerationEquipmentUncheckedUpdateManyWithoutEquipmentNestedInput + outfits?: Prisma.OutfitEquipmentUncheckedUpdateManyWithoutEquipmentNestedInput } export type EquipmentCreateManyInput = { @@ -451,6 +458,20 @@ export type EquipmentUpdateOneRequiredWithoutGenerationsNestedInput = { update?: Prisma.XOR, Prisma.EquipmentUncheckedUpdateWithoutGenerationsInput> } +export type EquipmentCreateNestedOneWithoutOutfitsInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.EquipmentCreateOrConnectWithoutOutfitsInput + connect?: Prisma.EquipmentWhereUniqueInput +} + +export type EquipmentUpdateOneRequiredWithoutOutfitsNestedInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.EquipmentCreateOrConnectWithoutOutfitsInput + upsert?: Prisma.EquipmentUpsertWithoutOutfitsInput + connect?: Prisma.EquipmentWhereUniqueInput + update?: Prisma.XOR, Prisma.EquipmentUncheckedUpdateWithoutOutfitsInput> +} + export type EquipmentCreateWithoutImageInput = { id: string name: string @@ -460,6 +481,7 @@ export type EquipmentCreateWithoutImageInput = { createdAt?: Date | string updatedAt?: Date | string generations?: Prisma.GenerationEquipmentCreateNestedManyWithoutEquipmentInput + outfits?: Prisma.OutfitEquipmentCreateNestedManyWithoutEquipmentInput } export type EquipmentUncheckedCreateWithoutImageInput = { @@ -471,6 +493,7 @@ export type EquipmentUncheckedCreateWithoutImageInput = { createdAt?: Date | string updatedAt?: Date | string generations?: Prisma.GenerationEquipmentUncheckedCreateNestedManyWithoutEquipmentInput + outfits?: Prisma.OutfitEquipmentUncheckedCreateNestedManyWithoutEquipmentInput } export type EquipmentCreateOrConnectWithoutImageInput = { @@ -521,6 +544,7 @@ export type EquipmentCreateWithoutGenerationsInput = { createdAt?: Date | string updatedAt?: Date | string image: Prisma.AssetCreateNestedOneWithoutEquipmentsInput + outfits?: Prisma.OutfitEquipmentCreateNestedManyWithoutEquipmentInput } export type EquipmentUncheckedCreateWithoutGenerationsInput = { @@ -532,6 +556,7 @@ export type EquipmentUncheckedCreateWithoutGenerationsInput = { imageId: string createdAt?: Date | string updatedAt?: Date | string + outfits?: Prisma.OutfitEquipmentUncheckedCreateNestedManyWithoutEquipmentInput } export type EquipmentCreateOrConnectWithoutGenerationsInput = { @@ -559,6 +584,7 @@ export type EquipmentUpdateWithoutGenerationsInput = { createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string image?: Prisma.AssetUpdateOneRequiredWithoutEquipmentsNestedInput + outfits?: Prisma.OutfitEquipmentUpdateManyWithoutEquipmentNestedInput } export type EquipmentUncheckedUpdateWithoutGenerationsInput = { @@ -570,6 +596,71 @@ export type EquipmentUncheckedUpdateWithoutGenerationsInput = { imageId?: Prisma.StringFieldUpdateOperationsInput | string createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + outfits?: Prisma.OutfitEquipmentUncheckedUpdateManyWithoutEquipmentNestedInput +} + +export type EquipmentCreateWithoutOutfitsInput = { + id: string + name: string + description: string + category: string + subCategory?: string | null + createdAt?: Date | string + updatedAt?: Date | string + image: Prisma.AssetCreateNestedOneWithoutEquipmentsInput + generations?: Prisma.GenerationEquipmentCreateNestedManyWithoutEquipmentInput +} + +export type EquipmentUncheckedCreateWithoutOutfitsInput = { + id: string + name: string + description: string + category: string + subCategory?: string | null + imageId: string + createdAt?: Date | string + updatedAt?: Date | string + generations?: Prisma.GenerationEquipmentUncheckedCreateNestedManyWithoutEquipmentInput +} + +export type EquipmentCreateOrConnectWithoutOutfitsInput = { + where: Prisma.EquipmentWhereUniqueInput + create: Prisma.XOR +} + +export type EquipmentUpsertWithoutOutfitsInput = { + update: Prisma.XOR + create: Prisma.XOR + where?: Prisma.EquipmentWhereInput +} + +export type EquipmentUpdateToOneWithWhereWithoutOutfitsInput = { + where?: Prisma.EquipmentWhereInput + data: Prisma.XOR +} + +export type EquipmentUpdateWithoutOutfitsInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + description?: Prisma.StringFieldUpdateOperationsInput | string + category?: Prisma.StringFieldUpdateOperationsInput | string + subCategory?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + image?: Prisma.AssetUpdateOneRequiredWithoutEquipmentsNestedInput + generations?: Prisma.GenerationEquipmentUpdateManyWithoutEquipmentNestedInput +} + +export type EquipmentUncheckedUpdateWithoutOutfitsInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + description?: Prisma.StringFieldUpdateOperationsInput | string + category?: Prisma.StringFieldUpdateOperationsInput | string + subCategory?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + imageId?: Prisma.StringFieldUpdateOperationsInput | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + generations?: Prisma.GenerationEquipmentUncheckedUpdateManyWithoutEquipmentNestedInput } export type EquipmentCreateManyImageInput = { @@ -591,6 +682,7 @@ export type EquipmentUpdateWithoutImageInput = { createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string generations?: Prisma.GenerationEquipmentUpdateManyWithoutEquipmentNestedInput + outfits?: Prisma.OutfitEquipmentUpdateManyWithoutEquipmentNestedInput } export type EquipmentUncheckedUpdateWithoutImageInput = { @@ -602,6 +694,7 @@ export type EquipmentUncheckedUpdateWithoutImageInput = { createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string generations?: Prisma.GenerationEquipmentUncheckedUpdateManyWithoutEquipmentNestedInput + outfits?: Prisma.OutfitEquipmentUncheckedUpdateManyWithoutEquipmentNestedInput } export type EquipmentUncheckedUpdateManyWithoutImageInput = { @@ -621,10 +714,12 @@ export type EquipmentUncheckedUpdateManyWithoutImageInput = { export type EquipmentCountOutputType = { generations: number + outfits: number } export type EquipmentCountOutputTypeSelect = { generations?: boolean | EquipmentCountOutputTypeCountGenerationsArgs + outfits?: boolean | EquipmentCountOutputTypeCountOutfitsArgs } /** @@ -644,6 +739,13 @@ export type EquipmentCountOutputTypeCountGenerationsArgs = { + where?: Prisma.OutfitEquipmentWhereInput +} + export type EquipmentSelect = runtime.Types.Extensions.GetSelect<{ id?: boolean @@ -656,6 +758,7 @@ export type EquipmentSelect generations?: boolean | Prisma.Equipment$generationsArgs + outfits?: boolean | Prisma.Equipment$outfitsArgs _count?: boolean | Prisma.EquipmentCountOutputTypeDefaultArgs }, ExtArgs["result"]["equipment"]> @@ -698,6 +801,7 @@ export type EquipmentOmit = { image?: boolean | Prisma.AssetDefaultArgs generations?: boolean | Prisma.Equipment$generationsArgs + outfits?: boolean | Prisma.Equipment$outfitsArgs _count?: boolean | Prisma.EquipmentCountOutputTypeDefaultArgs } export type EquipmentIncludeCreateManyAndReturn = { @@ -712,6 +816,7 @@ export type $EquipmentPayload generations: Prisma.$GenerationEquipmentPayload[] + outfits: Prisma.$OutfitEquipmentPayload[] } scalars: runtime.Types.Extensions.GetPayloadResult<{ id: string @@ -1118,6 +1223,7 @@ export interface Prisma__EquipmentClient = {}>(args?: Prisma.Subset>): Prisma.Prisma__AssetClient, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions> generations = {}>(args?: Prisma.Subset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions> | Null> + outfits = {}>(args?: Prisma.Subset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions> | Null> /** * Attaches callbacks for the resolution and/or rejection of the Promise. * @param onfulfilled The callback to execute when the Promise is resolved. @@ -1572,6 +1678,30 @@ export type Equipment$generationsArgs = { + /** + * Select specific fields to fetch from the OutfitEquipment + */ + select?: Prisma.OutfitEquipmentSelect | null + /** + * Omit specific fields from the OutfitEquipment + */ + omit?: Prisma.OutfitEquipmentOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.OutfitEquipmentInclude | null + where?: Prisma.OutfitEquipmentWhereInput + orderBy?: Prisma.OutfitEquipmentOrderByWithRelationInput | Prisma.OutfitEquipmentOrderByWithRelationInput[] + cursor?: Prisma.OutfitEquipmentWhereUniqueInput + take?: number + skip?: number + distinct?: Prisma.OutfitEquipmentScalarFieldEnum | Prisma.OutfitEquipmentScalarFieldEnum[] +} + /** * Equipment without action */ diff --git a/src/generated/prisma/models/Outfit.ts b/src/generated/prisma/models/Outfit.ts new file mode 100644 index 0000000..7f418de --- /dev/null +++ b/src/generated/prisma/models/Outfit.ts @@ -0,0 +1,1320 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! */ +/* eslint-disable */ +// biome-ignore-all lint: generated file +// @ts-nocheck +/* + * This file exports the `Outfit` model and its related types. + * + * 🟢 You can import this file directly. + */ +import type * as runtime from "@prisma/client/runtime/client" +import type * as $Enums from "../enums.ts" +import type * as Prisma from "../internal/prismaNamespace.ts" + +/** + * Model Outfit + * + */ +export type OutfitModel = runtime.Types.Result.DefaultSelection + +export type AggregateOutfit = { + _count: OutfitCountAggregateOutputType | null + _min: OutfitMinAggregateOutputType | null + _max: OutfitMaxAggregateOutputType | null +} + +export type OutfitMinAggregateOutputType = { + id: string | null + name: string | null + prompt: string | null + createdAt: Date | null + updatedAt: Date | null +} + +export type OutfitMaxAggregateOutputType = { + id: string | null + name: string | null + prompt: string | null + createdAt: Date | null + updatedAt: Date | null +} + +export type OutfitCountAggregateOutputType = { + id: number + name: number + prompt: number + createdAt: number + updatedAt: number + _all: number +} + + +export type OutfitMinAggregateInputType = { + id?: true + name?: true + prompt?: true + createdAt?: true + updatedAt?: true +} + +export type OutfitMaxAggregateInputType = { + id?: true + name?: true + prompt?: true + createdAt?: true + updatedAt?: true +} + +export type OutfitCountAggregateInputType = { + id?: true + name?: true + prompt?: true + createdAt?: true + updatedAt?: true + _all?: true +} + +export type OutfitAggregateArgs = { + /** + * Filter which Outfit to aggregate. + */ + where?: Prisma.OutfitWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Outfits to fetch. + */ + orderBy?: Prisma.OutfitOrderByWithRelationInput | Prisma.OutfitOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the start position + */ + cursor?: Prisma.OutfitWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Outfits from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` Outfits. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned Outfits + **/ + _count?: true | OutfitCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: OutfitMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: OutfitMaxAggregateInputType +} + +export type GetOutfitAggregateType = { + [P in keyof T & keyof AggregateOutfit]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType +} + + + + +export type OutfitGroupByArgs = { + where?: Prisma.OutfitWhereInput + orderBy?: Prisma.OutfitOrderByWithAggregationInput | Prisma.OutfitOrderByWithAggregationInput[] + by: Prisma.OutfitScalarFieldEnum[] | Prisma.OutfitScalarFieldEnum + having?: Prisma.OutfitScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: OutfitCountAggregateInputType | true + _min?: OutfitMinAggregateInputType + _max?: OutfitMaxAggregateInputType +} + +export type OutfitGroupByOutputType = { + id: string + name: string + prompt: string | null + createdAt: Date + updatedAt: Date + _count: OutfitCountAggregateOutputType | null + _min: OutfitMinAggregateOutputType | null + _max: OutfitMaxAggregateOutputType | null +} + +type GetOutfitGroupByPayload = Prisma.PrismaPromise< + Array< + Prisma.PickEnumerable & + { + [P in ((keyof T) & (keyof OutfitGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType + } + > + > + + + +export type OutfitWhereInput = { + AND?: Prisma.OutfitWhereInput | Prisma.OutfitWhereInput[] + OR?: Prisma.OutfitWhereInput[] + NOT?: Prisma.OutfitWhereInput | Prisma.OutfitWhereInput[] + id?: Prisma.StringFilter<"Outfit"> | string + name?: Prisma.StringFilter<"Outfit"> | string + prompt?: Prisma.StringNullableFilter<"Outfit"> | string | null + createdAt?: Prisma.DateTimeFilter<"Outfit"> | Date | string + updatedAt?: Prisma.DateTimeFilter<"Outfit"> | Date | string + equipments?: Prisma.OutfitEquipmentListRelationFilter +} + +export type OutfitOrderByWithRelationInput = { + id?: Prisma.SortOrder + name?: Prisma.SortOrder + prompt?: Prisma.SortOrderInput | Prisma.SortOrder + createdAt?: Prisma.SortOrder + updatedAt?: Prisma.SortOrder + equipments?: Prisma.OutfitEquipmentOrderByRelationAggregateInput +} + +export type OutfitWhereUniqueInput = Prisma.AtLeast<{ + id?: string + AND?: Prisma.OutfitWhereInput | Prisma.OutfitWhereInput[] + OR?: Prisma.OutfitWhereInput[] + NOT?: Prisma.OutfitWhereInput | Prisma.OutfitWhereInput[] + name?: Prisma.StringFilter<"Outfit"> | string + prompt?: Prisma.StringNullableFilter<"Outfit"> | string | null + createdAt?: Prisma.DateTimeFilter<"Outfit"> | Date | string + updatedAt?: Prisma.DateTimeFilter<"Outfit"> | Date | string + equipments?: Prisma.OutfitEquipmentListRelationFilter +}, "id"> + +export type OutfitOrderByWithAggregationInput = { + id?: Prisma.SortOrder + name?: Prisma.SortOrder + prompt?: Prisma.SortOrderInput | Prisma.SortOrder + createdAt?: Prisma.SortOrder + updatedAt?: Prisma.SortOrder + _count?: Prisma.OutfitCountOrderByAggregateInput + _max?: Prisma.OutfitMaxOrderByAggregateInput + _min?: Prisma.OutfitMinOrderByAggregateInput +} + +export type OutfitScalarWhereWithAggregatesInput = { + AND?: Prisma.OutfitScalarWhereWithAggregatesInput | Prisma.OutfitScalarWhereWithAggregatesInput[] + OR?: Prisma.OutfitScalarWhereWithAggregatesInput[] + NOT?: Prisma.OutfitScalarWhereWithAggregatesInput | Prisma.OutfitScalarWhereWithAggregatesInput[] + id?: Prisma.StringWithAggregatesFilter<"Outfit"> | string + name?: Prisma.StringWithAggregatesFilter<"Outfit"> | string + prompt?: Prisma.StringNullableWithAggregatesFilter<"Outfit"> | string | null + createdAt?: Prisma.DateTimeWithAggregatesFilter<"Outfit"> | Date | string + updatedAt?: Prisma.DateTimeWithAggregatesFilter<"Outfit"> | Date | string +} + +export type OutfitCreateInput = { + id: string + name: string + prompt?: string | null + createdAt?: Date | string + updatedAt?: Date | string + equipments?: Prisma.OutfitEquipmentCreateNestedManyWithoutOutfitInput +} + +export type OutfitUncheckedCreateInput = { + id: string + name: string + prompt?: string | null + createdAt?: Date | string + updatedAt?: Date | string + equipments?: Prisma.OutfitEquipmentUncheckedCreateNestedManyWithoutOutfitInput +} + +export type OutfitUpdateInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + prompt?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + equipments?: Prisma.OutfitEquipmentUpdateManyWithoutOutfitNestedInput +} + +export type OutfitUncheckedUpdateInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + prompt?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + equipments?: Prisma.OutfitEquipmentUncheckedUpdateManyWithoutOutfitNestedInput +} + +export type OutfitCreateManyInput = { + id: string + name: string + prompt?: string | null + createdAt?: Date | string + updatedAt?: Date | string +} + +export type OutfitUpdateManyMutationInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + prompt?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string +} + +export type OutfitUncheckedUpdateManyInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + prompt?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string +} + +export type OutfitCountOrderByAggregateInput = { + id?: Prisma.SortOrder + name?: Prisma.SortOrder + prompt?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + updatedAt?: Prisma.SortOrder +} + +export type OutfitMaxOrderByAggregateInput = { + id?: Prisma.SortOrder + name?: Prisma.SortOrder + prompt?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + updatedAt?: Prisma.SortOrder +} + +export type OutfitMinOrderByAggregateInput = { + id?: Prisma.SortOrder + name?: Prisma.SortOrder + prompt?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + updatedAt?: Prisma.SortOrder +} + +export type OutfitScalarRelationFilter = { + is?: Prisma.OutfitWhereInput + isNot?: Prisma.OutfitWhereInput +} + +export type OutfitCreateNestedOneWithoutEquipmentsInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.OutfitCreateOrConnectWithoutEquipmentsInput + connect?: Prisma.OutfitWhereUniqueInput +} + +export type OutfitUpdateOneRequiredWithoutEquipmentsNestedInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.OutfitCreateOrConnectWithoutEquipmentsInput + upsert?: Prisma.OutfitUpsertWithoutEquipmentsInput + connect?: Prisma.OutfitWhereUniqueInput + update?: Prisma.XOR, Prisma.OutfitUncheckedUpdateWithoutEquipmentsInput> +} + +export type OutfitCreateWithoutEquipmentsInput = { + id: string + name: string + prompt?: string | null + createdAt?: Date | string + updatedAt?: Date | string +} + +export type OutfitUncheckedCreateWithoutEquipmentsInput = { + id: string + name: string + prompt?: string | null + createdAt?: Date | string + updatedAt?: Date | string +} + +export type OutfitCreateOrConnectWithoutEquipmentsInput = { + where: Prisma.OutfitWhereUniqueInput + create: Prisma.XOR +} + +export type OutfitUpsertWithoutEquipmentsInput = { + update: Prisma.XOR + create: Prisma.XOR + where?: Prisma.OutfitWhereInput +} + +export type OutfitUpdateToOneWithWhereWithoutEquipmentsInput = { + where?: Prisma.OutfitWhereInput + data: Prisma.XOR +} + +export type OutfitUpdateWithoutEquipmentsInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + prompt?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string +} + +export type OutfitUncheckedUpdateWithoutEquipmentsInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + prompt?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string +} + + +/** + * Count Type OutfitCountOutputType + */ + +export type OutfitCountOutputType = { + equipments: number +} + +export type OutfitCountOutputTypeSelect = { + equipments?: boolean | OutfitCountOutputTypeCountEquipmentsArgs +} + +/** + * OutfitCountOutputType without action + */ +export type OutfitCountOutputTypeDefaultArgs = { + /** + * Select specific fields to fetch from the OutfitCountOutputType + */ + select?: Prisma.OutfitCountOutputTypeSelect | null +} + +/** + * OutfitCountOutputType without action + */ +export type OutfitCountOutputTypeCountEquipmentsArgs = { + where?: Prisma.OutfitEquipmentWhereInput +} + + +export type OutfitSelect = runtime.Types.Extensions.GetSelect<{ + id?: boolean + name?: boolean + prompt?: boolean + createdAt?: boolean + updatedAt?: boolean + equipments?: boolean | Prisma.Outfit$equipmentsArgs + _count?: boolean | Prisma.OutfitCountOutputTypeDefaultArgs +}, ExtArgs["result"]["outfit"]> + +export type OutfitSelectCreateManyAndReturn = runtime.Types.Extensions.GetSelect<{ + id?: boolean + name?: boolean + prompt?: boolean + createdAt?: boolean + updatedAt?: boolean +}, ExtArgs["result"]["outfit"]> + +export type OutfitSelectUpdateManyAndReturn = runtime.Types.Extensions.GetSelect<{ + id?: boolean + name?: boolean + prompt?: boolean + createdAt?: boolean + updatedAt?: boolean +}, ExtArgs["result"]["outfit"]> + +export type OutfitSelectScalar = { + id?: boolean + name?: boolean + prompt?: boolean + createdAt?: boolean + updatedAt?: boolean +} + +export type OutfitOmit = runtime.Types.Extensions.GetOmit<"id" | "name" | "prompt" | "createdAt" | "updatedAt", ExtArgs["result"]["outfit"]> +export type OutfitInclude = { + equipments?: boolean | Prisma.Outfit$equipmentsArgs + _count?: boolean | Prisma.OutfitCountOutputTypeDefaultArgs +} +export type OutfitIncludeCreateManyAndReturn = {} +export type OutfitIncludeUpdateManyAndReturn = {} + +export type $OutfitPayload = { + name: "Outfit" + objects: { + equipments: Prisma.$OutfitEquipmentPayload[] + } + scalars: runtime.Types.Extensions.GetPayloadResult<{ + id: string + name: string + prompt: string | null + createdAt: Date + updatedAt: Date + }, ExtArgs["result"]["outfit"]> + composites: {} +} + +export type OutfitGetPayload = runtime.Types.Result.GetResult + +export type OutfitCountArgs = + Omit & { + select?: OutfitCountAggregateInputType | true + } + +export interface OutfitDelegate { + [K: symbol]: { types: Prisma.TypeMap['model']['Outfit'], meta: { name: 'Outfit' } } + /** + * Find zero or one Outfit that matches the filter. + * @param {OutfitFindUniqueArgs} args - Arguments to find a Outfit + * @example + * // Get one Outfit + * const outfit = await prisma.outfit.findUnique({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUnique(args: Prisma.SelectSubset>): Prisma.Prisma__OutfitClient, T, "findUnique", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find one Outfit that matches the filter or throw an error with `error.code='P2025'` + * if no matches were found. + * @param {OutfitFindUniqueOrThrowArgs} args - Arguments to find a Outfit + * @example + * // Get one Outfit + * const outfit = await prisma.outfit.findUniqueOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUniqueOrThrow(args: Prisma.SelectSubset>): Prisma.Prisma__OutfitClient, T, "findUniqueOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find the first Outfit that matches the filter. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {OutfitFindFirstArgs} args - Arguments to find a Outfit + * @example + * // Get one Outfit + * const outfit = await prisma.outfit.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirst(args?: Prisma.SelectSubset>): Prisma.Prisma__OutfitClient, T, "findFirst", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find the first Outfit that matches the filter or + * throw `PrismaKnownClientError` with `P2025` code if no matches were found. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {OutfitFindFirstOrThrowArgs} args - Arguments to find a Outfit + * @example + * // Get one Outfit + * const outfit = await prisma.outfit.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirstOrThrow(args?: Prisma.SelectSubset>): Prisma.Prisma__OutfitClient, T, "findFirstOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find zero or more Outfits that matches the filter. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {OutfitFindManyArgs} args - Arguments to filter and select certain fields only. + * @example + * // Get all Outfits + * const outfits = await prisma.outfit.findMany() + * + * // Get first 10 Outfits + * const outfits = await prisma.outfit.findMany({ take: 10 }) + * + * // Only select the `id` + * const outfitWithIdOnly = await prisma.outfit.findMany({ select: { id: true } }) + * + */ + findMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions>> + + /** + * Create a Outfit. + * @param {OutfitCreateArgs} args - Arguments to create a Outfit. + * @example + * // Create one Outfit + * const Outfit = await prisma.outfit.create({ + * data: { + * // ... data to create a Outfit + * } + * }) + * + */ + create(args: Prisma.SelectSubset>): Prisma.Prisma__OutfitClient, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Create many Outfits. + * @param {OutfitCreateManyArgs} args - Arguments to create many Outfits. + * @example + * // Create many Outfits + * const outfit = await prisma.outfit.createMany({ + * data: [ + * // ... provide data here + * ] + * }) + * + */ + createMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Create many Outfits and returns the data saved in the database. + * @param {OutfitCreateManyAndReturnArgs} args - Arguments to create many Outfits. + * @example + * // Create many Outfits + * const outfit = await prisma.outfit.createManyAndReturn({ + * data: [ + * // ... provide data here + * ] + * }) + * + * // Create many Outfits and only return the `id` + * const outfitWithIdOnly = await prisma.outfit.createManyAndReturn({ + * select: { id: true }, + * data: [ + * // ... provide data here + * ] + * }) + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * + */ + createManyAndReturn(args?: Prisma.SelectSubset>): Prisma.PrismaPromise, T, "createManyAndReturn", GlobalOmitOptions>> + + /** + * Delete a Outfit. + * @param {OutfitDeleteArgs} args - Arguments to delete one Outfit. + * @example + * // Delete one Outfit + * const Outfit = await prisma.outfit.delete({ + * where: { + * // ... filter to delete one Outfit + * } + * }) + * + */ + delete(args: Prisma.SelectSubset>): Prisma.Prisma__OutfitClient, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Update one Outfit. + * @param {OutfitUpdateArgs} args - Arguments to update one Outfit. + * @example + * // Update one Outfit + * const outfit = await prisma.outfit.update({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + update(args: Prisma.SelectSubset>): Prisma.Prisma__OutfitClient, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Delete zero or more Outfits. + * @param {OutfitDeleteManyArgs} args - Arguments to filter Outfits to delete. + * @example + * // Delete a few Outfits + * const { count } = await prisma.outfit.deleteMany({ + * where: { + * // ... provide filter here + * } + * }) + * + */ + deleteMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more Outfits. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {OutfitUpdateManyArgs} args - Arguments to update one or more rows. + * @example + * // Update many Outfits + * const outfit = await prisma.outfit.updateMany({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + updateMany(args: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more Outfits and returns the data updated in the database. + * @param {OutfitUpdateManyAndReturnArgs} args - Arguments to update many Outfits. + * @example + * // Update many Outfits + * const outfit = await prisma.outfit.updateManyAndReturn({ + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * + * // Update zero or more Outfits and only return the `id` + * const outfitWithIdOnly = await prisma.outfit.updateManyAndReturn({ + * select: { id: true }, + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * + */ + updateManyAndReturn(args: Prisma.SelectSubset>): Prisma.PrismaPromise, T, "updateManyAndReturn", GlobalOmitOptions>> + + /** + * Create or update one Outfit. + * @param {OutfitUpsertArgs} args - Arguments to update or create a Outfit. + * @example + * // Update or create a Outfit + * const outfit = await prisma.outfit.upsert({ + * create: { + * // ... data to create a Outfit + * }, + * update: { + * // ... in case it already exists, update + * }, + * where: { + * // ... the filter for the Outfit we want to update + * } + * }) + */ + upsert(args: Prisma.SelectSubset>): Prisma.Prisma__OutfitClient, T, "upsert", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + + /** + * Count the number of Outfits. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {OutfitCountArgs} args - Arguments to filter Outfits to count. + * @example + * // Count the number of Outfits + * const count = await prisma.outfit.count({ + * where: { + * // ... the filter for the Outfits we want to count + * } + * }) + **/ + count( + args?: Prisma.Subset, + ): Prisma.PrismaPromise< + T extends runtime.Types.Utils.Record<'select', any> + ? T['select'] extends true + ? number + : Prisma.GetScalarType + : number + > + + /** + * Allows you to perform aggregations operations on a Outfit. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {OutfitAggregateArgs} args - Select which aggregations you would like to apply and on what fields. + * @example + * // Ordered by age ascending + * // Where email contains prisma.io + * // Limited to the 10 users + * const aggregations = await prisma.user.aggregate({ + * _avg: { + * age: true, + * }, + * where: { + * email: { + * contains: "prisma.io", + * }, + * }, + * orderBy: { + * age: "asc", + * }, + * take: 10, + * }) + **/ + aggregate(args: Prisma.Subset): Prisma.PrismaPromise> + + /** + * Group by Outfit. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {OutfitGroupByArgs} args - Group by arguments. + * @example + * // Group by city, order by createdAt, get count + * const result = await prisma.user.groupBy({ + * by: ['city', 'createdAt'], + * orderBy: { + * createdAt: true + * }, + * _count: { + * _all: true + * }, + * }) + * + **/ + groupBy< + T extends OutfitGroupByArgs, + HasSelectOrTake extends Prisma.Or< + Prisma.Extends<'skip', Prisma.Keys>, + Prisma.Extends<'take', Prisma.Keys> + >, + OrderByArg extends Prisma.True extends HasSelectOrTake + ? { orderBy: OutfitGroupByArgs['orderBy'] } + : { orderBy?: OutfitGroupByArgs['orderBy'] }, + OrderFields extends Prisma.ExcludeUnderscoreKeys>>, + ByFields extends Prisma.MaybeTupleToUnion, + ByValid extends Prisma.Has, + HavingFields extends Prisma.GetHavingFields, + HavingValid extends Prisma.Has, + ByEmpty extends T['by'] extends never[] ? Prisma.True : Prisma.False, + InputErrors extends ByEmpty extends Prisma.True + ? `Error: "by" must not be empty.` + : HavingValid extends Prisma.False + ? { + [P in HavingFields]: P extends ByFields + ? never + : P extends string + ? `Error: Field "${P}" used in "having" needs to be provided in "by".` + : [ + Error, + 'Field ', + P, + ` in "having" needs to be provided in "by"`, + ] + }[HavingFields] + : 'take' extends Prisma.Keys + ? 'orderBy' extends Prisma.Keys + ? ByValid extends Prisma.True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + : 'Error: If you provide "take", you also need to provide "orderBy"' + : 'skip' extends Prisma.Keys + ? 'orderBy' extends Prisma.Keys + ? ByValid extends Prisma.True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + : 'Error: If you provide "skip", you also need to provide "orderBy"' + : ByValid extends Prisma.True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + >(args: Prisma.SubsetIntersection & InputErrors): {} extends InputErrors ? GetOutfitGroupByPayload : Prisma.PrismaPromise +/** + * Fields of the Outfit model + */ +readonly fields: OutfitFieldRefs; +} + +/** + * The delegate class that acts as a "Promise-like" for Outfit. + * Why is this prefixed with `Prisma__`? + * Because we want to prevent naming conflicts as mentioned in + * https://github.com/prisma/prisma-client-js/issues/707 + */ +export interface Prisma__OutfitClient extends Prisma.PrismaPromise { + readonly [Symbol.toStringTag]: "PrismaPromise" + equipments = {}>(args?: Prisma.Subset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions> | Null> + /** + * Attaches callbacks for the resolution and/or rejection of the Promise. + * @param onfulfilled The callback to execute when the Promise is resolved. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of which ever callback is executed. + */ + then(onfulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null): runtime.Types.Utils.JsPromise + /** + * Attaches a callback for only the rejection of the Promise. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of the callback. + */ + catch(onrejected?: ((reason: any) => TResult | PromiseLike) | undefined | null): runtime.Types.Utils.JsPromise + /** + * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The + * resolved value cannot be modified from the callback. + * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected). + * @returns A Promise for the completion of the callback. + */ + finally(onfinally?: (() => void) | undefined | null): runtime.Types.Utils.JsPromise +} + + + + +/** + * Fields of the Outfit model + */ +export interface OutfitFieldRefs { + readonly id: Prisma.FieldRef<"Outfit", 'String'> + readonly name: Prisma.FieldRef<"Outfit", 'String'> + readonly prompt: Prisma.FieldRef<"Outfit", 'String'> + readonly createdAt: Prisma.FieldRef<"Outfit", 'DateTime'> + readonly updatedAt: Prisma.FieldRef<"Outfit", 'DateTime'> +} + + +// Custom InputTypes +/** + * Outfit findUnique + */ +export type OutfitFindUniqueArgs = { + /** + * Select specific fields to fetch from the Outfit + */ + select?: Prisma.OutfitSelect | null + /** + * Omit specific fields from the Outfit + */ + omit?: Prisma.OutfitOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.OutfitInclude | null + /** + * Filter, which Outfit to fetch. + */ + where: Prisma.OutfitWhereUniqueInput +} + +/** + * Outfit findUniqueOrThrow + */ +export type OutfitFindUniqueOrThrowArgs = { + /** + * Select specific fields to fetch from the Outfit + */ + select?: Prisma.OutfitSelect | null + /** + * Omit specific fields from the Outfit + */ + omit?: Prisma.OutfitOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.OutfitInclude | null + /** + * Filter, which Outfit to fetch. + */ + where: Prisma.OutfitWhereUniqueInput +} + +/** + * Outfit findFirst + */ +export type OutfitFindFirstArgs = { + /** + * Select specific fields to fetch from the Outfit + */ + select?: Prisma.OutfitSelect | null + /** + * Omit specific fields from the Outfit + */ + omit?: Prisma.OutfitOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.OutfitInclude | null + /** + * Filter, which Outfit to fetch. + */ + where?: Prisma.OutfitWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Outfits to fetch. + */ + orderBy?: Prisma.OutfitOrderByWithRelationInput | Prisma.OutfitOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for Outfits. + */ + cursor?: Prisma.OutfitWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Outfits from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` Outfits. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Outfits. + */ + distinct?: Prisma.OutfitScalarFieldEnum | Prisma.OutfitScalarFieldEnum[] +} + +/** + * Outfit findFirstOrThrow + */ +export type OutfitFindFirstOrThrowArgs = { + /** + * Select specific fields to fetch from the Outfit + */ + select?: Prisma.OutfitSelect | null + /** + * Omit specific fields from the Outfit + */ + omit?: Prisma.OutfitOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.OutfitInclude | null + /** + * Filter, which Outfit to fetch. + */ + where?: Prisma.OutfitWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Outfits to fetch. + */ + orderBy?: Prisma.OutfitOrderByWithRelationInput | Prisma.OutfitOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for Outfits. + */ + cursor?: Prisma.OutfitWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Outfits from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` Outfits. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Outfits. + */ + distinct?: Prisma.OutfitScalarFieldEnum | Prisma.OutfitScalarFieldEnum[] +} + +/** + * Outfit findMany + */ +export type OutfitFindManyArgs = { + /** + * Select specific fields to fetch from the Outfit + */ + select?: Prisma.OutfitSelect | null + /** + * Omit specific fields from the Outfit + */ + omit?: Prisma.OutfitOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.OutfitInclude | null + /** + * Filter, which Outfits to fetch. + */ + where?: Prisma.OutfitWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Outfits to fetch. + */ + orderBy?: Prisma.OutfitOrderByWithRelationInput | Prisma.OutfitOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for listing Outfits. + */ + cursor?: Prisma.OutfitWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Outfits from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` Outfits. + */ + skip?: number + distinct?: Prisma.OutfitScalarFieldEnum | Prisma.OutfitScalarFieldEnum[] +} + +/** + * Outfit create + */ +export type OutfitCreateArgs = { + /** + * Select specific fields to fetch from the Outfit + */ + select?: Prisma.OutfitSelect | null + /** + * Omit specific fields from the Outfit + */ + omit?: Prisma.OutfitOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.OutfitInclude | null + /** + * The data needed to create a Outfit. + */ + data: Prisma.XOR +} + +/** + * Outfit createMany + */ +export type OutfitCreateManyArgs = { + /** + * The data used to create many Outfits. + */ + data: Prisma.OutfitCreateManyInput | Prisma.OutfitCreateManyInput[] +} + +/** + * Outfit createManyAndReturn + */ +export type OutfitCreateManyAndReturnArgs = { + /** + * Select specific fields to fetch from the Outfit + */ + select?: Prisma.OutfitSelectCreateManyAndReturn | null + /** + * Omit specific fields from the Outfit + */ + omit?: Prisma.OutfitOmit | null + /** + * The data used to create many Outfits. + */ + data: Prisma.OutfitCreateManyInput | Prisma.OutfitCreateManyInput[] +} + +/** + * Outfit update + */ +export type OutfitUpdateArgs = { + /** + * Select specific fields to fetch from the Outfit + */ + select?: Prisma.OutfitSelect | null + /** + * Omit specific fields from the Outfit + */ + omit?: Prisma.OutfitOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.OutfitInclude | null + /** + * The data needed to update a Outfit. + */ + data: Prisma.XOR + /** + * Choose, which Outfit to update. + */ + where: Prisma.OutfitWhereUniqueInput +} + +/** + * Outfit updateMany + */ +export type OutfitUpdateManyArgs = { + /** + * The data used to update Outfits. + */ + data: Prisma.XOR + /** + * Filter which Outfits to update + */ + where?: Prisma.OutfitWhereInput + /** + * Limit how many Outfits to update. + */ + limit?: number +} + +/** + * Outfit updateManyAndReturn + */ +export type OutfitUpdateManyAndReturnArgs = { + /** + * Select specific fields to fetch from the Outfit + */ + select?: Prisma.OutfitSelectUpdateManyAndReturn | null + /** + * Omit specific fields from the Outfit + */ + omit?: Prisma.OutfitOmit | null + /** + * The data used to update Outfits. + */ + data: Prisma.XOR + /** + * Filter which Outfits to update + */ + where?: Prisma.OutfitWhereInput + /** + * Limit how many Outfits to update. + */ + limit?: number +} + +/** + * Outfit upsert + */ +export type OutfitUpsertArgs = { + /** + * Select specific fields to fetch from the Outfit + */ + select?: Prisma.OutfitSelect | null + /** + * Omit specific fields from the Outfit + */ + omit?: Prisma.OutfitOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.OutfitInclude | null + /** + * The filter to search for the Outfit to update in case it exists. + */ + where: Prisma.OutfitWhereUniqueInput + /** + * In case the Outfit found by the `where` argument doesn't exist, create a new Outfit with this data. + */ + create: Prisma.XOR + /** + * In case the Outfit was found with the provided `where` argument, update it with this data. + */ + update: Prisma.XOR +} + +/** + * Outfit delete + */ +export type OutfitDeleteArgs = { + /** + * Select specific fields to fetch from the Outfit + */ + select?: Prisma.OutfitSelect | null + /** + * Omit specific fields from the Outfit + */ + omit?: Prisma.OutfitOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.OutfitInclude | null + /** + * Filter which Outfit to delete. + */ + where: Prisma.OutfitWhereUniqueInput +} + +/** + * Outfit deleteMany + */ +export type OutfitDeleteManyArgs = { + /** + * Filter which Outfits to delete + */ + where?: Prisma.OutfitWhereInput + /** + * Limit how many Outfits to delete. + */ + limit?: number +} + +/** + * Outfit.equipments + */ +export type Outfit$equipmentsArgs = { + /** + * Select specific fields to fetch from the OutfitEquipment + */ + select?: Prisma.OutfitEquipmentSelect | null + /** + * Omit specific fields from the OutfitEquipment + */ + omit?: Prisma.OutfitEquipmentOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.OutfitEquipmentInclude | null + where?: Prisma.OutfitEquipmentWhereInput + orderBy?: Prisma.OutfitEquipmentOrderByWithRelationInput | Prisma.OutfitEquipmentOrderByWithRelationInput[] + cursor?: Prisma.OutfitEquipmentWhereUniqueInput + take?: number + skip?: number + distinct?: Prisma.OutfitEquipmentScalarFieldEnum | Prisma.OutfitEquipmentScalarFieldEnum[] +} + +/** + * Outfit without action + */ +export type OutfitDefaultArgs = { + /** + * Select specific fields to fetch from the Outfit + */ + select?: Prisma.OutfitSelect | null + /** + * Omit specific fields from the Outfit + */ + omit?: Prisma.OutfitOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.OutfitInclude | null +} diff --git a/src/generated/prisma/models/OutfitEquipment.ts b/src/generated/prisma/models/OutfitEquipment.ts new file mode 100644 index 0000000..68c8bd9 --- /dev/null +++ b/src/generated/prisma/models/OutfitEquipment.ts @@ -0,0 +1,1340 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! */ +/* eslint-disable */ +// biome-ignore-all lint: generated file +// @ts-nocheck +/* + * This file exports the `OutfitEquipment` model and its related types. + * + * 🟢 You can import this file directly. + */ +import type * as runtime from "@prisma/client/runtime/client" +import type * as $Enums from "../enums.ts" +import type * as Prisma from "../internal/prismaNamespace.ts" + +/** + * Model OutfitEquipment + * + */ +export type OutfitEquipmentModel = runtime.Types.Result.DefaultSelection + +export type AggregateOutfitEquipment = { + _count: OutfitEquipmentCountAggregateOutputType | null + _min: OutfitEquipmentMinAggregateOutputType | null + _max: OutfitEquipmentMaxAggregateOutputType | null +} + +export type OutfitEquipmentMinAggregateOutputType = { + outfitId: string | null + equipmentId: string | null +} + +export type OutfitEquipmentMaxAggregateOutputType = { + outfitId: string | null + equipmentId: string | null +} + +export type OutfitEquipmentCountAggregateOutputType = { + outfitId: number + equipmentId: number + _all: number +} + + +export type OutfitEquipmentMinAggregateInputType = { + outfitId?: true + equipmentId?: true +} + +export type OutfitEquipmentMaxAggregateInputType = { + outfitId?: true + equipmentId?: true +} + +export type OutfitEquipmentCountAggregateInputType = { + outfitId?: true + equipmentId?: true + _all?: true +} + +export type OutfitEquipmentAggregateArgs = { + /** + * Filter which OutfitEquipment to aggregate. + */ + where?: Prisma.OutfitEquipmentWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of OutfitEquipments to fetch. + */ + orderBy?: Prisma.OutfitEquipmentOrderByWithRelationInput | Prisma.OutfitEquipmentOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the start position + */ + cursor?: Prisma.OutfitEquipmentWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` OutfitEquipments from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` OutfitEquipments. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned OutfitEquipments + **/ + _count?: true | OutfitEquipmentCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: OutfitEquipmentMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: OutfitEquipmentMaxAggregateInputType +} + +export type GetOutfitEquipmentAggregateType = { + [P in keyof T & keyof AggregateOutfitEquipment]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType +} + + + + +export type OutfitEquipmentGroupByArgs = { + where?: Prisma.OutfitEquipmentWhereInput + orderBy?: Prisma.OutfitEquipmentOrderByWithAggregationInput | Prisma.OutfitEquipmentOrderByWithAggregationInput[] + by: Prisma.OutfitEquipmentScalarFieldEnum[] | Prisma.OutfitEquipmentScalarFieldEnum + having?: Prisma.OutfitEquipmentScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: OutfitEquipmentCountAggregateInputType | true + _min?: OutfitEquipmentMinAggregateInputType + _max?: OutfitEquipmentMaxAggregateInputType +} + +export type OutfitEquipmentGroupByOutputType = { + outfitId: string + equipmentId: string + _count: OutfitEquipmentCountAggregateOutputType | null + _min: OutfitEquipmentMinAggregateOutputType | null + _max: OutfitEquipmentMaxAggregateOutputType | null +} + +type GetOutfitEquipmentGroupByPayload = Prisma.PrismaPromise< + Array< + Prisma.PickEnumerable & + { + [P in ((keyof T) & (keyof OutfitEquipmentGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType + } + > + > + + + +export type OutfitEquipmentWhereInput = { + AND?: Prisma.OutfitEquipmentWhereInput | Prisma.OutfitEquipmentWhereInput[] + OR?: Prisma.OutfitEquipmentWhereInput[] + NOT?: Prisma.OutfitEquipmentWhereInput | Prisma.OutfitEquipmentWhereInput[] + outfitId?: Prisma.StringFilter<"OutfitEquipment"> | string + equipmentId?: Prisma.StringFilter<"OutfitEquipment"> | string + outfit?: Prisma.XOR + equipment?: Prisma.XOR +} + +export type OutfitEquipmentOrderByWithRelationInput = { + outfitId?: Prisma.SortOrder + equipmentId?: Prisma.SortOrder + outfit?: Prisma.OutfitOrderByWithRelationInput + equipment?: Prisma.EquipmentOrderByWithRelationInput +} + +export type OutfitEquipmentWhereUniqueInput = Prisma.AtLeast<{ + outfitId_equipmentId?: Prisma.OutfitEquipmentOutfitIdEquipmentIdCompoundUniqueInput + AND?: Prisma.OutfitEquipmentWhereInput | Prisma.OutfitEquipmentWhereInput[] + OR?: Prisma.OutfitEquipmentWhereInput[] + NOT?: Prisma.OutfitEquipmentWhereInput | Prisma.OutfitEquipmentWhereInput[] + outfitId?: Prisma.StringFilter<"OutfitEquipment"> | string + equipmentId?: Prisma.StringFilter<"OutfitEquipment"> | string + outfit?: Prisma.XOR + equipment?: Prisma.XOR +}, "outfitId_equipmentId"> + +export type OutfitEquipmentOrderByWithAggregationInput = { + outfitId?: Prisma.SortOrder + equipmentId?: Prisma.SortOrder + _count?: Prisma.OutfitEquipmentCountOrderByAggregateInput + _max?: Prisma.OutfitEquipmentMaxOrderByAggregateInput + _min?: Prisma.OutfitEquipmentMinOrderByAggregateInput +} + +export type OutfitEquipmentScalarWhereWithAggregatesInput = { + AND?: Prisma.OutfitEquipmentScalarWhereWithAggregatesInput | Prisma.OutfitEquipmentScalarWhereWithAggregatesInput[] + OR?: Prisma.OutfitEquipmentScalarWhereWithAggregatesInput[] + NOT?: Prisma.OutfitEquipmentScalarWhereWithAggregatesInput | Prisma.OutfitEquipmentScalarWhereWithAggregatesInput[] + outfitId?: Prisma.StringWithAggregatesFilter<"OutfitEquipment"> | string + equipmentId?: Prisma.StringWithAggregatesFilter<"OutfitEquipment"> | string +} + +export type OutfitEquipmentCreateInput = { + outfit: Prisma.OutfitCreateNestedOneWithoutEquipmentsInput + equipment: Prisma.EquipmentCreateNestedOneWithoutOutfitsInput +} + +export type OutfitEquipmentUncheckedCreateInput = { + outfitId: string + equipmentId: string +} + +export type OutfitEquipmentUpdateInput = { + outfit?: Prisma.OutfitUpdateOneRequiredWithoutEquipmentsNestedInput + equipment?: Prisma.EquipmentUpdateOneRequiredWithoutOutfitsNestedInput +} + +export type OutfitEquipmentUncheckedUpdateInput = { + outfitId?: Prisma.StringFieldUpdateOperationsInput | string + equipmentId?: Prisma.StringFieldUpdateOperationsInput | string +} + +export type OutfitEquipmentCreateManyInput = { + outfitId: string + equipmentId: string +} + +export type OutfitEquipmentUpdateManyMutationInput = { + +} + +export type OutfitEquipmentUncheckedUpdateManyInput = { + outfitId?: Prisma.StringFieldUpdateOperationsInput | string + equipmentId?: Prisma.StringFieldUpdateOperationsInput | string +} + +export type OutfitEquipmentListRelationFilter = { + every?: Prisma.OutfitEquipmentWhereInput + some?: Prisma.OutfitEquipmentWhereInput + none?: Prisma.OutfitEquipmentWhereInput +} + +export type OutfitEquipmentOrderByRelationAggregateInput = { + _count?: Prisma.SortOrder +} + +export type OutfitEquipmentOutfitIdEquipmentIdCompoundUniqueInput = { + outfitId: string + equipmentId: string +} + +export type OutfitEquipmentCountOrderByAggregateInput = { + outfitId?: Prisma.SortOrder + equipmentId?: Prisma.SortOrder +} + +export type OutfitEquipmentMaxOrderByAggregateInput = { + outfitId?: Prisma.SortOrder + equipmentId?: Prisma.SortOrder +} + +export type OutfitEquipmentMinOrderByAggregateInput = { + outfitId?: Prisma.SortOrder + equipmentId?: Prisma.SortOrder +} + +export type OutfitEquipmentCreateNestedManyWithoutEquipmentInput = { + create?: Prisma.XOR | Prisma.OutfitEquipmentCreateWithoutEquipmentInput[] | Prisma.OutfitEquipmentUncheckedCreateWithoutEquipmentInput[] + connectOrCreate?: Prisma.OutfitEquipmentCreateOrConnectWithoutEquipmentInput | Prisma.OutfitEquipmentCreateOrConnectWithoutEquipmentInput[] + createMany?: Prisma.OutfitEquipmentCreateManyEquipmentInputEnvelope + connect?: Prisma.OutfitEquipmentWhereUniqueInput | Prisma.OutfitEquipmentWhereUniqueInput[] +} + +export type OutfitEquipmentUncheckedCreateNestedManyWithoutEquipmentInput = { + create?: Prisma.XOR | Prisma.OutfitEquipmentCreateWithoutEquipmentInput[] | Prisma.OutfitEquipmentUncheckedCreateWithoutEquipmentInput[] + connectOrCreate?: Prisma.OutfitEquipmentCreateOrConnectWithoutEquipmentInput | Prisma.OutfitEquipmentCreateOrConnectWithoutEquipmentInput[] + createMany?: Prisma.OutfitEquipmentCreateManyEquipmentInputEnvelope + connect?: Prisma.OutfitEquipmentWhereUniqueInput | Prisma.OutfitEquipmentWhereUniqueInput[] +} + +export type OutfitEquipmentUpdateManyWithoutEquipmentNestedInput = { + create?: Prisma.XOR | Prisma.OutfitEquipmentCreateWithoutEquipmentInput[] | Prisma.OutfitEquipmentUncheckedCreateWithoutEquipmentInput[] + connectOrCreate?: Prisma.OutfitEquipmentCreateOrConnectWithoutEquipmentInput | Prisma.OutfitEquipmentCreateOrConnectWithoutEquipmentInput[] + upsert?: Prisma.OutfitEquipmentUpsertWithWhereUniqueWithoutEquipmentInput | Prisma.OutfitEquipmentUpsertWithWhereUniqueWithoutEquipmentInput[] + createMany?: Prisma.OutfitEquipmentCreateManyEquipmentInputEnvelope + set?: Prisma.OutfitEquipmentWhereUniqueInput | Prisma.OutfitEquipmentWhereUniqueInput[] + disconnect?: Prisma.OutfitEquipmentWhereUniqueInput | Prisma.OutfitEquipmentWhereUniqueInput[] + delete?: Prisma.OutfitEquipmentWhereUniqueInput | Prisma.OutfitEquipmentWhereUniqueInput[] + connect?: Prisma.OutfitEquipmentWhereUniqueInput | Prisma.OutfitEquipmentWhereUniqueInput[] + update?: Prisma.OutfitEquipmentUpdateWithWhereUniqueWithoutEquipmentInput | Prisma.OutfitEquipmentUpdateWithWhereUniqueWithoutEquipmentInput[] + updateMany?: Prisma.OutfitEquipmentUpdateManyWithWhereWithoutEquipmentInput | Prisma.OutfitEquipmentUpdateManyWithWhereWithoutEquipmentInput[] + deleteMany?: Prisma.OutfitEquipmentScalarWhereInput | Prisma.OutfitEquipmentScalarWhereInput[] +} + +export type OutfitEquipmentUncheckedUpdateManyWithoutEquipmentNestedInput = { + create?: Prisma.XOR | Prisma.OutfitEquipmentCreateWithoutEquipmentInput[] | Prisma.OutfitEquipmentUncheckedCreateWithoutEquipmentInput[] + connectOrCreate?: Prisma.OutfitEquipmentCreateOrConnectWithoutEquipmentInput | Prisma.OutfitEquipmentCreateOrConnectWithoutEquipmentInput[] + upsert?: Prisma.OutfitEquipmentUpsertWithWhereUniqueWithoutEquipmentInput | Prisma.OutfitEquipmentUpsertWithWhereUniqueWithoutEquipmentInput[] + createMany?: Prisma.OutfitEquipmentCreateManyEquipmentInputEnvelope + set?: Prisma.OutfitEquipmentWhereUniqueInput | Prisma.OutfitEquipmentWhereUniqueInput[] + disconnect?: Prisma.OutfitEquipmentWhereUniqueInput | Prisma.OutfitEquipmentWhereUniqueInput[] + delete?: Prisma.OutfitEquipmentWhereUniqueInput | Prisma.OutfitEquipmentWhereUniqueInput[] + connect?: Prisma.OutfitEquipmentWhereUniqueInput | Prisma.OutfitEquipmentWhereUniqueInput[] + update?: Prisma.OutfitEquipmentUpdateWithWhereUniqueWithoutEquipmentInput | Prisma.OutfitEquipmentUpdateWithWhereUniqueWithoutEquipmentInput[] + updateMany?: Prisma.OutfitEquipmentUpdateManyWithWhereWithoutEquipmentInput | Prisma.OutfitEquipmentUpdateManyWithWhereWithoutEquipmentInput[] + deleteMany?: Prisma.OutfitEquipmentScalarWhereInput | Prisma.OutfitEquipmentScalarWhereInput[] +} + +export type OutfitEquipmentCreateNestedManyWithoutOutfitInput = { + create?: Prisma.XOR | Prisma.OutfitEquipmentCreateWithoutOutfitInput[] | Prisma.OutfitEquipmentUncheckedCreateWithoutOutfitInput[] + connectOrCreate?: Prisma.OutfitEquipmentCreateOrConnectWithoutOutfitInput | Prisma.OutfitEquipmentCreateOrConnectWithoutOutfitInput[] + createMany?: Prisma.OutfitEquipmentCreateManyOutfitInputEnvelope + connect?: Prisma.OutfitEquipmentWhereUniqueInput | Prisma.OutfitEquipmentWhereUniqueInput[] +} + +export type OutfitEquipmentUncheckedCreateNestedManyWithoutOutfitInput = { + create?: Prisma.XOR | Prisma.OutfitEquipmentCreateWithoutOutfitInput[] | Prisma.OutfitEquipmentUncheckedCreateWithoutOutfitInput[] + connectOrCreate?: Prisma.OutfitEquipmentCreateOrConnectWithoutOutfitInput | Prisma.OutfitEquipmentCreateOrConnectWithoutOutfitInput[] + createMany?: Prisma.OutfitEquipmentCreateManyOutfitInputEnvelope + connect?: Prisma.OutfitEquipmentWhereUniqueInput | Prisma.OutfitEquipmentWhereUniqueInput[] +} + +export type OutfitEquipmentUpdateManyWithoutOutfitNestedInput = { + create?: Prisma.XOR | Prisma.OutfitEquipmentCreateWithoutOutfitInput[] | Prisma.OutfitEquipmentUncheckedCreateWithoutOutfitInput[] + connectOrCreate?: Prisma.OutfitEquipmentCreateOrConnectWithoutOutfitInput | Prisma.OutfitEquipmentCreateOrConnectWithoutOutfitInput[] + upsert?: Prisma.OutfitEquipmentUpsertWithWhereUniqueWithoutOutfitInput | Prisma.OutfitEquipmentUpsertWithWhereUniqueWithoutOutfitInput[] + createMany?: Prisma.OutfitEquipmentCreateManyOutfitInputEnvelope + set?: Prisma.OutfitEquipmentWhereUniqueInput | Prisma.OutfitEquipmentWhereUniqueInput[] + disconnect?: Prisma.OutfitEquipmentWhereUniqueInput | Prisma.OutfitEquipmentWhereUniqueInput[] + delete?: Prisma.OutfitEquipmentWhereUniqueInput | Prisma.OutfitEquipmentWhereUniqueInput[] + connect?: Prisma.OutfitEquipmentWhereUniqueInput | Prisma.OutfitEquipmentWhereUniqueInput[] + update?: Prisma.OutfitEquipmentUpdateWithWhereUniqueWithoutOutfitInput | Prisma.OutfitEquipmentUpdateWithWhereUniqueWithoutOutfitInput[] + updateMany?: Prisma.OutfitEquipmentUpdateManyWithWhereWithoutOutfitInput | Prisma.OutfitEquipmentUpdateManyWithWhereWithoutOutfitInput[] + deleteMany?: Prisma.OutfitEquipmentScalarWhereInput | Prisma.OutfitEquipmentScalarWhereInput[] +} + +export type OutfitEquipmentUncheckedUpdateManyWithoutOutfitNestedInput = { + create?: Prisma.XOR | Prisma.OutfitEquipmentCreateWithoutOutfitInput[] | Prisma.OutfitEquipmentUncheckedCreateWithoutOutfitInput[] + connectOrCreate?: Prisma.OutfitEquipmentCreateOrConnectWithoutOutfitInput | Prisma.OutfitEquipmentCreateOrConnectWithoutOutfitInput[] + upsert?: Prisma.OutfitEquipmentUpsertWithWhereUniqueWithoutOutfitInput | Prisma.OutfitEquipmentUpsertWithWhereUniqueWithoutOutfitInput[] + createMany?: Prisma.OutfitEquipmentCreateManyOutfitInputEnvelope + set?: Prisma.OutfitEquipmentWhereUniqueInput | Prisma.OutfitEquipmentWhereUniqueInput[] + disconnect?: Prisma.OutfitEquipmentWhereUniqueInput | Prisma.OutfitEquipmentWhereUniqueInput[] + delete?: Prisma.OutfitEquipmentWhereUniqueInput | Prisma.OutfitEquipmentWhereUniqueInput[] + connect?: Prisma.OutfitEquipmentWhereUniqueInput | Prisma.OutfitEquipmentWhereUniqueInput[] + update?: Prisma.OutfitEquipmentUpdateWithWhereUniqueWithoutOutfitInput | Prisma.OutfitEquipmentUpdateWithWhereUniqueWithoutOutfitInput[] + updateMany?: Prisma.OutfitEquipmentUpdateManyWithWhereWithoutOutfitInput | Prisma.OutfitEquipmentUpdateManyWithWhereWithoutOutfitInput[] + deleteMany?: Prisma.OutfitEquipmentScalarWhereInput | Prisma.OutfitEquipmentScalarWhereInput[] +} + +export type OutfitEquipmentCreateWithoutEquipmentInput = { + outfit: Prisma.OutfitCreateNestedOneWithoutEquipmentsInput +} + +export type OutfitEquipmentUncheckedCreateWithoutEquipmentInput = { + outfitId: string +} + +export type OutfitEquipmentCreateOrConnectWithoutEquipmentInput = { + where: Prisma.OutfitEquipmentWhereUniqueInput + create: Prisma.XOR +} + +export type OutfitEquipmentCreateManyEquipmentInputEnvelope = { + data: Prisma.OutfitEquipmentCreateManyEquipmentInput | Prisma.OutfitEquipmentCreateManyEquipmentInput[] +} + +export type OutfitEquipmentUpsertWithWhereUniqueWithoutEquipmentInput = { + where: Prisma.OutfitEquipmentWhereUniqueInput + update: Prisma.XOR + create: Prisma.XOR +} + +export type OutfitEquipmentUpdateWithWhereUniqueWithoutEquipmentInput = { + where: Prisma.OutfitEquipmentWhereUniqueInput + data: Prisma.XOR +} + +export type OutfitEquipmentUpdateManyWithWhereWithoutEquipmentInput = { + where: Prisma.OutfitEquipmentScalarWhereInput + data: Prisma.XOR +} + +export type OutfitEquipmentScalarWhereInput = { + AND?: Prisma.OutfitEquipmentScalarWhereInput | Prisma.OutfitEquipmentScalarWhereInput[] + OR?: Prisma.OutfitEquipmentScalarWhereInput[] + NOT?: Prisma.OutfitEquipmentScalarWhereInput | Prisma.OutfitEquipmentScalarWhereInput[] + outfitId?: Prisma.StringFilter<"OutfitEquipment"> | string + equipmentId?: Prisma.StringFilter<"OutfitEquipment"> | string +} + +export type OutfitEquipmentCreateWithoutOutfitInput = { + equipment: Prisma.EquipmentCreateNestedOneWithoutOutfitsInput +} + +export type OutfitEquipmentUncheckedCreateWithoutOutfitInput = { + equipmentId: string +} + +export type OutfitEquipmentCreateOrConnectWithoutOutfitInput = { + where: Prisma.OutfitEquipmentWhereUniqueInput + create: Prisma.XOR +} + +export type OutfitEquipmentCreateManyOutfitInputEnvelope = { + data: Prisma.OutfitEquipmentCreateManyOutfitInput | Prisma.OutfitEquipmentCreateManyOutfitInput[] +} + +export type OutfitEquipmentUpsertWithWhereUniqueWithoutOutfitInput = { + where: Prisma.OutfitEquipmentWhereUniqueInput + update: Prisma.XOR + create: Prisma.XOR +} + +export type OutfitEquipmentUpdateWithWhereUniqueWithoutOutfitInput = { + where: Prisma.OutfitEquipmentWhereUniqueInput + data: Prisma.XOR +} + +export type OutfitEquipmentUpdateManyWithWhereWithoutOutfitInput = { + where: Prisma.OutfitEquipmentScalarWhereInput + data: Prisma.XOR +} + +export type OutfitEquipmentCreateManyEquipmentInput = { + outfitId: string +} + +export type OutfitEquipmentUpdateWithoutEquipmentInput = { + outfit?: Prisma.OutfitUpdateOneRequiredWithoutEquipmentsNestedInput +} + +export type OutfitEquipmentUncheckedUpdateWithoutEquipmentInput = { + outfitId?: Prisma.StringFieldUpdateOperationsInput | string +} + +export type OutfitEquipmentUncheckedUpdateManyWithoutEquipmentInput = { + outfitId?: Prisma.StringFieldUpdateOperationsInput | string +} + +export type OutfitEquipmentCreateManyOutfitInput = { + equipmentId: string +} + +export type OutfitEquipmentUpdateWithoutOutfitInput = { + equipment?: Prisma.EquipmentUpdateOneRequiredWithoutOutfitsNestedInput +} + +export type OutfitEquipmentUncheckedUpdateWithoutOutfitInput = { + equipmentId?: Prisma.StringFieldUpdateOperationsInput | string +} + +export type OutfitEquipmentUncheckedUpdateManyWithoutOutfitInput = { + equipmentId?: Prisma.StringFieldUpdateOperationsInput | string +} + + + +export type OutfitEquipmentSelect = runtime.Types.Extensions.GetSelect<{ + outfitId?: boolean + equipmentId?: boolean + outfit?: boolean | Prisma.OutfitDefaultArgs + equipment?: boolean | Prisma.EquipmentDefaultArgs +}, ExtArgs["result"]["outfitEquipment"]> + +export type OutfitEquipmentSelectCreateManyAndReturn = runtime.Types.Extensions.GetSelect<{ + outfitId?: boolean + equipmentId?: boolean + outfit?: boolean | Prisma.OutfitDefaultArgs + equipment?: boolean | Prisma.EquipmentDefaultArgs +}, ExtArgs["result"]["outfitEquipment"]> + +export type OutfitEquipmentSelectUpdateManyAndReturn = runtime.Types.Extensions.GetSelect<{ + outfitId?: boolean + equipmentId?: boolean + outfit?: boolean | Prisma.OutfitDefaultArgs + equipment?: boolean | Prisma.EquipmentDefaultArgs +}, ExtArgs["result"]["outfitEquipment"]> + +export type OutfitEquipmentSelectScalar = { + outfitId?: boolean + equipmentId?: boolean +} + +export type OutfitEquipmentOmit = runtime.Types.Extensions.GetOmit<"outfitId" | "equipmentId", ExtArgs["result"]["outfitEquipment"]> +export type OutfitEquipmentInclude = { + outfit?: boolean | Prisma.OutfitDefaultArgs + equipment?: boolean | Prisma.EquipmentDefaultArgs +} +export type OutfitEquipmentIncludeCreateManyAndReturn = { + outfit?: boolean | Prisma.OutfitDefaultArgs + equipment?: boolean | Prisma.EquipmentDefaultArgs +} +export type OutfitEquipmentIncludeUpdateManyAndReturn = { + outfit?: boolean | Prisma.OutfitDefaultArgs + equipment?: boolean | Prisma.EquipmentDefaultArgs +} + +export type $OutfitEquipmentPayload = { + name: "OutfitEquipment" + objects: { + outfit: Prisma.$OutfitPayload + equipment: Prisma.$EquipmentPayload + } + scalars: runtime.Types.Extensions.GetPayloadResult<{ + outfitId: string + equipmentId: string + }, ExtArgs["result"]["outfitEquipment"]> + composites: {} +} + +export type OutfitEquipmentGetPayload = runtime.Types.Result.GetResult + +export type OutfitEquipmentCountArgs = + Omit & { + select?: OutfitEquipmentCountAggregateInputType | true + } + +export interface OutfitEquipmentDelegate { + [K: symbol]: { types: Prisma.TypeMap['model']['OutfitEquipment'], meta: { name: 'OutfitEquipment' } } + /** + * Find zero or one OutfitEquipment that matches the filter. + * @param {OutfitEquipmentFindUniqueArgs} args - Arguments to find a OutfitEquipment + * @example + * // Get one OutfitEquipment + * const outfitEquipment = await prisma.outfitEquipment.findUnique({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUnique(args: Prisma.SelectSubset>): Prisma.Prisma__OutfitEquipmentClient, T, "findUnique", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find one OutfitEquipment that matches the filter or throw an error with `error.code='P2025'` + * if no matches were found. + * @param {OutfitEquipmentFindUniqueOrThrowArgs} args - Arguments to find a OutfitEquipment + * @example + * // Get one OutfitEquipment + * const outfitEquipment = await prisma.outfitEquipment.findUniqueOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUniqueOrThrow(args: Prisma.SelectSubset>): Prisma.Prisma__OutfitEquipmentClient, T, "findUniqueOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find the first OutfitEquipment that matches the filter. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {OutfitEquipmentFindFirstArgs} args - Arguments to find a OutfitEquipment + * @example + * // Get one OutfitEquipment + * const outfitEquipment = await prisma.outfitEquipment.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirst(args?: Prisma.SelectSubset>): Prisma.Prisma__OutfitEquipmentClient, T, "findFirst", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find the first OutfitEquipment that matches the filter or + * throw `PrismaKnownClientError` with `P2025` code if no matches were found. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {OutfitEquipmentFindFirstOrThrowArgs} args - Arguments to find a OutfitEquipment + * @example + * // Get one OutfitEquipment + * const outfitEquipment = await prisma.outfitEquipment.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirstOrThrow(args?: Prisma.SelectSubset>): Prisma.Prisma__OutfitEquipmentClient, T, "findFirstOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find zero or more OutfitEquipments that matches the filter. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {OutfitEquipmentFindManyArgs} args - Arguments to filter and select certain fields only. + * @example + * // Get all OutfitEquipments + * const outfitEquipments = await prisma.outfitEquipment.findMany() + * + * // Get first 10 OutfitEquipments + * const outfitEquipments = await prisma.outfitEquipment.findMany({ take: 10 }) + * + * // Only select the `outfitId` + * const outfitEquipmentWithOutfitIdOnly = await prisma.outfitEquipment.findMany({ select: { outfitId: true } }) + * + */ + findMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions>> + + /** + * Create a OutfitEquipment. + * @param {OutfitEquipmentCreateArgs} args - Arguments to create a OutfitEquipment. + * @example + * // Create one OutfitEquipment + * const OutfitEquipment = await prisma.outfitEquipment.create({ + * data: { + * // ... data to create a OutfitEquipment + * } + * }) + * + */ + create(args: Prisma.SelectSubset>): Prisma.Prisma__OutfitEquipmentClient, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Create many OutfitEquipments. + * @param {OutfitEquipmentCreateManyArgs} args - Arguments to create many OutfitEquipments. + * @example + * // Create many OutfitEquipments + * const outfitEquipment = await prisma.outfitEquipment.createMany({ + * data: [ + * // ... provide data here + * ] + * }) + * + */ + createMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Create many OutfitEquipments and returns the data saved in the database. + * @param {OutfitEquipmentCreateManyAndReturnArgs} args - Arguments to create many OutfitEquipments. + * @example + * // Create many OutfitEquipments + * const outfitEquipment = await prisma.outfitEquipment.createManyAndReturn({ + * data: [ + * // ... provide data here + * ] + * }) + * + * // Create many OutfitEquipments and only return the `outfitId` + * const outfitEquipmentWithOutfitIdOnly = await prisma.outfitEquipment.createManyAndReturn({ + * select: { outfitId: true }, + * data: [ + * // ... provide data here + * ] + * }) + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * + */ + createManyAndReturn(args?: Prisma.SelectSubset>): Prisma.PrismaPromise, T, "createManyAndReturn", GlobalOmitOptions>> + + /** + * Delete a OutfitEquipment. + * @param {OutfitEquipmentDeleteArgs} args - Arguments to delete one OutfitEquipment. + * @example + * // Delete one OutfitEquipment + * const OutfitEquipment = await prisma.outfitEquipment.delete({ + * where: { + * // ... filter to delete one OutfitEquipment + * } + * }) + * + */ + delete(args: Prisma.SelectSubset>): Prisma.Prisma__OutfitEquipmentClient, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Update one OutfitEquipment. + * @param {OutfitEquipmentUpdateArgs} args - Arguments to update one OutfitEquipment. + * @example + * // Update one OutfitEquipment + * const outfitEquipment = await prisma.outfitEquipment.update({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + update(args: Prisma.SelectSubset>): Prisma.Prisma__OutfitEquipmentClient, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Delete zero or more OutfitEquipments. + * @param {OutfitEquipmentDeleteManyArgs} args - Arguments to filter OutfitEquipments to delete. + * @example + * // Delete a few OutfitEquipments + * const { count } = await prisma.outfitEquipment.deleteMany({ + * where: { + * // ... provide filter here + * } + * }) + * + */ + deleteMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more OutfitEquipments. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {OutfitEquipmentUpdateManyArgs} args - Arguments to update one or more rows. + * @example + * // Update many OutfitEquipments + * const outfitEquipment = await prisma.outfitEquipment.updateMany({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + updateMany(args: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more OutfitEquipments and returns the data updated in the database. + * @param {OutfitEquipmentUpdateManyAndReturnArgs} args - Arguments to update many OutfitEquipments. + * @example + * // Update many OutfitEquipments + * const outfitEquipment = await prisma.outfitEquipment.updateManyAndReturn({ + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * + * // Update zero or more OutfitEquipments and only return the `outfitId` + * const outfitEquipmentWithOutfitIdOnly = await prisma.outfitEquipment.updateManyAndReturn({ + * select: { outfitId: true }, + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * + */ + updateManyAndReturn(args: Prisma.SelectSubset>): Prisma.PrismaPromise, T, "updateManyAndReturn", GlobalOmitOptions>> + + /** + * Create or update one OutfitEquipment. + * @param {OutfitEquipmentUpsertArgs} args - Arguments to update or create a OutfitEquipment. + * @example + * // Update or create a OutfitEquipment + * const outfitEquipment = await prisma.outfitEquipment.upsert({ + * create: { + * // ... data to create a OutfitEquipment + * }, + * update: { + * // ... in case it already exists, update + * }, + * where: { + * // ... the filter for the OutfitEquipment we want to update + * } + * }) + */ + upsert(args: Prisma.SelectSubset>): Prisma.Prisma__OutfitEquipmentClient, T, "upsert", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + + /** + * Count the number of OutfitEquipments. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {OutfitEquipmentCountArgs} args - Arguments to filter OutfitEquipments to count. + * @example + * // Count the number of OutfitEquipments + * const count = await prisma.outfitEquipment.count({ + * where: { + * // ... the filter for the OutfitEquipments we want to count + * } + * }) + **/ + count( + args?: Prisma.Subset, + ): Prisma.PrismaPromise< + T extends runtime.Types.Utils.Record<'select', any> + ? T['select'] extends true + ? number + : Prisma.GetScalarType + : number + > + + /** + * Allows you to perform aggregations operations on a OutfitEquipment. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {OutfitEquipmentAggregateArgs} args - Select which aggregations you would like to apply and on what fields. + * @example + * // Ordered by age ascending + * // Where email contains prisma.io + * // Limited to the 10 users + * const aggregations = await prisma.user.aggregate({ + * _avg: { + * age: true, + * }, + * where: { + * email: { + * contains: "prisma.io", + * }, + * }, + * orderBy: { + * age: "asc", + * }, + * take: 10, + * }) + **/ + aggregate(args: Prisma.Subset): Prisma.PrismaPromise> + + /** + * Group by OutfitEquipment. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {OutfitEquipmentGroupByArgs} args - Group by arguments. + * @example + * // Group by city, order by createdAt, get count + * const result = await prisma.user.groupBy({ + * by: ['city', 'createdAt'], + * orderBy: { + * createdAt: true + * }, + * _count: { + * _all: true + * }, + * }) + * + **/ + groupBy< + T extends OutfitEquipmentGroupByArgs, + HasSelectOrTake extends Prisma.Or< + Prisma.Extends<'skip', Prisma.Keys>, + Prisma.Extends<'take', Prisma.Keys> + >, + OrderByArg extends Prisma.True extends HasSelectOrTake + ? { orderBy: OutfitEquipmentGroupByArgs['orderBy'] } + : { orderBy?: OutfitEquipmentGroupByArgs['orderBy'] }, + OrderFields extends Prisma.ExcludeUnderscoreKeys>>, + ByFields extends Prisma.MaybeTupleToUnion, + ByValid extends Prisma.Has, + HavingFields extends Prisma.GetHavingFields, + HavingValid extends Prisma.Has, + ByEmpty extends T['by'] extends never[] ? Prisma.True : Prisma.False, + InputErrors extends ByEmpty extends Prisma.True + ? `Error: "by" must not be empty.` + : HavingValid extends Prisma.False + ? { + [P in HavingFields]: P extends ByFields + ? never + : P extends string + ? `Error: Field "${P}" used in "having" needs to be provided in "by".` + : [ + Error, + 'Field ', + P, + ` in "having" needs to be provided in "by"`, + ] + }[HavingFields] + : 'take' extends Prisma.Keys + ? 'orderBy' extends Prisma.Keys + ? ByValid extends Prisma.True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + : 'Error: If you provide "take", you also need to provide "orderBy"' + : 'skip' extends Prisma.Keys + ? 'orderBy' extends Prisma.Keys + ? ByValid extends Prisma.True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + : 'Error: If you provide "skip", you also need to provide "orderBy"' + : ByValid extends Prisma.True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + >(args: Prisma.SubsetIntersection & InputErrors): {} extends InputErrors ? GetOutfitEquipmentGroupByPayload : Prisma.PrismaPromise +/** + * Fields of the OutfitEquipment model + */ +readonly fields: OutfitEquipmentFieldRefs; +} + +/** + * The delegate class that acts as a "Promise-like" for OutfitEquipment. + * Why is this prefixed with `Prisma__`? + * Because we want to prevent naming conflicts as mentioned in + * https://github.com/prisma/prisma-client-js/issues/707 + */ +export interface Prisma__OutfitEquipmentClient extends Prisma.PrismaPromise { + readonly [Symbol.toStringTag]: "PrismaPromise" + outfit = {}>(args?: Prisma.Subset>): Prisma.Prisma__OutfitClient, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions> + equipment = {}>(args?: Prisma.Subset>): Prisma.Prisma__EquipmentClient, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions> + /** + * Attaches callbacks for the resolution and/or rejection of the Promise. + * @param onfulfilled The callback to execute when the Promise is resolved. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of which ever callback is executed. + */ + then(onfulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null): runtime.Types.Utils.JsPromise + /** + * Attaches a callback for only the rejection of the Promise. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of the callback. + */ + catch(onrejected?: ((reason: any) => TResult | PromiseLike) | undefined | null): runtime.Types.Utils.JsPromise + /** + * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The + * resolved value cannot be modified from the callback. + * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected). + * @returns A Promise for the completion of the callback. + */ + finally(onfinally?: (() => void) | undefined | null): runtime.Types.Utils.JsPromise +} + + + + +/** + * Fields of the OutfitEquipment model + */ +export interface OutfitEquipmentFieldRefs { + readonly outfitId: Prisma.FieldRef<"OutfitEquipment", 'String'> + readonly equipmentId: Prisma.FieldRef<"OutfitEquipment", 'String'> +} + + +// Custom InputTypes +/** + * OutfitEquipment findUnique + */ +export type OutfitEquipmentFindUniqueArgs = { + /** + * Select specific fields to fetch from the OutfitEquipment + */ + select?: Prisma.OutfitEquipmentSelect | null + /** + * Omit specific fields from the OutfitEquipment + */ + omit?: Prisma.OutfitEquipmentOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.OutfitEquipmentInclude | null + /** + * Filter, which OutfitEquipment to fetch. + */ + where: Prisma.OutfitEquipmentWhereUniqueInput +} + +/** + * OutfitEquipment findUniqueOrThrow + */ +export type OutfitEquipmentFindUniqueOrThrowArgs = { + /** + * Select specific fields to fetch from the OutfitEquipment + */ + select?: Prisma.OutfitEquipmentSelect | null + /** + * Omit specific fields from the OutfitEquipment + */ + omit?: Prisma.OutfitEquipmentOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.OutfitEquipmentInclude | null + /** + * Filter, which OutfitEquipment to fetch. + */ + where: Prisma.OutfitEquipmentWhereUniqueInput +} + +/** + * OutfitEquipment findFirst + */ +export type OutfitEquipmentFindFirstArgs = { + /** + * Select specific fields to fetch from the OutfitEquipment + */ + select?: Prisma.OutfitEquipmentSelect | null + /** + * Omit specific fields from the OutfitEquipment + */ + omit?: Prisma.OutfitEquipmentOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.OutfitEquipmentInclude | null + /** + * Filter, which OutfitEquipment to fetch. + */ + where?: Prisma.OutfitEquipmentWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of OutfitEquipments to fetch. + */ + orderBy?: Prisma.OutfitEquipmentOrderByWithRelationInput | Prisma.OutfitEquipmentOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for OutfitEquipments. + */ + cursor?: Prisma.OutfitEquipmentWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` OutfitEquipments from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` OutfitEquipments. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of OutfitEquipments. + */ + distinct?: Prisma.OutfitEquipmentScalarFieldEnum | Prisma.OutfitEquipmentScalarFieldEnum[] +} + +/** + * OutfitEquipment findFirstOrThrow + */ +export type OutfitEquipmentFindFirstOrThrowArgs = { + /** + * Select specific fields to fetch from the OutfitEquipment + */ + select?: Prisma.OutfitEquipmentSelect | null + /** + * Omit specific fields from the OutfitEquipment + */ + omit?: Prisma.OutfitEquipmentOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.OutfitEquipmentInclude | null + /** + * Filter, which OutfitEquipment to fetch. + */ + where?: Prisma.OutfitEquipmentWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of OutfitEquipments to fetch. + */ + orderBy?: Prisma.OutfitEquipmentOrderByWithRelationInput | Prisma.OutfitEquipmentOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for OutfitEquipments. + */ + cursor?: Prisma.OutfitEquipmentWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` OutfitEquipments from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` OutfitEquipments. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of OutfitEquipments. + */ + distinct?: Prisma.OutfitEquipmentScalarFieldEnum | Prisma.OutfitEquipmentScalarFieldEnum[] +} + +/** + * OutfitEquipment findMany + */ +export type OutfitEquipmentFindManyArgs = { + /** + * Select specific fields to fetch from the OutfitEquipment + */ + select?: Prisma.OutfitEquipmentSelect | null + /** + * Omit specific fields from the OutfitEquipment + */ + omit?: Prisma.OutfitEquipmentOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.OutfitEquipmentInclude | null + /** + * Filter, which OutfitEquipments to fetch. + */ + where?: Prisma.OutfitEquipmentWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of OutfitEquipments to fetch. + */ + orderBy?: Prisma.OutfitEquipmentOrderByWithRelationInput | Prisma.OutfitEquipmentOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for listing OutfitEquipments. + */ + cursor?: Prisma.OutfitEquipmentWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` OutfitEquipments from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` OutfitEquipments. + */ + skip?: number + distinct?: Prisma.OutfitEquipmentScalarFieldEnum | Prisma.OutfitEquipmentScalarFieldEnum[] +} + +/** + * OutfitEquipment create + */ +export type OutfitEquipmentCreateArgs = { + /** + * Select specific fields to fetch from the OutfitEquipment + */ + select?: Prisma.OutfitEquipmentSelect | null + /** + * Omit specific fields from the OutfitEquipment + */ + omit?: Prisma.OutfitEquipmentOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.OutfitEquipmentInclude | null + /** + * The data needed to create a OutfitEquipment. + */ + data: Prisma.XOR +} + +/** + * OutfitEquipment createMany + */ +export type OutfitEquipmentCreateManyArgs = { + /** + * The data used to create many OutfitEquipments. + */ + data: Prisma.OutfitEquipmentCreateManyInput | Prisma.OutfitEquipmentCreateManyInput[] +} + +/** + * OutfitEquipment createManyAndReturn + */ +export type OutfitEquipmentCreateManyAndReturnArgs = { + /** + * Select specific fields to fetch from the OutfitEquipment + */ + select?: Prisma.OutfitEquipmentSelectCreateManyAndReturn | null + /** + * Omit specific fields from the OutfitEquipment + */ + omit?: Prisma.OutfitEquipmentOmit | null + /** + * The data used to create many OutfitEquipments. + */ + data: Prisma.OutfitEquipmentCreateManyInput | Prisma.OutfitEquipmentCreateManyInput[] + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.OutfitEquipmentIncludeCreateManyAndReturn | null +} + +/** + * OutfitEquipment update + */ +export type OutfitEquipmentUpdateArgs = { + /** + * Select specific fields to fetch from the OutfitEquipment + */ + select?: Prisma.OutfitEquipmentSelect | null + /** + * Omit specific fields from the OutfitEquipment + */ + omit?: Prisma.OutfitEquipmentOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.OutfitEquipmentInclude | null + /** + * The data needed to update a OutfitEquipment. + */ + data: Prisma.XOR + /** + * Choose, which OutfitEquipment to update. + */ + where: Prisma.OutfitEquipmentWhereUniqueInput +} + +/** + * OutfitEquipment updateMany + */ +export type OutfitEquipmentUpdateManyArgs = { + /** + * The data used to update OutfitEquipments. + */ + data: Prisma.XOR + /** + * Filter which OutfitEquipments to update + */ + where?: Prisma.OutfitEquipmentWhereInput + /** + * Limit how many OutfitEquipments to update. + */ + limit?: number +} + +/** + * OutfitEquipment updateManyAndReturn + */ +export type OutfitEquipmentUpdateManyAndReturnArgs = { + /** + * Select specific fields to fetch from the OutfitEquipment + */ + select?: Prisma.OutfitEquipmentSelectUpdateManyAndReturn | null + /** + * Omit specific fields from the OutfitEquipment + */ + omit?: Prisma.OutfitEquipmentOmit | null + /** + * The data used to update OutfitEquipments. + */ + data: Prisma.XOR + /** + * Filter which OutfitEquipments to update + */ + where?: Prisma.OutfitEquipmentWhereInput + /** + * Limit how many OutfitEquipments to update. + */ + limit?: number + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.OutfitEquipmentIncludeUpdateManyAndReturn | null +} + +/** + * OutfitEquipment upsert + */ +export type OutfitEquipmentUpsertArgs = { + /** + * Select specific fields to fetch from the OutfitEquipment + */ + select?: Prisma.OutfitEquipmentSelect | null + /** + * Omit specific fields from the OutfitEquipment + */ + omit?: Prisma.OutfitEquipmentOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.OutfitEquipmentInclude | null + /** + * The filter to search for the OutfitEquipment to update in case it exists. + */ + where: Prisma.OutfitEquipmentWhereUniqueInput + /** + * In case the OutfitEquipment found by the `where` argument doesn't exist, create a new OutfitEquipment with this data. + */ + create: Prisma.XOR + /** + * In case the OutfitEquipment was found with the provided `where` argument, update it with this data. + */ + update: Prisma.XOR +} + +/** + * OutfitEquipment delete + */ +export type OutfitEquipmentDeleteArgs = { + /** + * Select specific fields to fetch from the OutfitEquipment + */ + select?: Prisma.OutfitEquipmentSelect | null + /** + * Omit specific fields from the OutfitEquipment + */ + omit?: Prisma.OutfitEquipmentOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.OutfitEquipmentInclude | null + /** + * Filter which OutfitEquipment to delete. + */ + where: Prisma.OutfitEquipmentWhereUniqueInput +} + +/** + * OutfitEquipment deleteMany + */ +export type OutfitEquipmentDeleteManyArgs = { + /** + * Filter which OutfitEquipments to delete + */ + where?: Prisma.OutfitEquipmentWhereInput + /** + * Limit how many OutfitEquipments to delete. + */ + limit?: number +} + +/** + * OutfitEquipment without action + */ +export type OutfitEquipmentDefaultArgs = { + /** + * Select specific fields to fetch from the OutfitEquipment + */ + select?: Prisma.OutfitEquipmentSelect | null + /** + * Omit specific fields from the OutfitEquipment + */ + omit?: Prisma.OutfitEquipmentOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.OutfitEquipmentInclude | null +} diff --git a/src/index.ts b/src/index.ts index e89ac98..a3027c4 100644 --- a/src/index.ts +++ b/src/index.ts @@ -7,6 +7,7 @@ import character from './api/character' import equipment from './api/equipment' import extract from './api/extract' import generation from './api/generation' +import outfit from './api/outfit' import setting from './api/setting' import index from './ui/index.html' @@ -23,6 +24,7 @@ const route = api .route('/equipments', equipment) .route('/generations', generation) .route('/extract', extract) + .route('/outfits', outfit) .route('/settings', setting) // Mount API diff --git a/src/service/outfit.test.ts b/src/service/outfit.test.ts new file mode 100644 index 0000000..de05a4a --- /dev/null +++ b/src/service/outfit.test.ts @@ -0,0 +1,96 @@ +import { describe, it, expect, mock, afterEach } from 'bun:test' + +const mockPrisma = { + outfit: { + findMany: mock(), + create: mock(), + update: mock(), + delete: mock(), + }, +} + +mock.module('../db', () => ({ + prisma: mockPrisma, +})) + +describe('OutfitService', () => { + afterEach(() => { + mockPrisma.outfit.findMany.mockClear() + mockPrisma.outfit.create.mockClear() + mockPrisma.outfit.update.mockClear() + mockPrisma.outfit.delete.mockClear() + }) + + it('listOutfits should return outfits', async () => { + // @ts-ignore + const { outfitService } = await import(`./outfit?v=${Date.now()}`) + mockPrisma.outfit.findMany.mockResolvedValue([{ id: '1', name: 'Test Outfit', equipments: [] }]) + + const result = await outfitService.listOutfits() + expect(result).toHaveLength(1) + expect(mockPrisma.outfit.findMany).toHaveBeenCalled() + }) + + it('createOutfit should create an outfit', async () => { + // @ts-ignore + const { outfitService } = await import(`./outfit?v=${Date.now()}`) + const mockOutfit = { id: '1', name: 'New Outfit', equipments: [] } + mockPrisma.outfit.create.mockResolvedValue(mockOutfit) + + const result = await outfitService.createOutfit({ + name: 'New Outfit', + prompt: 'Test prompt', + equipmentIds: ['eq1', 'eq2'], + }) + + expect(result).toEqual(mockOutfit) + expect(mockPrisma.outfit.create).toHaveBeenCalledWith( + expect.objectContaining({ + data: expect.objectContaining({ + name: 'New Outfit', + prompt: 'Test prompt', + equipments: { + create: [{ equipmentId: 'eq1' }, { equipmentId: 'eq2' }], + }, + }), + }), + ) + }) + + it('updateOutfit should update an outfit', async () => { + // @ts-ignore + const { outfitService } = await import(`./outfit?v=${Date.now()}`) + const mockOutfit = { id: '1', name: 'Updated Outfit', equipments: [] } + mockPrisma.outfit.update.mockResolvedValue(mockOutfit) + + const result = await outfitService.updateOutfit('1', { + name: 'Updated Outfit', + equipmentIds: ['eq3'], + }) + + expect(result).toEqual(mockOutfit) + expect(mockPrisma.outfit.update).toHaveBeenCalledWith( + expect.objectContaining({ + where: { id: '1' }, + data: expect.objectContaining({ + name: 'Updated Outfit', + equipments: { + deleteMany: {}, + create: [{ equipmentId: 'eq3' }], + }, + }), + }), + ) + }) + + it('deleteOutfit should delete an outfit', async () => { + // @ts-ignore + const { outfitService } = await import(`./outfit?v=${Date.now()}`) + mockPrisma.outfit.delete.mockResolvedValue({ id: '1' }) + + await outfitService.deleteOutfit('1') + expect(mockPrisma.outfit.delete).toHaveBeenCalledWith({ + where: { id: '1' }, + }) + }) +}) diff --git a/src/service/outfit.ts b/src/service/outfit.ts new file mode 100644 index 0000000..a5827fa --- /dev/null +++ b/src/service/outfit.ts @@ -0,0 +1,97 @@ +import { prisma } from '../db' +import { ulid } from 'ulidx' +import { Prisma } from '../generated/prisma/client' + +export class OutfitService { + async listOutfits(equipmentId?: string) { + const where: Prisma.OutfitWhereInput = {} + if (equipmentId) { + where.equipments = { + some: { + equipmentId, + }, + } + } + + return prisma.outfit.findMany({ + where, + include: { + equipments: { + include: { + equipment: { + include: { + image: true, + }, + }, + }, + }, + }, + orderBy: { + createdAt: 'desc', + }, + }) + } + + async createOutfit(data: { name: string; prompt?: string; equipmentIds: string[] }) { + const id = ulid() + + return prisma.outfit.create({ + data: { + id, + name: data.name, + prompt: data.prompt, + equipments: { + create: data.equipmentIds.map((eid) => ({ + equipmentId: eid, + })), + }, + }, + include: { + equipments: { + include: { + equipment: true, + }, + }, + }, + }) + } + + async updateOutfit( + id: string, + data: { name?: string; prompt?: string; equipmentIds?: string[] }, + ) { + const updateData: Prisma.OutfitUpdateInput = {} + + if (data.name !== undefined) updateData.name = data.name + if (data.prompt !== undefined) updateData.prompt = data.prompt + + if (data.equipmentIds) { + updateData.equipments = { + deleteMany: {}, + create: data.equipmentIds.map((eid) => ({ + equipmentId: eid, + })), + } + } + + return prisma.outfit.update({ + where: { id }, + data: updateData, + include: { + equipments: { + include: { + equipment: true, + }, + }, + }, + }) + } + + async deleteOutfit(id: string) { + return prisma.outfit.delete({ + where: { id }, + }) + } +} + +export const outfitService = new OutfitService() diff --git a/src/ui/components/CreateLookDialog.tsx b/src/ui/components/CreateLookDialog.tsx index 562af4f..6348c5d 100644 --- a/src/ui/components/CreateLookDialog.tsx +++ b/src/ui/components/CreateLookDialog.tsx @@ -9,10 +9,14 @@ import { Label } from './ui/label' import { ScrollArea, ScrollBar } from './ui/scroll-area' import { EQUIPMENT_CATEGORIES } from '../../lib/categories' import { cn } from '../lib/utils' -import { Loader2, X, Check } from 'lucide-react' +import { Loader2, X, Check, Download, Save } from 'lucide-react' +import { LoadOutfitDialog } from './LoadOutfitDialog' +import { SaveOutfitDialog } from './SaveOutfitDialog' +import { toast } from 'sonner' type EquipmentResponse = InferResponseType type EquipmentItem = EquipmentResponse['items'][number] +type OutfitItem = InferResponseType[number] interface CreateLookDialogProps { open: boolean @@ -35,6 +39,9 @@ export const CreateLookDialog: React.FC = ({ const [submitting, setSubmitting] = useState(false) const [error, setError] = useState(null) + const [loadOutfitOpen, setLoadOutfitOpen] = useState(false) + const [saveOutfitOpen, setSaveOutfitOpen] = useState(false) + useEffect(() => { if (open) { fetchItems() @@ -110,174 +117,213 @@ export const CreateLookDialog: React.FC = ({ } } + const handleOutfitSelected = (outfit: OutfitItem) => { + const equipments = outfit.equipments.map((oe) => oe.equipment) + setSelectedEquipments(equipments) + if (outfit.prompt) { + setUserPrompt(outfit.prompt) + } + toast.success(`Loaded outfit: ${outfit.name}`) + } + return ( - - - - - Select Equipment - - Choose items to equip on your character. - + <> + + + +
+ + Select Equipment + + Choose items to equip on your character. +
+
+ + +
+
- {/* Categories */} -
- -
- {EQUIPMENT_CATEGORIES.map((cat) => { - const isSelected = selectedCategories.includes(cat.main_category) - return ( - toggleCategory(cat.main_category)} - > - {cat.main_category} - - ) - })} -
- -
-
- - {/* Main Content Area */} -
- {loading ? ( -
- -
- ) : items.length === 0 ? ( -
-

No equipment found.

-
- ) : ( -
- {items.map((item) => { - const isSelected = selectedEquipments.some((e) => e.id === item.id) - return ( -
toggleEquipment(item)} - > -
- {item.name} - {isSelected && ( -
- -
+ {/* Categories */} +
+ +
+ {EQUIPMENT_CATEGORIES.map((cat) => { + const isSelected = selectedCategories.includes(cat.main_category) + return ( + -
-

{item.name}

-

- {item.category} -

-
-
- ) - })} -
- )} -
+ onClick={() => toggleCategory(cat.main_category)} + > + {cat.main_category} + + ) + })} +
+ + +
- {/* User Prompt Area */} -
- -