2918 lines
51 KiB
JavaScript
2918 lines
51 KiB
JavaScript
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const db = require('../models');
|
|
const Users = db.users;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const Customers = db.customers;
|
|
|
|
const Products = db.products;
|
|
|
|
const Suppliers = db.suppliers;
|
|
|
|
const Orders = db.orders;
|
|
|
|
const OrderItems = db.order_items;
|
|
|
|
const LoyaltyPrograms = db.loyalty_programs;
|
|
|
|
const LoyaltyMemberships = db.loyalty_memberships;
|
|
|
|
const StockMovements = db.stock_movements;
|
|
|
|
const Payments = db.payments;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const CustomersData = [
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
"name": "Ethan Walker",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"email": "ethan.walker@example.com",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"phone": "+1-510-555-1001",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"birthday": new Date('1990-04-12T00:00:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"address": "12 Birch Street, Oakland, CA 94607",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"notes": "Prefers oat milk lattes and morning pickups.",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"preferred_payment": "Cash",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"joined_date": new Date('2021-05-03T09:30:00Z'),
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
"name": "Grace Lee",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"email": "grace.lee@example.com",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"phone": "+1-510-555-1002",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"birthday": new Date('1986-09-22T00:00:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"address": "220 Maple Ave, Berkeley, CA 94704",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"notes": "Allergic to soy. Enjoys seasonal pastries.",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"preferred_payment": "Card",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"joined_date": new Date('2022-10-11T14:15:00Z'),
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
"name": "Noah Bennett",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"email": "noah.bennett@example.com",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"phone": "+1-510-555-1003",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"birthday": new Date('1995-01-05T00:00:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"address": "7 Oceanview Drive, Alameda, CA 94501",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"notes": "Loyalty member, redeems points monthly.",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"preferred_payment": "Cash",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"joined_date": new Date('2020-02-20T08:45:00Z'),
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
"name": "Ava Patel",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"email": "ava.patel@example.com",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"phone": "+1-510-555-1004",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"birthday": new Date('1989-11-30T00:00:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"address": "45 Pine Lane, San Francisco, CA 94110",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"notes": "Favorite drink is cold brew with vanilla.",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"preferred_payment": "Card",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"joined_date": new Date('2023-01-15T12:00:00Z'),
|
|
|
|
|
|
|
|
},
|
|
|
|
];
|
|
|
|
|
|
|
|
const ProductsData = [
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
"name": "House Blend Espresso",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"sku": "HB-E01",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"description": "Medium roast espresso blend with chocolate notes.",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"price": 3.5,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"cost": 1.2,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"stock": 120,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"reorder_level": 30,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "images" field
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
"name": "Single Origin Ethiopia",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"sku": "SO-EF02",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"description": "Bright single origin with citrus acidity.",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"price": 4.0,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"cost": 1.6,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"stock": 60,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"reorder_level": 20,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "images" field
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
"name": "Vanilla Latte Syrup",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"sku": "SY-VL03",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"description": "Rich vanilla syrup for specialty drinks.",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"price": 0.75,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"cost": 0.15,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"stock": 200,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"reorder_level": 50,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "images" field
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
"name": "Almond Milk 1L",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"sku": "ML-AL04",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"description": "Unsweetened almond milk for dairy-free drinks.",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"price": 2.5,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"cost": 1.0,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"stock": 40,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"reorder_level": 15,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "images" field
|
|
|
|
|
|
|
|
},
|
|
|
|
];
|
|
|
|
|
|
|
|
const SuppliersData = [
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
"name": "Pacific Coffee Suppliers",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"contact_name": "Hannah Brooks",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"phone": "+1-800-555-2001",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"email": "hannah@pacificcoffee.com",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"address": "300 Harbor Way, Oakland, CA 94607",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"lead_time": 3,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"active": true,
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
"name": "Green Bean Imports",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"contact_name": "Marco Silva",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"phone": "+1-800-555-2002",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"email": "marco@greenbean.io",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"address": "77 Commerce Blvd, Richmond, CA 94801",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"lead_time": 7,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"active": true,
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
"name": "Bakery Goods Co",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"contact_name": "Samantha Cole",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"phone": "+1-800-555-2003",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"email": "samantha@bakerygoods.com",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"address": "15 Central Ave, Berkeley, CA 94702",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"lead_time": 2,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"active": true,
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
"name": "Local Dairy Partners",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"contact_name": "Pedro Alvarez",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"phone": "+1-800-555-2004",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"email": "pedro@localdairy.com",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"address": "40 Farm Road, Petaluma, CA 94952",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"lead_time": 1,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"active": true,
|
|
|
|
|
|
|
|
},
|
|
|
|
];
|
|
|
|
|
|
|
|
const OrdersData = [
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
"reference": "ORD-1001",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"status": "Ready",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"total": 9.5,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"order_date": new Date('2024-01-05T08:45:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"delivery_date": new Date('2024-01-05T09:00:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"payment_method": "Card",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"paid": true,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"notes": "Extra hot on the latte.",
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
"reference": "ORD-1002",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"status": "InProgress",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"total": 15.0,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"order_date": new Date('2024-01-06T10:15:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"delivery_date": new Date('2024-01-06T10:25:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"payment_method": "Card",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"paid": true,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"notes": "Order for meeting table 3.",
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
"reference": "ORD-1003",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"status": "InProgress",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"total": 4.0,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"order_date": new Date('2024-01-07T09:50:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"delivery_date": new Date('2024-01-07T10:10:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"payment_method": "Mobile",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"paid": false,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"notes": "Pickup in 30 minutes.",
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
"reference": "ORD-1004",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"status": "Pending",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"total": 7.4,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"order_date": new Date('2024-01-08T07:30:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"delivery_date": new Date('2024-01-08T07:40:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"payment_method": "Cash",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"paid": true,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"notes": "No foam on cappuccino.",
|
|
|
|
|
|
|
|
},
|
|
|
|
];
|
|
|
|
|
|
|
|
const OrderItemsData = [
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
"item_name": "Latte",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"quantity": 2,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"unit_price": 3.5,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"line_total": 7.0,
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
"item_name": "Blueberry Muffin",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"quantity": 1,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"unit_price": 2.5,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"line_total": 2.5,
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
"item_name": "Cold Brew",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"quantity": 2,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"unit_price": 4.0,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"line_total": 8.0,
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
"item_name": "Single Origin Pour Over",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"quantity": 1,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"unit_price": 4.0,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"line_total": 4.0,
|
|
|
|
|
|
|
|
},
|
|
|
|
];
|
|
|
|
|
|
|
|
const LoyaltyProgramsData = [
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
"name": "Bean Rewards",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"points_per_dollar": 1.0,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"description": "Earn one point for every dollar spent.",
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
"name": "Morning Club",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"points_per_dollar": 1.5,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"description": "Bonus points for purchases before 11 AM.",
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
"name": "Pastry Perks",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"points_per_dollar": 2.0,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"description": "Extra points on bakery items and combos.",
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
"name": "Referral Bonus",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"points_per_dollar": 0.5,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"description": "Points for referring a new customer.",
|
|
|
|
|
|
|
|
},
|
|
|
|
];
|
|
|
|
|
|
|
|
const LoyaltyMembershipsData = [
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
"membership_code": "LR-0001",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"points": 240,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"tier": "Platinum",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"joined_date": new Date('2020-03-10T09:00:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"active": true,
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
"membership_code": "LR-0002",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"points": 85,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"tier": "Gold",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"joined_date": new Date('2021-06-05T10:30:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"active": true,
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
"membership_code": "LR-0003",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"points": 40,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"tier": "Silver",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"joined_date": new Date('2022-10-12T12:00:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"active": true,
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
"membership_code": "LR-0004",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"points": 15,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"tier": "Gold",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"joined_date": new Date('2023-01-20T08:20:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"active": true,
|
|
|
|
|
|
|
|
},
|
|
|
|
];
|
|
|
|
|
|
|
|
const StockMovementsData = [
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"type": "IN",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"quantity": 50,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"date": new Date('2024-01-02T07:30:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"reason": "Weekly roast delivery",
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"type": "ADJUSTMENT",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"quantity": 30,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"date": new Date('2024-01-03T15:45:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"reason": "Used in drink preparation",
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"type": "ADJUSTMENT",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"quantity": 20,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"date": new Date('2024-01-04T09:10:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"reason": "Dairy delivery",
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"type": "ADJUSTMENT",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"quantity": 25,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"date": new Date('2024-01-05T11:00:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"reason": "Morning pastry sales",
|
|
|
|
|
|
|
|
},
|
|
|
|
];
|
|
|
|
|
|
|
|
const PaymentsData = [
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"amount": 9.5,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"method": "Cash",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"status": "Completed",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"paid_at": new Date('2024-01-05T08:50:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"reference": "PAY-2001",
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"amount": 15.0,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"method": "Cash",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"status": "Completed",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"paid_at": new Date('2024-01-06T10:20:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"reference": "PAY-2002",
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"amount": 4.0,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"method": "Mobile",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"status": "Completed",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"paid_at": new Date('2024-01-07T09:55:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"reference": "PAY-2003",
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"amount": 7.4,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"method": "Mobile",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"status": "Completed",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"paid_at": new Date('2024-01-08T07:35:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"reference": "PAY-2004",
|
|
|
|
|
|
|
|
},
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Similar logic for "relation_many"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async function associateProductWithSupplier() {
|
|
|
|
const relatedSupplier0 = await Suppliers.findOne({
|
|
offset: Math.floor(Math.random() * (await Suppliers.count())),
|
|
});
|
|
const Product0 = await Products.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 0
|
|
});
|
|
if (Product0?.setSupplier)
|
|
{
|
|
await
|
|
Product0.
|
|
setSupplier(relatedSupplier0);
|
|
}
|
|
|
|
const relatedSupplier1 = await Suppliers.findOne({
|
|
offset: Math.floor(Math.random() * (await Suppliers.count())),
|
|
});
|
|
const Product1 = await Products.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 1
|
|
});
|
|
if (Product1?.setSupplier)
|
|
{
|
|
await
|
|
Product1.
|
|
setSupplier(relatedSupplier1);
|
|
}
|
|
|
|
const relatedSupplier2 = await Suppliers.findOne({
|
|
offset: Math.floor(Math.random() * (await Suppliers.count())),
|
|
});
|
|
const Product2 = await Products.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 2
|
|
});
|
|
if (Product2?.setSupplier)
|
|
{
|
|
await
|
|
Product2.
|
|
setSupplier(relatedSupplier2);
|
|
}
|
|
|
|
const relatedSupplier3 = await Suppliers.findOne({
|
|
offset: Math.floor(Math.random() * (await Suppliers.count())),
|
|
});
|
|
const Product3 = await Products.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 3
|
|
});
|
|
if (Product3?.setSupplier)
|
|
{
|
|
await
|
|
Product3.
|
|
setSupplier(relatedSupplier3);
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async function associateOrderWithCustomer() {
|
|
|
|
const relatedCustomer0 = await Customers.findOne({
|
|
offset: Math.floor(Math.random() * (await Customers.count())),
|
|
});
|
|
const Order0 = await Orders.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 0
|
|
});
|
|
if (Order0?.setCustomer)
|
|
{
|
|
await
|
|
Order0.
|
|
setCustomer(relatedCustomer0);
|
|
}
|
|
|
|
const relatedCustomer1 = await Customers.findOne({
|
|
offset: Math.floor(Math.random() * (await Customers.count())),
|
|
});
|
|
const Order1 = await Orders.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 1
|
|
});
|
|
if (Order1?.setCustomer)
|
|
{
|
|
await
|
|
Order1.
|
|
setCustomer(relatedCustomer1);
|
|
}
|
|
|
|
const relatedCustomer2 = await Customers.findOne({
|
|
offset: Math.floor(Math.random() * (await Customers.count())),
|
|
});
|
|
const Order2 = await Orders.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 2
|
|
});
|
|
if (Order2?.setCustomer)
|
|
{
|
|
await
|
|
Order2.
|
|
setCustomer(relatedCustomer2);
|
|
}
|
|
|
|
const relatedCustomer3 = await Customers.findOne({
|
|
offset: Math.floor(Math.random() * (await Customers.count())),
|
|
});
|
|
const Order3 = await Orders.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 3
|
|
});
|
|
if (Order3?.setCustomer)
|
|
{
|
|
await
|
|
Order3.
|
|
setCustomer(relatedCustomer3);
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 associateOrderItemWithProduct() {
|
|
|
|
const relatedProduct0 = await Products.findOne({
|
|
offset: Math.floor(Math.random() * (await Products.count())),
|
|
});
|
|
const OrderItem0 = await OrderItems.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 0
|
|
});
|
|
if (OrderItem0?.setProduct)
|
|
{
|
|
await
|
|
OrderItem0.
|
|
setProduct(relatedProduct0);
|
|
}
|
|
|
|
const relatedProduct1 = await Products.findOne({
|
|
offset: Math.floor(Math.random() * (await Products.count())),
|
|
});
|
|
const OrderItem1 = await OrderItems.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 1
|
|
});
|
|
if (OrderItem1?.setProduct)
|
|
{
|
|
await
|
|
OrderItem1.
|
|
setProduct(relatedProduct1);
|
|
}
|
|
|
|
const relatedProduct2 = await Products.findOne({
|
|
offset: Math.floor(Math.random() * (await Products.count())),
|
|
});
|
|
const OrderItem2 = await OrderItems.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 2
|
|
});
|
|
if (OrderItem2?.setProduct)
|
|
{
|
|
await
|
|
OrderItem2.
|
|
setProduct(relatedProduct2);
|
|
}
|
|
|
|
const relatedProduct3 = await Products.findOne({
|
|
offset: Math.floor(Math.random() * (await Products.count())),
|
|
});
|
|
const OrderItem3 = await OrderItems.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 3
|
|
});
|
|
if (OrderItem3?.setProduct)
|
|
{
|
|
await
|
|
OrderItem3.
|
|
setProduct(relatedProduct3);
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async function associateLoyaltyMembershipWithCustomer() {
|
|
|
|
const relatedCustomer0 = await Customers.findOne({
|
|
offset: Math.floor(Math.random() * (await Customers.count())),
|
|
});
|
|
const LoyaltyMembership0 = await LoyaltyMemberships.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 0
|
|
});
|
|
if (LoyaltyMembership0?.setCustomer)
|
|
{
|
|
await
|
|
LoyaltyMembership0.
|
|
setCustomer(relatedCustomer0);
|
|
}
|
|
|
|
const relatedCustomer1 = await Customers.findOne({
|
|
offset: Math.floor(Math.random() * (await Customers.count())),
|
|
});
|
|
const LoyaltyMembership1 = await LoyaltyMemberships.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 1
|
|
});
|
|
if (LoyaltyMembership1?.setCustomer)
|
|
{
|
|
await
|
|
LoyaltyMembership1.
|
|
setCustomer(relatedCustomer1);
|
|
}
|
|
|
|
const relatedCustomer2 = await Customers.findOne({
|
|
offset: Math.floor(Math.random() * (await Customers.count())),
|
|
});
|
|
const LoyaltyMembership2 = await LoyaltyMemberships.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 2
|
|
});
|
|
if (LoyaltyMembership2?.setCustomer)
|
|
{
|
|
await
|
|
LoyaltyMembership2.
|
|
setCustomer(relatedCustomer2);
|
|
}
|
|
|
|
const relatedCustomer3 = await Customers.findOne({
|
|
offset: Math.floor(Math.random() * (await Customers.count())),
|
|
});
|
|
const LoyaltyMembership3 = await LoyaltyMemberships.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 3
|
|
});
|
|
if (LoyaltyMembership3?.setCustomer)
|
|
{
|
|
await
|
|
LoyaltyMembership3.
|
|
setCustomer(relatedCustomer3);
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async function associateLoyaltyMembershipWithProgram() {
|
|
|
|
const relatedProgram0 = await LoyaltyPrograms.findOne({
|
|
offset: Math.floor(Math.random() * (await LoyaltyPrograms.count())),
|
|
});
|
|
const LoyaltyMembership0 = await LoyaltyMemberships.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 0
|
|
});
|
|
if (LoyaltyMembership0?.setProgram)
|
|
{
|
|
await
|
|
LoyaltyMembership0.
|
|
setProgram(relatedProgram0);
|
|
}
|
|
|
|
const relatedProgram1 = await LoyaltyPrograms.findOne({
|
|
offset: Math.floor(Math.random() * (await LoyaltyPrograms.count())),
|
|
});
|
|
const LoyaltyMembership1 = await LoyaltyMemberships.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 1
|
|
});
|
|
if (LoyaltyMembership1?.setProgram)
|
|
{
|
|
await
|
|
LoyaltyMembership1.
|
|
setProgram(relatedProgram1);
|
|
}
|
|
|
|
const relatedProgram2 = await LoyaltyPrograms.findOne({
|
|
offset: Math.floor(Math.random() * (await LoyaltyPrograms.count())),
|
|
});
|
|
const LoyaltyMembership2 = await LoyaltyMemberships.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 2
|
|
});
|
|
if (LoyaltyMembership2?.setProgram)
|
|
{
|
|
await
|
|
LoyaltyMembership2.
|
|
setProgram(relatedProgram2);
|
|
}
|
|
|
|
const relatedProgram3 = await LoyaltyPrograms.findOne({
|
|
offset: Math.floor(Math.random() * (await LoyaltyPrograms.count())),
|
|
});
|
|
const LoyaltyMembership3 = await LoyaltyMemberships.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 3
|
|
});
|
|
if (LoyaltyMembership3?.setProgram)
|
|
{
|
|
await
|
|
LoyaltyMembership3.
|
|
setProgram(relatedProgram3);
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async function associateStockMovementWithProduct() {
|
|
|
|
const relatedProduct0 = await Products.findOne({
|
|
offset: Math.floor(Math.random() * (await Products.count())),
|
|
});
|
|
const StockMovement0 = await StockMovements.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 0
|
|
});
|
|
if (StockMovement0?.setProduct)
|
|
{
|
|
await
|
|
StockMovement0.
|
|
setProduct(relatedProduct0);
|
|
}
|
|
|
|
const relatedProduct1 = await Products.findOne({
|
|
offset: Math.floor(Math.random() * (await Products.count())),
|
|
});
|
|
const StockMovement1 = await StockMovements.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 1
|
|
});
|
|
if (StockMovement1?.setProduct)
|
|
{
|
|
await
|
|
StockMovement1.
|
|
setProduct(relatedProduct1);
|
|
}
|
|
|
|
const relatedProduct2 = await Products.findOne({
|
|
offset: Math.floor(Math.random() * (await Products.count())),
|
|
});
|
|
const StockMovement2 = await StockMovements.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 2
|
|
});
|
|
if (StockMovement2?.setProduct)
|
|
{
|
|
await
|
|
StockMovement2.
|
|
setProduct(relatedProduct2);
|
|
}
|
|
|
|
const relatedProduct3 = await Products.findOne({
|
|
offset: Math.floor(Math.random() * (await Products.count())),
|
|
});
|
|
const StockMovement3 = await StockMovements.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 3
|
|
});
|
|
if (StockMovement3?.setProduct)
|
|
{
|
|
await
|
|
StockMovement3.
|
|
setProduct(relatedProduct3);
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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);
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
module.exports = {
|
|
up: async (queryInterface, Sequelize) => {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await Customers.bulkCreate(CustomersData);
|
|
|
|
|
|
|
|
|
|
await Products.bulkCreate(ProductsData);
|
|
|
|
|
|
|
|
|
|
await Suppliers.bulkCreate(SuppliersData);
|
|
|
|
|
|
|
|
|
|
await Orders.bulkCreate(OrdersData);
|
|
|
|
|
|
|
|
|
|
await OrderItems.bulkCreate(OrderItemsData);
|
|
|
|
|
|
|
|
|
|
await LoyaltyPrograms.bulkCreate(LoyaltyProgramsData);
|
|
|
|
|
|
|
|
|
|
await LoyaltyMemberships.bulkCreate(LoyaltyMembershipsData);
|
|
|
|
|
|
|
|
|
|
await StockMovements.bulkCreate(StockMovementsData);
|
|
|
|
|
|
|
|
|
|
await Payments.bulkCreate(PaymentsData);
|
|
|
|
|
|
await Promise.all([
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Similar logic for "relation_many"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await associateProductWithSupplier(),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await associateOrderWithCustomer(),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await associateOrderItemWithOrder(),
|
|
|
|
|
|
|
|
|
|
await associateOrderItemWithProduct(),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await associateLoyaltyMembershipWithCustomer(),
|
|
|
|
|
|
|
|
|
|
await associateLoyaltyMembershipWithProgram(),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await associateStockMovementWithProduct(),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await associatePaymentWithOrder(),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
]);
|
|
|
|
},
|
|
|
|
down: async (queryInterface, Sequelize) => {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await queryInterface.bulkDelete('customers', null, {});
|
|
|
|
|
|
await queryInterface.bulkDelete('products', null, {});
|
|
|
|
|
|
await queryInterface.bulkDelete('suppliers', null, {});
|
|
|
|
|
|
await queryInterface.bulkDelete('orders', null, {});
|
|
|
|
|
|
await queryInterface.bulkDelete('order_items', null, {});
|
|
|
|
|
|
await queryInterface.bulkDelete('loyalty_programs', null, {});
|
|
|
|
|
|
await queryInterface.bulkDelete('loyalty_memberships', null, {});
|
|
|
|
|
|
await queryInterface.bulkDelete('stock_movements', null, {});
|
|
|
|
|
|
await queryInterface.bulkDelete('payments', null, {});
|
|
|
|
|
|
},
|
|
}; |