





















const db = require('../models');
const Users = db.users;






const AccountApprovals = db.account_approvals;

const Restaurants = db.restaurants;

const RestaurantTables = db.restaurant_tables;

const WorkSchedules = db.work_schedules;

const WorkShifts = db.work_shifts;

const AttendanceEvents = db.attendance_events;

const GeofenceAlerts = db.geofence_alerts;

const MenuCategories = db.menu_categories;

const MenuItems = db.menu_items;

const Orders = db.orders;

const OrderItems = db.order_items;

const Reservations = db.reservations;

const Payments = db.payments;

const LoyaltyAccounts = db.loyalty_accounts;

const LoyaltyRules = db.loyalty_rules;

const LoyaltyTransactions = db.loyalty_transactions;

const CustomerReviews = db.customer_reviews;

const NotificationEvents = db.notification_events;

const StockLocations = db.stock_locations;

const StockItems = db.stock_items;

const StockMovements = db.stock_movements;

const Invoices = db.invoices;

const AuditLogs = db.audit_logs;







const AccountApprovalsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "status": "en_attente",
            
        
    
        
        
            
                "requested_at": new Date('2026-02-20T14:00:00Z'),
            
        
    
        
        
            
                "reviewed_at": new Date('2026-02-20T16:00:00Z'),
            
        
    
        
        
            
                "review_comment": "Validation du profil superviseur",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "status": "approuve",
            
        
    
        
        
            
                "requested_at": new Date('2026-02-25T09:00:00Z'),
            
        
    
        
        
            
                "reviewed_at": new Date('2026-02-25T09:00:00Z'),
            
        
    
        
        
            
                "review_comment": "En attente de validation DG",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "status": "en_attente",
            
        
    
        
        
            
                "requested_at": new Date('2026-02-24T13:20:00Z'),
            
        
    
        
        
            
                "reviewed_at": new Date('2026-02-24T15:05:00Z'),
            
        
    
        
        
            
                "review_comment": "Photo insuffisante pour verification",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "status": "rejete",
            
        
    
        
        
            
                "requested_at": new Date('2026-02-22T08:30:00Z'),
            
        
    
        
        
            
                "reviewed_at": new Date('2026-02-22T10:00:00Z'),
            
        
    
        
        
            
                "review_comment": "Cuisinier approuve",
            
        
    
    },
    
];



const RestaurantsData = [
    
    {
    
        
        
            
                "name": "Texas Grillz Plateau",
            
        
    
        
        
            
                "address": "Avenue Chardy, Plateau, Abidjan",
            
        
    
        
        
            
                "contact_phone": "+2252720001001",
            
        
    
        
        
            
                "staff_count_planned": 32,
            
        
    
        
        
            
                "table_count": 18,
            
        
    
        
        
            
                "opening_time": new Date('2026-03-01T10:00:00Z'),
            
        
    
        
        
            
                "closing_time": new Date('2026-03-01T23:00:00Z'),
            
        
    
        
        
            
                "latitude": 5.3405,
            
        
    
        
        
            
                "longitude": -4.0285,
            
        
    
        
        
            
                "geofence_radius_meters": 30,
            
        
    
        
        
            
                "is_active": true,
            
        
    
    },
    
    {
    
        
        
            
                "name": "Texas Grillz Cocody",
            
        
    
        
        
            
                "address": "Boulevard Latrille, Cocody, Abidjan",
            
        
    
        
        
            
                "contact_phone": "+2252720001002",
            
        
    
        
        
            
                "staff_count_planned": 28,
            
        
    
        
        
            
                "table_count": 16,
            
        
    
        
        
            
                "opening_time": new Date('2026-03-01T10:00:00Z'),
            
        
    
        
        
            
                "closing_time": new Date('2026-03-01T23:30:00Z'),
            
        
    
        
        
            
                "latitude": 5.3612,
            
        
    
        
        
            
                "longitude": -3.9991,
            
        
    
        
        
            
                "geofence_radius_meters": 30,
            
        
    
        
        
            
                "is_active": true,
            
        
    
    },
    
    {
    
        
        
            
                "name": "Texas Grillz Marcory",
            
        
    
        
        
            
                "address": "Zone 4, Marcory, Abidjan",
            
        
    
        
        
            
                "contact_phone": "+2252720001003",
            
        
    
        
        
            
                "staff_count_planned": 30,
            
        
    
        
        
            
                "table_count": 20,
            
        
    
        
        
            
                "opening_time": new Date('2026-03-01T11:00:00Z'),
            
        
    
        
        
            
                "closing_time": new Date('2026-03-01T00:00:00Z'),
            
        
    
        
        
            
                "latitude": 5.2953,
            
        
    
        
        
            
                "longitude": -3.9867,
            
        
    
        
        
            
                "geofence_radius_meters": 30,
            
        
    
        
        
            
                "is_active": true,
            
        
    
    },
    
    {
    
        
        
            
                "name": "Texas Grillz Yopougon",
            
        
    
        
        
            
                "address": "Sideci, Yopougon, Abidjan",
            
        
    
        
        
            
                "contact_phone": "+2252720001004",
            
        
    
        
        
            
                "staff_count_planned": 26,
            
        
    
        
        
            
                "table_count": 14,
            
        
    
        
        
            
                "opening_time": new Date('2026-03-01T10:30:00Z'),
            
        
    
        
        
            
                "closing_time": new Date('2026-03-01T22:30:00Z'),
            
        
    
        
        
            
                "latitude": 5.3419,
            
        
    
        
        
            
                "longitude": -4.0873,
            
        
    
        
        
            
                "geofence_radius_meters": 30,
            
        
    
        
        
            
                "is_active": false,
            
        
    
    },
    
];



const RestaurantTablesData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "table_label": "P-01",
            
        
    
        
        
            
                "seat_count": 4,
            
        
    
        
        
            
                "qr_payload": "tgz://plateau/table/P-01",
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                "is_available": true,
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "table_label": "P-02",
            
        
    
        
        
            
                "seat_count": 6,
            
        
    
        
        
            
                "qr_payload": "tgz://plateau/table/P-02",
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                "is_available": true,
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "table_label": "C-01",
            
        
    
        
        
            
                "seat_count": 4,
            
        
    
        
        
            
                "qr_payload": "tgz://cocody/table/C-01",
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                "is_available": true,
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "table_label": "M-03",
            
        
    
        
        
            
                "seat_count": 2,
            
        
    
        
        
            
                "qr_payload": "tgz://marcory/table/M-03",
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                "is_available": false,
            
        
    
    },
    
];



const WorkSchedulesData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "title": "Planning Semaine 10 - Plateau",
            
        
    
        
        
            
                "period_start": new Date('2026-03-02T00:00:00Z'),
            
        
    
        
        
            
                "period_end": new Date('2026-03-08T23:59:59Z'),
            
        
    
        
        
            
                "status": "archive",
            
        
    
        
        
            
                "notes": "Rotation cuisine et salle, weekend renforcé",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "title": "Planning Semaine 10 - Cocody",
            
        
    
        
        
            
                "period_start": new Date('2026-03-02T00:00:00Z'),
            
        
    
        
        
            
                "period_end": new Date('2026-03-08T23:59:59Z'),
            
        
    
        
        
            
                "status": "publie",
            
        
    
        
        
            
                "notes": "A valider par superviseur assigné",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "title": "Planning Semaine 11 - Marcory",
            
        
    
        
        
            
                "period_start": new Date('2026-03-09T00:00:00Z'),
            
        
    
        
        
            
                "period_end": new Date('2026-03-15T23:59:59Z'),
            
        
    
        
        
            
                "status": "publie",
            
        
    
        
        
            
                "notes": "Focus service soir",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "title": "Planning Semaine 10 - Bassam",
            
        
    
        
        
            
                "period_start": new Date('2026-03-02T00:00:00Z'),
            
        
    
        
        
            
                "period_end": new Date('2026-03-08T23:59:59Z'),
            
        
    
        
        
            
                "status": "archive",
            
        
    
        
        
            
                "notes": "Renfort bar vendredi samedi",
            
        
    
    },
    
];



const WorkShiftsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "shift_start": new Date('2026-03-02T09:00:00Z'),
            
        
    
        
        
            
                "shift_end": new Date('2026-03-02T18:00:00Z'),
            
        
    
        
        
            
                "shift_role": "agent_entretien",
            
        
    
        
        
            
                "shift_status": "confirme",
            
        
    
        
        
            
                "shift_notes": "Ouverture et briefing equipe",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "shift_start": new Date('2026-03-02T10:00:00Z'),
            
        
    
        
        
            
                "shift_end": new Date('2026-03-02T19:00:00Z'),
            
        
    
        
        
            
                "shift_role": "agent_entretien",
            
        
    
        
        
            
                "shift_status": "confirme",
            
        
    
        
        
            
                "shift_notes": "Poste grillades",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "shift_start": new Date('2026-03-02T11:00:00Z'),
            
        
    
        
        
            
                "shift_end": new Date('2026-03-02T20:00:00Z'),
            
        
    
        
        
            
                "shift_role": "caissier",
            
        
    
        
        
            
                "shift_status": "planifie",
            
        
    
        
        
            
                "shift_notes": "Caisse et cloture",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "shift_start": new Date('2026-03-06T14:00:00Z'),
            
        
    
        
        
            
                "shift_end": new Date('2026-03-06T22:30:00Z'),
            
        
    
        
        
            
                "shift_role": "agent_entretien",
            
        
    
        
        
            
                "shift_status": "annule",
            
        
    
        
        
            
                "shift_notes": "Service cocktail et inventaire",
            
        
    
    },
    
];



const AttendanceEventsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "event_type": "check_in",
            
        
    
        
        
            
                "event_time": new Date('2026-03-02T08:58:00Z'),
            
        
    
        
        
            
                "latitude": 5.3405,
            
        
    
        
        
            
                "longitude": -4.0284,
            
        
    
        
        
            
                "distance_meters": 12.4,
            
        
    
        
        
            
                "out_of_geofence": false,
            
        
    
        
        
            
                "comment": "Arrivee avant ouverture",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "event_type": "absence",
            
        
    
        
        
            
                "event_time": new Date('2026-03-02T10:17:00Z'),
            
        
    
        
        
            
                "latitude": 5.3411,
            
        
    
        
        
            
                "longitude": -4.0293,
            
        
    
        
        
            
                "distance_meters": 45.2,
            
        
    
        
        
            
                "out_of_geofence": true,
            
        
    
        
        
            
                "comment": "Retard trafic, hors zone au moment pointage",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "event_type": "check_in",
            
        
    
        
        
            
                "event_time": new Date('2026-03-02T10:55:00Z'),
            
        
    
        
        
            
                "latitude": 5.3406,
            
        
    
        
        
            
                "longitude": -4.0286,
            
        
    
        
        
            
                "distance_meters": 9.1,
            
        
    
        
        
            
                "out_of_geofence": true,
            
        
    
        
        
            
                "comment": "RAS",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "event_type": "absence",
            
        
    
        
        
            
                "event_time": new Date('2026-03-06T13:52:00Z'),
            
        
    
        
        
            
                "latitude": 5.2077,
            
        
    
        
        
            
                "longitude": -3.7396,
            
        
    
        
        
            
                "distance_meters": 18.0,
            
        
    
        
        
            
                "out_of_geofence": false,
            
        
    
        
        
            
                "comment": "Brief bar",
            
        
    
    },
    
];



const GeofenceAlertsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "distance_meters": 45.2,
            
        
    
        
        
            
                "latitude": 5.3411,
            
        
    
        
        
            
                "longitude": -4.0293,
            
        
    
        
        
            
                "alert_time": new Date('2026-03-02T10:17:10Z'),
            
        
    
        
        
            
                "severity": "critical",
            
        
    
        
        
            
                "is_acknowledged": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "distance_meters": 62.8,
            
        
    
        
        
            
                "latitude": 5.342,
            
        
    
        
        
            
                "longitude": -4.031,
            
        
    
        
        
            
                "alert_time": new Date('2026-03-02T10:20:00Z'),
            
        
    
        
        
            
                "severity": "warning",
            
        
    
        
        
            
                "is_acknowledged": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "distance_meters": 31.5,
            
        
    
        
        
            
                "latitude": 5.3615,
            
        
    
        
        
            
                "longitude": -3.9984,
            
        
    
        
        
            
                "alert_time": new Date('2026-03-03T09:02:00Z'),
            
        
    
        
        
            
                "severity": "info",
            
        
    
        
        
            
                "is_acknowledged": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "distance_meters": 38.0,
            
        
    
        
        
            
                "latitude": 5.2079,
            
        
    
        
        
            
                "longitude": -3.7392,
            
        
    
        
        
            
                "alert_time": new Date('2026-03-06T22:40:00Z'),
            
        
    
        
        
            
                "severity": "critical",
            
        
    
        
        
            
                "is_acknowledged": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const MenuCategoriesData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Grillades Premium",
            
        
    
        
        
            
                "category_type": "boisson",
            
        
    
        
        
            
                "description": "Selection de viandes grillees et sauces maison",
            
        
    
        
        
            
                "sort_order": 1,
            
        
    
        
        
            
                "is_active": true,
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Accompagnements",
            
        
    
        
        
            
                "category_type": "nourriture",
            
        
    
        
        
            
                "description": "Frites, riz, legumes et salades",
            
        
    
        
        
            
                "sort_order": 2,
            
        
    
        
        
            
                "is_active": true,
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Cocktails Signature",
            
        
    
        
        
            
                "category_type": "boisson",
            
        
    
        
        
            
                "description": "Cocktails classiques et creations maison",
            
        
    
        
        
            
                "sort_order": 1,
            
        
    
        
        
            
                "is_active": true,
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Boissons Fraiches",
            
        
    
        
        
            
                "category_type": "nourriture",
            
        
    
        
        
            
                "description": "Jus, sodas et eaux",
            
        
    
        
        
            
                "sort_order": 2,
            
        
    
        
        
            
                "is_active": true,
            
        
    
    },
    
];



const MenuItemsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Entrecote BBQ",
            
        
    
        
        
            
                "description": "Entrecote grillee, sauce BBQ signature, servie avec choix daccompagnement",
            
        
    
        
        
            
                "item_type": "nourriture",
            
        
    
        
        
            
                "price": 14500,
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                "is_available": true,
            
        
    
        
        
            
                "prep_time_minutes": 20,
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Frites Maison",
            
        
    
        
        
            
                "description": "Frites croustillantes, sel fin et epices douces",
            
        
    
        
        
            
                "item_type": "nourriture",
            
        
    
        
        
            
                "price": 2500,
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                "is_available": true,
            
        
    
        
        
            
                "prep_time_minutes": 8,
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Texas Sunset",
            
        
    
        
        
            
                "description": "Mocktail exotique, orange, ananas, grenadine",
            
        
    
        
        
            
                "item_type": "boisson",
            
        
    
        
        
            
                "price": 4500,
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                "is_available": true,
            
        
    
        
        
            
                "prep_time_minutes": 5,
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Eau Minerale 50cl",
            
        
    
        
        
            
                "description": "Eau minerale fraiche",
            
        
    
        
        
            
                "item_type": "boisson",
            
        
    
        
        
            
                "price": 1000,
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                "is_available": true,
            
        
    
        
        
            
                "prep_time_minutes": 1,
            
        
    
    },
    
];



const OrdersData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "order_channel": "a_distance",
            
        
    
        
        
            
                "fulfillment_type": "sur_place",
            
        
    
        
        
            
                "delivery_address": "NA",
            
        
    
        
        
            
                "delivery_latitude": 0,
            
        
    
        
        
            
                "delivery_longitude": 0,
            
        
    
        
        
            
                "status": "validee",
            
        
    
        
        
            
                "ordered_at": new Date('2026-03-02T12:35:00Z'),
            
        
    
        
        
            
                "requested_for": new Date('2026-03-02T12:50:00Z'),
            
        
    
        
        
            
                "customer_note": "Sans piment",
            
        
    
        
        
            
                "subtotal_amount": 17000,
            
        
    
        
        
            
                "total_amount": 17000,
            
        
    
        
        
            
                "is_paid": true,
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "order_channel": "sur_place_qr",
            
        
    
        
        
            
                "fulfillment_type": "sur_place",
            
        
    
        
        
            
                "delivery_address": "Cocody Angre 8e Tranche, immeuble A, apt 12",
            
        
    
        
        
            
                "delivery_latitude": 5.372,
            
        
    
        
        
            
                "delivery_longitude": -3.967,
            
        
    
        
        
            
                "status": "prete",
            
        
    
        
        
            
                "ordered_at": new Date('2026-03-03T19:10:00Z'),
            
        
    
        
        
            
                "requested_for": new Date('2026-03-03T20:00:00Z'),
            
        
    
        
        
            
                "customer_note": "Appeler a larrivee",
            
        
    
        
        
            
                "subtotal_amount": 9500,
            
        
    
        
        
            
                "total_amount": 9500,
            
        
    
        
        
            
                "is_paid": false,
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "order_channel": "sur_place_qr",
            
        
    
        
        
            
                "fulfillment_type": "sur_place",
            
        
    
        
        
            
                "delivery_address": "NA",
            
        
    
        
        
            
                "delivery_latitude": 0,
            
        
    
        
        
            
                "delivery_longitude": 0,
            
        
    
        
        
            
                "status": "en_preparation",
            
        
    
        
        
            
                "ordered_at": new Date('2026-03-04T13:05:00Z'),
            
        
    
        
        
            
                "requested_for": new Date('2026-03-04T13:20:00Z'),
            
        
    
        
        
            
                "customer_note": "Erreur de table",
            
        
    
        
        
            
                "subtotal_amount": 0,
            
        
    
        
        
            
                "total_amount": 0,
            
        
    
        
        
            
                "is_paid": false,
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "order_channel": "sur_place_qr",
            
        
    
        
        
            
                "fulfillment_type": "livraison",
            
        
    
        
        
            
                "delivery_address": "NA",
            
        
    
        
        
            
                "delivery_latitude": 0,
            
        
    
        
        
            
                "delivery_longitude": 0,
            
        
    
        
        
            
                "status": "annulee",
            
        
    
        
        
            
                "ordered_at": new Date('2026-03-05T18:40:00Z'),
            
        
    
        
        
            
                "requested_for": new Date('2026-03-05T19:10:00Z'),
            
        
    
        
        
            
                "customer_note": "Ajouter serviettes",
            
        
    
        
        
            
                "subtotal_amount": 5500,
            
        
    
        
        
            
                "total_amount": 5500,
            
        
    
        
        
            
                "is_paid": true,
            
        
    
    },
    
];



const OrderItemsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "quantity": 1,
            
        
    
        
        
            
                "unit_price": 14500,
            
        
    
        
        
            
                "line_total": 14500,
            
        
    
        
        
            
                "special_instructions": "Bien cuit",
            
        
    
        
        
            
                "item_status": "annule",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "quantity": 1,
            
        
    
        
        
            
                "unit_price": 2500,
            
        
    
        
        
            
                "line_total": 2500,
            
        
    
        
        
            
                "special_instructions": "Sans sel",
            
        
    
        
        
            
                "item_status": "en_preparation",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "quantity": 2,
            
        
    
        
        
            
                "unit_price": 4500,
            
        
    
        
        
            
                "line_total": 9000,
            
        
    
        
        
            
                "special_instructions": "Peu sucre",
            
        
    
        
        
            
                "item_status": "en_attente",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "quantity": 1,
            
        
    
        
        
            
                "unit_price": 1000,
            
        
    
        
        
            
                "line_total": 1000,
            
        
    
        
        
            
                "special_instructions": "Tres fraiche",
            
        
    
        
        
            
                "item_status": "en_attente",
            
        
    
    },
    
];



const ReservationsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "start_time": new Date('2026-03-06T19:00:00Z'),
            
        
    
        
        
            
                "end_time": new Date('2026-03-06T21:00:00Z'),
            
        
    
        
        
            
                "party_size": 4,
            
        
    
        
        
            
                "status": "annulee",
            
        
    
        
        
            
                "note": "Anniversaire, discret",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "start_time": new Date('2026-03-07T20:00:00Z'),
            
        
    
        
        
            
                "end_time": new Date('2026-03-07T22:00:00Z'),
            
        
    
        
        
            
                "party_size": 2,
            
        
    
        
        
            
                "status": "en_attente",
            
        
    
        
        
            
                "note": "Table calme si possible",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "start_time": new Date('2026-03-05T12:30:00Z'),
            
        
    
        
        
            
                "end_time": new Date('2026-03-05T13:30:00Z'),
            
        
    
        
        
            
                "party_size": 1,
            
        
    
        
        
            
                "status": "annulee",
            
        
    
        
        
            
                "note": "Changement de programme",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "start_time": new Date('2026-03-08T13:00:00Z'),
            
        
    
        
        
            
                "end_time": new Date('2026-03-08T15:00:00Z'),
            
        
    
        
        
            
                "party_size": 6,
            
        
    
        
        
            
                "status": "honoree",
            
        
    
        
        
            
                "note": "Vue exterieure",
            
        
    
    },
    
];



const PaymentsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "payment_method": "mastercard",
            
        
    
        
        
            
                "status": "initie",
            
        
    
        
        
            
                "amount": 17000,
            
        
    
        
        
            
                "paid_at": new Date('2026-03-02T13:10:00Z'),
            
        
    
        
        
            
                "provider_reference": "OM-20260302-00021",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "receipt_text": "Recu OM 17000 XOF Texas Grillz Plateau",
            
        
    
        
        
            
                "points_earned": 170,
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "payment_method": "orange_money",
            
        
    
        
        
            
                "status": "rembourse",
            
        
    
        
        
            
                "amount": 5500,
            
        
    
        
        
            
                "paid_at": new Date('2026-03-05T19:12:00Z'),
            
        
    
        
        
            
                "provider_reference": "CASH-20260305-00102",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "receipt_text": "Recu espece 5500 XOF Texas Grillz Bassam",
            
        
    
        
        
            
                "points_earned": 55,
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "payment_method": "mtn_mobile_money",
            
        
    
        
        
            
                "status": "reussi",
            
        
    
        
        
            
                "amount": 14500,
            
        
    
        
        
            
                "paid_at": new Date('2026-03-01T21:05:00Z'),
            
        
    
        
        
            
                "provider_reference": "VISA-20260301-00991",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "receipt_text": "Recu carte 14500 XOF Texas Grillz Plateau",
            
        
    
        
        
            
                "points_earned": 145,
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "payment_method": "visa",
            
        
    
        
        
            
                "status": "initie",
            
        
    
        
        
            
                "amount": 9500,
            
        
    
        
        
            
                "paid_at": new Date('2026-03-03T19:12:00Z'),
            
        
    
        
        
            
                "provider_reference": "WAVE-20260303-00440",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "receipt_text": "Paiement en cours Wave 9500 XOF",
            
        
    
        
        
            
                "points_earned": 0,
            
        
    
    },
    
];



const LoyaltyAccountsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "points_balance": 370,
            
        
    
        
        
            
                "last_activity_at": new Date('2026-03-05T19:12:00Z'),
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "points_balance": 120,
            
        
    
        
        
            
                "last_activity_at": new Date('2026-02-28T20:00:00Z'),
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "points_balance": 45,
            
        
    
        
        
            
                "last_activity_at": new Date('2026-03-01T14:25:00Z'),
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "points_balance": 210,
            
        
    
        
        
            
                "last_activity_at": new Date('2026-03-02T18:40:00Z'),
            
        
    
    },
    
];



const LoyaltyRulesData = [
    
    {
    
        
        
            
                "name": "Points Standard",
            
        
    
        
        
            
                "reward_type": "reduction",
            
        
    
        
        
            
                "points_to_value_rate": 0.01,
            
        
    
        
        
            
                "max_discount_amount": 5000,
            
        
    
        
        
            
                "starts_at": new Date('2026-01-01T00:00:00Z'),
            
        
    
        
        
            
                "ends_at": new Date('2026-12-31T23:59:59Z'),
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                "description": "1 point vaut 1 pourcent de remise sur un plafond defini",
            
        
    
    },
    
    {
    
        
        
            
                "name": "Ticket Tombola Weekend",
            
        
    
        
        
            
                "reward_type": "ticket_tombola",
            
        
    
        
        
            
                "points_to_value_rate": 1,
            
        
    
        
        
            
                "max_discount_amount": 0,
            
        
    
        
        
            
                "starts_at": new Date('2026-03-01T00:00:00Z'),
            
        
    
        
        
            
                "ends_at": new Date('2026-06-30T23:59:59Z'),
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                "description": "Chaque 300 points donne un ticket de tombola weekend",
            
        
    
    },
    
    {
    
        
        
            
                "name": "Happy Hour Bonus",
            
        
    
        
        
            
                "reward_type": "reduction",
            
        
    
        
        
            
                "points_to_value_rate": 0.015,
            
        
    
        
        
            
                "max_discount_amount": 7000,
            
        
    
        
        
            
                "starts_at": new Date('2026-03-01T00:00:00Z'),
            
        
    
        
        
            
                "ends_at": new Date('2026-04-30T23:59:59Z'),
            
        
    
        
        
            
                "is_active": false,
            
        
    
        
        
            
                "description": "Bonus temporaire sur les points en heures creuses",
            
        
    
    },
    
    {
    
        
        
            
                "name": "Anniversaire Client",
            
        
    
        
        
            
                "reward_type": "ticket_tombola",
            
        
    
        
        
            
                "points_to_value_rate": 0.02,
            
        
    
        
        
            
                "max_discount_amount": 10000,
            
        
    
        
        
            
                "starts_at": new Date('2026-01-01T00:00:00Z'),
            
        
    
        
        
            
                "ends_at": new Date('2026-12-31T23:59:59Z'),
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                "description": "Remise renforcée pour clients le mois anniversaire",
            
        
    
    },
    
];



const LoyaltyTransactionsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "transaction_type": "ajustement",
            
        
    
        
        
            
                "points": 170,
            
        
    
        
        
            
                "transaction_time": new Date('2026-03-02T13:10:05Z'),
            
        
    
        
        
            
                "description": "Points sur paiement Orange Money",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "transaction_type": "gain",
            
        
    
        
        
            
                "points": 145,
            
        
    
        
        
            
                "transaction_time": new Date('2026-03-01T21:05:10Z'),
            
        
    
        
        
            
                "description": "Points sur paiement carte",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "transaction_type": "ajustement",
            
        
    
        
        
            
                "points": 55,
            
        
    
        
        
            
                "transaction_time": new Date('2026-03-05T19:12:05Z'),
            
        
    
        
        
            
                "description": "Points sur paiement espece",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "transaction_type": "ajustement",
            
        
    
        
        
            
                "points": 120,
            
        
    
        
        
            
                "transaction_time": new Date('2026-03-02T18:40:00Z'),
            
        
    
        
        
            
                "description": "Points commande diner",
            
        
    
    },
    
];



const CustomerReviewsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "rating": 5,
            
        
    
        
        
            
                "comment": "Service impeccable et viande excellente",
            
        
    
        
        
            
                "reviewed_at": new Date('2026-03-01T21:30:00Z'),
            
        
    
        
        
            
                "is_published": true,
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "rating": 4,
            
        
    
        
        
            
                "comment": "Bon repas, attente un peu longue",
            
        
    
        
        
            
                "reviewed_at": new Date('2026-03-02T14:10:00Z'),
            
        
    
        
        
            
                "is_published": true,
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "rating": 3,
            
        
    
        
        
            
                "comment": "Livraison en cours, suivi perfectible",
            
        
    
        
        
            
                "reviewed_at": new Date('2026-03-03T20:30:00Z'),
            
        
    
        
        
            
                "is_published": true,
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "rating": 5,
            
        
    
        
        
            
                "comment": "Emballage soigné et dessert top",
            
        
    
        
        
            
                "reviewed_at": new Date('2026-03-05T19:40:00Z'),
            
        
    
        
        
            
                "is_published": true,
            
        
    
    },
    
];



const NotificationEventsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "event_type": "avis",
            
        
    
        
        
            
                "audience": "personnel",
            
        
    
        
        
            
                "order_nature": "boisson",
            
        
    
        
        
            
                "quantity_total": 2,
            
        
    
        
        
            
                "title": "Nouvelle commande sur place",
            
        
    
        
        
            
                "message": "Table P-01 a valide une commande",
            
        
    
        
        
            
                "event_time": new Date('2026-03-02T12:35:10Z'),
            
        
    
        
        
            
                "is_read": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "event_type": "paiement",
            
        
    
        
        
            
                "audience": "utilisateur_cible",
            
        
    
        
        
            
                "order_nature": "mixte",
            
        
    
        
        
            
                "quantity_total": 0,
            
        
    
        
        
            
                "title": "Paiement confirme",
            
        
    
        
        
            
                "message": "Paiement OM-20260302-00021 reussi",
            
        
    
        
        
            
                "event_time": new Date('2026-03-02T13:10:10Z'),
            
        
    
        
        
            
                "is_read": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "event_type": "geofence",
            
        
    
        
        
            
                "audience": "client",
            
        
    
        
        
            
                "order_nature": "boisson",
            
        
    
        
        
            
                "quantity_total": 0,
            
        
    
        
        
            
                "title": "Alerte distance personnel",
            
        
    
        
        
            
                "message": "Personnel hors zone a 45.2 metres du restaurant Plateau",
            
        
    
        
        
            
                "event_time": new Date('2026-03-02T10:17:10Z'),
            
        
    
        
        
            
                "is_read": false,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "event_type": "paiement",
            
        
    
        
        
            
                "audience": "admins",
            
        
    
        
        
            
                "order_nature": "nourriture",
            
        
    
        
        
            
                "quantity_total": 0,
            
        
    
        
        
            
                "title": "Seuil stock atteint",
            
        
    
        
        
            
                "message": "Stock faible sur sirop grenadine au bar",
            
        
    
        
        
            
                "event_time": new Date('2026-03-06T18:00:00Z'),
            
        
    
        
        
            
                "is_read": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const StockLocationsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "location_type": "cuisine",
            
        
    
        
        
            
                "name": "Cuisine Plateau",
            
        
    
        
        
            
                "is_active": true,
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "location_type": "cuisine",
            
        
    
        
        
            
                "name": "Bar Plateau",
            
        
    
        
        
            
                "is_active": true,
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "location_type": "cuisine",
            
        
    
        
        
            
                "name": "Entretien Plateau",
            
        
    
        
        
            
                "is_active": true,
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "location_type": "bar",
            
        
    
        
        
            
                "name": "Cuisine Cocody",
            
        
    
        
        
            
                "is_active": true,
            
        
    
    },
    
];



const StockItemsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Entrecote boeuf",
            
        
    
        
        
            
                "category": "autre",
            
        
    
        
        
            
                "unit": "kg",
            
        
    
        
        
            
                "quantity_on_hand": 18.5,
            
        
    
        
        
            
                "reorder_threshold": 8,
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                "notes": "Fournisseur local, livraison mardi",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Pommes de terre",
            
        
    
        
        
            
                "category": "autre",
            
        
    
        
        
            
                "unit": "kg",
            
        
    
        
        
            
                "quantity_on_hand": 42,
            
        
    
        
        
            
                "reorder_threshold": 15,
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                "notes": "Pour frites maison",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Sirop grenadine",
            
        
    
        
        
            
                "category": "nourriture",
            
        
    
        
        
            
                "unit": "bouteille",
            
        
    
        
        
            
                "quantity_on_hand": 3,
            
        
    
        
        
            
                "reorder_threshold": 5,
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                "notes": "A commander avant weekend",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Detergent sol",
            
        
    
        
        
            
                "category": "boisson",
            
        
    
        
        
            
                "unit": "bidon",
            
        
    
        
        
            
                "quantity_on_hand": 6,
            
        
    
        
        
            
                "reorder_threshold": 4,
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                "notes": "Stock mensuel",
            
        
    
    },
    
];



const StockMovementsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "movement_type": "entree",
            
        
    
        
        
            
                "quantity": 2.5,
            
        
    
        
        
            
                "movement_time": new Date('2026-03-02T13:00:00Z'),
            
        
    
        
        
            
                "reason": "Preparation commandes midi",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "movement_type": "entree",
            
        
    
        
        
            
                "quantity": 5,
            
        
    
        
        
            
                "movement_time": new Date('2026-03-02T13:05:00Z'),
            
        
    
        
        
            
                "reason": "Service frites midi",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "movement_type": "entree",
            
        
    
        
        
            
                "quantity": 1,
            
        
    
        
        
            
                "movement_time": new Date('2026-03-02T20:10:00Z'),
            
        
    
        
        
            
                "reason": "Cocktails service soir",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "movement_type": "ajustement",
            
        
    
        
        
            
                "quantity": 4,
            
        
    
        
        
            
                "movement_time": new Date('2026-03-01T09:20:00Z'),
            
        
    
        
        
            
                "reason": "Reapprovisionnement hebdo",
            
        
    
    },
    
];



const InvoicesData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "invoice_number": "INV-PLT-20260302-0021",
            
        
    
        
        
            
                "status": "remboursee",
            
        
    
        
        
            
                "subtotal_amount": 17000,
            
        
    
        
        
            
                "total_amount": 17000,
            
        
    
        
        
            
                "issued_at": new Date('2026-03-02T12:35:30Z'),
            
        
    
        
        
            
                "closed_at": new Date('2026-03-02T13:10:10Z'),
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "invoice_number": "INV-PLT-20260301-0991",
            
        
    
        
        
            
                "status": "remboursee",
            
        
    
        
        
            
                "subtotal_amount": 14500,
            
        
    
        
        
            
                "total_amount": 14500,
            
        
    
        
        
            
                "issued_at": new Date('2026-03-01T20:10:30Z'),
            
        
    
        
        
            
                "closed_at": new Date('2026-03-01T21:05:10Z'),
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "invoice_number": "INV-BSM-20260305-0102",
            
        
    
        
        
            
                "status": "annulee",
            
        
    
        
        
            
                "subtotal_amount": 5500,
            
        
    
        
        
            
                "total_amount": 5500,
            
        
    
        
        
            
                "issued_at": new Date('2026-03-05T18:40:30Z'),
            
        
    
        
        
            
                "closed_at": new Date('2026-03-05T19:12:05Z'),
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "invoice_number": "INV-CCD-20260303-0440",
            
        
    
        
        
            
                "status": "ouverte",
            
        
    
        
        
            
                "subtotal_amount": 9500,
            
        
    
        
        
            
                "total_amount": 9500,
            
        
    
        
        
            
                "issued_at": new Date('2026-03-03T19:10:30Z'),
            
        
    
        
        
            
                "closed_at": new Date('2026-03-03T19:10:30Z'),
            
        
    
    },
    
];



const AuditLogsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "action": "logout",
            
        
    
        
        
            
                "entity_name": "restaurants",
            
        
    
        
        
            
                "entity_ref": "Texas Grillz Plateau",
            
        
    
        
        
            
                "action_time": new Date('2026-02-10T09:00:00Z'),
            
        
    
        
        
            
                "details": "Creation du restaurant Plateau et parametres geofence",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "action": "login",
            
        
    
        
        
            
                "entity_name": "account_approvals",
            
        
    
        
        
            
                "entity_ref": "Traore Awa",
            
        
    
        
        
            
                "action_time": new Date('2026-02-20T16:00:00Z'),
            
        
    
        
        
            
                "details": "Approbation compte superviseur",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "action": "reject",
            
        
    
        
        
            
                "entity_name": "work_schedules",
            
        
    
        
        
            
                "entity_ref": "Planning Semaine 10 - Plateau",
            
        
    
        
        
            
                "action_time": new Date('2026-03-01T17:45:00Z'),
            
        
    
        
        
            
                "details": "Publication planning semaine 10",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "action": "other",
            
        
    
        
        
            
                "entity_name": "payments",
            
        
    
        
        
            
                "entity_ref": "OM-20260302-00021",
            
        
    
        
        
            
                "action_time": new Date('2026-03-02T13:10:10Z'),
            
        
    
        
        
            
                "details": "Paiement confirme et recu genere",
            
        
    
    },
    
];




    
    
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            // Similar logic for "relation_many"
        
    

    
    
    
    
    
        
            
            async function associateAccountApprovalWithCandidate_user() {
            
                const relatedCandidate_user0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const AccountApproval0 = await AccountApprovals.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (AccountApproval0?.setCandidate_user)
                {
                    await
                    AccountApproval0.
                    setCandidate_user(relatedCandidate_user0);
                }
            
                const relatedCandidate_user1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const AccountApproval1 = await AccountApprovals.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (AccountApproval1?.setCandidate_user)
                {
                    await
                    AccountApproval1.
                    setCandidate_user(relatedCandidate_user1);
                }
            
                const relatedCandidate_user2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const AccountApproval2 = await AccountApprovals.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (AccountApproval2?.setCandidate_user)
                {
                    await
                    AccountApproval2.
                    setCandidate_user(relatedCandidate_user2);
                }
            
                const relatedCandidate_user3 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const AccountApproval3 = await AccountApprovals.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (AccountApproval3?.setCandidate_user)
                {
                    await
                    AccountApproval3.
                    setCandidate_user(relatedCandidate_user3);
                }
            
        }
        
    
        
            
            async function associateAccountApprovalWithRequested_by_user() {
            
                const relatedRequested_by_user0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const AccountApproval0 = await AccountApprovals.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (AccountApproval0?.setRequested_by_user)
                {
                    await
                    AccountApproval0.
                    setRequested_by_user(relatedRequested_by_user0);
                }
            
                const relatedRequested_by_user1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const AccountApproval1 = await AccountApprovals.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (AccountApproval1?.setRequested_by_user)
                {
                    await
                    AccountApproval1.
                    setRequested_by_user(relatedRequested_by_user1);
                }
            
                const relatedRequested_by_user2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const AccountApproval2 = await AccountApprovals.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (AccountApproval2?.setRequested_by_user)
                {
                    await
                    AccountApproval2.
                    setRequested_by_user(relatedRequested_by_user2);
                }
            
                const relatedRequested_by_user3 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const AccountApproval3 = await AccountApprovals.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (AccountApproval3?.setRequested_by_user)
                {
                    await
                    AccountApproval3.
                    setRequested_by_user(relatedRequested_by_user3);
                }
            
        }
        
    
        
            
            async function associateAccountApprovalWithReviewed_by_user() {
            
                const relatedReviewed_by_user0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const AccountApproval0 = await AccountApprovals.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (AccountApproval0?.setReviewed_by_user)
                {
                    await
                    AccountApproval0.
                    setReviewed_by_user(relatedReviewed_by_user0);
                }
            
                const relatedReviewed_by_user1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const AccountApproval1 = await AccountApprovals.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (AccountApproval1?.setReviewed_by_user)
                {
                    await
                    AccountApproval1.
                    setReviewed_by_user(relatedReviewed_by_user1);
                }
            
                const relatedReviewed_by_user2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const AccountApproval2 = await AccountApprovals.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (AccountApproval2?.setReviewed_by_user)
                {
                    await
                    AccountApproval2.
                    setReviewed_by_user(relatedReviewed_by_user2);
                }
            
                const relatedReviewed_by_user3 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const AccountApproval3 = await AccountApprovals.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (AccountApproval3?.setReviewed_by_user)
                {
                    await
                    AccountApproval3.
                    setReviewed_by_user(relatedReviewed_by_user3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    

    
    
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    

    
    
    
        
            
            async function associateRestaurantTableWithRestaurant() {
            
                const relatedRestaurant0 = await Restaurants.findOne({
                    offset: Math.floor(Math.random() * (await Restaurants.count())),
                });
                const RestaurantTable0 = await RestaurantTables.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (RestaurantTable0?.setRestaurant)
                {
                    await
                    RestaurantTable0.
                    setRestaurant(relatedRestaurant0);
                }
            
                const relatedRestaurant1 = await Restaurants.findOne({
                    offset: Math.floor(Math.random() * (await Restaurants.count())),
                });
                const RestaurantTable1 = await RestaurantTables.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (RestaurantTable1?.setRestaurant)
                {
                    await
                    RestaurantTable1.
                    setRestaurant(relatedRestaurant1);
                }
            
                const relatedRestaurant2 = await Restaurants.findOne({
                    offset: Math.floor(Math.random() * (await Restaurants.count())),
                });
                const RestaurantTable2 = await RestaurantTables.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (RestaurantTable2?.setRestaurant)
                {
                    await
                    RestaurantTable2.
                    setRestaurant(relatedRestaurant2);
                }
            
                const relatedRestaurant3 = await Restaurants.findOne({
                    offset: Math.floor(Math.random() * (await Restaurants.count())),
                });
                const RestaurantTable3 = await RestaurantTables.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (RestaurantTable3?.setRestaurant)
                {
                    await
                    RestaurantTable3.
                    setRestaurant(relatedRestaurant3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    

    
    
    
        
            
            async function associateWorkScheduleWithRestaurant() {
            
                const relatedRestaurant0 = await Restaurants.findOne({
                    offset: Math.floor(Math.random() * (await Restaurants.count())),
                });
                const WorkSchedule0 = await WorkSchedules.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (WorkSchedule0?.setRestaurant)
                {
                    await
                    WorkSchedule0.
                    setRestaurant(relatedRestaurant0);
                }
            
                const relatedRestaurant1 = await Restaurants.findOne({
                    offset: Math.floor(Math.random() * (await Restaurants.count())),
                });
                const WorkSchedule1 = await WorkSchedules.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (WorkSchedule1?.setRestaurant)
                {
                    await
                    WorkSchedule1.
                    setRestaurant(relatedRestaurant1);
                }
            
                const relatedRestaurant2 = await Restaurants.findOne({
                    offset: Math.floor(Math.random() * (await Restaurants.count())),
                });
                const WorkSchedule2 = await WorkSchedules.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (WorkSchedule2?.setRestaurant)
                {
                    await
                    WorkSchedule2.
                    setRestaurant(relatedRestaurant2);
                }
            
                const relatedRestaurant3 = await Restaurants.findOne({
                    offset: Math.floor(Math.random() * (await Restaurants.count())),
                });
                const WorkSchedule3 = await WorkSchedules.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (WorkSchedule3?.setRestaurant)
                {
                    await
                    WorkSchedule3.
                    setRestaurant(relatedRestaurant3);
                }
            
        }
        
    
        
            
            async function associateWorkScheduleWithCreated_by_user() {
            
                const relatedCreated_by_user0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const WorkSchedule0 = await WorkSchedules.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (WorkSchedule0?.setCreated_by_user)
                {
                    await
                    WorkSchedule0.
                    setCreated_by_user(relatedCreated_by_user0);
                }
            
                const relatedCreated_by_user1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const WorkSchedule1 = await WorkSchedules.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (WorkSchedule1?.setCreated_by_user)
                {
                    await
                    WorkSchedule1.
                    setCreated_by_user(relatedCreated_by_user1);
                }
            
                const relatedCreated_by_user2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const WorkSchedule2 = await WorkSchedules.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (WorkSchedule2?.setCreated_by_user)
                {
                    await
                    WorkSchedule2.
                    setCreated_by_user(relatedCreated_by_user2);
                }
            
                const relatedCreated_by_user3 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const WorkSchedule3 = await WorkSchedules.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (WorkSchedule3?.setCreated_by_user)
                {
                    await
                    WorkSchedule3.
                    setCreated_by_user(relatedCreated_by_user3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    

    
    
    
        
            
            async function associateWorkShiftWithWork_schedule() {
            
                const relatedWork_schedule0 = await WorkSchedules.findOne({
                    offset: Math.floor(Math.random() * (await WorkSchedules.count())),
                });
                const WorkShift0 = await WorkShifts.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (WorkShift0?.setWork_schedule)
                {
                    await
                    WorkShift0.
                    setWork_schedule(relatedWork_schedule0);
                }
            
                const relatedWork_schedule1 = await WorkSchedules.findOne({
                    offset: Math.floor(Math.random() * (await WorkSchedules.count())),
                });
                const WorkShift1 = await WorkShifts.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (WorkShift1?.setWork_schedule)
                {
                    await
                    WorkShift1.
                    setWork_schedule(relatedWork_schedule1);
                }
            
                const relatedWork_schedule2 = await WorkSchedules.findOne({
                    offset: Math.floor(Math.random() * (await WorkSchedules.count())),
                });
                const WorkShift2 = await WorkShifts.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (WorkShift2?.setWork_schedule)
                {
                    await
                    WorkShift2.
                    setWork_schedule(relatedWork_schedule2);
                }
            
                const relatedWork_schedule3 = await WorkSchedules.findOne({
                    offset: Math.floor(Math.random() * (await WorkSchedules.count())),
                });
                const WorkShift3 = await WorkShifts.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (WorkShift3?.setWork_schedule)
                {
                    await
                    WorkShift3.
                    setWork_schedule(relatedWork_schedule3);
                }
            
        }
        
    
        
            
            async function associateWorkShiftWithStaff_user() {
            
                const relatedStaff_user0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const WorkShift0 = await WorkShifts.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (WorkShift0?.setStaff_user)
                {
                    await
                    WorkShift0.
                    setStaff_user(relatedStaff_user0);
                }
            
                const relatedStaff_user1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const WorkShift1 = await WorkShifts.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (WorkShift1?.setStaff_user)
                {
                    await
                    WorkShift1.
                    setStaff_user(relatedStaff_user1);
                }
            
                const relatedStaff_user2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const WorkShift2 = await WorkShifts.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (WorkShift2?.setStaff_user)
                {
                    await
                    WorkShift2.
                    setStaff_user(relatedStaff_user2);
                }
            
                const relatedStaff_user3 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const WorkShift3 = await WorkShifts.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (WorkShift3?.setStaff_user)
                {
                    await
                    WorkShift3.
                    setStaff_user(relatedStaff_user3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    

    
    
    
        
            
            async function associateAttendanceEventWithRestaurant() {
            
                const relatedRestaurant0 = await Restaurants.findOne({
                    offset: Math.floor(Math.random() * (await Restaurants.count())),
                });
                const AttendanceEvent0 = await AttendanceEvents.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (AttendanceEvent0?.setRestaurant)
                {
                    await
                    AttendanceEvent0.
                    setRestaurant(relatedRestaurant0);
                }
            
                const relatedRestaurant1 = await Restaurants.findOne({
                    offset: Math.floor(Math.random() * (await Restaurants.count())),
                });
                const AttendanceEvent1 = await AttendanceEvents.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (AttendanceEvent1?.setRestaurant)
                {
                    await
                    AttendanceEvent1.
                    setRestaurant(relatedRestaurant1);
                }
            
                const relatedRestaurant2 = await Restaurants.findOne({
                    offset: Math.floor(Math.random() * (await Restaurants.count())),
                });
                const AttendanceEvent2 = await AttendanceEvents.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (AttendanceEvent2?.setRestaurant)
                {
                    await
                    AttendanceEvent2.
                    setRestaurant(relatedRestaurant2);
                }
            
                const relatedRestaurant3 = await Restaurants.findOne({
                    offset: Math.floor(Math.random() * (await Restaurants.count())),
                });
                const AttendanceEvent3 = await AttendanceEvents.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (AttendanceEvent3?.setRestaurant)
                {
                    await
                    AttendanceEvent3.
                    setRestaurant(relatedRestaurant3);
                }
            
        }
        
    
        
            
            async function associateAttendanceEventWithStaff_user() {
            
                const relatedStaff_user0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const AttendanceEvent0 = await AttendanceEvents.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (AttendanceEvent0?.setStaff_user)
                {
                    await
                    AttendanceEvent0.
                    setStaff_user(relatedStaff_user0);
                }
            
                const relatedStaff_user1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const AttendanceEvent1 = await AttendanceEvents.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (AttendanceEvent1?.setStaff_user)
                {
                    await
                    AttendanceEvent1.
                    setStaff_user(relatedStaff_user1);
                }
            
                const relatedStaff_user2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const AttendanceEvent2 = await AttendanceEvents.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (AttendanceEvent2?.setStaff_user)
                {
                    await
                    AttendanceEvent2.
                    setStaff_user(relatedStaff_user2);
                }
            
                const relatedStaff_user3 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const AttendanceEvent3 = await AttendanceEvents.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (AttendanceEvent3?.setStaff_user)
                {
                    await
                    AttendanceEvent3.
                    setStaff_user(relatedStaff_user3);
                }
            
        }
        
    
        
            
            async function associateAttendanceEventWithWork_shift() {
            
                const relatedWork_shift0 = await WorkShifts.findOne({
                    offset: Math.floor(Math.random() * (await WorkShifts.count())),
                });
                const AttendanceEvent0 = await AttendanceEvents.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (AttendanceEvent0?.setWork_shift)
                {
                    await
                    AttendanceEvent0.
                    setWork_shift(relatedWork_shift0);
                }
            
                const relatedWork_shift1 = await WorkShifts.findOne({
                    offset: Math.floor(Math.random() * (await WorkShifts.count())),
                });
                const AttendanceEvent1 = await AttendanceEvents.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (AttendanceEvent1?.setWork_shift)
                {
                    await
                    AttendanceEvent1.
                    setWork_shift(relatedWork_shift1);
                }
            
                const relatedWork_shift2 = await WorkShifts.findOne({
                    offset: Math.floor(Math.random() * (await WorkShifts.count())),
                });
                const AttendanceEvent2 = await AttendanceEvents.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (AttendanceEvent2?.setWork_shift)
                {
                    await
                    AttendanceEvent2.
                    setWork_shift(relatedWork_shift2);
                }
            
                const relatedWork_shift3 = await WorkShifts.findOne({
                    offset: Math.floor(Math.random() * (await WorkShifts.count())),
                });
                const AttendanceEvent3 = await AttendanceEvents.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (AttendanceEvent3?.setWork_shift)
                {
                    await
                    AttendanceEvent3.
                    setWork_shift(relatedWork_shift3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    

    
    
    
        
            
            async function associateGeofenceAlertWithRestaurant() {
            
                const relatedRestaurant0 = await Restaurants.findOne({
                    offset: Math.floor(Math.random() * (await Restaurants.count())),
                });
                const GeofenceAlert0 = await GeofenceAlerts.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (GeofenceAlert0?.setRestaurant)
                {
                    await
                    GeofenceAlert0.
                    setRestaurant(relatedRestaurant0);
                }
            
                const relatedRestaurant1 = await Restaurants.findOne({
                    offset: Math.floor(Math.random() * (await Restaurants.count())),
                });
                const GeofenceAlert1 = await GeofenceAlerts.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (GeofenceAlert1?.setRestaurant)
                {
                    await
                    GeofenceAlert1.
                    setRestaurant(relatedRestaurant1);
                }
            
                const relatedRestaurant2 = await Restaurants.findOne({
                    offset: Math.floor(Math.random() * (await Restaurants.count())),
                });
                const GeofenceAlert2 = await GeofenceAlerts.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (GeofenceAlert2?.setRestaurant)
                {
                    await
                    GeofenceAlert2.
                    setRestaurant(relatedRestaurant2);
                }
            
                const relatedRestaurant3 = await Restaurants.findOne({
                    offset: Math.floor(Math.random() * (await Restaurants.count())),
                });
                const GeofenceAlert3 = await GeofenceAlerts.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (GeofenceAlert3?.setRestaurant)
                {
                    await
                    GeofenceAlert3.
                    setRestaurant(relatedRestaurant3);
                }
            
        }
        
    
        
            
            async function associateGeofenceAlertWithStaff_user() {
            
                const relatedStaff_user0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const GeofenceAlert0 = await GeofenceAlerts.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (GeofenceAlert0?.setStaff_user)
                {
                    await
                    GeofenceAlert0.
                    setStaff_user(relatedStaff_user0);
                }
            
                const relatedStaff_user1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const GeofenceAlert1 = await GeofenceAlerts.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (GeofenceAlert1?.setStaff_user)
                {
                    await
                    GeofenceAlert1.
                    setStaff_user(relatedStaff_user1);
                }
            
                const relatedStaff_user2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const GeofenceAlert2 = await GeofenceAlerts.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (GeofenceAlert2?.setStaff_user)
                {
                    await
                    GeofenceAlert2.
                    setStaff_user(relatedStaff_user2);
                }
            
                const relatedStaff_user3 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const GeofenceAlert3 = await GeofenceAlerts.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (GeofenceAlert3?.setStaff_user)
                {
                    await
                    GeofenceAlert3.
                    setStaff_user(relatedStaff_user3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateGeofenceAlertWithAcknowledged_by_user() {
            
                const relatedAcknowledged_by_user0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const GeofenceAlert0 = await GeofenceAlerts.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (GeofenceAlert0?.setAcknowledged_by_user)
                {
                    await
                    GeofenceAlert0.
                    setAcknowledged_by_user(relatedAcknowledged_by_user0);
                }
            
                const relatedAcknowledged_by_user1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const GeofenceAlert1 = await GeofenceAlerts.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (GeofenceAlert1?.setAcknowledged_by_user)
                {
                    await
                    GeofenceAlert1.
                    setAcknowledged_by_user(relatedAcknowledged_by_user1);
                }
            
                const relatedAcknowledged_by_user2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const GeofenceAlert2 = await GeofenceAlerts.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (GeofenceAlert2?.setAcknowledged_by_user)
                {
                    await
                    GeofenceAlert2.
                    setAcknowledged_by_user(relatedAcknowledged_by_user2);
                }
            
                const relatedAcknowledged_by_user3 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const GeofenceAlert3 = await GeofenceAlerts.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (GeofenceAlert3?.setAcknowledged_by_user)
                {
                    await
                    GeofenceAlert3.
                    setAcknowledged_by_user(relatedAcknowledged_by_user3);
                }
            
        }
        
    

    
    
    
        
            
            async function associateMenuCategoryWithRestaurant() {
            
                const relatedRestaurant0 = await Restaurants.findOne({
                    offset: Math.floor(Math.random() * (await Restaurants.count())),
                });
                const MenuCategory0 = await MenuCategories.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (MenuCategory0?.setRestaurant)
                {
                    await
                    MenuCategory0.
                    setRestaurant(relatedRestaurant0);
                }
            
                const relatedRestaurant1 = await Restaurants.findOne({
                    offset: Math.floor(Math.random() * (await Restaurants.count())),
                });
                const MenuCategory1 = await MenuCategories.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (MenuCategory1?.setRestaurant)
                {
                    await
                    MenuCategory1.
                    setRestaurant(relatedRestaurant1);
                }
            
                const relatedRestaurant2 = await Restaurants.findOne({
                    offset: Math.floor(Math.random() * (await Restaurants.count())),
                });
                const MenuCategory2 = await MenuCategories.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (MenuCategory2?.setRestaurant)
                {
                    await
                    MenuCategory2.
                    setRestaurant(relatedRestaurant2);
                }
            
                const relatedRestaurant3 = await Restaurants.findOne({
                    offset: Math.floor(Math.random() * (await Restaurants.count())),
                });
                const MenuCategory3 = await MenuCategories.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (MenuCategory3?.setRestaurant)
                {
                    await
                    MenuCategory3.
                    setRestaurant(relatedRestaurant3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    

    
    
    
        
            
            async function associateMenuItemWithRestaurant() {
            
                const relatedRestaurant0 = await Restaurants.findOne({
                    offset: Math.floor(Math.random() * (await Restaurants.count())),
                });
                const MenuItem0 = await MenuItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (MenuItem0?.setRestaurant)
                {
                    await
                    MenuItem0.
                    setRestaurant(relatedRestaurant0);
                }
            
                const relatedRestaurant1 = await Restaurants.findOne({
                    offset: Math.floor(Math.random() * (await Restaurants.count())),
                });
                const MenuItem1 = await MenuItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (MenuItem1?.setRestaurant)
                {
                    await
                    MenuItem1.
                    setRestaurant(relatedRestaurant1);
                }
            
                const relatedRestaurant2 = await Restaurants.findOne({
                    offset: Math.floor(Math.random() * (await Restaurants.count())),
                });
                const MenuItem2 = await MenuItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (MenuItem2?.setRestaurant)
                {
                    await
                    MenuItem2.
                    setRestaurant(relatedRestaurant2);
                }
            
                const relatedRestaurant3 = await Restaurants.findOne({
                    offset: Math.floor(Math.random() * (await Restaurants.count())),
                });
                const MenuItem3 = await MenuItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (MenuItem3?.setRestaurant)
                {
                    await
                    MenuItem3.
                    setRestaurant(relatedRestaurant3);
                }
            
        }
        
    
        
            
            async function associateMenuItemWithMenu_category() {
            
                const relatedMenu_category0 = await MenuCategories.findOne({
                    offset: Math.floor(Math.random() * (await MenuCategories.count())),
                });
                const MenuItem0 = await MenuItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (MenuItem0?.setMenu_category)
                {
                    await
                    MenuItem0.
                    setMenu_category(relatedMenu_category0);
                }
            
                const relatedMenu_category1 = await MenuCategories.findOne({
                    offset: Math.floor(Math.random() * (await MenuCategories.count())),
                });
                const MenuItem1 = await MenuItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (MenuItem1?.setMenu_category)
                {
                    await
                    MenuItem1.
                    setMenu_category(relatedMenu_category1);
                }
            
                const relatedMenu_category2 = await MenuCategories.findOne({
                    offset: Math.floor(Math.random() * (await MenuCategories.count())),
                });
                const MenuItem2 = await MenuItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (MenuItem2?.setMenu_category)
                {
                    await
                    MenuItem2.
                    setMenu_category(relatedMenu_category2);
                }
            
                const relatedMenu_category3 = await MenuCategories.findOne({
                    offset: Math.floor(Math.random() * (await MenuCategories.count())),
                });
                const MenuItem3 = await MenuItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (MenuItem3?.setMenu_category)
                {
                    await
                    MenuItem3.
                    setMenu_category(relatedMenu_category3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    

    
    
    
        
            
            async function associateOrderWithRestaurant() {
            
                const relatedRestaurant0 = await Restaurants.findOne({
                    offset: Math.floor(Math.random() * (await Restaurants.count())),
                });
                const Order0 = await Orders.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Order0?.setRestaurant)
                {
                    await
                    Order0.
                    setRestaurant(relatedRestaurant0);
                }
            
                const relatedRestaurant1 = await Restaurants.findOne({
                    offset: Math.floor(Math.random() * (await Restaurants.count())),
                });
                const Order1 = await Orders.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Order1?.setRestaurant)
                {
                    await
                    Order1.
                    setRestaurant(relatedRestaurant1);
                }
            
                const relatedRestaurant2 = await Restaurants.findOne({
                    offset: Math.floor(Math.random() * (await Restaurants.count())),
                });
                const Order2 = await Orders.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Order2?.setRestaurant)
                {
                    await
                    Order2.
                    setRestaurant(relatedRestaurant2);
                }
            
                const relatedRestaurant3 = await Restaurants.findOne({
                    offset: Math.floor(Math.random() * (await Restaurants.count())),
                });
                const Order3 = await Orders.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Order3?.setRestaurant)
                {
                    await
                    Order3.
                    setRestaurant(relatedRestaurant3);
                }
            
        }
        
    
        
            
            async function associateOrderWithClient_user() {
            
                const relatedClient_user0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Order0 = await Orders.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Order0?.setClient_user)
                {
                    await
                    Order0.
                    setClient_user(relatedClient_user0);
                }
            
                const relatedClient_user1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Order1 = await Orders.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Order1?.setClient_user)
                {
                    await
                    Order1.
                    setClient_user(relatedClient_user1);
                }
            
                const relatedClient_user2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Order2 = await Orders.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Order2?.setClient_user)
                {
                    await
                    Order2.
                    setClient_user(relatedClient_user2);
                }
            
                const relatedClient_user3 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Order3 = await Orders.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Order3?.setClient_user)
                {
                    await
                    Order3.
                    setClient_user(relatedClient_user3);
                }
            
        }
        
    
        
            
            async function associateOrderWithTable() {
            
                const relatedTable0 = await RestaurantTables.findOne({
                    offset: Math.floor(Math.random() * (await RestaurantTables.count())),
                });
                const Order0 = await Orders.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Order0?.setTable)
                {
                    await
                    Order0.
                    setTable(relatedTable0);
                }
            
                const relatedTable1 = await RestaurantTables.findOne({
                    offset: Math.floor(Math.random() * (await RestaurantTables.count())),
                });
                const Order1 = await Orders.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Order1?.setTable)
                {
                    await
                    Order1.
                    setTable(relatedTable1);
                }
            
                const relatedTable2 = await RestaurantTables.findOne({
                    offset: Math.floor(Math.random() * (await RestaurantTables.count())),
                });
                const Order2 = await Orders.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Order2?.setTable)
                {
                    await
                    Order2.
                    setTable(relatedTable2);
                }
            
                const relatedTable3 = await RestaurantTables.findOne({
                    offset: Math.floor(Math.random() * (await RestaurantTables.count())),
                });
                const Order3 = await Orders.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Order3?.setTable)
                {
                    await
                    Order3.
                    setTable(relatedTable3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    

    
    
    
        
            
            async function associateOrderItemWithOrder() {
            
                const relatedOrder0 = await Orders.findOne({
                    offset: Math.floor(Math.random() * (await Orders.count())),
                });
                const OrderItem0 = await OrderItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (OrderItem0?.setOrder)
                {
                    await
                    OrderItem0.
                    setOrder(relatedOrder0);
                }
            
                const relatedOrder1 = await Orders.findOne({
                    offset: Math.floor(Math.random() * (await Orders.count())),
                });
                const OrderItem1 = await OrderItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (OrderItem1?.setOrder)
                {
                    await
                    OrderItem1.
                    setOrder(relatedOrder1);
                }
            
                const relatedOrder2 = await Orders.findOne({
                    offset: Math.floor(Math.random() * (await Orders.count())),
                });
                const OrderItem2 = await OrderItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (OrderItem2?.setOrder)
                {
                    await
                    OrderItem2.
                    setOrder(relatedOrder2);
                }
            
                const relatedOrder3 = await Orders.findOne({
                    offset: Math.floor(Math.random() * (await Orders.count())),
                });
                const OrderItem3 = await OrderItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (OrderItem3?.setOrder)
                {
                    await
                    OrderItem3.
                    setOrder(relatedOrder3);
                }
            
        }
        
    
        
            
            async function associateOrderItemWithMenu_item() {
            
                const relatedMenu_item0 = await MenuItems.findOne({
                    offset: Math.floor(Math.random() * (await MenuItems.count())),
                });
                const OrderItem0 = await OrderItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (OrderItem0?.setMenu_item)
                {
                    await
                    OrderItem0.
                    setMenu_item(relatedMenu_item0);
                }
            
                const relatedMenu_item1 = await MenuItems.findOne({
                    offset: Math.floor(Math.random() * (await MenuItems.count())),
                });
                const OrderItem1 = await OrderItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (OrderItem1?.setMenu_item)
                {
                    await
                    OrderItem1.
                    setMenu_item(relatedMenu_item1);
                }
            
                const relatedMenu_item2 = await MenuItems.findOne({
                    offset: Math.floor(Math.random() * (await MenuItems.count())),
                });
                const OrderItem2 = await OrderItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (OrderItem2?.setMenu_item)
                {
                    await
                    OrderItem2.
                    setMenu_item(relatedMenu_item2);
                }
            
                const relatedMenu_item3 = await MenuItems.findOne({
                    offset: Math.floor(Math.random() * (await MenuItems.count())),
                });
                const OrderItem3 = await OrderItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (OrderItem3?.setMenu_item)
                {
                    await
                    OrderItem3.
                    setMenu_item(relatedMenu_item3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    

    
    
    
        
            
            async function associateReservationWithRestaurant() {
            
                const relatedRestaurant0 = await Restaurants.findOne({
                    offset: Math.floor(Math.random() * (await Restaurants.count())),
                });
                const Reservation0 = await Reservations.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Reservation0?.setRestaurant)
                {
                    await
                    Reservation0.
                    setRestaurant(relatedRestaurant0);
                }
            
                const relatedRestaurant1 = await Restaurants.findOne({
                    offset: Math.floor(Math.random() * (await Restaurants.count())),
                });
                const Reservation1 = await Reservations.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Reservation1?.setRestaurant)
                {
                    await
                    Reservation1.
                    setRestaurant(relatedRestaurant1);
                }
            
                const relatedRestaurant2 = await Restaurants.findOne({
                    offset: Math.floor(Math.random() * (await Restaurants.count())),
                });
                const Reservation2 = await Reservations.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Reservation2?.setRestaurant)
                {
                    await
                    Reservation2.
                    setRestaurant(relatedRestaurant2);
                }
            
                const relatedRestaurant3 = await Restaurants.findOne({
                    offset: Math.floor(Math.random() * (await Restaurants.count())),
                });
                const Reservation3 = await Reservations.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Reservation3?.setRestaurant)
                {
                    await
                    Reservation3.
                    setRestaurant(relatedRestaurant3);
                }
            
        }
        
    
        
            
            async function associateReservationWithClient_user() {
            
                const relatedClient_user0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Reservation0 = await Reservations.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Reservation0?.setClient_user)
                {
                    await
                    Reservation0.
                    setClient_user(relatedClient_user0);
                }
            
                const relatedClient_user1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Reservation1 = await Reservations.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Reservation1?.setClient_user)
                {
                    await
                    Reservation1.
                    setClient_user(relatedClient_user1);
                }
            
                const relatedClient_user2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Reservation2 = await Reservations.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Reservation2?.setClient_user)
                {
                    await
                    Reservation2.
                    setClient_user(relatedClient_user2);
                }
            
                const relatedClient_user3 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Reservation3 = await Reservations.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Reservation3?.setClient_user)
                {
                    await
                    Reservation3.
                    setClient_user(relatedClient_user3);
                }
            
        }
        
    
        
            
            async function associateReservationWithTable() {
            
                const relatedTable0 = await RestaurantTables.findOne({
                    offset: Math.floor(Math.random() * (await RestaurantTables.count())),
                });
                const Reservation0 = await Reservations.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Reservation0?.setTable)
                {
                    await
                    Reservation0.
                    setTable(relatedTable0);
                }
            
                const relatedTable1 = await RestaurantTables.findOne({
                    offset: Math.floor(Math.random() * (await RestaurantTables.count())),
                });
                const Reservation1 = await Reservations.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Reservation1?.setTable)
                {
                    await
                    Reservation1.
                    setTable(relatedTable1);
                }
            
                const relatedTable2 = await RestaurantTables.findOne({
                    offset: Math.floor(Math.random() * (await RestaurantTables.count())),
                });
                const Reservation2 = await Reservations.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Reservation2?.setTable)
                {
                    await
                    Reservation2.
                    setTable(relatedTable2);
                }
            
                const relatedTable3 = await RestaurantTables.findOne({
                    offset: Math.floor(Math.random() * (await RestaurantTables.count())),
                });
                const Reservation3 = await Reservations.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Reservation3?.setTable)
                {
                    await
                    Reservation3.
                    setTable(relatedTable3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    

    
    
    
        
            
            async function associatePaymentWithRestaurant() {
            
                const relatedRestaurant0 = await Restaurants.findOne({
                    offset: Math.floor(Math.random() * (await Restaurants.count())),
                });
                const Payment0 = await Payments.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Payment0?.setRestaurant)
                {
                    await
                    Payment0.
                    setRestaurant(relatedRestaurant0);
                }
            
                const relatedRestaurant1 = await Restaurants.findOne({
                    offset: Math.floor(Math.random() * (await Restaurants.count())),
                });
                const Payment1 = await Payments.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Payment1?.setRestaurant)
                {
                    await
                    Payment1.
                    setRestaurant(relatedRestaurant1);
                }
            
                const relatedRestaurant2 = await Restaurants.findOne({
                    offset: Math.floor(Math.random() * (await Restaurants.count())),
                });
                const Payment2 = await Payments.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Payment2?.setRestaurant)
                {
                    await
                    Payment2.
                    setRestaurant(relatedRestaurant2);
                }
            
                const relatedRestaurant3 = await Restaurants.findOne({
                    offset: Math.floor(Math.random() * (await Restaurants.count())),
                });
                const Payment3 = await Payments.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Payment3?.setRestaurant)
                {
                    await
                    Payment3.
                    setRestaurant(relatedRestaurant3);
                }
            
        }
        
    
        
            
            async function associatePaymentWithOrder() {
            
                const relatedOrder0 = await Orders.findOne({
                    offset: Math.floor(Math.random() * (await Orders.count())),
                });
                const Payment0 = await Payments.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Payment0?.setOrder)
                {
                    await
                    Payment0.
                    setOrder(relatedOrder0);
                }
            
                const relatedOrder1 = await Orders.findOne({
                    offset: Math.floor(Math.random() * (await Orders.count())),
                });
                const Payment1 = await Payments.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Payment1?.setOrder)
                {
                    await
                    Payment1.
                    setOrder(relatedOrder1);
                }
            
                const relatedOrder2 = await Orders.findOne({
                    offset: Math.floor(Math.random() * (await Orders.count())),
                });
                const Payment2 = await Payments.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Payment2?.setOrder)
                {
                    await
                    Payment2.
                    setOrder(relatedOrder2);
                }
            
                const relatedOrder3 = await Orders.findOne({
                    offset: Math.floor(Math.random() * (await Orders.count())),
                });
                const Payment3 = await Payments.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Payment3?.setOrder)
                {
                    await
                    Payment3.
                    setOrder(relatedOrder3);
                }
            
        }
        
    
        
            
            async function associatePaymentWithClient_user() {
            
                const relatedClient_user0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Payment0 = await Payments.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Payment0?.setClient_user)
                {
                    await
                    Payment0.
                    setClient_user(relatedClient_user0);
                }
            
                const relatedClient_user1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Payment1 = await Payments.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Payment1?.setClient_user)
                {
                    await
                    Payment1.
                    setClient_user(relatedClient_user1);
                }
            
                const relatedClient_user2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Payment2 = await Payments.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Payment2?.setClient_user)
                {
                    await
                    Payment2.
                    setClient_user(relatedClient_user2);
                }
            
                const relatedClient_user3 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Payment3 = await Payments.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Payment3?.setClient_user)
                {
                    await
                    Payment3.
                    setClient_user(relatedClient_user3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    

    
    
    
        
            
            async function associateLoyaltyAccountWithClient_user() {
            
                const relatedClient_user0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const LoyaltyAccount0 = await LoyaltyAccounts.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (LoyaltyAccount0?.setClient_user)
                {
                    await
                    LoyaltyAccount0.
                    setClient_user(relatedClient_user0);
                }
            
                const relatedClient_user1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const LoyaltyAccount1 = await LoyaltyAccounts.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (LoyaltyAccount1?.setClient_user)
                {
                    await
                    LoyaltyAccount1.
                    setClient_user(relatedClient_user1);
                }
            
                const relatedClient_user2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const LoyaltyAccount2 = await LoyaltyAccounts.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (LoyaltyAccount2?.setClient_user)
                {
                    await
                    LoyaltyAccount2.
                    setClient_user(relatedClient_user2);
                }
            
                const relatedClient_user3 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const LoyaltyAccount3 = await LoyaltyAccounts.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (LoyaltyAccount3?.setClient_user)
                {
                    await
                    LoyaltyAccount3.
                    setClient_user(relatedClient_user3);
                }
            
        }
        
    
        
    
        
    

    
    
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    

    
    
    
        
            
            async function associateLoyaltyTransactionWithLoyalty_account() {
            
                const relatedLoyalty_account0 = await LoyaltyAccounts.findOne({
                    offset: Math.floor(Math.random() * (await LoyaltyAccounts.count())),
                });
                const LoyaltyTransaction0 = await LoyaltyTransactions.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (LoyaltyTransaction0?.setLoyalty_account)
                {
                    await
                    LoyaltyTransaction0.
                    setLoyalty_account(relatedLoyalty_account0);
                }
            
                const relatedLoyalty_account1 = await LoyaltyAccounts.findOne({
                    offset: Math.floor(Math.random() * (await LoyaltyAccounts.count())),
                });
                const LoyaltyTransaction1 = await LoyaltyTransactions.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (LoyaltyTransaction1?.setLoyalty_account)
                {
                    await
                    LoyaltyTransaction1.
                    setLoyalty_account(relatedLoyalty_account1);
                }
            
                const relatedLoyalty_account2 = await LoyaltyAccounts.findOne({
                    offset: Math.floor(Math.random() * (await LoyaltyAccounts.count())),
                });
                const LoyaltyTransaction2 = await LoyaltyTransactions.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (LoyaltyTransaction2?.setLoyalty_account)
                {
                    await
                    LoyaltyTransaction2.
                    setLoyalty_account(relatedLoyalty_account2);
                }
            
                const relatedLoyalty_account3 = await LoyaltyAccounts.findOne({
                    offset: Math.floor(Math.random() * (await LoyaltyAccounts.count())),
                });
                const LoyaltyTransaction3 = await LoyaltyTransactions.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (LoyaltyTransaction3?.setLoyalty_account)
                {
                    await
                    LoyaltyTransaction3.
                    setLoyalty_account(relatedLoyalty_account3);
                }
            
        }
        
    
        
            
            async function associateLoyaltyTransactionWithPayment() {
            
                const relatedPayment0 = await Payments.findOne({
                    offset: Math.floor(Math.random() * (await Payments.count())),
                });
                const LoyaltyTransaction0 = await LoyaltyTransactions.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (LoyaltyTransaction0?.setPayment)
                {
                    await
                    LoyaltyTransaction0.
                    setPayment(relatedPayment0);
                }
            
                const relatedPayment1 = await Payments.findOne({
                    offset: Math.floor(Math.random() * (await Payments.count())),
                });
                const LoyaltyTransaction1 = await LoyaltyTransactions.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (LoyaltyTransaction1?.setPayment)
                {
                    await
                    LoyaltyTransaction1.
                    setPayment(relatedPayment1);
                }
            
                const relatedPayment2 = await Payments.findOne({
                    offset: Math.floor(Math.random() * (await Payments.count())),
                });
                const LoyaltyTransaction2 = await LoyaltyTransactions.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (LoyaltyTransaction2?.setPayment)
                {
                    await
                    LoyaltyTransaction2.
                    setPayment(relatedPayment2);
                }
            
                const relatedPayment3 = await Payments.findOne({
                    offset: Math.floor(Math.random() * (await Payments.count())),
                });
                const LoyaltyTransaction3 = await LoyaltyTransactions.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (LoyaltyTransaction3?.setPayment)
                {
                    await
                    LoyaltyTransaction3.
                    setPayment(relatedPayment3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    

    
    
    
        
            
            async function associateCustomerReviewWithRestaurant() {
            
                const relatedRestaurant0 = await Restaurants.findOne({
                    offset: Math.floor(Math.random() * (await Restaurants.count())),
                });
                const CustomerReview0 = await CustomerReviews.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (CustomerReview0?.setRestaurant)
                {
                    await
                    CustomerReview0.
                    setRestaurant(relatedRestaurant0);
                }
            
                const relatedRestaurant1 = await Restaurants.findOne({
                    offset: Math.floor(Math.random() * (await Restaurants.count())),
                });
                const CustomerReview1 = await CustomerReviews.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (CustomerReview1?.setRestaurant)
                {
                    await
                    CustomerReview1.
                    setRestaurant(relatedRestaurant1);
                }
            
                const relatedRestaurant2 = await Restaurants.findOne({
                    offset: Math.floor(Math.random() * (await Restaurants.count())),
                });
                const CustomerReview2 = await CustomerReviews.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (CustomerReview2?.setRestaurant)
                {
                    await
                    CustomerReview2.
                    setRestaurant(relatedRestaurant2);
                }
            
                const relatedRestaurant3 = await Restaurants.findOne({
                    offset: Math.floor(Math.random() * (await Restaurants.count())),
                });
                const CustomerReview3 = await CustomerReviews.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (CustomerReview3?.setRestaurant)
                {
                    await
                    CustomerReview3.
                    setRestaurant(relatedRestaurant3);
                }
            
        }
        
    
        
            
            async function associateCustomerReviewWithClient_user() {
            
                const relatedClient_user0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const CustomerReview0 = await CustomerReviews.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (CustomerReview0?.setClient_user)
                {
                    await
                    CustomerReview0.
                    setClient_user(relatedClient_user0);
                }
            
                const relatedClient_user1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const CustomerReview1 = await CustomerReviews.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (CustomerReview1?.setClient_user)
                {
                    await
                    CustomerReview1.
                    setClient_user(relatedClient_user1);
                }
            
                const relatedClient_user2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const CustomerReview2 = await CustomerReviews.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (CustomerReview2?.setClient_user)
                {
                    await
                    CustomerReview2.
                    setClient_user(relatedClient_user2);
                }
            
                const relatedClient_user3 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const CustomerReview3 = await CustomerReviews.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (CustomerReview3?.setClient_user)
                {
                    await
                    CustomerReview3.
                    setClient_user(relatedClient_user3);
                }
            
        }
        
    
        
            
            async function associateCustomerReviewWithOrder() {
            
                const relatedOrder0 = await Orders.findOne({
                    offset: Math.floor(Math.random() * (await Orders.count())),
                });
                const CustomerReview0 = await CustomerReviews.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (CustomerReview0?.setOrder)
                {
                    await
                    CustomerReview0.
                    setOrder(relatedOrder0);
                }
            
                const relatedOrder1 = await Orders.findOne({
                    offset: Math.floor(Math.random() * (await Orders.count())),
                });
                const CustomerReview1 = await CustomerReviews.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (CustomerReview1?.setOrder)
                {
                    await
                    CustomerReview1.
                    setOrder(relatedOrder1);
                }
            
                const relatedOrder2 = await Orders.findOne({
                    offset: Math.floor(Math.random() * (await Orders.count())),
                });
                const CustomerReview2 = await CustomerReviews.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (CustomerReview2?.setOrder)
                {
                    await
                    CustomerReview2.
                    setOrder(relatedOrder2);
                }
            
                const relatedOrder3 = await Orders.findOne({
                    offset: Math.floor(Math.random() * (await Orders.count())),
                });
                const CustomerReview3 = await CustomerReviews.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (CustomerReview3?.setOrder)
                {
                    await
                    CustomerReview3.
                    setOrder(relatedOrder3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    

    
    
    
        
            
            async function associateNotificationEventWithRestaurant() {
            
                const relatedRestaurant0 = await Restaurants.findOne({
                    offset: Math.floor(Math.random() * (await Restaurants.count())),
                });
                const NotificationEvent0 = await NotificationEvents.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (NotificationEvent0?.setRestaurant)
                {
                    await
                    NotificationEvent0.
                    setRestaurant(relatedRestaurant0);
                }
            
                const relatedRestaurant1 = await Restaurants.findOne({
                    offset: Math.floor(Math.random() * (await Restaurants.count())),
                });
                const NotificationEvent1 = await NotificationEvents.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (NotificationEvent1?.setRestaurant)
                {
                    await
                    NotificationEvent1.
                    setRestaurant(relatedRestaurant1);
                }
            
                const relatedRestaurant2 = await Restaurants.findOne({
                    offset: Math.floor(Math.random() * (await Restaurants.count())),
                });
                const NotificationEvent2 = await NotificationEvents.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (NotificationEvent2?.setRestaurant)
                {
                    await
                    NotificationEvent2.
                    setRestaurant(relatedRestaurant2);
                }
            
                const relatedRestaurant3 = await Restaurants.findOne({
                    offset: Math.floor(Math.random() * (await Restaurants.count())),
                });
                const NotificationEvent3 = await NotificationEvents.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (NotificationEvent3?.setRestaurant)
                {
                    await
                    NotificationEvent3.
                    setRestaurant(relatedRestaurant3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateNotificationEventWithTarget_user() {
            
                const relatedTarget_user0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const NotificationEvent0 = await NotificationEvents.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (NotificationEvent0?.setTarget_user)
                {
                    await
                    NotificationEvent0.
                    setTarget_user(relatedTarget_user0);
                }
            
                const relatedTarget_user1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const NotificationEvent1 = await NotificationEvents.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (NotificationEvent1?.setTarget_user)
                {
                    await
                    NotificationEvent1.
                    setTarget_user(relatedTarget_user1);
                }
            
                const relatedTarget_user2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const NotificationEvent2 = await NotificationEvents.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (NotificationEvent2?.setTarget_user)
                {
                    await
                    NotificationEvent2.
                    setTarget_user(relatedTarget_user2);
                }
            
                const relatedTarget_user3 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const NotificationEvent3 = await NotificationEvents.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (NotificationEvent3?.setTarget_user)
                {
                    await
                    NotificationEvent3.
                    setTarget_user(relatedTarget_user3);
                }
            
        }
        
    

    
    
    
        
            
            async function associateStockLocationWithRestaurant() {
            
                const relatedRestaurant0 = await Restaurants.findOne({
                    offset: Math.floor(Math.random() * (await Restaurants.count())),
                });
                const StockLocation0 = await StockLocations.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (StockLocation0?.setRestaurant)
                {
                    await
                    StockLocation0.
                    setRestaurant(relatedRestaurant0);
                }
            
                const relatedRestaurant1 = await Restaurants.findOne({
                    offset: Math.floor(Math.random() * (await Restaurants.count())),
                });
                const StockLocation1 = await StockLocations.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (StockLocation1?.setRestaurant)
                {
                    await
                    StockLocation1.
                    setRestaurant(relatedRestaurant1);
                }
            
                const relatedRestaurant2 = await Restaurants.findOne({
                    offset: Math.floor(Math.random() * (await Restaurants.count())),
                });
                const StockLocation2 = await StockLocations.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (StockLocation2?.setRestaurant)
                {
                    await
                    StockLocation2.
                    setRestaurant(relatedRestaurant2);
                }
            
                const relatedRestaurant3 = await Restaurants.findOne({
                    offset: Math.floor(Math.random() * (await Restaurants.count())),
                });
                const StockLocation3 = await StockLocations.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (StockLocation3?.setRestaurant)
                {
                    await
                    StockLocation3.
                    setRestaurant(relatedRestaurant3);
                }
            
        }
        
    
        
    
        
    
        
    

    
    
    
        
            
            async function associateStockItemWithStock_location() {
            
                const relatedStock_location0 = await StockLocations.findOne({
                    offset: Math.floor(Math.random() * (await StockLocations.count())),
                });
                const StockItem0 = await StockItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (StockItem0?.setStock_location)
                {
                    await
                    StockItem0.
                    setStock_location(relatedStock_location0);
                }
            
                const relatedStock_location1 = await StockLocations.findOne({
                    offset: Math.floor(Math.random() * (await StockLocations.count())),
                });
                const StockItem1 = await StockItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (StockItem1?.setStock_location)
                {
                    await
                    StockItem1.
                    setStock_location(relatedStock_location1);
                }
            
                const relatedStock_location2 = await StockLocations.findOne({
                    offset: Math.floor(Math.random() * (await StockLocations.count())),
                });
                const StockItem2 = await StockItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (StockItem2?.setStock_location)
                {
                    await
                    StockItem2.
                    setStock_location(relatedStock_location2);
                }
            
                const relatedStock_location3 = await StockLocations.findOne({
                    offset: Math.floor(Math.random() * (await StockLocations.count())),
                });
                const StockItem3 = await StockItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (StockItem3?.setStock_location)
                {
                    await
                    StockItem3.
                    setStock_location(relatedStock_location3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    

    
    
    
        
            
            async function associateStockMovementWithStock_item() {
            
                const relatedStock_item0 = await StockItems.findOne({
                    offset: Math.floor(Math.random() * (await StockItems.count())),
                });
                const StockMovement0 = await StockMovements.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (StockMovement0?.setStock_item)
                {
                    await
                    StockMovement0.
                    setStock_item(relatedStock_item0);
                }
            
                const relatedStock_item1 = await StockItems.findOne({
                    offset: Math.floor(Math.random() * (await StockItems.count())),
                });
                const StockMovement1 = await StockMovements.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (StockMovement1?.setStock_item)
                {
                    await
                    StockMovement1.
                    setStock_item(relatedStock_item1);
                }
            
                const relatedStock_item2 = await StockItems.findOne({
                    offset: Math.floor(Math.random() * (await StockItems.count())),
                });
                const StockMovement2 = await StockMovements.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (StockMovement2?.setStock_item)
                {
                    await
                    StockMovement2.
                    setStock_item(relatedStock_item2);
                }
            
                const relatedStock_item3 = await StockItems.findOne({
                    offset: Math.floor(Math.random() * (await StockItems.count())),
                });
                const StockMovement3 = await StockMovements.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (StockMovement3?.setStock_item)
                {
                    await
                    StockMovement3.
                    setStock_item(relatedStock_item3);
                }
            
        }
        
    
        
            
            async function associateStockMovementWithRestaurant() {
            
                const relatedRestaurant0 = await Restaurants.findOne({
                    offset: Math.floor(Math.random() * (await Restaurants.count())),
                });
                const StockMovement0 = await StockMovements.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (StockMovement0?.setRestaurant)
                {
                    await
                    StockMovement0.
                    setRestaurant(relatedRestaurant0);
                }
            
                const relatedRestaurant1 = await Restaurants.findOne({
                    offset: Math.floor(Math.random() * (await Restaurants.count())),
                });
                const StockMovement1 = await StockMovements.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (StockMovement1?.setRestaurant)
                {
                    await
                    StockMovement1.
                    setRestaurant(relatedRestaurant1);
                }
            
                const relatedRestaurant2 = await Restaurants.findOne({
                    offset: Math.floor(Math.random() * (await Restaurants.count())),
                });
                const StockMovement2 = await StockMovements.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (StockMovement2?.setRestaurant)
                {
                    await
                    StockMovement2.
                    setRestaurant(relatedRestaurant2);
                }
            
                const relatedRestaurant3 = await Restaurants.findOne({
                    offset: Math.floor(Math.random() * (await Restaurants.count())),
                });
                const StockMovement3 = await StockMovements.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (StockMovement3?.setRestaurant)
                {
                    await
                    StockMovement3.
                    setRestaurant(relatedRestaurant3);
                }
            
        }
        
    
        
            
            async function associateStockMovementWithPerformed_by_user() {
            
                const relatedPerformed_by_user0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const StockMovement0 = await StockMovements.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (StockMovement0?.setPerformed_by_user)
                {
                    await
                    StockMovement0.
                    setPerformed_by_user(relatedPerformed_by_user0);
                }
            
                const relatedPerformed_by_user1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const StockMovement1 = await StockMovements.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (StockMovement1?.setPerformed_by_user)
                {
                    await
                    StockMovement1.
                    setPerformed_by_user(relatedPerformed_by_user1);
                }
            
                const relatedPerformed_by_user2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const StockMovement2 = await StockMovements.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (StockMovement2?.setPerformed_by_user)
                {
                    await
                    StockMovement2.
                    setPerformed_by_user(relatedPerformed_by_user2);
                }
            
                const relatedPerformed_by_user3 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const StockMovement3 = await StockMovements.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (StockMovement3?.setPerformed_by_user)
                {
                    await
                    StockMovement3.
                    setPerformed_by_user(relatedPerformed_by_user3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    

    
    
    
        
            
            async function associateInvoiceWithRestaurant() {
            
                const relatedRestaurant0 = await Restaurants.findOne({
                    offset: Math.floor(Math.random() * (await Restaurants.count())),
                });
                const Invoice0 = await Invoices.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Invoice0?.setRestaurant)
                {
                    await
                    Invoice0.
                    setRestaurant(relatedRestaurant0);
                }
            
                const relatedRestaurant1 = await Restaurants.findOne({
                    offset: Math.floor(Math.random() * (await Restaurants.count())),
                });
                const Invoice1 = await Invoices.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Invoice1?.setRestaurant)
                {
                    await
                    Invoice1.
                    setRestaurant(relatedRestaurant1);
                }
            
                const relatedRestaurant2 = await Restaurants.findOne({
                    offset: Math.floor(Math.random() * (await Restaurants.count())),
                });
                const Invoice2 = await Invoices.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Invoice2?.setRestaurant)
                {
                    await
                    Invoice2.
                    setRestaurant(relatedRestaurant2);
                }
            
                const relatedRestaurant3 = await Restaurants.findOne({
                    offset: Math.floor(Math.random() * (await Restaurants.count())),
                });
                const Invoice3 = await Invoices.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Invoice3?.setRestaurant)
                {
                    await
                    Invoice3.
                    setRestaurant(relatedRestaurant3);
                }
            
        }
        
    
        
            
            async function associateInvoiceWithOrder() {
            
                const relatedOrder0 = await Orders.findOne({
                    offset: Math.floor(Math.random() * (await Orders.count())),
                });
                const Invoice0 = await Invoices.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Invoice0?.setOrder)
                {
                    await
                    Invoice0.
                    setOrder(relatedOrder0);
                }
            
                const relatedOrder1 = await Orders.findOne({
                    offset: Math.floor(Math.random() * (await Orders.count())),
                });
                const Invoice1 = await Invoices.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Invoice1?.setOrder)
                {
                    await
                    Invoice1.
                    setOrder(relatedOrder1);
                }
            
                const relatedOrder2 = await Orders.findOne({
                    offset: Math.floor(Math.random() * (await Orders.count())),
                });
                const Invoice2 = await Invoices.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Invoice2?.setOrder)
                {
                    await
                    Invoice2.
                    setOrder(relatedOrder2);
                }
            
                const relatedOrder3 = await Orders.findOne({
                    offset: Math.floor(Math.random() * (await Orders.count())),
                });
                const Invoice3 = await Invoices.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Invoice3?.setOrder)
                {
                    await
                    Invoice3.
                    setOrder(relatedOrder3);
                }
            
        }
        
    
        
            
            async function associateInvoiceWithClient_user() {
            
                const relatedClient_user0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Invoice0 = await Invoices.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Invoice0?.setClient_user)
                {
                    await
                    Invoice0.
                    setClient_user(relatedClient_user0);
                }
            
                const relatedClient_user1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Invoice1 = await Invoices.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Invoice1?.setClient_user)
                {
                    await
                    Invoice1.
                    setClient_user(relatedClient_user1);
                }
            
                const relatedClient_user2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Invoice2 = await Invoices.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Invoice2?.setClient_user)
                {
                    await
                    Invoice2.
                    setClient_user(relatedClient_user2);
                }
            
                const relatedClient_user3 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Invoice3 = await Invoices.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Invoice3?.setClient_user)
                {
                    await
                    Invoice3.
                    setClient_user(relatedClient_user3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    

    
    
    
        
            
            async function associateAuditLogWithActor_user() {
            
                const relatedActor_user0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const AuditLog0 = await AuditLogs.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (AuditLog0?.setActor_user)
                {
                    await
                    AuditLog0.
                    setActor_user(relatedActor_user0);
                }
            
                const relatedActor_user1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const AuditLog1 = await AuditLogs.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (AuditLog1?.setActor_user)
                {
                    await
                    AuditLog1.
                    setActor_user(relatedActor_user1);
                }
            
                const relatedActor_user2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const AuditLog2 = await AuditLogs.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (AuditLog2?.setActor_user)
                {
                    await
                    AuditLog2.
                    setActor_user(relatedActor_user2);
                }
            
                const relatedActor_user3 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const AuditLog3 = await AuditLogs.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (AuditLog3?.setActor_user)
                {
                    await
                    AuditLog3.
                    setActor_user(relatedActor_user3);
                }
            
        }
        
    
        
            
            async function associateAuditLogWithRestaurant() {
            
                const relatedRestaurant0 = await Restaurants.findOne({
                    offset: Math.floor(Math.random() * (await Restaurants.count())),
                });
                const AuditLog0 = await AuditLogs.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (AuditLog0?.setRestaurant)
                {
                    await
                    AuditLog0.
                    setRestaurant(relatedRestaurant0);
                }
            
                const relatedRestaurant1 = await Restaurants.findOne({
                    offset: Math.floor(Math.random() * (await Restaurants.count())),
                });
                const AuditLog1 = await AuditLogs.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (AuditLog1?.setRestaurant)
                {
                    await
                    AuditLog1.
                    setRestaurant(relatedRestaurant1);
                }
            
                const relatedRestaurant2 = await Restaurants.findOne({
                    offset: Math.floor(Math.random() * (await Restaurants.count())),
                });
                const AuditLog2 = await AuditLogs.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (AuditLog2?.setRestaurant)
                {
                    await
                    AuditLog2.
                    setRestaurant(relatedRestaurant2);
                }
            
                const relatedRestaurant3 = await Restaurants.findOne({
                    offset: Math.floor(Math.random() * (await Restaurants.count())),
                });
                const AuditLog3 = await AuditLogs.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (AuditLog3?.setRestaurant)
                {
                    await
                    AuditLog3.
                    setRestaurant(relatedRestaurant3);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    


module.exports = {
    up: async (queryInterface, Sequelize) => {
        
            
            
            
            
            
                
                await AccountApprovals.bulkCreate(AccountApprovalsData);
                
            
            
                
                await Restaurants.bulkCreate(RestaurantsData);
                
            
            
                
                await RestaurantTables.bulkCreate(RestaurantTablesData);
                
            
            
                
                await WorkSchedules.bulkCreate(WorkSchedulesData);
                
            
            
                
                await WorkShifts.bulkCreate(WorkShiftsData);
                
            
            
                
                await AttendanceEvents.bulkCreate(AttendanceEventsData);
                
            
            
                
                await GeofenceAlerts.bulkCreate(GeofenceAlertsData);
                
            
            
                
                await MenuCategories.bulkCreate(MenuCategoriesData);
                
            
            
                
                await MenuItems.bulkCreate(MenuItemsData);
                
            
            
                
                await Orders.bulkCreate(OrdersData);
                
            
            
                
                await OrderItems.bulkCreate(OrderItemsData);
                
            
            
                
                await Reservations.bulkCreate(ReservationsData);
                
            
            
                
                await Payments.bulkCreate(PaymentsData);
                
            
            
                
                await LoyaltyAccounts.bulkCreate(LoyaltyAccountsData);
                
            
            
                
                await LoyaltyRules.bulkCreate(LoyaltyRulesData);
                
            
            
                
                await LoyaltyTransactions.bulkCreate(LoyaltyTransactionsData);
                
            
            
                
                await CustomerReviews.bulkCreate(CustomerReviewsData);
                
            
            
                
                await NotificationEvents.bulkCreate(NotificationEventsData);
                
            
            
                
                await StockLocations.bulkCreate(StockLocationsData);
                
            
            
                
                await StockItems.bulkCreate(StockItemsData);
                
            
            
                
                await StockMovements.bulkCreate(StockMovementsData);
                
            
            
                
                await Invoices.bulkCreate(InvoicesData);
                
            
            
                
                await AuditLogs.bulkCreate(AuditLogsData);
                
            
            await Promise.all([
            
                
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        // Similar logic for "relation_many"
                    
                
            
                
                
                
                
                    
                        
                        await associateAccountApprovalWithCandidate_user(),
                    
                
                    
                        
                        await associateAccountApprovalWithRequested_by_user(),
                    
                
                    
                        
                        await associateAccountApprovalWithReviewed_by_user(),
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associateRestaurantTableWithRestaurant(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associateWorkScheduleWithRestaurant(),
                    
                
                    
                        
                        await associateWorkScheduleWithCreated_by_user(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associateWorkShiftWithWork_schedule(),
                    
                
                    
                        
                        await associateWorkShiftWithStaff_user(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associateAttendanceEventWithRestaurant(),
                    
                
                    
                        
                        await associateAttendanceEventWithStaff_user(),
                    
                
                    
                        
                        await associateAttendanceEventWithWork_shift(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associateGeofenceAlertWithRestaurant(),
                    
                
                    
                        
                        await associateGeofenceAlertWithStaff_user(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateGeofenceAlertWithAcknowledged_by_user(),
                    
                
            
                
                
                    
                        
                        await associateMenuCategoryWithRestaurant(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associateMenuItemWithRestaurant(),
                    
                
                    
                        
                        await associateMenuItemWithMenu_category(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associateOrderWithRestaurant(),
                    
                
                    
                        
                        await associateOrderWithClient_user(),
                    
                
                    
                        
                        await associateOrderWithTable(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associateOrderItemWithOrder(),
                    
                
                    
                        
                        await associateOrderItemWithMenu_item(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associateReservationWithRestaurant(),
                    
                
                    
                        
                        await associateReservationWithClient_user(),
                    
                
                    
                        
                        await associateReservationWithTable(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associatePaymentWithRestaurant(),
                    
                
                    
                        
                        await associatePaymentWithOrder(),
                    
                
                    
                        
                        await associatePaymentWithClient_user(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associateLoyaltyAccountWithClient_user(),
                    
                
                    
                
                    
                
            
                
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associateLoyaltyTransactionWithLoyalty_account(),
                    
                
                    
                        
                        await associateLoyaltyTransactionWithPayment(),
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associateCustomerReviewWithRestaurant(),
                    
                
                    
                        
                        await associateCustomerReviewWithClient_user(),
                    
                
                    
                        
                        await associateCustomerReviewWithOrder(),
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associateNotificationEventWithRestaurant(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateNotificationEventWithTarget_user(),
                    
                
            
                
                
                    
                        
                        await associateStockLocationWithRestaurant(),
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associateStockItemWithStock_location(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associateStockMovementWithStock_item(),
                    
                
                    
                        
                        await associateStockMovementWithRestaurant(),
                    
                
                    
                        
                        await associateStockMovementWithPerformed_by_user(),
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associateInvoiceWithRestaurant(),
                    
                
                    
                        
                        await associateInvoiceWithOrder(),
                    
                
                    
                        
                        await associateInvoiceWithClient_user(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associateAuditLogWithActor_user(),
                    
                
                    
                        
                        await associateAuditLogWithRestaurant(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
            ]);
        
    },

    down: async (queryInterface, Sequelize) => {
        
            
            
            
            
            
            await queryInterface.bulkDelete('account_approvals', null, {});
            
            
            await queryInterface.bulkDelete('restaurants', null, {});
            
            
            await queryInterface.bulkDelete('restaurant_tables', null, {});
            
            
            await queryInterface.bulkDelete('work_schedules', null, {});
            
            
            await queryInterface.bulkDelete('work_shifts', null, {});
            
            
            await queryInterface.bulkDelete('attendance_events', null, {});
            
            
            await queryInterface.bulkDelete('geofence_alerts', null, {});
            
            
            await queryInterface.bulkDelete('menu_categories', null, {});
            
            
            await queryInterface.bulkDelete('menu_items', null, {});
            
            
            await queryInterface.bulkDelete('orders', null, {});
            
            
            await queryInterface.bulkDelete('order_items', null, {});
            
            
            await queryInterface.bulkDelete('reservations', null, {});
            
            
            await queryInterface.bulkDelete('payments', null, {});
            
            
            await queryInterface.bulkDelete('loyalty_accounts', null, {});
            
            
            await queryInterface.bulkDelete('loyalty_rules', null, {});
            
            
            await queryInterface.bulkDelete('loyalty_transactions', null, {});
            
            
            await queryInterface.bulkDelete('customer_reviews', null, {});
            
            
            await queryInterface.bulkDelete('notification_events', null, {});
            
            
            await queryInterface.bulkDelete('stock_locations', null, {});
            
            
            await queryInterface.bulkDelete('stock_items', null, {});
            
            
            await queryInterface.bulkDelete('stock_movements', null, {});
            
            
            await queryInterface.bulkDelete('invoices', null, {});
            
            
            await queryInterface.bulkDelete('audit_logs', null, {});
            
        
    },
};