38802-vm/backend/src/db/seeders/20231127130745-sample-data.js
2026-02-27 02:45:03 +00:00

9727 lines
181 KiB
JavaScript

const db = require('../models');
const Users = db.users;
const Currencies = db.currencies;
const Networks = db.networks;
const Wallets = db.wallets;
const DepositAddresses = db.deposit_addresses;
const Transactions = db.transactions;
const WithdrawalRequests = db.withdrawal_requests;
const Games = db.games;
const DiceBets = db.dice_bets;
const ProvablyFairSessions = db.provably_fair_sessions;
const Bonuses = db.bonuses;
const UserBonusClaims = db.user_bonus_claims;
const VipTiers = db.vip_tiers;
const UserVipStatuses = db.user_vip_statuses;
const RiskRules = db.risk_rules;
const SecurityEvents = db.security_events;
const ApiKeys = db.api_keys;
const Announcements = db.announcements;
const SupportTickets = db.support_tickets;
const AuditLogs = db.audit_logs;
const CurrenciesData = [
{
"code": "Grace Hopper",
"name": "Alan Turing",
"symbol": "Marie Curie",
"kind": "token",
"precision": 4,
"enabled": true,
"icon_url": "Ada Lovelace",
},
{
"code": "Marie Curie",
"name": "Marie Curie",
"symbol": "Grace Hopper",
"kind": "token",
"precision": 3,
"enabled": false,
"icon_url": "Marie Curie",
},
{
"code": "Marie Curie",
"name": "Ada Lovelace",
"symbol": "Grace Hopper",
"kind": "token",
"precision": 4,
"enabled": false,
"icon_url": "Marie Curie",
},
{
"code": "Alan Turing",
"name": "Grace Hopper",
"symbol": "Ada Lovelace",
"kind": "token",
"precision": 6,
"enabled": false,
"icon_url": "Marie Curie",
},
{
"code": "Alan Turing",
"name": "Grace Hopper",
"symbol": "Ada Lovelace",
"kind": "token",
"precision": 9,
"enabled": false,
"icon_url": "Alan Turing",
},
];
const NetworksData = [
{
"code": "Marie Curie",
"name": "Ada Lovelace",
"chain_id": 8,
"enabled": false,
"explorer_base_url": "Marie Curie",
"native_currency_code": "Marie Curie",
},
{
"code": "Ada Lovelace",
"name": "Marie Curie",
"chain_id": 4,
"enabled": false,
"explorer_base_url": "Marie Curie",
"native_currency_code": "Ada Lovelace",
},
{
"code": "Ada Lovelace",
"name": "Grace Hopper",
"chain_id": 8,
"enabled": true,
"explorer_base_url": "Grace Hopper",
"native_currency_code": "Grace Hopper",
},
{
"code": "Ada Lovelace",
"name": "Ada Lovelace",
"chain_id": 2,
"enabled": true,
"explorer_base_url": "Alan Turing",
"native_currency_code": "Grace Hopper",
},
{
"code": "Marie Curie",
"name": "Marie Curie",
"chain_id": 7,
"enabled": false,
"explorer_base_url": "Grace Hopper",
"native_currency_code": "Grace Hopper",
},
];
const WalletsData = [
{
// type code here for "relation_one" field
// type code here for "relation_one" field
// type code here for "relation_one" field
"available_balance": 8.21,
"locked_balance": 5.07,
"deposit_address": "Grace Hopper",
"status": "disabled",
"last_balance_update_at": new Date(Date.now()),
},
{
// type code here for "relation_one" field
// type code here for "relation_one" field
// type code here for "relation_one" field
"available_balance": 5.41,
"locked_balance": 4.2,
"deposit_address": "Ada Lovelace",
"status": "disabled",
"last_balance_update_at": new Date(Date.now()),
},
{
// type code here for "relation_one" field
// type code here for "relation_one" field
// type code here for "relation_one" field
"available_balance": 0.15,
"locked_balance": 3.24,
"deposit_address": "Ada Lovelace",
"status": "active",
"last_balance_update_at": new Date(Date.now()),
},
{
// type code here for "relation_one" field
// type code here for "relation_one" field
// type code here for "relation_one" field
"available_balance": 9.3,
"locked_balance": 1.21,
"deposit_address": "Marie Curie",
"status": "disabled",
"last_balance_update_at": new Date(Date.now()),
},
{
// type code here for "relation_one" field
// type code here for "relation_one" field
// type code here for "relation_one" field
"available_balance": 6.31,
"locked_balance": 0.2,
"deposit_address": "Ada Lovelace",
"status": "disabled",
"last_balance_update_at": new Date(Date.now()),
},
];
const DepositAddressesData = [
{
// type code here for "relation_one" field
"address": "Ada Lovelace",
"address_tag": "Grace Hopper",
"provider": "self_hosted",
"status": "rotated",
"assigned_at": new Date(Date.now()),
},
{
// type code here for "relation_one" field
"address": "Grace Hopper",
"address_tag": "Alan Turing",
"provider": "custodial",
"status": "active",
"assigned_at": new Date(Date.now()),
},
{
// type code here for "relation_one" field
"address": "Grace Hopper",
"address_tag": "Ada Lovelace",
"provider": "custodial",
"status": "active",
"assigned_at": new Date(Date.now()),
},
{
// type code here for "relation_one" field
"address": "Grace Hopper",
"address_tag": "Ada Lovelace",
"provider": "custodial",
"status": "rotated",
"assigned_at": new Date(Date.now()),
},
{
// type code here for "relation_one" field
"address": "Grace Hopper",
"address_tag": "Marie Curie",
"provider": "self_hosted",
"status": "disabled",
"assigned_at": new Date(Date.now()),
},
];
const TransactionsData = [
{
// type code here for "relation_one" field
// type code here for "relation_one" field
// type code here for "relation_one" field
// type code here for "relation_one" field
"type": "deposit",
"status": "failed",
"amount": 4.61,
"fee_amount": 0.78,
"tx_hash": "Marie Curie",
"confirmations": 9,
"required_confirmations": 7,
"from_address": "Grace Hopper",
"to_address": "Ada Lovelace",
"note": "Alan Turing",
"requested_at": new Date(Date.now()),
"processed_at": new Date(Date.now()),
},
{
// type code here for "relation_one" field
// type code here for "relation_one" field
// type code here for "relation_one" field
// type code here for "relation_one" field
"type": "bonus_credit",
"status": "created",
"amount": 2.52,
"fee_amount": 6.33,
"tx_hash": "Ada Lovelace",
"confirmations": 9,
"required_confirmations": 6,
"from_address": "Alan Turing",
"to_address": "Alan Turing",
"note": "Ada Lovelace",
"requested_at": new Date(Date.now()),
"processed_at": new Date(Date.now()),
},
{
// type code here for "relation_one" field
// type code here for "relation_one" field
// type code here for "relation_one" field
// type code here for "relation_one" field
"type": "bonus_debit",
"status": "failed",
"amount": 9.83,
"fee_amount": 9.65,
"tx_hash": "Ada Lovelace",
"confirmations": 1,
"required_confirmations": 5,
"from_address": "Alan Turing",
"to_address": "Marie Curie",
"note": "Marie Curie",
"requested_at": new Date(Date.now()),
"processed_at": new Date(Date.now()),
},
{
// type code here for "relation_one" field
// type code here for "relation_one" field
// type code here for "relation_one" field
// type code here for "relation_one" field
"type": "adjustment",
"status": "created",
"amount": 7.08,
"fee_amount": 3.33,
"tx_hash": "Grace Hopper",
"confirmations": 1,
"required_confirmations": 8,
"from_address": "Grace Hopper",
"to_address": "Marie Curie",
"note": "Marie Curie",
"requested_at": new Date(Date.now()),
"processed_at": new Date(Date.now()),
},
{
// type code here for "relation_one" field
// type code here for "relation_one" field
// type code here for "relation_one" field
// type code here for "relation_one" field
"type": "withdrawal",
"status": "failed",
"amount": 5.71,
"fee_amount": 2.86,
"tx_hash": "Alan Turing",
"confirmations": 1,
"required_confirmations": 1,
"from_address": "Alan Turing",
"to_address": "Marie Curie",
"note": "Alan Turing",
"requested_at": new Date(Date.now()),
"processed_at": new Date(Date.now()),
},
];
const WithdrawalRequestsData = [
{
// type code here for "relation_one" field
// type code here for "relation_one" field
// type code here for "relation_one" field
// type code here for "relation_one" field
"amount": 3.5,
"fee_amount": 7.42,
"destination_address": "Marie Curie",
"destination_tag": "Marie Curie",
"status": "pending_review",
"risk_reason": "Alan Turing",
"provider_reference": "Marie Curie",
"tx_hash": "Ada Lovelace",
"requested_at": new Date(Date.now()),
"reviewed_at": new Date(Date.now()),
"completed_at": new Date(Date.now()),
},
{
// type code here for "relation_one" field
// type code here for "relation_one" field
// type code here for "relation_one" field
// type code here for "relation_one" field
"amount": 9.17,
"fee_amount": 3.14,
"destination_address": "Alan Turing",
"destination_tag": "Alan Turing",
"status": "rejected",
"risk_reason": "Alan Turing",
"provider_reference": "Marie Curie",
"tx_hash": "Alan Turing",
"requested_at": new Date(Date.now()),
"reviewed_at": new Date(Date.now()),
"completed_at": new Date(Date.now()),
},
{
// type code here for "relation_one" field
// type code here for "relation_one" field
// type code here for "relation_one" field
// type code here for "relation_one" field
"amount": 5.56,
"fee_amount": 0.26,
"destination_address": "Ada Lovelace",
"destination_tag": "Grace Hopper",
"status": "pending_review",
"risk_reason": "Ada Lovelace",
"provider_reference": "Marie Curie",
"tx_hash": "Grace Hopper",
"requested_at": new Date(Date.now()),
"reviewed_at": new Date(Date.now()),
"completed_at": new Date(Date.now()),
},
{
// type code here for "relation_one" field
// type code here for "relation_one" field
// type code here for "relation_one" field
// type code here for "relation_one" field
"amount": 5.79,
"fee_amount": 3.94,
"destination_address": "Alan Turing",
"destination_tag": "Alan Turing",
"status": "rejected",
"risk_reason": "Alan Turing",
"provider_reference": "Marie Curie",
"tx_hash": "Grace Hopper",
"requested_at": new Date(Date.now()),
"reviewed_at": new Date(Date.now()),
"completed_at": new Date(Date.now()),
},
{
// type code here for "relation_one" field
// type code here for "relation_one" field
// type code here for "relation_one" field
// type code here for "relation_one" field
"amount": 8.72,
"fee_amount": 6.2,
"destination_address": "Ada Lovelace",
"destination_tag": "Marie Curie",
"status": "canceled",
"risk_reason": "Grace Hopper",
"provider_reference": "Grace Hopper",
"tx_hash": "Marie Curie",
"requested_at": new Date(Date.now()),
"reviewed_at": new Date(Date.now()),
"completed_at": new Date(Date.now()),
},
];
const GamesData = [
{
"code": "Ada Lovelace",
"name": "Ada Lovelace",
"status": "disabled",
"house_edge_percent": 4.78,
"min_bet": 4.85,
"max_bet": 6.1,
"max_profit": 9.58,
"provably_fair_enabled": true,
},
{
"code": "Grace Hopper",
"name": "Grace Hopper",
"status": "enabled",
"house_edge_percent": 8.1,
"min_bet": 2.89,
"max_bet": 1.15,
"max_profit": 4.37,
"provably_fair_enabled": false,
},
{
"code": "Grace Hopper",
"name": "Grace Hopper",
"status": "disabled",
"house_edge_percent": 1.3,
"min_bet": 9.73,
"max_bet": 0.39,
"max_profit": 0.14,
"provably_fair_enabled": false,
},
{
"code": "Marie Curie",
"name": "Alan Turing",
"status": "maintenance",
"house_edge_percent": 5.95,
"min_bet": 3.96,
"max_bet": 7.77,
"max_profit": 2.51,
"provably_fair_enabled": false,
},
{
"code": "Ada Lovelace",
"name": "Marie Curie",
"status": "disabled",
"house_edge_percent": 6.31,
"min_bet": 1.42,
"max_bet": 6.58,
"max_profit": 2.58,
"provably_fair_enabled": true,
},
];
const DiceBetsData = [
{
// type code here for "relation_one" field
// type code here for "relation_one" field
// type code here for "relation_one" field
// type code here for "relation_one" field
"bet_type": "roll_under",
"target": 1.46,
"wager": 8.57,
"payout_multiplier": 5.86,
"profit": 2.71,
"roll_result": 0.6,
"outcome": "void",
"client_seed_number": 4.04,
"client_seed_text": "Alan Turing",
"server_seed_hash": "Grace Hopper",
"server_seed_revealed": "Marie Curie",
"nonce": 2,
"random_source": "Marie Curie",
"placed_at": new Date(Date.now()),
"settled_at": new Date(Date.now()),
},
{
// type code here for "relation_one" field
// type code here for "relation_one" field
// type code here for "relation_one" field
// type code here for "relation_one" field
"bet_type": "roll_under",
"target": 2.27,
"wager": 6.34,
"payout_multiplier": 1.03,
"profit": 6.24,
"roll_result": 9.61,
"outcome": "win",
"client_seed_number": 1.37,
"client_seed_text": "Alan Turing",
"server_seed_hash": "Grace Hopper",
"server_seed_revealed": "Marie Curie",
"nonce": 4,
"random_source": "Grace Hopper",
"placed_at": new Date(Date.now()),
"settled_at": new Date(Date.now()),
},
{
// type code here for "relation_one" field
// type code here for "relation_one" field
// type code here for "relation_one" field
// type code here for "relation_one" field
"bet_type": "roll_under",
"target": 8.78,
"wager": 7.9,
"payout_multiplier": 2.12,
"profit": 1.05,
"roll_result": 1.35,
"outcome": "void",
"client_seed_number": 7.08,
"client_seed_text": "Alan Turing",
"server_seed_hash": "Ada Lovelace",
"server_seed_revealed": "Alan Turing",
"nonce": 4,
"random_source": "Marie Curie",
"placed_at": new Date(Date.now()),
"settled_at": new Date(Date.now()),
},
{
// type code here for "relation_one" field
// type code here for "relation_one" field
// type code here for "relation_one" field
// type code here for "relation_one" field
"bet_type": "roll_over",
"target": 4.92,
"wager": 4.16,
"payout_multiplier": 7.16,
"profit": 2.88,
"roll_result": 8.96,
"outcome": "void",
"client_seed_number": 6.31,
"client_seed_text": "Ada Lovelace",
"server_seed_hash": "Marie Curie",
"server_seed_revealed": "Grace Hopper",
"nonce": 1,
"random_source": "Marie Curie",
"placed_at": new Date(Date.now()),
"settled_at": new Date(Date.now()),
},
{
// type code here for "relation_one" field
// type code here for "relation_one" field
// type code here for "relation_one" field
// type code here for "relation_one" field
"bet_type": "roll_over",
"target": 9.18,
"wager": 6.15,
"payout_multiplier": 1.29,
"profit": 6.55,
"roll_result": 1.11,
"outcome": "void",
"client_seed_number": 9.38,
"client_seed_text": "Alan Turing",
"server_seed_hash": "Ada Lovelace",
"server_seed_revealed": "Marie Curie",
"nonce": 4,
"random_source": "Marie Curie",
"placed_at": new Date(Date.now()),
"settled_at": new Date(Date.now()),
},
];
const ProvablyFairSessionsData = [
{
// type code here for "relation_one" field
// type code here for "relation_one" field
"status": "active",
"client_seed_text": "Grace Hopper",
"client_seed_number": 4.9,
"server_seed_hash": "Ada Lovelace",
"server_seed_revealed": "Alan Turing",
"current_nonce": 7,
"activated_at": new Date(Date.now()),
"rotated_at": new Date(Date.now()),
"revealed_at": new Date(Date.now()),
},
{
// type code here for "relation_one" field
// type code here for "relation_one" field
"status": "revealed",
"client_seed_text": "Marie Curie",
"client_seed_number": 4.73,
"server_seed_hash": "Alan Turing",
"server_seed_revealed": "Alan Turing",
"current_nonce": 2,
"activated_at": new Date(Date.now()),
"rotated_at": new Date(Date.now()),
"revealed_at": new Date(Date.now()),
},
{
// type code here for "relation_one" field
// type code here for "relation_one" field
"status": "active",
"client_seed_text": "Ada Lovelace",
"client_seed_number": 3.39,
"server_seed_hash": "Alan Turing",
"server_seed_revealed": "Alan Turing",
"current_nonce": 4,
"activated_at": new Date(Date.now()),
"rotated_at": new Date(Date.now()),
"revealed_at": new Date(Date.now()),
},
{
// type code here for "relation_one" field
// type code here for "relation_one" field
"status": "rotated",
"client_seed_text": "Grace Hopper",
"client_seed_number": 8.44,
"server_seed_hash": "Alan Turing",
"server_seed_revealed": "Alan Turing",
"current_nonce": 8,
"activated_at": new Date(Date.now()),
"rotated_at": new Date(Date.now()),
"revealed_at": new Date(Date.now()),
},
{
// type code here for "relation_one" field
// type code here for "relation_one" field
"status": "revealed",
"client_seed_text": "Grace Hopper",
"client_seed_number": 7.74,
"server_seed_hash": "Marie Curie",
"server_seed_revealed": "Marie Curie",
"current_nonce": 6,
"activated_at": new Date(Date.now()),
"rotated_at": new Date(Date.now()),
"revealed_at": new Date(Date.now()),
},
];
const BonusesData = [
{
"code": "Ada Lovelace",
"name": "Ada Lovelace",
"type": "cashback",
"status": "paused",
"percentage": 8.05,
"max_amount": 1.5,
"min_deposit": 5.64,
"wagering_requirement": 7.92,
"starts_at": new Date(Date.now()),
"ends_at": new Date(Date.now()),
"terms": "Marie Curie",
},
{
"code": "Alan Turing",
"name": "Grace Hopper",
"type": "deposit_match",
"status": "paused",
"percentage": 2.63,
"max_amount": 6.62,
"min_deposit": 5.91,
"wagering_requirement": 6.92,
"starts_at": new Date(Date.now()),
"ends_at": new Date(Date.now()),
"terms": "Marie Curie",
},
{
"code": "Ada Lovelace",
"name": "Alan Turing",
"type": "cashback",
"status": "expired",
"percentage": 4.16,
"max_amount": 9.14,
"min_deposit": 6.69,
"wagering_requirement": 4.07,
"starts_at": new Date(Date.now()),
"ends_at": new Date(Date.now()),
"terms": "Ada Lovelace",
},
{
"code": "Alan Turing",
"name": "Alan Turing",
"type": "free_balance",
"status": "expired",
"percentage": 0.59,
"max_amount": 1.92,
"min_deposit": 5.15,
"wagering_requirement": 6.09,
"starts_at": new Date(Date.now()),
"ends_at": new Date(Date.now()),
"terms": "Grace Hopper",
},
{
"code": "Alan Turing",
"name": "Ada Lovelace",
"type": "free_balance",
"status": "active",
"percentage": 7.17,
"max_amount": 4.77,
"min_deposit": 9.31,
"wagering_requirement": 7.79,
"starts_at": new Date(Date.now()),
"ends_at": new Date(Date.now()),
"terms": "Grace Hopper",
},
];
const UserBonusClaimsData = [
{
// type code here for "relation_one" field
// type code here for "relation_one" field
// type code here for "relation_one" field
"status": "canceled",
"credited_amount": 6.48,
"wagering_progress": 8.77,
"wagering_target": 1.52,
"claimed_at": new Date(Date.now()),
"completed_at": new Date(Date.now()),
},
{
// type code here for "relation_one" field
// type code here for "relation_one" field
// type code here for "relation_one" field
"status": "canceled",
"credited_amount": 3.93,
"wagering_progress": 3.59,
"wagering_target": 3.32,
"claimed_at": new Date(Date.now()),
"completed_at": new Date(Date.now()),
},
{
// type code here for "relation_one" field
// type code here for "relation_one" field
// type code here for "relation_one" field
"status": "canceled",
"credited_amount": 1.8,
"wagering_progress": 3.26,
"wagering_target": 4.33,
"claimed_at": new Date(Date.now()),
"completed_at": new Date(Date.now()),
},
{
// type code here for "relation_one" field
// type code here for "relation_one" field
// type code here for "relation_one" field
"status": "active",
"credited_amount": 6.9,
"wagering_progress": 5.33,
"wagering_target": 6.51,
"claimed_at": new Date(Date.now()),
"completed_at": new Date(Date.now()),
},
{
// type code here for "relation_one" field
// type code here for "relation_one" field
// type code here for "relation_one" field
"status": "completed",
"credited_amount": 3.96,
"wagering_progress": 2.77,
"wagering_target": 2.12,
"claimed_at": new Date(Date.now()),
"completed_at": new Date(Date.now()),
},
];
const VipTiersData = [
{
"name": "Ada Lovelace",
"level": 4,
"min_wagered": 9.46,
"cashback_percent": 6.22,
"withdrawal_fee_discount_percent": 4.72,
"benefits": "Ada Lovelace",
"enabled": false,
},
{
"name": "Alan Turing",
"level": 8,
"min_wagered": 0.59,
"cashback_percent": 6.83,
"withdrawal_fee_discount_percent": 1.02,
"benefits": "Grace Hopper",
"enabled": false,
},
{
"name": "Ada Lovelace",
"level": 9,
"min_wagered": 4.25,
"cashback_percent": 0.25,
"withdrawal_fee_discount_percent": 0.91,
"benefits": "Marie Curie",
"enabled": true,
},
{
"name": "Marie Curie",
"level": 4,
"min_wagered": 7.93,
"cashback_percent": 4.7,
"withdrawal_fee_discount_percent": 3.52,
"benefits": "Ada Lovelace",
"enabled": true,
},
{
"name": "Grace Hopper",
"level": 1,
"min_wagered": 1.97,
"cashback_percent": 0.64,
"withdrawal_fee_discount_percent": 1.7,
"benefits": "Alan Turing",
"enabled": true,
},
];
const UserVipStatusesData = [
{
// type code here for "relation_one" field
// type code here for "relation_one" field
"total_wagered": 3.3,
"tier_assigned_at": new Date(Date.now()),
"tier_expires_at": new Date(Date.now()),
},
{
// type code here for "relation_one" field
// type code here for "relation_one" field
"total_wagered": 5.88,
"tier_assigned_at": new Date(Date.now()),
"tier_expires_at": new Date(Date.now()),
},
{
// type code here for "relation_one" field
// type code here for "relation_one" field
"total_wagered": 8.63,
"tier_assigned_at": new Date(Date.now()),
"tier_expires_at": new Date(Date.now()),
},
{
// type code here for "relation_one" field
// type code here for "relation_one" field
"total_wagered": 5.42,
"tier_assigned_at": new Date(Date.now()),
"tier_expires_at": new Date(Date.now()),
},
{
// type code here for "relation_one" field
// type code here for "relation_one" field
"total_wagered": 7.04,
"tier_assigned_at": new Date(Date.now()),
"tier_expires_at": new Date(Date.now()),
},
];
const RiskRulesData = [
{
"name": "Marie Curie",
"status": "active",
"max_bet": 6.59,
"max_profit": 0.01,
"max_withdrawal_per_day": 4.49,
"max_withdrawal_per_tx": 3.41,
"max_bets_per_minute": 2,
"requires_manual_withdrawal_review": true,
"conditions_json": "Marie Curie",
},
{
"name": "Marie Curie",
"status": "disabled",
"max_bet": 7.57,
"max_profit": 3.82,
"max_withdrawal_per_day": 4.58,
"max_withdrawal_per_tx": 2.89,
"max_bets_per_minute": 9,
"requires_manual_withdrawal_review": true,
"conditions_json": "Grace Hopper",
},
{
"name": "Ada Lovelace",
"status": "active",
"max_bet": 3.31,
"max_profit": 1.09,
"max_withdrawal_per_day": 5.45,
"max_withdrawal_per_tx": 9.66,
"max_bets_per_minute": 5,
"requires_manual_withdrawal_review": false,
"conditions_json": "Alan Turing",
},
{
"name": "Ada Lovelace",
"status": "active",
"max_bet": 9.14,
"max_profit": 8.19,
"max_withdrawal_per_day": 0.57,
"max_withdrawal_per_tx": 6.1,
"max_bets_per_minute": 1,
"requires_manual_withdrawal_review": true,
"conditions_json": "Marie Curie",
},
{
"name": "Grace Hopper",
"status": "active",
"max_bet": 7.7,
"max_profit": 3.27,
"max_withdrawal_per_day": 6.3,
"max_withdrawal_per_tx": 0.35,
"max_bets_per_minute": 1,
"requires_manual_withdrawal_review": true,
"conditions_json": "Alan Turing",
},
];
const SecurityEventsData = [
{
// type code here for "relation_one" field
"event_type": "api_key_revoked",
"ip_address": "Ada Lovelace",
"user_agent": "Grace Hopper",
"details": "Alan Turing",
"occurred_at": new Date(Date.now()),
},
{
// type code here for "relation_one" field
"event_type": "withdrawal_approved",
"ip_address": "Grace Hopper",
"user_agent": "Grace Hopper",
"details": "Ada Lovelace",
"occurred_at": new Date(Date.now()),
},
{
// type code here for "relation_one" field
"event_type": "api_key_revoked",
"ip_address": "Marie Curie",
"user_agent": "Marie Curie",
"details": "Marie Curie",
"occurred_at": new Date(Date.now()),
},
{
// type code here for "relation_one" field
"event_type": "password_changed",
"ip_address": "Ada Lovelace",
"user_agent": "Ada Lovelace",
"details": "Ada Lovelace",
"occurred_at": new Date(Date.now()),
},
{
// type code here for "relation_one" field
"event_type": "api_key_created",
"ip_address": "Ada Lovelace",
"user_agent": "Marie Curie",
"details": "Grace Hopper",
"occurred_at": new Date(Date.now()),
},
];
const ApiKeysData = [
{
// type code here for "relation_one" field
"name": "Ada Lovelace",
"key_prefix": "Ada Lovelace",
"key_hash": "Grace Hopper",
"status": "active",
"last_used_at": new Date(Date.now()),
"revoked_at": new Date(Date.now()),
},
{
// type code here for "relation_one" field
"name": "Ada Lovelace",
"key_prefix": "Ada Lovelace",
"key_hash": "Ada Lovelace",
"status": "active",
"last_used_at": new Date(Date.now()),
"revoked_at": new Date(Date.now()),
},
{
// type code here for "relation_one" field
"name": "Marie Curie",
"key_prefix": "Ada Lovelace",
"key_hash": "Grace Hopper",
"status": "active",
"last_used_at": new Date(Date.now()),
"revoked_at": new Date(Date.now()),
},
{
// type code here for "relation_one" field
"name": "Alan Turing",
"key_prefix": "Ada Lovelace",
"key_hash": "Marie Curie",
"status": "revoked",
"last_used_at": new Date(Date.now()),
"revoked_at": new Date(Date.now()),
},
{
// type code here for "relation_one" field
"name": "Grace Hopper",
"key_prefix": "Grace Hopper",
"key_hash": "Ada Lovelace",
"status": "active",
"last_used_at": new Date(Date.now()),
"revoked_at": new Date(Date.now()),
},
];
const AnnouncementsData = [
{
"title": "Grace Hopper",
"slug": "Marie Curie",
"content": "Marie Curie",
"status": "archived",
"published_at": new Date(Date.now()),
},
{
"title": "Alan Turing",
"slug": "Ada Lovelace",
"content": "Marie Curie",
"status": "published",
"published_at": new Date(Date.now()),
},
{
"title": "Alan Turing",
"slug": "Grace Hopper",
"content": "Grace Hopper",
"status": "published",
"published_at": new Date(Date.now()),
},
{
"title": "Grace Hopper",
"slug": "Ada Lovelace",
"content": "Grace Hopper",
"status": "archived",
"published_at": new Date(Date.now()),
},
{
"title": "Ada Lovelace",
"slug": "Alan Turing",
"content": "Ada Lovelace",
"status": "archived",
"published_at": new Date(Date.now()),
},
];
const SupportTicketsData = [
{
// type code here for "relation_one" field
"subject": "Grace Hopper",
"status": "resolved",
"priority": "normal",
"message": "Ada Lovelace",
// type code here for "files" field
"opened_at": new Date(Date.now()),
"closed_at": new Date(Date.now()),
},
{
// type code here for "relation_one" field
"subject": "Marie Curie",
"status": "open",
"priority": "normal",
"message": "Alan Turing",
// type code here for "files" field
"opened_at": new Date(Date.now()),
"closed_at": new Date(Date.now()),
},
{
// type code here for "relation_one" field
"subject": "Grace Hopper",
"status": "open",
"priority": "normal",
"message": "Alan Turing",
// type code here for "files" field
"opened_at": new Date(Date.now()),
"closed_at": new Date(Date.now()),
},
{
// type code here for "relation_one" field
"subject": "Marie Curie",
"status": "pending",
"priority": "normal",
"message": "Marie Curie",
// type code here for "files" field
"opened_at": new Date(Date.now()),
"closed_at": new Date(Date.now()),
},
{
// type code here for "relation_one" field
"subject": "Marie Curie",
"status": "resolved",
"priority": "low",
"message": "Marie Curie",
// type code here for "files" field
"opened_at": new Date(Date.now()),
"closed_at": new Date(Date.now()),
},
];
const AuditLogsData = [
{
// type code here for "relation_one" field
"action": "Marie Curie",
"entity_name": "Alan Turing",
"entity_key": "Grace Hopper",
"before_json": "Grace Hopper",
"after_json": "Grace Hopper",
"ip_address": "Grace Hopper",
"logged_at": new Date(Date.now()),
},
{
// type code here for "relation_one" field
"action": "Ada Lovelace",
"entity_name": "Grace Hopper",
"entity_key": "Marie Curie",
"before_json": "Alan Turing",
"after_json": "Marie Curie",
"ip_address": "Marie Curie",
"logged_at": new Date(Date.now()),
},
{
// type code here for "relation_one" field
"action": "Ada Lovelace",
"entity_name": "Alan Turing",
"entity_key": "Alan Turing",
"before_json": "Grace Hopper",
"after_json": "Marie Curie",
"ip_address": "Grace Hopper",
"logged_at": new Date(Date.now()),
},
{
// type code here for "relation_one" field
"action": "Marie Curie",
"entity_name": "Alan Turing",
"entity_key": "Grace Hopper",
"before_json": "Marie Curie",
"after_json": "Ada Lovelace",
"ip_address": "Ada Lovelace",
"logged_at": new Date(Date.now()),
},
{
// type code here for "relation_one" field
"action": "Marie Curie",
"entity_name": "Marie Curie",
"entity_key": "Grace Hopper",
"before_json": "Grace Hopper",
"after_json": "Grace Hopper",
"ip_address": "Marie Curie",
"logged_at": new Date(Date.now()),
},
];
// Similar logic for "relation_many"
async function associateWalletWithUser() {
const relatedUser0 = await Users.findOne({
offset: Math.floor(Math.random() * (await Users.count())),
});
const Wallet0 = await Wallets.findOne({
order: [['id', 'ASC']],
offset: 0
});
if (Wallet0?.setUser)
{
await
Wallet0.
setUser(relatedUser0);
}
const relatedUser1 = await Users.findOne({
offset: Math.floor(Math.random() * (await Users.count())),
});
const Wallet1 = await Wallets.findOne({
order: [['id', 'ASC']],
offset: 1
});
if (Wallet1?.setUser)
{
await
Wallet1.
setUser(relatedUser1);
}
const relatedUser2 = await Users.findOne({
offset: Math.floor(Math.random() * (await Users.count())),
});
const Wallet2 = await Wallets.findOne({
order: [['id', 'ASC']],
offset: 2
});
if (Wallet2?.setUser)
{
await
Wallet2.
setUser(relatedUser2);
}
const relatedUser3 = await Users.findOne({
offset: Math.floor(Math.random() * (await Users.count())),
});
const Wallet3 = await Wallets.findOne({
order: [['id', 'ASC']],
offset: 3
});
if (Wallet3?.setUser)
{
await
Wallet3.
setUser(relatedUser3);
}
const relatedUser4 = await Users.findOne({
offset: Math.floor(Math.random() * (await Users.count())),
});
const Wallet4 = await Wallets.findOne({
order: [['id', 'ASC']],
offset: 4
});
if (Wallet4?.setUser)
{
await
Wallet4.
setUser(relatedUser4);
}
}
async function associateWalletWithCurrency() {
const relatedCurrency0 = await Currencies.findOne({
offset: Math.floor(Math.random() * (await Currencies.count())),
});
const Wallet0 = await Wallets.findOne({
order: [['id', 'ASC']],
offset: 0
});
if (Wallet0?.setCurrency)
{
await
Wallet0.
setCurrency(relatedCurrency0);
}
const relatedCurrency1 = await Currencies.findOne({
offset: Math.floor(Math.random() * (await Currencies.count())),
});
const Wallet1 = await Wallets.findOne({
order: [['id', 'ASC']],
offset: 1
});
if (Wallet1?.setCurrency)
{
await
Wallet1.
setCurrency(relatedCurrency1);
}
const relatedCurrency2 = await Currencies.findOne({
offset: Math.floor(Math.random() * (await Currencies.count())),
});
const Wallet2 = await Wallets.findOne({
order: [['id', 'ASC']],
offset: 2
});
if (Wallet2?.setCurrency)
{
await
Wallet2.
setCurrency(relatedCurrency2);
}
const relatedCurrency3 = await Currencies.findOne({
offset: Math.floor(Math.random() * (await Currencies.count())),
});
const Wallet3 = await Wallets.findOne({
order: [['id', 'ASC']],
offset: 3
});
if (Wallet3?.setCurrency)
{
await
Wallet3.
setCurrency(relatedCurrency3);
}
const relatedCurrency4 = await Currencies.findOne({
offset: Math.floor(Math.random() * (await Currencies.count())),
});
const Wallet4 = await Wallets.findOne({
order: [['id', 'ASC']],
offset: 4
});
if (Wallet4?.setCurrency)
{
await
Wallet4.
setCurrency(relatedCurrency4);
}
}
async function associateWalletWithNetwork() {
const relatedNetwork0 = await Networks.findOne({
offset: Math.floor(Math.random() * (await Networks.count())),
});
const Wallet0 = await Wallets.findOne({
order: [['id', 'ASC']],
offset: 0
});
if (Wallet0?.setNetwork)
{
await
Wallet0.
setNetwork(relatedNetwork0);
}
const relatedNetwork1 = await Networks.findOne({
offset: Math.floor(Math.random() * (await Networks.count())),
});
const Wallet1 = await Wallets.findOne({
order: [['id', 'ASC']],
offset: 1
});
if (Wallet1?.setNetwork)
{
await
Wallet1.
setNetwork(relatedNetwork1);
}
const relatedNetwork2 = await Networks.findOne({
offset: Math.floor(Math.random() * (await Networks.count())),
});
const Wallet2 = await Wallets.findOne({
order: [['id', 'ASC']],
offset: 2
});
if (Wallet2?.setNetwork)
{
await
Wallet2.
setNetwork(relatedNetwork2);
}
const relatedNetwork3 = await Networks.findOne({
offset: Math.floor(Math.random() * (await Networks.count())),
});
const Wallet3 = await Wallets.findOne({
order: [['id', 'ASC']],
offset: 3
});
if (Wallet3?.setNetwork)
{
await
Wallet3.
setNetwork(relatedNetwork3);
}
const relatedNetwork4 = await Networks.findOne({
offset: Math.floor(Math.random() * (await Networks.count())),
});
const Wallet4 = await Wallets.findOne({
order: [['id', 'ASC']],
offset: 4
});
if (Wallet4?.setNetwork)
{
await
Wallet4.
setNetwork(relatedNetwork4);
}
}
async function associateDepositAddressWithWallet() {
const relatedWallet0 = await Wallets.findOne({
offset: Math.floor(Math.random() * (await Wallets.count())),
});
const DepositAddress0 = await DepositAddresses.findOne({
order: [['id', 'ASC']],
offset: 0
});
if (DepositAddress0?.setWallet)
{
await
DepositAddress0.
setWallet(relatedWallet0);
}
const relatedWallet1 = await Wallets.findOne({
offset: Math.floor(Math.random() * (await Wallets.count())),
});
const DepositAddress1 = await DepositAddresses.findOne({
order: [['id', 'ASC']],
offset: 1
});
if (DepositAddress1?.setWallet)
{
await
DepositAddress1.
setWallet(relatedWallet1);
}
const relatedWallet2 = await Wallets.findOne({
offset: Math.floor(Math.random() * (await Wallets.count())),
});
const DepositAddress2 = await DepositAddresses.findOne({
order: [['id', 'ASC']],
offset: 2
});
if (DepositAddress2?.setWallet)
{
await
DepositAddress2.
setWallet(relatedWallet2);
}
const relatedWallet3 = await Wallets.findOne({
offset: Math.floor(Math.random() * (await Wallets.count())),
});
const DepositAddress3 = await DepositAddresses.findOne({
order: [['id', 'ASC']],
offset: 3
});
if (DepositAddress3?.setWallet)
{
await
DepositAddress3.
setWallet(relatedWallet3);
}
const relatedWallet4 = await Wallets.findOne({
offset: Math.floor(Math.random() * (await Wallets.count())),
});
const DepositAddress4 = await DepositAddresses.findOne({
order: [['id', 'ASC']],
offset: 4
});
if (DepositAddress4?.setWallet)
{
await
DepositAddress4.
setWallet(relatedWallet4);
}
}
async function associateTransactionWithUser() {
const relatedUser0 = await Users.findOne({
offset: Math.floor(Math.random() * (await Users.count())),
});
const Transaction0 = await Transactions.findOne({
order: [['id', 'ASC']],
offset: 0
});
if (Transaction0?.setUser)
{
await
Transaction0.
setUser(relatedUser0);
}
const relatedUser1 = await Users.findOne({
offset: Math.floor(Math.random() * (await Users.count())),
});
const Transaction1 = await Transactions.findOne({
order: [['id', 'ASC']],
offset: 1
});
if (Transaction1?.setUser)
{
await
Transaction1.
setUser(relatedUser1);
}
const relatedUser2 = await Users.findOne({
offset: Math.floor(Math.random() * (await Users.count())),
});
const Transaction2 = await Transactions.findOne({
order: [['id', 'ASC']],
offset: 2
});
if (Transaction2?.setUser)
{
await
Transaction2.
setUser(relatedUser2);
}
const relatedUser3 = await Users.findOne({
offset: Math.floor(Math.random() * (await Users.count())),
});
const Transaction3 = await Transactions.findOne({
order: [['id', 'ASC']],
offset: 3
});
if (Transaction3?.setUser)
{
await
Transaction3.
setUser(relatedUser3);
}
const relatedUser4 = await Users.findOne({
offset: Math.floor(Math.random() * (await Users.count())),
});
const Transaction4 = await Transactions.findOne({
order: [['id', 'ASC']],
offset: 4
});
if (Transaction4?.setUser)
{
await
Transaction4.
setUser(relatedUser4);
}
}
async function associateTransactionWithWallet() {
const relatedWallet0 = await Wallets.findOne({
offset: Math.floor(Math.random() * (await Wallets.count())),
});
const Transaction0 = await Transactions.findOne({
order: [['id', 'ASC']],
offset: 0
});
if (Transaction0?.setWallet)
{
await
Transaction0.
setWallet(relatedWallet0);
}
const relatedWallet1 = await Wallets.findOne({
offset: Math.floor(Math.random() * (await Wallets.count())),
});
const Transaction1 = await Transactions.findOne({
order: [['id', 'ASC']],
offset: 1
});
if (Transaction1?.setWallet)
{
await
Transaction1.
setWallet(relatedWallet1);
}
const relatedWallet2 = await Wallets.findOne({
offset: Math.floor(Math.random() * (await Wallets.count())),
});
const Transaction2 = await Transactions.findOne({
order: [['id', 'ASC']],
offset: 2
});
if (Transaction2?.setWallet)
{
await
Transaction2.
setWallet(relatedWallet2);
}
const relatedWallet3 = await Wallets.findOne({
offset: Math.floor(Math.random() * (await Wallets.count())),
});
const Transaction3 = await Transactions.findOne({
order: [['id', 'ASC']],
offset: 3
});
if (Transaction3?.setWallet)
{
await
Transaction3.
setWallet(relatedWallet3);
}
const relatedWallet4 = await Wallets.findOne({
offset: Math.floor(Math.random() * (await Wallets.count())),
});
const Transaction4 = await Transactions.findOne({
order: [['id', 'ASC']],
offset: 4
});
if (Transaction4?.setWallet)
{
await
Transaction4.
setWallet(relatedWallet4);
}
}
async function associateTransactionWithCurrency() {
const relatedCurrency0 = await Currencies.findOne({
offset: Math.floor(Math.random() * (await Currencies.count())),
});
const Transaction0 = await Transactions.findOne({
order: [['id', 'ASC']],
offset: 0
});
if (Transaction0?.setCurrency)
{
await
Transaction0.
setCurrency(relatedCurrency0);
}
const relatedCurrency1 = await Currencies.findOne({
offset: Math.floor(Math.random() * (await Currencies.count())),
});
const Transaction1 = await Transactions.findOne({
order: [['id', 'ASC']],
offset: 1
});
if (Transaction1?.setCurrency)
{
await
Transaction1.
setCurrency(relatedCurrency1);
}
const relatedCurrency2 = await Currencies.findOne({
offset: Math.floor(Math.random() * (await Currencies.count())),
});
const Transaction2 = await Transactions.findOne({
order: [['id', 'ASC']],
offset: 2
});
if (Transaction2?.setCurrency)
{
await
Transaction2.
setCurrency(relatedCurrency2);
}
const relatedCurrency3 = await Currencies.findOne({
offset: Math.floor(Math.random() * (await Currencies.count())),
});
const Transaction3 = await Transactions.findOne({
order: [['id', 'ASC']],
offset: 3
});
if (Transaction3?.setCurrency)
{
await
Transaction3.
setCurrency(relatedCurrency3);
}
const relatedCurrency4 = await Currencies.findOne({
offset: Math.floor(Math.random() * (await Currencies.count())),
});
const Transaction4 = await Transactions.findOne({
order: [['id', 'ASC']],
offset: 4
});
if (Transaction4?.setCurrency)
{
await
Transaction4.
setCurrency(relatedCurrency4);
}
}
async function associateTransactionWithNetwork() {
const relatedNetwork0 = await Networks.findOne({
offset: Math.floor(Math.random() * (await Networks.count())),
});
const Transaction0 = await Transactions.findOne({
order: [['id', 'ASC']],
offset: 0
});
if (Transaction0?.setNetwork)
{
await
Transaction0.
setNetwork(relatedNetwork0);
}
const relatedNetwork1 = await Networks.findOne({
offset: Math.floor(Math.random() * (await Networks.count())),
});
const Transaction1 = await Transactions.findOne({
order: [['id', 'ASC']],
offset: 1
});
if (Transaction1?.setNetwork)
{
await
Transaction1.
setNetwork(relatedNetwork1);
}
const relatedNetwork2 = await Networks.findOne({
offset: Math.floor(Math.random() * (await Networks.count())),
});
const Transaction2 = await Transactions.findOne({
order: [['id', 'ASC']],
offset: 2
});
if (Transaction2?.setNetwork)
{
await
Transaction2.
setNetwork(relatedNetwork2);
}
const relatedNetwork3 = await Networks.findOne({
offset: Math.floor(Math.random() * (await Networks.count())),
});
const Transaction3 = await Transactions.findOne({
order: [['id', 'ASC']],
offset: 3
});
if (Transaction3?.setNetwork)
{
await
Transaction3.
setNetwork(relatedNetwork3);
}
const relatedNetwork4 = await Networks.findOne({
offset: Math.floor(Math.random() * (await Networks.count())),
});
const Transaction4 = await Transactions.findOne({
order: [['id', 'ASC']],
offset: 4
});
if (Transaction4?.setNetwork)
{
await
Transaction4.
setNetwork(relatedNetwork4);
}
}
async function associateWithdrawalRequestWithUser() {
const relatedUser0 = await Users.findOne({
offset: Math.floor(Math.random() * (await Users.count())),
});
const WithdrawalRequest0 = await WithdrawalRequests.findOne({
order: [['id', 'ASC']],
offset: 0
});
if (WithdrawalRequest0?.setUser)
{
await
WithdrawalRequest0.
setUser(relatedUser0);
}
const relatedUser1 = await Users.findOne({
offset: Math.floor(Math.random() * (await Users.count())),
});
const WithdrawalRequest1 = await WithdrawalRequests.findOne({
order: [['id', 'ASC']],
offset: 1
});
if (WithdrawalRequest1?.setUser)
{
await
WithdrawalRequest1.
setUser(relatedUser1);
}
const relatedUser2 = await Users.findOne({
offset: Math.floor(Math.random() * (await Users.count())),
});
const WithdrawalRequest2 = await WithdrawalRequests.findOne({
order: [['id', 'ASC']],
offset: 2
});
if (WithdrawalRequest2?.setUser)
{
await
WithdrawalRequest2.
setUser(relatedUser2);
}
const relatedUser3 = await Users.findOne({
offset: Math.floor(Math.random() * (await Users.count())),
});
const WithdrawalRequest3 = await WithdrawalRequests.findOne({
order: [['id', 'ASC']],
offset: 3
});
if (WithdrawalRequest3?.setUser)
{
await
WithdrawalRequest3.
setUser(relatedUser3);
}
const relatedUser4 = await Users.findOne({
offset: Math.floor(Math.random() * (await Users.count())),
});
const WithdrawalRequest4 = await WithdrawalRequests.findOne({
order: [['id', 'ASC']],
offset: 4
});
if (WithdrawalRequest4?.setUser)
{
await
WithdrawalRequest4.
setUser(relatedUser4);
}
}
async function associateWithdrawalRequestWithWallet() {
const relatedWallet0 = await Wallets.findOne({
offset: Math.floor(Math.random() * (await Wallets.count())),
});
const WithdrawalRequest0 = await WithdrawalRequests.findOne({
order: [['id', 'ASC']],
offset: 0
});
if (WithdrawalRequest0?.setWallet)
{
await
WithdrawalRequest0.
setWallet(relatedWallet0);
}
const relatedWallet1 = await Wallets.findOne({
offset: Math.floor(Math.random() * (await Wallets.count())),
});
const WithdrawalRequest1 = await WithdrawalRequests.findOne({
order: [['id', 'ASC']],
offset: 1
});
if (WithdrawalRequest1?.setWallet)
{
await
WithdrawalRequest1.
setWallet(relatedWallet1);
}
const relatedWallet2 = await Wallets.findOne({
offset: Math.floor(Math.random() * (await Wallets.count())),
});
const WithdrawalRequest2 = await WithdrawalRequests.findOne({
order: [['id', 'ASC']],
offset: 2
});
if (WithdrawalRequest2?.setWallet)
{
await
WithdrawalRequest2.
setWallet(relatedWallet2);
}
const relatedWallet3 = await Wallets.findOne({
offset: Math.floor(Math.random() * (await Wallets.count())),
});
const WithdrawalRequest3 = await WithdrawalRequests.findOne({
order: [['id', 'ASC']],
offset: 3
});
if (WithdrawalRequest3?.setWallet)
{
await
WithdrawalRequest3.
setWallet(relatedWallet3);
}
const relatedWallet4 = await Wallets.findOne({
offset: Math.floor(Math.random() * (await Wallets.count())),
});
const WithdrawalRequest4 = await WithdrawalRequests.findOne({
order: [['id', 'ASC']],
offset: 4
});
if (WithdrawalRequest4?.setWallet)
{
await
WithdrawalRequest4.
setWallet(relatedWallet4);
}
}
async function associateWithdrawalRequestWithCurrency() {
const relatedCurrency0 = await Currencies.findOne({
offset: Math.floor(Math.random() * (await Currencies.count())),
});
const WithdrawalRequest0 = await WithdrawalRequests.findOne({
order: [['id', 'ASC']],
offset: 0
});
if (WithdrawalRequest0?.setCurrency)
{
await
WithdrawalRequest0.
setCurrency(relatedCurrency0);
}
const relatedCurrency1 = await Currencies.findOne({
offset: Math.floor(Math.random() * (await Currencies.count())),
});
const WithdrawalRequest1 = await WithdrawalRequests.findOne({
order: [['id', 'ASC']],
offset: 1
});
if (WithdrawalRequest1?.setCurrency)
{
await
WithdrawalRequest1.
setCurrency(relatedCurrency1);
}
const relatedCurrency2 = await Currencies.findOne({
offset: Math.floor(Math.random() * (await Currencies.count())),
});
const WithdrawalRequest2 = await WithdrawalRequests.findOne({
order: [['id', 'ASC']],
offset: 2
});
if (WithdrawalRequest2?.setCurrency)
{
await
WithdrawalRequest2.
setCurrency(relatedCurrency2);
}
const relatedCurrency3 = await Currencies.findOne({
offset: Math.floor(Math.random() * (await Currencies.count())),
});
const WithdrawalRequest3 = await WithdrawalRequests.findOne({
order: [['id', 'ASC']],
offset: 3
});
if (WithdrawalRequest3?.setCurrency)
{
await
WithdrawalRequest3.
setCurrency(relatedCurrency3);
}
const relatedCurrency4 = await Currencies.findOne({
offset: Math.floor(Math.random() * (await Currencies.count())),
});
const WithdrawalRequest4 = await WithdrawalRequests.findOne({
order: [['id', 'ASC']],
offset: 4
});
if (WithdrawalRequest4?.setCurrency)
{
await
WithdrawalRequest4.
setCurrency(relatedCurrency4);
}
}
async function associateWithdrawalRequestWithNetwork() {
const relatedNetwork0 = await Networks.findOne({
offset: Math.floor(Math.random() * (await Networks.count())),
});
const WithdrawalRequest0 = await WithdrawalRequests.findOne({
order: [['id', 'ASC']],
offset: 0
});
if (WithdrawalRequest0?.setNetwork)
{
await
WithdrawalRequest0.
setNetwork(relatedNetwork0);
}
const relatedNetwork1 = await Networks.findOne({
offset: Math.floor(Math.random() * (await Networks.count())),
});
const WithdrawalRequest1 = await WithdrawalRequests.findOne({
order: [['id', 'ASC']],
offset: 1
});
if (WithdrawalRequest1?.setNetwork)
{
await
WithdrawalRequest1.
setNetwork(relatedNetwork1);
}
const relatedNetwork2 = await Networks.findOne({
offset: Math.floor(Math.random() * (await Networks.count())),
});
const WithdrawalRequest2 = await WithdrawalRequests.findOne({
order: [['id', 'ASC']],
offset: 2
});
if (WithdrawalRequest2?.setNetwork)
{
await
WithdrawalRequest2.
setNetwork(relatedNetwork2);
}
const relatedNetwork3 = await Networks.findOne({
offset: Math.floor(Math.random() * (await Networks.count())),
});
const WithdrawalRequest3 = await WithdrawalRequests.findOne({
order: [['id', 'ASC']],
offset: 3
});
if (WithdrawalRequest3?.setNetwork)
{
await
WithdrawalRequest3.
setNetwork(relatedNetwork3);
}
const relatedNetwork4 = await Networks.findOne({
offset: Math.floor(Math.random() * (await Networks.count())),
});
const WithdrawalRequest4 = await WithdrawalRequests.findOne({
order: [['id', 'ASC']],
offset: 4
});
if (WithdrawalRequest4?.setNetwork)
{
await
WithdrawalRequest4.
setNetwork(relatedNetwork4);
}
}
async function associateDiceBetWithUser() {
const relatedUser0 = await Users.findOne({
offset: Math.floor(Math.random() * (await Users.count())),
});
const DiceBet0 = await DiceBets.findOne({
order: [['id', 'ASC']],
offset: 0
});
if (DiceBet0?.setUser)
{
await
DiceBet0.
setUser(relatedUser0);
}
const relatedUser1 = await Users.findOne({
offset: Math.floor(Math.random() * (await Users.count())),
});
const DiceBet1 = await DiceBets.findOne({
order: [['id', 'ASC']],
offset: 1
});
if (DiceBet1?.setUser)
{
await
DiceBet1.
setUser(relatedUser1);
}
const relatedUser2 = await Users.findOne({
offset: Math.floor(Math.random() * (await Users.count())),
});
const DiceBet2 = await DiceBets.findOne({
order: [['id', 'ASC']],
offset: 2
});
if (DiceBet2?.setUser)
{
await
DiceBet2.
setUser(relatedUser2);
}
const relatedUser3 = await Users.findOne({
offset: Math.floor(Math.random() * (await Users.count())),
});
const DiceBet3 = await DiceBets.findOne({
order: [['id', 'ASC']],
offset: 3
});
if (DiceBet3?.setUser)
{
await
DiceBet3.
setUser(relatedUser3);
}
const relatedUser4 = await Users.findOne({
offset: Math.floor(Math.random() * (await Users.count())),
});
const DiceBet4 = await DiceBets.findOne({
order: [['id', 'ASC']],
offset: 4
});
if (DiceBet4?.setUser)
{
await
DiceBet4.
setUser(relatedUser4);
}
}
async function associateDiceBetWithGame() {
const relatedGame0 = await Games.findOne({
offset: Math.floor(Math.random() * (await Games.count())),
});
const DiceBet0 = await DiceBets.findOne({
order: [['id', 'ASC']],
offset: 0
});
if (DiceBet0?.setGame)
{
await
DiceBet0.
setGame(relatedGame0);
}
const relatedGame1 = await Games.findOne({
offset: Math.floor(Math.random() * (await Games.count())),
});
const DiceBet1 = await DiceBets.findOne({
order: [['id', 'ASC']],
offset: 1
});
if (DiceBet1?.setGame)
{
await
DiceBet1.
setGame(relatedGame1);
}
const relatedGame2 = await Games.findOne({
offset: Math.floor(Math.random() * (await Games.count())),
});
const DiceBet2 = await DiceBets.findOne({
order: [['id', 'ASC']],
offset: 2
});
if (DiceBet2?.setGame)
{
await
DiceBet2.
setGame(relatedGame2);
}
const relatedGame3 = await Games.findOne({
offset: Math.floor(Math.random() * (await Games.count())),
});
const DiceBet3 = await DiceBets.findOne({
order: [['id', 'ASC']],
offset: 3
});
if (DiceBet3?.setGame)
{
await
DiceBet3.
setGame(relatedGame3);
}
const relatedGame4 = await Games.findOne({
offset: Math.floor(Math.random() * (await Games.count())),
});
const DiceBet4 = await DiceBets.findOne({
order: [['id', 'ASC']],
offset: 4
});
if (DiceBet4?.setGame)
{
await
DiceBet4.
setGame(relatedGame4);
}
}
async function associateDiceBetWithWallet() {
const relatedWallet0 = await Wallets.findOne({
offset: Math.floor(Math.random() * (await Wallets.count())),
});
const DiceBet0 = await DiceBets.findOne({
order: [['id', 'ASC']],
offset: 0
});
if (DiceBet0?.setWallet)
{
await
DiceBet0.
setWallet(relatedWallet0);
}
const relatedWallet1 = await Wallets.findOne({
offset: Math.floor(Math.random() * (await Wallets.count())),
});
const DiceBet1 = await DiceBets.findOne({
order: [['id', 'ASC']],
offset: 1
});
if (DiceBet1?.setWallet)
{
await
DiceBet1.
setWallet(relatedWallet1);
}
const relatedWallet2 = await Wallets.findOne({
offset: Math.floor(Math.random() * (await Wallets.count())),
});
const DiceBet2 = await DiceBets.findOne({
order: [['id', 'ASC']],
offset: 2
});
if (DiceBet2?.setWallet)
{
await
DiceBet2.
setWallet(relatedWallet2);
}
const relatedWallet3 = await Wallets.findOne({
offset: Math.floor(Math.random() * (await Wallets.count())),
});
const DiceBet3 = await DiceBets.findOne({
order: [['id', 'ASC']],
offset: 3
});
if (DiceBet3?.setWallet)
{
await
DiceBet3.
setWallet(relatedWallet3);
}
const relatedWallet4 = await Wallets.findOne({
offset: Math.floor(Math.random() * (await Wallets.count())),
});
const DiceBet4 = await DiceBets.findOne({
order: [['id', 'ASC']],
offset: 4
});
if (DiceBet4?.setWallet)
{
await
DiceBet4.
setWallet(relatedWallet4);
}
}
async function associateDiceBetWithCurrency() {
const relatedCurrency0 = await Currencies.findOne({
offset: Math.floor(Math.random() * (await Currencies.count())),
});
const DiceBet0 = await DiceBets.findOne({
order: [['id', 'ASC']],
offset: 0
});
if (DiceBet0?.setCurrency)
{
await
DiceBet0.
setCurrency(relatedCurrency0);
}
const relatedCurrency1 = await Currencies.findOne({
offset: Math.floor(Math.random() * (await Currencies.count())),
});
const DiceBet1 = await DiceBets.findOne({
order: [['id', 'ASC']],
offset: 1
});
if (DiceBet1?.setCurrency)
{
await
DiceBet1.
setCurrency(relatedCurrency1);
}
const relatedCurrency2 = await Currencies.findOne({
offset: Math.floor(Math.random() * (await Currencies.count())),
});
const DiceBet2 = await DiceBets.findOne({
order: [['id', 'ASC']],
offset: 2
});
if (DiceBet2?.setCurrency)
{
await
DiceBet2.
setCurrency(relatedCurrency2);
}
const relatedCurrency3 = await Currencies.findOne({
offset: Math.floor(Math.random() * (await Currencies.count())),
});
const DiceBet3 = await DiceBets.findOne({
order: [['id', 'ASC']],
offset: 3
});
if (DiceBet3?.setCurrency)
{
await
DiceBet3.
setCurrency(relatedCurrency3);
}
const relatedCurrency4 = await Currencies.findOne({
offset: Math.floor(Math.random() * (await Currencies.count())),
});
const DiceBet4 = await DiceBets.findOne({
order: [['id', 'ASC']],
offset: 4
});
if (DiceBet4?.setCurrency)
{
await
DiceBet4.
setCurrency(relatedCurrency4);
}
}
async function associateProvablyFairSessionWithUser() {
const relatedUser0 = await Users.findOne({
offset: Math.floor(Math.random() * (await Users.count())),
});
const ProvablyFairSession0 = await ProvablyFairSessions.findOne({
order: [['id', 'ASC']],
offset: 0
});
if (ProvablyFairSession0?.setUser)
{
await
ProvablyFairSession0.
setUser(relatedUser0);
}
const relatedUser1 = await Users.findOne({
offset: Math.floor(Math.random() * (await Users.count())),
});
const ProvablyFairSession1 = await ProvablyFairSessions.findOne({
order: [['id', 'ASC']],
offset: 1
});
if (ProvablyFairSession1?.setUser)
{
await
ProvablyFairSession1.
setUser(relatedUser1);
}
const relatedUser2 = await Users.findOne({
offset: Math.floor(Math.random() * (await Users.count())),
});
const ProvablyFairSession2 = await ProvablyFairSessions.findOne({
order: [['id', 'ASC']],
offset: 2
});
if (ProvablyFairSession2?.setUser)
{
await
ProvablyFairSession2.
setUser(relatedUser2);
}
const relatedUser3 = await Users.findOne({
offset: Math.floor(Math.random() * (await Users.count())),
});
const ProvablyFairSession3 = await ProvablyFairSessions.findOne({
order: [['id', 'ASC']],
offset: 3
});
if (ProvablyFairSession3?.setUser)
{
await
ProvablyFairSession3.
setUser(relatedUser3);
}
const relatedUser4 = await Users.findOne({
offset: Math.floor(Math.random() * (await Users.count())),
});
const ProvablyFairSession4 = await ProvablyFairSessions.findOne({
order: [['id', 'ASC']],
offset: 4
});
if (ProvablyFairSession4?.setUser)
{
await
ProvablyFairSession4.
setUser(relatedUser4);
}
}
async function associateProvablyFairSessionWithGame() {
const relatedGame0 = await Games.findOne({
offset: Math.floor(Math.random() * (await Games.count())),
});
const ProvablyFairSession0 = await ProvablyFairSessions.findOne({
order: [['id', 'ASC']],
offset: 0
});
if (ProvablyFairSession0?.setGame)
{
await
ProvablyFairSession0.
setGame(relatedGame0);
}
const relatedGame1 = await Games.findOne({
offset: Math.floor(Math.random() * (await Games.count())),
});
const ProvablyFairSession1 = await ProvablyFairSessions.findOne({
order: [['id', 'ASC']],
offset: 1
});
if (ProvablyFairSession1?.setGame)
{
await
ProvablyFairSession1.
setGame(relatedGame1);
}
const relatedGame2 = await Games.findOne({
offset: Math.floor(Math.random() * (await Games.count())),
});
const ProvablyFairSession2 = await ProvablyFairSessions.findOne({
order: [['id', 'ASC']],
offset: 2
});
if (ProvablyFairSession2?.setGame)
{
await
ProvablyFairSession2.
setGame(relatedGame2);
}
const relatedGame3 = await Games.findOne({
offset: Math.floor(Math.random() * (await Games.count())),
});
const ProvablyFairSession3 = await ProvablyFairSessions.findOne({
order: [['id', 'ASC']],
offset: 3
});
if (ProvablyFairSession3?.setGame)
{
await
ProvablyFairSession3.
setGame(relatedGame3);
}
const relatedGame4 = await Games.findOne({
offset: Math.floor(Math.random() * (await Games.count())),
});
const ProvablyFairSession4 = await ProvablyFairSessions.findOne({
order: [['id', 'ASC']],
offset: 4
});
if (ProvablyFairSession4?.setGame)
{
await
ProvablyFairSession4.
setGame(relatedGame4);
}
}
async function associateUserBonusClaimWithUser() {
const relatedUser0 = await Users.findOne({
offset: Math.floor(Math.random() * (await Users.count())),
});
const UserBonusClaim0 = await UserBonusClaims.findOne({
order: [['id', 'ASC']],
offset: 0
});
if (UserBonusClaim0?.setUser)
{
await
UserBonusClaim0.
setUser(relatedUser0);
}
const relatedUser1 = await Users.findOne({
offset: Math.floor(Math.random() * (await Users.count())),
});
const UserBonusClaim1 = await UserBonusClaims.findOne({
order: [['id', 'ASC']],
offset: 1
});
if (UserBonusClaim1?.setUser)
{
await
UserBonusClaim1.
setUser(relatedUser1);
}
const relatedUser2 = await Users.findOne({
offset: Math.floor(Math.random() * (await Users.count())),
});
const UserBonusClaim2 = await UserBonusClaims.findOne({
order: [['id', 'ASC']],
offset: 2
});
if (UserBonusClaim2?.setUser)
{
await
UserBonusClaim2.
setUser(relatedUser2);
}
const relatedUser3 = await Users.findOne({
offset: Math.floor(Math.random() * (await Users.count())),
});
const UserBonusClaim3 = await UserBonusClaims.findOne({
order: [['id', 'ASC']],
offset: 3
});
if (UserBonusClaim3?.setUser)
{
await
UserBonusClaim3.
setUser(relatedUser3);
}
const relatedUser4 = await Users.findOne({
offset: Math.floor(Math.random() * (await Users.count())),
});
const UserBonusClaim4 = await UserBonusClaims.findOne({
order: [['id', 'ASC']],
offset: 4
});
if (UserBonusClaim4?.setUser)
{
await
UserBonusClaim4.
setUser(relatedUser4);
}
}
async function associateUserBonusClaimWithBonu() {
const relatedBonu0 = await Bonuses.findOne({
offset: Math.floor(Math.random() * (await Bonuses.count())),
});
const UserBonusClaim0 = await UserBonusClaims.findOne({
order: [['id', 'ASC']],
offset: 0
});
if (UserBonusClaim0?.setBonu)
{
await
UserBonusClaim0.
setBonu(relatedBonu0);
}
const relatedBonu1 = await Bonuses.findOne({
offset: Math.floor(Math.random() * (await Bonuses.count())),
});
const UserBonusClaim1 = await UserBonusClaims.findOne({
order: [['id', 'ASC']],
offset: 1
});
if (UserBonusClaim1?.setBonu)
{
await
UserBonusClaim1.
setBonu(relatedBonu1);
}
const relatedBonu2 = await Bonuses.findOne({
offset: Math.floor(Math.random() * (await Bonuses.count())),
});
const UserBonusClaim2 = await UserBonusClaims.findOne({
order: [['id', 'ASC']],
offset: 2
});
if (UserBonusClaim2?.setBonu)
{
await
UserBonusClaim2.
setBonu(relatedBonu2);
}
const relatedBonu3 = await Bonuses.findOne({
offset: Math.floor(Math.random() * (await Bonuses.count())),
});
const UserBonusClaim3 = await UserBonusClaims.findOne({
order: [['id', 'ASC']],
offset: 3
});
if (UserBonusClaim3?.setBonu)
{
await
UserBonusClaim3.
setBonu(relatedBonu3);
}
const relatedBonu4 = await Bonuses.findOne({
offset: Math.floor(Math.random() * (await Bonuses.count())),
});
const UserBonusClaim4 = await UserBonusClaims.findOne({
order: [['id', 'ASC']],
offset: 4
});
if (UserBonusClaim4?.setBonu)
{
await
UserBonusClaim4.
setBonu(relatedBonu4);
}
}
async function associateUserBonusClaimWithWallet() {
const relatedWallet0 = await Wallets.findOne({
offset: Math.floor(Math.random() * (await Wallets.count())),
});
const UserBonusClaim0 = await UserBonusClaims.findOne({
order: [['id', 'ASC']],
offset: 0
});
if (UserBonusClaim0?.setWallet)
{
await
UserBonusClaim0.
setWallet(relatedWallet0);
}
const relatedWallet1 = await Wallets.findOne({
offset: Math.floor(Math.random() * (await Wallets.count())),
});
const UserBonusClaim1 = await UserBonusClaims.findOne({
order: [['id', 'ASC']],
offset: 1
});
if (UserBonusClaim1?.setWallet)
{
await
UserBonusClaim1.
setWallet(relatedWallet1);
}
const relatedWallet2 = await Wallets.findOne({
offset: Math.floor(Math.random() * (await Wallets.count())),
});
const UserBonusClaim2 = await UserBonusClaims.findOne({
order: [['id', 'ASC']],
offset: 2
});
if (UserBonusClaim2?.setWallet)
{
await
UserBonusClaim2.
setWallet(relatedWallet2);
}
const relatedWallet3 = await Wallets.findOne({
offset: Math.floor(Math.random() * (await Wallets.count())),
});
const UserBonusClaim3 = await UserBonusClaims.findOne({
order: [['id', 'ASC']],
offset: 3
});
if (UserBonusClaim3?.setWallet)
{
await
UserBonusClaim3.
setWallet(relatedWallet3);
}
const relatedWallet4 = await Wallets.findOne({
offset: Math.floor(Math.random() * (await Wallets.count())),
});
const UserBonusClaim4 = await UserBonusClaims.findOne({
order: [['id', 'ASC']],
offset: 4
});
if (UserBonusClaim4?.setWallet)
{
await
UserBonusClaim4.
setWallet(relatedWallet4);
}
}
async function associateUserVipStatusWithUser() {
const relatedUser0 = await Users.findOne({
offset: Math.floor(Math.random() * (await Users.count())),
});
const UserVipStatus0 = await UserVipStatuses.findOne({
order: [['id', 'ASC']],
offset: 0
});
if (UserVipStatus0?.setUser)
{
await
UserVipStatus0.
setUser(relatedUser0);
}
const relatedUser1 = await Users.findOne({
offset: Math.floor(Math.random() * (await Users.count())),
});
const UserVipStatus1 = await UserVipStatuses.findOne({
order: [['id', 'ASC']],
offset: 1
});
if (UserVipStatus1?.setUser)
{
await
UserVipStatus1.
setUser(relatedUser1);
}
const relatedUser2 = await Users.findOne({
offset: Math.floor(Math.random() * (await Users.count())),
});
const UserVipStatus2 = await UserVipStatuses.findOne({
order: [['id', 'ASC']],
offset: 2
});
if (UserVipStatus2?.setUser)
{
await
UserVipStatus2.
setUser(relatedUser2);
}
const relatedUser3 = await Users.findOne({
offset: Math.floor(Math.random() * (await Users.count())),
});
const UserVipStatus3 = await UserVipStatuses.findOne({
order: [['id', 'ASC']],
offset: 3
});
if (UserVipStatus3?.setUser)
{
await
UserVipStatus3.
setUser(relatedUser3);
}
const relatedUser4 = await Users.findOne({
offset: Math.floor(Math.random() * (await Users.count())),
});
const UserVipStatus4 = await UserVipStatuses.findOne({
order: [['id', 'ASC']],
offset: 4
});
if (UserVipStatus4?.setUser)
{
await
UserVipStatus4.
setUser(relatedUser4);
}
}
async function associateUserVipStatusWithVip_tier() {
const relatedVip_tier0 = await VipTiers.findOne({
offset: Math.floor(Math.random() * (await VipTiers.count())),
});
const UserVipStatus0 = await UserVipStatuses.findOne({
order: [['id', 'ASC']],
offset: 0
});
if (UserVipStatus0?.setVip_tier)
{
await
UserVipStatus0.
setVip_tier(relatedVip_tier0);
}
const relatedVip_tier1 = await VipTiers.findOne({
offset: Math.floor(Math.random() * (await VipTiers.count())),
});
const UserVipStatus1 = await UserVipStatuses.findOne({
order: [['id', 'ASC']],
offset: 1
});
if (UserVipStatus1?.setVip_tier)
{
await
UserVipStatus1.
setVip_tier(relatedVip_tier1);
}
const relatedVip_tier2 = await VipTiers.findOne({
offset: Math.floor(Math.random() * (await VipTiers.count())),
});
const UserVipStatus2 = await UserVipStatuses.findOne({
order: [['id', 'ASC']],
offset: 2
});
if (UserVipStatus2?.setVip_tier)
{
await
UserVipStatus2.
setVip_tier(relatedVip_tier2);
}
const relatedVip_tier3 = await VipTiers.findOne({
offset: Math.floor(Math.random() * (await VipTiers.count())),
});
const UserVipStatus3 = await UserVipStatuses.findOne({
order: [['id', 'ASC']],
offset: 3
});
if (UserVipStatus3?.setVip_tier)
{
await
UserVipStatus3.
setVip_tier(relatedVip_tier3);
}
const relatedVip_tier4 = await VipTiers.findOne({
offset: Math.floor(Math.random() * (await VipTiers.count())),
});
const UserVipStatus4 = await UserVipStatuses.findOne({
order: [['id', 'ASC']],
offset: 4
});
if (UserVipStatus4?.setVip_tier)
{
await
UserVipStatus4.
setVip_tier(relatedVip_tier4);
}
}
async function associateSecurityEventWithUser() {
const relatedUser0 = await Users.findOne({
offset: Math.floor(Math.random() * (await Users.count())),
});
const SecurityEvent0 = await SecurityEvents.findOne({
order: [['id', 'ASC']],
offset: 0
});
if (SecurityEvent0?.setUser)
{
await
SecurityEvent0.
setUser(relatedUser0);
}
const relatedUser1 = await Users.findOne({
offset: Math.floor(Math.random() * (await Users.count())),
});
const SecurityEvent1 = await SecurityEvents.findOne({
order: [['id', 'ASC']],
offset: 1
});
if (SecurityEvent1?.setUser)
{
await
SecurityEvent1.
setUser(relatedUser1);
}
const relatedUser2 = await Users.findOne({
offset: Math.floor(Math.random() * (await Users.count())),
});
const SecurityEvent2 = await SecurityEvents.findOne({
order: [['id', 'ASC']],
offset: 2
});
if (SecurityEvent2?.setUser)
{
await
SecurityEvent2.
setUser(relatedUser2);
}
const relatedUser3 = await Users.findOne({
offset: Math.floor(Math.random() * (await Users.count())),
});
const SecurityEvent3 = await SecurityEvents.findOne({
order: [['id', 'ASC']],
offset: 3
});
if (SecurityEvent3?.setUser)
{
await
SecurityEvent3.
setUser(relatedUser3);
}
const relatedUser4 = await Users.findOne({
offset: Math.floor(Math.random() * (await Users.count())),
});
const SecurityEvent4 = await SecurityEvents.findOne({
order: [['id', 'ASC']],
offset: 4
});
if (SecurityEvent4?.setUser)
{
await
SecurityEvent4.
setUser(relatedUser4);
}
}
async function associateApiKeyWithUser() {
const relatedUser0 = await Users.findOne({
offset: Math.floor(Math.random() * (await Users.count())),
});
const ApiKey0 = await ApiKeys.findOne({
order: [['id', 'ASC']],
offset: 0
});
if (ApiKey0?.setUser)
{
await
ApiKey0.
setUser(relatedUser0);
}
const relatedUser1 = await Users.findOne({
offset: Math.floor(Math.random() * (await Users.count())),
});
const ApiKey1 = await ApiKeys.findOne({
order: [['id', 'ASC']],
offset: 1
});
if (ApiKey1?.setUser)
{
await
ApiKey1.
setUser(relatedUser1);
}
const relatedUser2 = await Users.findOne({
offset: Math.floor(Math.random() * (await Users.count())),
});
const ApiKey2 = await ApiKeys.findOne({
order: [['id', 'ASC']],
offset: 2
});
if (ApiKey2?.setUser)
{
await
ApiKey2.
setUser(relatedUser2);
}
const relatedUser3 = await Users.findOne({
offset: Math.floor(Math.random() * (await Users.count())),
});
const ApiKey3 = await ApiKeys.findOne({
order: [['id', 'ASC']],
offset: 3
});
if (ApiKey3?.setUser)
{
await
ApiKey3.
setUser(relatedUser3);
}
const relatedUser4 = await Users.findOne({
offset: Math.floor(Math.random() * (await Users.count())),
});
const ApiKey4 = await ApiKeys.findOne({
order: [['id', 'ASC']],
offset: 4
});
if (ApiKey4?.setUser)
{
await
ApiKey4.
setUser(relatedUser4);
}
}
async function associateSupportTicketWithUser() {
const relatedUser0 = await Users.findOne({
offset: Math.floor(Math.random() * (await Users.count())),
});
const SupportTicket0 = await SupportTickets.findOne({
order: [['id', 'ASC']],
offset: 0
});
if (SupportTicket0?.setUser)
{
await
SupportTicket0.
setUser(relatedUser0);
}
const relatedUser1 = await Users.findOne({
offset: Math.floor(Math.random() * (await Users.count())),
});
const SupportTicket1 = await SupportTickets.findOne({
order: [['id', 'ASC']],
offset: 1
});
if (SupportTicket1?.setUser)
{
await
SupportTicket1.
setUser(relatedUser1);
}
const relatedUser2 = await Users.findOne({
offset: Math.floor(Math.random() * (await Users.count())),
});
const SupportTicket2 = await SupportTickets.findOne({
order: [['id', 'ASC']],
offset: 2
});
if (SupportTicket2?.setUser)
{
await
SupportTicket2.
setUser(relatedUser2);
}
const relatedUser3 = await Users.findOne({
offset: Math.floor(Math.random() * (await Users.count())),
});
const SupportTicket3 = await SupportTickets.findOne({
order: [['id', 'ASC']],
offset: 3
});
if (SupportTicket3?.setUser)
{
await
SupportTicket3.
setUser(relatedUser3);
}
const relatedUser4 = await Users.findOne({
offset: Math.floor(Math.random() * (await Users.count())),
});
const SupportTicket4 = await SupportTickets.findOne({
order: [['id', 'ASC']],
offset: 4
});
if (SupportTicket4?.setUser)
{
await
SupportTicket4.
setUser(relatedUser4);
}
}
async function associateAuditLogWithUser() {
const relatedUser0 = await Users.findOne({
offset: Math.floor(Math.random() * (await Users.count())),
});
const AuditLog0 = await AuditLogs.findOne({
order: [['id', 'ASC']],
offset: 0
});
if (AuditLog0?.setUser)
{
await
AuditLog0.
setUser(relatedUser0);
}
const relatedUser1 = await Users.findOne({
offset: Math.floor(Math.random() * (await Users.count())),
});
const AuditLog1 = await AuditLogs.findOne({
order: [['id', 'ASC']],
offset: 1
});
if (AuditLog1?.setUser)
{
await
AuditLog1.
setUser(relatedUser1);
}
const relatedUser2 = await Users.findOne({
offset: Math.floor(Math.random() * (await Users.count())),
});
const AuditLog2 = await AuditLogs.findOne({
order: [['id', 'ASC']],
offset: 2
});
if (AuditLog2?.setUser)
{
await
AuditLog2.
setUser(relatedUser2);
}
const relatedUser3 = await Users.findOne({
offset: Math.floor(Math.random() * (await Users.count())),
});
const AuditLog3 = await AuditLogs.findOne({
order: [['id', 'ASC']],
offset: 3
});
if (AuditLog3?.setUser)
{
await
AuditLog3.
setUser(relatedUser3);
}
const relatedUser4 = await Users.findOne({
offset: Math.floor(Math.random() * (await Users.count())),
});
const AuditLog4 = await AuditLogs.findOne({
order: [['id', 'ASC']],
offset: 4
});
if (AuditLog4?.setUser)
{
await
AuditLog4.
setUser(relatedUser4);
}
}
module.exports = {
up: async (queryInterface, Sequelize) => {
await Currencies.bulkCreate(CurrenciesData);
await Networks.bulkCreate(NetworksData);
await Wallets.bulkCreate(WalletsData);
await DepositAddresses.bulkCreate(DepositAddressesData);
await Transactions.bulkCreate(TransactionsData);
await WithdrawalRequests.bulkCreate(WithdrawalRequestsData);
await Games.bulkCreate(GamesData);
await DiceBets.bulkCreate(DiceBetsData);
await ProvablyFairSessions.bulkCreate(ProvablyFairSessionsData);
await Bonuses.bulkCreate(BonusesData);
await UserBonusClaims.bulkCreate(UserBonusClaimsData);
await VipTiers.bulkCreate(VipTiersData);
await UserVipStatuses.bulkCreate(UserVipStatusesData);
await RiskRules.bulkCreate(RiskRulesData);
await SecurityEvents.bulkCreate(SecurityEventsData);
await ApiKeys.bulkCreate(ApiKeysData);
await Announcements.bulkCreate(AnnouncementsData);
await SupportTickets.bulkCreate(SupportTicketsData);
await AuditLogs.bulkCreate(AuditLogsData);
await Promise.all([
// Similar logic for "relation_many"
await associateWalletWithUser(),
await associateWalletWithCurrency(),
await associateWalletWithNetwork(),
await associateDepositAddressWithWallet(),
await associateTransactionWithUser(),
await associateTransactionWithWallet(),
await associateTransactionWithCurrency(),
await associateTransactionWithNetwork(),
await associateWithdrawalRequestWithUser(),
await associateWithdrawalRequestWithWallet(),
await associateWithdrawalRequestWithCurrency(),
await associateWithdrawalRequestWithNetwork(),
await associateDiceBetWithUser(),
await associateDiceBetWithGame(),
await associateDiceBetWithWallet(),
await associateDiceBetWithCurrency(),
await associateProvablyFairSessionWithUser(),
await associateProvablyFairSessionWithGame(),
await associateUserBonusClaimWithUser(),
await associateUserBonusClaimWithBonu(),
await associateUserBonusClaimWithWallet(),
await associateUserVipStatusWithUser(),
await associateUserVipStatusWithVip_tier(),
await associateSecurityEventWithUser(),
await associateApiKeyWithUser(),
await associateSupportTicketWithUser(),
await associateAuditLogWithUser(),
]);
},
down: async (queryInterface, Sequelize) => {
await queryInterface.bulkDelete('currencies', null, {});
await queryInterface.bulkDelete('networks', null, {});
await queryInterface.bulkDelete('wallets', null, {});
await queryInterface.bulkDelete('deposit_addresses', null, {});
await queryInterface.bulkDelete('transactions', null, {});
await queryInterface.bulkDelete('withdrawal_requests', null, {});
await queryInterface.bulkDelete('games', null, {});
await queryInterface.bulkDelete('dice_bets', null, {});
await queryInterface.bulkDelete('provably_fair_sessions', null, {});
await queryInterface.bulkDelete('bonuses', null, {});
await queryInterface.bulkDelete('user_bonus_claims', null, {});
await queryInterface.bulkDelete('vip_tiers', null, {});
await queryInterface.bulkDelete('user_vip_statuses', null, {});
await queryInterface.bulkDelete('risk_rules', null, {});
await queryInterface.bulkDelete('security_events', null, {});
await queryInterface.bulkDelete('api_keys', null, {});
await queryInterface.bulkDelete('announcements', null, {});
await queryInterface.bulkDelete('support_tickets', null, {});
await queryInterface.bulkDelete('audit_logs', null, {});
},
};