diff --git a/src/modules/cart/providers/cart-validation.service.ts b/src/modules/cart/providers/cart-validation.service.ts index 34362cf..86f09ce 100644 --- a/src/modules/cart/providers/cart-validation.service.ts +++ b/src/modules/cart/providers/cart-validation.service.ts @@ -1,7 +1,7 @@ import { Injectable, NotFoundException, BadRequestException } from '@nestjs/common'; import { EntityManager } from '@mikro-orm/postgresql'; -import { Product } from ../../../products/entities/product.entity'; -import { Shop } from ../../../shops/entities/shop.entity'; +import { Product } from '../../../products/entities/product.entity'; +import { Shop } from '../../../shops/entities/shop.entity'; import { UserAddress } from '../../../users/entities/user-address.entity'; import { User } from '../../../users/entities/user.entity'; import { PaymentMethod } from '../../../payments/entities/payment-method.entity'; diff --git a/src/modules/cart/providers/cart-validation.service.ts.backup b/src/modules/cart/providers/cart-validation.service.ts.backup new file mode 100644 index 0000000..34362cf --- /dev/null +++ b/src/modules/cart/providers/cart-validation.service.ts.backup @@ -0,0 +1,273 @@ +import { Injectable, NotFoundException, BadRequestException } from '@nestjs/common'; +import { EntityManager } from '@mikro-orm/postgresql'; +import { Product } from ../../../products/entities/product.entity'; +import { Shop } from ../../../shops/entities/shop.entity'; +import { UserAddress } from '../../../users/entities/user-address.entity'; +import { User } from '../../../users/entities/user.entity'; +import { PaymentMethod } from '../../../payments/entities/payment-method.entity'; +import { Delivery } from '../../../delivery/entities/delivery.entity'; +import { DeliveryMethodEnum } from '../../../delivery/interface/delivery'; +import { PointTransaction } from '../../../users/entities/point-transaction.entity'; +import { Order } from '../../../orders/entities/order.entity'; +import { OrderStatus } from '../../../orders/interface/order.interface'; +import { Cart } from '../interfaces/cart.interface'; +import { GeographicUtils } from '../utils/geographic.utils'; +import { CartMessage } from 'src/common/enums/message.enum'; +import { WalletTransactionRepository } from 'src/modules/users/repositories/wallet-transaction.repository'; + +@Injectable() +export class CartValidationService { + constructor( + private readonly em: EntityManager, + private readonly walletTransactionRepository: WalletTransactionRepository, + ) { } + + /** + * Validate product exists and belongs to shop + */ + async validateAndGetFood(foodId: string, restaurantId: string, quantity: number): Promise { + const product = await this.em.findOne(Product, { id: foodId }, { populate: ['shop'] }); + if (!product) { + throw new NotFoundException(CartMessage.FOOD_NOT_FOUND); + } + + if (product.shop.id !== restaurantId) { + throw new BadRequestException(CartMessage.FOOD_NOT_BELONGS_TO_RESTAURANT); + } + + return product; + } + + + /** + * Get user or throw if not found + */ + async getUserOrFail(userId: string): Promise { + const user = await this.em.findOne(User, { id: userId }); + if (!user) { + throw new NotFoundException(CartMessage.USER_NOT_FOUND); + } + return user; + } + + /** + * Get user address or throw if not found + */ + async getUserAddressOrFail(addressId: string): Promise { + const address = await this.em.findOne(UserAddress, { id: addressId }, { populate: ['user'] }); + if (!address) { + throw new NotFoundException(CartMessage.ADDRESS_NOT_FOUND); + } + return address; + } + + /** + * Get product or throw if not found + */ + async getFoodOrFail(foodId: string): Promise { + const product = await this.em.findOne(Product, { id: foodId }); + if (!product) { + throw new NotFoundException(CartMessage.FOOD_NOT_FOUND); + } + return product; + } + + /** + * Get shop or throw if not found + */ + async getRestaurantOrFail(restaurantId: string): Promise { + const shop = await this.em.findOne(Shop, { id: restaurantId }); + if (!shop) { + throw new NotFoundException(CartMessage.RESTAURANT_NOT_FOUND); + } + return shop; + } + + /** + * Validate address belongs to user + */ + validateAddressOwnership(address: UserAddress, userId: string): void { + if (address.user.id !== userId) { + throw new BadRequestException(CartMessage.ADDRESS_NOT_BELONGS_TO_USER); + } + } + + /** + * Assert address is inside shop service area + */ + async assertAddressInsideServiceArea( + restaurantId: string, + latitude?: number | null, + longitude?: number | null, + ): Promise { + if (latitude === undefined || latitude === null || longitude === undefined || longitude === null) { + throw new BadRequestException(CartMessage.ADDRESS_NO_COORDINATES); + } + + const shop = await this.getRestaurantOrFail(restaurantId); + + const serviceArea = shop.serviceArea; + // If no service area is defined, assume service is available everywhere + if (!serviceArea || !serviceArea.coordinates || !Array.isArray(serviceArea.coordinates)) return; + + // GeoJSON coordinates: [ [ [lng, lat], ... ] ] -> take first ring + const rings = serviceArea.coordinates; + if (!rings || rings.length === 0 || !Array.isArray(rings[0])) return; + + const ring = rings[0]; + const point: [number, number] = [Number(longitude), Number(latitude)]; + + // Ensure polygon has the correct tuple typing ([lng, lat] pairs) + const polygon: [number, number][] = ring.map( + coord => [Number(coord[0] ?? 0), Number(coord[1] ?? 0)] as [number, number], + ); + + if (!GeographicUtils.isPointInPolygon(point, polygon)) { + throw new BadRequestException(CartMessage.ADDRESS_OUTSIDE_SERVICE_AREA); + } + } + + /** + * Get delivery method for shop or throw if not found + */ + async getDeliveryMethodForRestaurantOrFail( + restaurantId: string, + deliveryMethodId: string, + ): Promise { + const deliveryMethod = await this.em.findOne(Delivery, { + id: deliveryMethodId, + shop: { id: restaurantId }, + }); + + if (!deliveryMethod) { + throw new NotFoundException(CartMessage.DELIVERY_METHOD_NOT_FOUND_FOR_RESTAURANT); + } + + return deliveryMethod; + } + + /** + * Get enabled delivery method or throw if not found or disabled + */ + async getEnabledDeliveryMethodOrFail(restaurantId: string, deliveryMethodId: string): Promise { + const deliveryMethod = await this.em.findOne( + Delivery, + { id: deliveryMethodId, shop: { id: restaurantId } }, + { populate: ['shop'] }, + ); + if (!deliveryMethod) { + throw new NotFoundException(CartMessage.DELIVERY_METHOD_NOT_FOUND); + } + if (!deliveryMethod.enabled) { + throw new BadRequestException(CartMessage.DELIVERY_METHOD_NOT_ENABLED); + } + return deliveryMethod; + } + + /** + * Assert delivery method matches expected type + */ + assertDeliveryMethod(actual: DeliveryMethodEnum, expected: DeliveryMethodEnum, message: string): void { + if (actual !== expected) { + throw new BadRequestException(message); + } + } + + /** + * Require delivery method ID or throw + */ + requireDeliveryMethodId(cart: Cart, message: string): string { + if (!cart.deliveryMethodId) { + throw new BadRequestException(message); + } + return cart.deliveryMethodId; + } + + /** + * Get enabled payment method or throw if not found or disabled + */ + async getEnabledPaymentMethodOrFail(restaurantId: string, paymentMethodId: string): Promise { + const paymentMethod = await this.em.findOne( + PaymentMethod, + { id: paymentMethodId, shop: { id: restaurantId } }, + { populate: ['shop'] }, + ); + if (!paymentMethod) { + throw new NotFoundException(CartMessage.PAYMENT_METHOD_NOT_FOUND); + } + if (!paymentMethod.enabled) { + throw new BadRequestException(CartMessage.PAYMENT_METHOD_NOT_ENABLED); + } + return paymentMethod; + } + + /** + * Assert wallet has enough balance + */ + async assertWalletHasEnoughBalance(userId: string, restaurantId: string, amount: number): Promise { + const balance = await this.walletTransactionRepository.getCurrentWalletBalance(userId, restaurantId); + + if (balance < amount) { + throw new BadRequestException(CartMessage.WALLET_INSUFFICIENT); + } + } + + /** + * Assert coupon usage limit + */ + async assertCouponUsageLimit(userId: string, couponId: string, maxUsesPerUser?: number): Promise { + if (!maxUsesPerUser) return; + + const ordersThatUsedTheCouponCount = await this.em.count(Order, { + user: { id: userId }, + couponDetail: { couponId: couponId }, + status: { $ne: OrderStatus.CANCELED }, + deletedAt: null, + }); + + if (ordersThatUsedTheCouponCount >= maxUsesPerUser) { + throw new BadRequestException(CartMessage.COUPON_MAX_USES_REACHED); + } + } + + /** + * Assert coupon matches cart if restricted + */ + async assertCouponMatchesCartIfRestricted( + cart: Cart, + foodCategories?: string[] | null, + products?: string[] | null, + ): Promise { + const categoryRestriction = foodCategories?.filter(Boolean) ?? []; + const foodRestriction = products?.filter(Boolean) ?? []; + const hasCategoryRestriction = categoryRestriction.length > 0; + const hasFoodRestriction = foodRestriction.length > 0; + if (!hasCategoryRestriction && !hasFoodRestriction) return; + + const foodMap = await this.getFoodsInCartWithCategories(cart); + + for (const item of cart.items) { + const product = foodMap.get(item.foodId); + if (!product) continue; + + const matchesCategory = hasCategoryRestriction && product.category && categoryRestriction.includes(product.category.id); + const matchesFood = hasFoodRestriction && foodRestriction.includes(product.id); + if (matchesCategory || matchesFood) return; + } + + throw new BadRequestException(CartMessage.COUPON_CANNOT_BE_APPLIED); + } + + /** + * Get products in cart with categories + */ + async getFoodsInCartWithCategories(cart: Cart): Promise> { + const foodIds = cart.items.map(item => item.foodId); + if (foodIds.length === 0) return new Map(); + + const products = await this.em.find(Product, { id: { $in: foodIds } }, { populate: ['category'] }); + return new Map(products.map(f => [f.id, f])); + } + +} + diff --git a/src/modules/coupons/entities/coupon.entity.ts b/src/modules/coupons/entities/coupon.entity.ts index 05e1027..3586c6f 100644 --- a/src/modules/coupons/entities/coupon.entity.ts +++ b/src/modules/coupons/entities/coupon.entity.ts @@ -1,6 +1,6 @@ import { Entity, Index, ManyToOne, Property, Enum, Unique } from '@mikro-orm/core'; import { BaseEntity } from '../../../../common/entities/base.entity'; -import { Shop } from ../../../ shops / entities / shop.entity'; +import { Shop } from '../../../shops/entities/shop.entity'; import { normalizePhone } from '../../../utils/phone.util'; import { CouponType } from '../interface/coupon'; diff --git a/src/modules/products/crone/product.crone.ts b/src/modules/products/crone/product.crone.ts deleted file mode 100644 index 7ce4fe9..0000000 --- a/src/modules/products/crone/product.crone.ts +++ /dev/null @@ -1,44 +0,0 @@ -import { Injectable, Logger } from '@nestjs/common'; -import { Cron } from '@nestjs/schedule'; -import { EntityManager } from '@mikro-orm/postgresql'; - -@Injectable() -export class FoodStockCrone { - private readonly logger = new Logger(FoodStockCrone.name); - - constructor(private readonly em: EntityManager) {} - - // Inventory cron job disabled - inventory module removed - // @Cron('3 0 * * *', { - // name: 'resetAvailableStock', - // timeZone: 'UTC', - // }) - // async handleCron() { - // try { - // this.logger.debug('Starting daily inventory reset (availableStock = totalStock)'); - - // const inventories = await this.em.find(Inventory, {}); - // if (!inventories || inventories.length === 0) { - // this.logger.debug('No inventory records found to reset'); - // return; - // } - - // this.logger.log(`Resetting available stock for ${inventories.length} inventory records`); - - // await this.em.transactional(async em => { - // for (const inv of inventories) { - // // reload inside transaction to avoid concurrency issues - // const record = await em.findOne(Inventory, { id: inv.id }); - // if (!record) continue; - // record.availableStock = record.totalStock; - // em.persist(record); - // } - // await em.flush(); - // }); - - // this.logger.log('Daily inventory reset completed'); - // } catch (err) { - // this.logger.error(`FoodStockCrone failed: ${err?.message}`, err); - // } - // } -} diff --git a/src/modules/products/dto/create-product.dto.ts b/src/modules/products/dto/create-product.dto.ts index 5d279a7..de04b65 100644 --- a/src/modules/products/dto/create-product.dto.ts +++ b/src/modules/products/dto/create-product.dto.ts @@ -27,9 +27,6 @@ export class CreateVariantDto { @ApiProperty() price: number - @IsNumber() - @ApiProperty() - stock: number } export class CreateProductDto { diff --git a/src/modules/products/entities/product.entity.ts b/src/modules/products/entities/product.entity.ts index 2c9235a..e6cfd6e 100644 --- a/src/modules/products/entities/product.entity.ts +++ b/src/modules/products/entities/product.entity.ts @@ -12,7 +12,7 @@ import { Variant } from './variant.entity'; @Index({ properties: ['isActive'] }) export class Product extends BaseEntity { @ManyToOne(() => Shop) - shop: Shop; + shop!: Shop; @ManyToOne(() => Category) category: Category; diff --git a/src/modules/products/entities/variant.entity.ts b/src/modules/products/entities/variant.entity.ts index 31c129f..cc44641 100644 --- a/src/modules/products/entities/variant.entity.ts +++ b/src/modules/products/entities/variant.entity.ts @@ -1,9 +1,9 @@ import { Entity, Index, Property, ManyToOne, ManyToMany, Collection } from '@mikro-orm/core'; import { Product } from './product.entity'; -import { BaseEntity } from '../../../../common/entities/base.entity'; +import { BaseEntity } from '../../../common/entities/base.entity'; @Entity({ tableName: 'variants' }) -@Index({ properties: ['product', 'isActive'] }) +@Index({ properties: ['product'] }) export class Variant extends BaseEntity { @ManyToOne(() => Product) product!: Product; @@ -14,7 +14,4 @@ export class Variant extends BaseEntity { @Property({ type: 'decimal', precision: 10, scale: 0, nullable: true }) price?: number; - @Property({ type: 'int', default: 0 }) - stock: number = 0; - } diff --git a/src/modules/products/providers/product.service.ts b/src/modules/products/providers/product.service.ts index 91c5ad0..69ee8b1 100644 --- a/src/modules/products/providers/product.service.ts +++ b/src/modules/products/providers/product.service.ts @@ -16,7 +16,7 @@ export class ProductService { constructor( private readonly productRepository: ProductRepository, private readonly categoryRepository: CategoryRepository, - private readonly shopService: ShopService, + private readonly shopService: ShopService, private readonly em: EntityManager, ) { } @@ -42,8 +42,7 @@ export class ProductService { // map single-title/content DTO to localized fields title: rest.title, attribute: rest.attribute, - // numeric/array fields - price: rest.price ?? 0, + images: rest.images ?? undefined, shop: shop, category: category, @@ -57,7 +56,6 @@ export class ProductService { const variantRecord = em.create(Variant, { product, value: variant.value, - stock: variant.stock, price: variant.price, }) @@ -102,7 +100,7 @@ export class ProductService { async findByShop(slug: string): Promise { - const shop = await this.shopService.findOrFailBySlug( slug ); + const shop = await this.shopService.findOrFailBySlug(slug); const queryFilter: FilterQuery = { shop: { slug }, @@ -142,7 +140,7 @@ export class ProductService { const updatedVariantIds = new Set(); for (const variant of variants) { - const { id, value, stock, price } = variant; + const { id, value, price } = variant; if (id) { // Update existing variant @@ -152,14 +150,13 @@ export class ProductService { } // Update the variant fields - this.em.assign(existingVariant, { value, stock, price }); + this.em.assign(existingVariant, { value, price }); updatedVariantIds.add(id); } else { // Create new variant const variantRecord = this.em.create(Variant, { product, value, - stock, price, }); this.em.persist(variantRecord); @@ -182,10 +179,10 @@ export class ProductService { return product; } - async remove(restId: string, id: string): Promise { + async remove(shopId: string, id: string): Promise { const product = await this.findOrFail(id) - if (product.shop.id !== restId) { + if (product.shop.id !== shopId) { throw new BadRequestException("Product doesnt belongs to you") } diff --git a/src/modules/shops/controllers/shops.controller.ts b/src/modules/shops/controllers/shops.controller.ts index 9c0a377..164dd67 100644 --- a/src/modules/shops/controllers/shops.controller.ts +++ b/src/modules/shops/controllers/shops.controller.ts @@ -1,9 +1,9 @@ import { Controller, Get, Post, Body, Patch, Param, UseGuards, Delete, Query } from '@nestjs/common'; -import { RestaurantsService } from ../../../ shops.service'; +import { RestaurantsService } from '../../../shops.service'; import { CreateRestaurantDto } from '../dto/create-shop.dto'; import { UpdateRestaurantDto } from '../dto/update-shop.dto'; import { UpgradeSubscriptionDto } from '../dto/upgrade-subscription.dto'; -import { FindRestaurantsDto } from ../../../ shops.dto'; +import { FindRestaurantsDto } from '../dto/find-shops.dto'; import { AdminAuthGuard } from 'src/modules/auth/guards/adminAuth.guard'; import { ApiBearerAuth, diff --git a/src/modules/shops/entities/shop.entity.ts b/src/modules/shops/entities/shop.entity.ts index c570a39..a6b4c1a 100644 --- a/src/modules/shops/entities/shop.entity.ts +++ b/src/modules/shops/entities/shop.entity.ts @@ -1,6 +1,6 @@ import { Collection, Entity, Enum, Index, OneToMany, Property } from '@mikro-orm/core'; -import { BaseEntity } from '../../../../common/entities/base.entity'; -import { Delivery } from '../../../delivery/entities/delivery.entity'; +import { BaseEntity } from '../../../common/entities/base.entity'; +import { Delivery } from '../../delivery/entities/delivery.entity'; import { PlanEnum } from '../interface/plan.interface'; @Entity({ tableName: 'shops' }) diff --git a/src/modules/shops/providers/shops.service.ts b/src/modules/shops/providers/shops.service.ts index 6cd55d7..0bf5736 100644 --- a/src/modules/shops/providers/shops.service.ts +++ b/src/modules/shops/providers/shops.service.ts @@ -6,7 +6,7 @@ import { Shop } from '../entities/shop.entity'; import { EntityManager } from '@mikro-orm/postgresql'; import { shopRepository } from '../repositories/rest.repository'; import { RestMessage } from 'src/common/enums/message.enum'; -import { FindRestaurantsDto } from '../providers/shops.dto'; +import { FindRestaurantsDto } from '../dto/find-shops.dto'; import { PaginatedResult } from 'src/common/interfaces/pagination.interface'; import { PlanEnum } from '../interface/plan.interface'; import { Admin } from '../../../admin/entities/admin.entity'; @@ -18,8 +18,8 @@ import { NotificationPreference } from '../../../notifications/entities/notifica import { notificationPreferencesData } from '../../../../seeders/data/notification-preferences.data'; import { Order } from '../../../orders/entities/order.entity'; import { Coupon } from '../../../coupons/entities/coupon.entity'; -import { Category } from ../../..products / entities / category.entity'; -import { Product } from ../../..products / entities / product.entity'; +import { Category } from '../../../products/entities/category.entity'; +import { Product } from '../../../products/entities/product.entity'; import { Delivery } from '../../../delivery/entities/delivery.entity'; import { PaymentMethod } from '../../../payments/entities/payment-method.entity'; import { Pager } from '../../../pager/entities/pager.entity'; diff --git a/src/modules/users/entities/point-transaction.entity.ts b/src/modules/users/entities/point-transaction.entity.ts index 5a1d95e..0d40b26 100644 --- a/src/modules/users/entities/point-transaction.entity.ts +++ b/src/modules/users/entities/point-transaction.entity.ts @@ -1,6 +1,6 @@ import { Entity, Property, ManyToOne, Index, Enum } from '@mikro-orm/core'; import { BaseEntity } from '../../../../common/entities/base.entity'; -import { Shop } from ../../../shops/entities/shop.entity'; +import { Shop } from '../../../shops/entities/shop.entity'; import { User } from './user.entity'; import { PointTransactionReason } from '../interface/point'; import { PointTransactionType } from '../interface/point'; diff --git a/src/modules/users/entities/wallet-transaction.entity.ts b/src/modules/users/entities/wallet-transaction.entity.ts index 1bd92e1..6d8f4c4 100644 --- a/src/modules/users/entities/wallet-transaction.entity.ts +++ b/src/modules/users/entities/wallet-transaction.entity.ts @@ -2,7 +2,7 @@ import { Entity, Index, Property, ManyToOne, Enum } from '@mikro-orm/core'; import { BaseEntity } from '../../../../common/entities/base.entity'; import { User } from './user.entity'; import { WalletTransactionReason, WalletTransactionType } from '../interface/wallet'; -import { Shop } from ../../../shops/entities/shop.entity'; +import { Shop } from '../../../shops/entities/shop.entity'; @Entity({ tableName: 'wallet_transactions' }) @Index({ properties: ['user', 'shop'] }) diff --git a/src/modules/users/providers/user.service.ts b/src/modules/users/providers/user.service.ts index b60a925..95e8627 100644 --- a/src/modules/users/providers/user.service.ts +++ b/src/modules/users/providers/user.service.ts @@ -2,7 +2,7 @@ import { Injectable, NotFoundException, BadRequestException } from '@nestjs/comm import { FilterQuery, RequiredEntityData } from '@mikro-orm/core'; import { User } from '../entities/user.entity'; import { UserAddress } from '../entities/user-address.entity'; -import { Shop } from ../../../shops/entities/shop.entity'; +import { Shop } from '../../../shops/entities/shop.entity'; import { EntityManager } from '@mikro-orm/postgresql'; import { UpdateUserDto } from '../dto/update-user.dto'; import { FindUsersDto } from '../dto/find-user.dto'; @@ -13,7 +13,7 @@ import { UpdateUserAddressDto } from '../dto/update-user-address.dto'; import { PaginatedResult } from 'src/common/interfaces/pagination.interface'; import { UserRepository } from '../repositories/user.repository'; import { normalizePhone } from '../../../utils/phone.util'; -import { RestRepository } from ../../../shops/repositories/rest.repository'; +import { RestRepository } from '../../../shops/repositories/rest.repository'; import { WalletTransactionRepository } from '../repositories/wallet-transaction.repository'; import { WalletService } from './wallet.service'; import { WalletTransactionReason, WalletTransactionType } from '../interface/wallet'; diff --git a/src/modules/users/user.module.ts b/src/modules/users/user.module.ts index eb2ff32..c7e1376 100644 --- a/src/modules/users/user.module.ts +++ b/src/modules/users/user.module.ts @@ -6,7 +6,7 @@ import { User } from './entities/user.entity'; import { UserAddress } from './entities/user-address.entity'; import { JwtModule } from '@nestjs/jwt'; import { UserRepository } from './repositories/user.repository'; -import { RestaurantsModule } from ../../../shops.module'; +import { RestaurantsModule } from '../../../shops.module'; import { WalletTransactionRepository } from './repositories/wallet-transaction.repository'; import { WalletService } from './providers/wallet.service'; import { WalletTransaction } from './entities/wallet-transaction.entity'; diff --git a/src/seeders/admins.seeder.ts b/src/seeders/admins.seeder.ts index 6e2548a..8711876 100644 --- a/src/seeders/admins.seeder.ts +++ b/src/seeders/admins.seeder.ts @@ -2,7 +2,7 @@ import type { EntityManager } from '@mikro-orm/core'; import { Admin } from '../modules/admin/entities/admin.entity'; import { AdminRole } from '../modules/admin/entities/adminRole.entity'; import type { Role } from '../modules/roles/entities/role.entity'; -import type { Shop } from ../../../shops/entities/shop.entity'; +import type { Shop } from '../../../shops/entities/shop.entity'; import { adminsData } from './data/admins.data'; import { normalizePhone } from '../modules/utils/phone.util'; diff --git a/src/seeders/categories.seeder.ts b/src/seeders/categories.seeder.ts index cdcf692..b24e488 100644 --- a/src/seeders/categories.seeder.ts +++ b/src/seeders/categories.seeder.ts @@ -1,6 +1,6 @@ import type { EntityManager } from '@mikro-orm/core'; -import { Category } from ../../../products/entities/category.entity'; -import type { Shop } from ../../../shops/entities/shop.entity'; +import { Category } from '../../../products/entities/category.entity'; +import type { Shop } from '../../../shops/entities/shop.entity'; import { categoriesData } from './data/categories.data'; import * as fs from 'fs'; import * as path from 'path'; diff --git a/src/seeders/coupons.seeder.ts b/src/seeders/coupons.seeder.ts index a17b7f8..b225681 100644 --- a/src/seeders/coupons.seeder.ts +++ b/src/seeders/coupons.seeder.ts @@ -1,6 +1,6 @@ import type { EntityManager } from '@mikro-orm/core'; import { Coupon } from '../modules/coupons/entities/coupon.entity'; -import type { Shop } from ../../../shops/entities/shop.entity'; +import type { Shop } from '../../../shops/entities/shop.entity'; import { couponsData } from './data/coupons.data'; export class CouponsSeeder { diff --git a/src/seeders/delivery-methods.seeder.ts b/src/seeders/delivery-methods.seeder.ts index 2c6e154..dead67b 100644 --- a/src/seeders/delivery-methods.seeder.ts +++ b/src/seeders/delivery-methods.seeder.ts @@ -1,6 +1,6 @@ import type { EntityManager } from '@mikro-orm/core'; import { Delivery } from '../modules/delivery/entities/delivery.entity'; -import type { Shop } from ../../../shops/entities/shop.entity'; +import type { Shop } from '../../../shops/entities/shop.entity'; import { deliveryMethodsData } from './data/delivery-methods.data'; import { DeliveryFeeTypeEnum } from 'src/modules/delivery/interface/delivery'; diff --git a/src/seeders/notification-preferences.seeder.ts b/src/seeders/notification-preferences.seeder.ts index 51646d2..bcdd0ff 100644 --- a/src/seeders/notification-preferences.seeder.ts +++ b/src/seeders/notification-preferences.seeder.ts @@ -1,6 +1,6 @@ import type { EntityManager } from '@mikro-orm/core'; import { NotificationPreference } from '../modules/notifications/entities/notification-preference.entity'; -import type { Shop } from ../../../shops/entities/shop.entity'; +import type { Shop } from '../../../shops/entities/shop.entity'; import { notificationPreferencesData } from './data/notification-preferences.data'; export class NotificationPreferencesSeeder { diff --git a/src/seeders/notifications.seeder.ts b/src/seeders/notifications.seeder.ts index 129ec99..5ef07bc 100644 --- a/src/seeders/notifications.seeder.ts +++ b/src/seeders/notifications.seeder.ts @@ -2,7 +2,7 @@ import type { EntityManager } from '@mikro-orm/core'; import { Notification } from '../modules/notifications/entities/notification.entity'; import { Admin } from '../modules/admin/entities/admin.entity'; import { User } from '../modules/users/entities/user.entity'; -import { Shop } from ../../../shops/entities/shop.entity'; +import { Shop } from '../../../shops/entities/shop.entity'; import { NotifTitleEnum } from '../modules/notifications/interfaces/notification.interface'; export class NotificationsSeeder { diff --git a/src/seeders/payment-methods.seeder.ts b/src/seeders/payment-methods.seeder.ts index b7fe515..af5e5b1 100644 --- a/src/seeders/payment-methods.seeder.ts +++ b/src/seeders/payment-methods.seeder.ts @@ -1,6 +1,6 @@ import type { EntityManager } from '@mikro-orm/core'; import { PaymentMethod } from '../modules/payments/entities/payment-method.entity'; -import type { Shop } from ../../../shops/entities/shop.entity'; +import type { Shop } from '../../../shops/entities/shop.entity'; import { paymentMethodsData } from './data/payment-methods.data'; export class PaymentMethodsSeeder { diff --git a/src/seeders/schedules.seeder.ts b/src/seeders/schedules.seeder.ts index a715e27..227ad8e 100644 --- a/src/seeders/schedules.seeder.ts +++ b/src/seeders/schedules.seeder.ts @@ -1,6 +1,6 @@ import type { EntityManager } from '@mikro-orm/core'; -import { Schedule } from ../../../shops/entities/schedule.entity'; -import type { Shop } from ../../../shops/entities/shop.entity'; +import { Schedule } from '../../../shops/entities/schedule.entity'; +import type { Shop } from '../../../shops/entities/shop.entity'; import { timeSlots } from './data/schedules.data'; export class SchedulesSeeder { diff --git a/src/seeders/user-wallets.seeder.ts b/src/seeders/user-wallets.seeder.ts index 1b8d515..c37020d 100644 --- a/src/seeders/user-wallets.seeder.ts +++ b/src/seeders/user-wallets.seeder.ts @@ -1,6 +1,6 @@ import type { EntityManager } from '@mikro-orm/core'; import { User } from '../modules/users/entities/user.entity'; -import { Shop } from ../../../shops/entities/shop.entity'; +import { Shop } from '../../../shops/entities/shop.entity'; import { WalletTransaction } from '../modules/users/entities/wallet-transaction.entity'; import { WalletTransactionReason, WalletTransactionType } from 'src/modules/users/interface/wallet';