transform core api codes into this project, update modules as admin/pos context modules

This commit is contained in:
2026-03-07 11:25:11 +03:30
parent b949500482
commit 8c5f1d4d49
167 changed files with 26975 additions and 1837 deletions
@@ -0,0 +1,35 @@
import { PrismaService } from '@/prisma/prisma.service'
import { Injectable } from '@nestjs/common'
import { ResponseMapper } from 'common/response/response-mapper'
@Injectable()
export class DeviceBrandsService {
constructor(private readonly prisma: PrismaService) {}
async findAll() {
const brands = await this.prisma.deviceBrand.findMany()
return ResponseMapper.list(brands)
}
async findOne(id: string) {
const brand = await this.prisma.deviceBrand.findUnique({
where: { id },
})
return ResponseMapper.single(brand)
}
async create(data: any) {
const device = await this.prisma.deviceBrand.create({ data })
return ResponseMapper.create(device)
}
async update(id: string, data: any) {
const device = await this.prisma.deviceBrand.update({ where: { id }, data })
return ResponseMapper.update(device)
}
async delete(id: string) {
await this.prisma.deviceBrand.delete({ where: { id } })
return ResponseMapper.delete()
}
}