Files
yara724api/src/claim-request-management/entites/db-service/video-capture.db.service.ts

26 lines
792 B
TypeScript

import { Injectable } from "@nestjs/common";
import { InjectModel } from "@nestjs/mongoose";
import { FilterQuery, Model } from "mongoose";
import { VideoCaptureModel } from "src/claim-request-management/entites/schema/video-capture.schema";
@Injectable()
export class VideoCaptureDbService {
constructor(
@InjectModel(VideoCaptureModel.name)
private readonly videoCapture: Model<VideoCaptureModel>,
) {}
async create(video): Promise<VideoCaptureModel> {
return await this.videoCapture.create(video);
}
async findOne(
filter: FilterQuery<VideoCaptureModel>,
): Promise<VideoCaptureModel> {
return await this.videoCapture.findOne(filter);
}
async findById(id: string): Promise<VideoCaptureModel | null> {
return this.videoCapture.findById(id);
}
}