import { IShop, OwnerRef } from "./models/Abstraction/IShop"; import { ShopModel } from "./models/shop.model"; import { BaseRepository } from "../../common/base/repository"; export class ShopRepo extends BaseRepository { constructor() { super(ShopModel); } async findWithShopcode(shopCode: number) { return this.model.findOne({ shopCode }, { _id: 1, shopName: 1, shopCode: 1, shopDescription: 1, logo: 1 }); } async findAdminShop() { return this.model.findOne({ ownerRef: OwnerRef.ADMIN }).populate({ path: "shipmentMethod" }); } } export function createShopRepo(): ShopRepo { return new ShopRepo(); }