change entity names

This commit is contained in:
2026-02-08 09:18:20 +03:30
parent 6be6a66079
commit 9a7010dcea
180 changed files with 2751 additions and 2513 deletions
+7 -7
View File
@@ -1,19 +1,19 @@
import type { EntityManager } from '@mikro-orm/core';
import { Schedule } from '../modules/restaurants/entities/schedule.entity';
import type { Restaurant } from '../modules/restaurants/entities/restaurant.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 {
async run(em: EntityManager, restaurants: Restaurant[]): Promise<void> {
for (const restaurant of restaurants) {
if (!restaurant) continue;
async run(em: EntityManager, shops: Shop[]): Promise<void> {
for (const shop of shops) {
if (!shop) continue;
// Create schedules for each day (0 = Sunday, 6 = Saturday)
for (let weekDay = 0; weekDay <= 6; weekDay++) {
// Create 3 schedules per day
for (const timeSlot of timeSlots) {
const existing = await em.findOne(Schedule, {
restId: restaurant.id,
restId: shop.id,
weekDay,
openTime: timeSlot.openTime,
closeTime: timeSlot.closeTime,
@@ -21,7 +21,7 @@ export class SchedulesSeeder {
if (!existing) {
const schedule = em.create(Schedule, {
restId: restaurant.id,
restId: shop.id,
weekDay,
openTime: timeSlot.openTime,
closeTime: timeSlot.closeTime,