From 73c80834fb2c4b53ace0b6f3bd17567b9f08f627 Mon Sep 17 00:00:00 2001 From: toir-bot Date: Mon, 13 Apr 2026 18:31:48 +0000 Subject: [PATCH] feat: add generated code: backend/src/equipment/equipment.service.ts --- backend/src/equipment/equipment.service.ts | 41 ++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 backend/src/equipment/equipment.service.ts diff --git a/backend/src/equipment/equipment.service.ts b/backend/src/equipment/equipment.service.ts new file mode 100644 index 0000000..a631a71 --- /dev/null +++ b/backend/src/equipment/equipment.service.ts @@ -0,0 +1,41 @@ +import { Injectable } from '@nestjs/common'; +import { PrismaService } from '../prisma/prisma.service'; +import { Equipment, Prisma } from '@prisma/client'; + +@Injectable() +export class EquipmentService { + constructor(private prisma: PrismaService) {} + + async findAll(params: { + skip?: number; + take?: number; + where?: Prisma.EquipmentWhereInput; + orderBy?: Prisma.EquipmentOrderByWithRelationInput; + }): Promise { + const { skip, take, where, orderBy } = params; + return this.prisma.equipment.findMany({ skip, take, where, orderBy }); + } + + async count(where?: Prisma.EquipmentWhereInput): Promise { + return this.prisma.equipment.count({ where }); + } + + async findOne(where: Prisma.EquipmentWhereUniqueInput): Promise { + return this.prisma.equipment.findUnique({ where }); + } + + async create(data: Prisma.EquipmentCreateInput): Promise { + return this.prisma.equipment.create({ data }); + } + + async update(params: { + where: Prisma.EquipmentWhereUniqueInput; + data: Prisma.EquipmentUpdateInput; + }): Promise { + return this.prisma.equipment.update(params); + } + + async remove(where: Prisma.EquipmentWhereUniqueInput): Promise { + return this.prisma.equipment.delete({ where }); + } +} \ No newline at end of file