add: admin shop shipment

This commit is contained in:
morteza-mortezai
2025-10-26 16:50:17 +03:30
parent 1e38c353f2
commit e469a2eadd
4 changed files with 65 additions and 3 deletions
+5 -1
View File
@@ -1,4 +1,4 @@
import { IShop } from "./models/Abstraction/IShop";
import { IShop, OwnerRef } from "./models/Abstraction/IShop";
import { ShopModel } from "./models/shop.model";
import { BaseRepository } from "../../common/base/repository";
@@ -10,6 +10,10 @@ export class ShopRepo extends BaseRepository<IShop> {
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 {