package com.demo.demo.factories.demo;

import com.demo.demo.factories.demo.DemoDataPoolFactory;
import com.demo.demo.model.obj.demo.*;
import com.demo.randomlib.data.dataGeneration.*;


/** 
 * DAO factory implementation.
 * @author autogenerated
 */
public class DemoDataPoolFactory {




    /**
     * Data pool factory for Customer.
     * @return CustomerA Customer object
     */
    public static Customer getCustomer() {

        Customer customer = new Customer();    
        
        customer.setName(BasicDataGenerator.generateRandomString(45));
        customer.setSurname(BasicDataGenerator.generateRandomString(45));

        return customer;
    }

    /**
     * Data pool factory for Line.
     * @return Line A Line object
     */
    public static Line getLine() {
        
        Line line =  getLine(
            getOrder(), getStock());

        return line;
       
    }

     /**
     * Data pool factory for Line.
     * @param order A valid Order object
     * @param stock A valid Stock object
     * @return Line A Line object
     */
    public static Line getLine(Order order, Stock stock) {

        Line line = new Line();     
        line.setComment(BasicDataGenerator.generateRandomString(45));
        line.setOrder(order);
        line.setQuantity(BasicDataGenerator.generateRandomLong());
        line.setStock(stock);

        return line;
    }

    /**
     * Data pool factory for Order.
     * @return Order A Order object
     */
    public static Order getOrder() {
        
        Order order =  getOrder(
            getCustomer());

        return order;
       
    }

     /**
     * Data pool factory for Order.
     * @param customer A valid Customer object
     * @return Order A Order object
     */
    public static Order getOrder(Customer customer) {

        Order order = new Order();     
        order.setCustomer(customer);
        order.setOrderDate(BasicDataGenerator.generateDate());

        return order;
    }

    /**
     * Data pool factory for Stock.
     * @return StockA Stock object
     */
    public static Stock getStock() {

        Stock stock = new Stock();    
        
        stock.setDescription(BasicDataGenerator.generateRandomString(45));

        return stock;
    }
}