//*********************************************************************
//orders.h
//
//    Author:  Constance Royden
//    Date:  April 13, 2014
//    Class: CSCI 131, Professor Royden
//    Purpose: contains constants, struct definitions and
//             function prototypes for dealing with store
//             inventory.
//*********************************************************************

#include <iostream>
#include <fstream>
#include <iomanip>
#include <cstring>
#include "customerRec.h"

using namespace std;

const int TITLE_SIZE = 30;        //max length of name of item
const int MAX_PURCHASES = 20;     //max number of purchases per customer
const int MAX_ITEMS = 20;         //max items in inventory
const int MAX_CUSTOMERS = 20;     //max number of individual customers

typedef char TitleType [TITLE_SIZE + 1];       //type for name of item for sale

struct RequestRec {
  CustomerRec customer;              //name and address of customer
  TitleType item;                    //title of item requested
  float price;                       //price of item requested
  int quantity;                      //number requested
};

enum ItemType{ BOOK, CD, VIDEO, GAME };          //Type of item in inventory

struct ItemInfo {
  TitleType itemName;               //name of item
  float price;                      //price of item
  ItemType item;                    //category of item (book, cd, etc)
  int inStock;                      //number of item in stock
  int numOrdered;                   //number of items ordered
  int numCustomers;                 //number of customers having placed an order
  RequestRec customers[MAX_CUSTOMERS];    //list of customers with orders
};

typedef RequestRec ShoppingList[MAX_PURCHASES];    //Array of requests from a customer
typedef ItemInfo Inventory[MAX_ITEMS];             //Array of items for sale
typedef RequestRec BackOrderList[MAX_CUSTOMERS];   //Array of orders on back-order