Main System Database and Interface Specifications

Authors | Publisher


Outline


Entity Relationship Diagram

This Entity Relationship Diagram models the information that must be remembered and therefore stored by the Automated gas Station system over a nontrivial period of time. This information is received as input from various sources including the user, the credit card companies,a nd the system software itself and must be accessed, modified, or reported at a later time.


Data Dictionaries

Following are the data dictionaries of all the data elements that are pertinent to the Automated Gas Station system, with semi-precise definitions. These are to help ensure that both users (or "customers") and developers of systems have a common understanding of all the inputs, outputs, components of stores, and intermediate calculations used by a system.

Follwing are the entities included in the data dictionaries. The data dictionaries are divided up into four separte parts for clarification only. Each part is interrelated via these entities:


Transaction Data Dictionary

amount in litres = real

* Description: The number of litres of gas delivered for the current
* transaction.
* Parameters: OOR.RR
* Example: 100.00

card number = string

* Description: The account number of the card used for the current transaction
* Parameters: [string]
* Example: [4520 02 95643657 33]

card type = ["Mastercard" | "Visa" | "American Express" | "Bank Card"]

* Description: The type of credit card or bank card used
* Parameters: list
* Example: Visa

customer's first name = string

* Description: The first name of the customer for the current transaction.
* Type: Text
* Parameters: Length=50
* Example: John

customer's last name = string

* Description: The last name of the customer for the current transaction.
* Parameters: Length=50
* Example: Smith

summary ID = unsigned integer

* Description: The ID for the particular report being generated.
* Parameters: none
* Example: 1

summary start = date/time

* Description: The starting time for the period of time covered by the report.
* Parameters: hh:tt
* Example: 13:30

summary stop = date/time

* Description: The end time of the period of time covered by the report.
* Parameters: hh:tt
* Example: 23:30

tax total = real

* Description: The total amount in Canadian dollars charged as tax for the
* current transaction.
* Parameters: (Gas Amount in Litres * Price per Litre) * (Tax)
* Example: $3.00

Transaction = @transaction ID + transaction date + Pump + Fuel + customer's first name + customer's last name + card type + card number + amount in litres + Tax + tax total + transaction total

* The transaction entity stores data pertaining to each transaction
* processed by a pump at the station.

transaction ID = unsiged integer

* Description: The number representing the particular pump at the gas
* which delivered the gas for the current transaction.
* Parameters: from 1 to #Number of gas pumps at station
* Example: 3

transaction date = date/time

* Description: The date on which the transaction took place.
* Parameters: dd/mm/yyyy
* Example: 24/02/97

Transation Summary = @Summary ID + Summary Start + Summary Stop

* The report entity stores data pertaining to a batch report generated
* for the transactions processed during a particular period of time.

transaction total = real

* Description: The total cost for the current transaction.
* Parameters: (Gas Amount in Litres * Price per Litre) + Tax Total
* Example: $58.74


Delivery Data Dictionary

Delivery = @delivery ID + delivery date + Tank + delivery person last name + delivery person first name + delivery person ID + delivery tank level before + delivery tank level added + delivery tank level after + delivery total value

* Delivery Entity stores the definition for the data records for each
* delivery.

delivery date = date/time

* Description: The time of delivery of fuel to main tank.
* Parameters: hh:tt
* Example: 13:30

delivery ID = usinged integer

* Description: ID of the delivery of fuel to main tank.
* Parameters: none
* Example: 04

delivery person first name = string

* Description: First Name of person delivering fuel to main tank.
* Parameters: Length = 50
* Example: John

delivery person ID = usigned integer

* Description: An employee number of person delivering fuel to main tank.
* Parameters: Length = 8
* Example: 12345678

delivery person last name = string

* Description: Last Name of person delivering fuel to main tank.
* Parameters: Length = 50
* Example: Smith

delivery tank level added = real

* Description: The number of litres added to main tank.
* Parameters: OOOOO.OO
* Example: 5000.00

delivery tank level after = real

* Description: The number of litres in the main tank after delivery.
* Parameters: OOOOO.OO
* Example: 15523.50

delivery tank level before = real

* Description: The number of litres in the main tank before delivery of
* additional fuel.
* Parameters: OOOOO.OO
* Example: 10523.50

delivery total value = real

* Description: The value of the gas added to the tank at current value of
* gas.
* Parameters: $DDDDD.CC
* Example: $9158.57


Rejected Credit Card Data Dictionary

action taken = [ "Card kept" | "Card returned" | "Credit card company system informed" ]

* Non-key attribute of the entity Rejected Credit Card. This is an enumerated
* type field that specifies the action taken on the rejected credit card as
* specified by the credit card company.

card holder name = string

* Non-key attribute of the entity Rejected Credit Card. This is a string field of
* masimum 30 characters and includes the credit card holder's full name, first
* and last name, as presented on the rejected credit card.

card status = [ "Lost" | "Stolen" ]

* Non-key attribute of the entity Rejected Credit Card. This is an enumerated
* type field that specifies the status of the rejected credit card.

credit card number = string

* Non-key attribute of the entity Rejected Credit Card. This is a string field of
* maximum 30 characters holding the rejected credit card number including all
* relevent spaces.

Rejected Credit Card = @rejected credit card ID + rejected credit card date + credit card number + card holder name + card status + action taken

* Rejected Credit Card Entity; this represents credit cards that have been
* been rejected by credit card companies because they have been reported
* lost or stolen.

rejected credit card date = date/time

* Non-key attribute of the entity Rejected Credit Card. This is a date/time field
* indicating the time the Rejceted Credit Card was logged.

rejected credit card ID = usinged integer

* Key attribute of the entity Rejected Credit Card. This is a unique ID assigned
* when a new entry is added.


System Configuration Data Dictionary

access level = [ "Level 0" | " Level 1"]

* Non-key attribute of the entity Login. This is an enumerated type field that
* indicates the access level of the user.

amount of fuel in tank

* Non-key attribute of the entity Fuel. This is a real indicating the amount of fuel
* Currently in the tank.

Fuel = @fuel type + fuel price per litre + maximum amount

* Fuel Entity; this represents the fuel types and their respective prices.

fuel price per litre = real

* Non-key attribute of the entity Fuel. This is a real field indicating the
* price/litre the fuel is to purchase.

fuel sold = real

* Non-key attribute of the entity Pump. This is a real indicating the amount of
* fuel sold by the Pump since it was turned on.

fuel type = ["Regular" | "Mid Grade" | "Premium" | "Diesel"]

* Key attribute of the entity Fuel. This is an enumerated type field indicating
* the type of fuel.

gst = real

* This is a member of the entity Tax. It is used to store the value of the GST.

Login = @user + password + access level

* Login Entity; this represents the users that may log into the Remote
* Operations Interface and their corresponding access password and access
* level. *

password = string

* Non-key attribute of the entity Login. This is a string field of minimum 4
* characters and maximum 8 characters and indicates a password for the
* corresponding username.

pst = real

* This is a member of the entity Tax. It is used to store the value of the PST.

Pump = @pump number + pump status + fuel sold

* Pump Entity; this represents the different pumps at the Automated gas Station
* and allows pumps to be turned On and Off.

pump number = integer

* Key attribute of the entity Pump. This is an integer field starting at the
* minimum value of 1 to the maximum value of the number of pumps installed
* at the Automated Gas Station.

pump status = [ "On" | "Off" ]

* Non-key attribute of the entity Pump. This is an enumerated type field
* indicating whether the pump should be On or Off.

maximum amount = real

* Non-key attrinbute of the entity Fuel. This is a real indicated the maximum amount
* a transaction may have of the particular type of fuel.

Tank = @tank type + tank status + amount of fuel in tank

* Tank entity; this reporesents the different tanks at the Automated Gas
* Station and is used to identify tanks in delivery reports.

tank status = ["Locked" | "Unlocked"]

* Non-key attribute of entity Tank. This is the status of the Tank, whether it
* is locked or unlcoked.

tank type = ["Regular" | "Mid Grade" | "Premium" | "Diesel"]

* Key attribute of the entity Tank. This is the type of Tank. There is exactly
* one Tank for each type of fuel.

Tax = gst + pst

* Tax entity; this is the system configuration stored values for the Tax applied
* transactions.

Report = @report date + report type

* Report Entity; this represents when each report is to be generated by the
* Automated Gas Station.

report date = date/time

* Key attribute of the entity Report. This is a date/time field that indicates the
* when a report is to be generated. The date field may be an actual date or
* may just be "Daily".

report type = [ "Transaction" | "Deliveries" | "Rejected Credit Cards" | "Statistics" | "Monthly"]

* Non-key attribute of the entity Report. This is an enumerated type field
* that indicates the type of report to be generated.

Statistics = Fuel + Pump + Tank + Tax

* Statistics Entity; this represents the current station statistics.

user = string

* Key attribute of the entity Login. This is a string field of maximum 8
* characters and indicates a unique username for the Remote Operations
* Interface.


Process Specifications

These Process Specifcations are the interfaces for each Data Store that hold information based on the definitions given in the Data Dictionaries. One Data Store (database) exists for each Entity.


Transaction Module

Transaction.Add()
Description:
Add a Transaction to the Transaction Database.
Input: Transaction
Output: None (since addding a transaction will be implemented via a pre-packaged table locking mechanism, there
is no need for a status flag as output)

Transaction.Report()
Description:
Generate a report for all transactions conducted within the batch reporting interval.
Input: Transaction ID
Output: A list of transactions within the specified interval.

Transaction.BackupDatabase()
Description:
This is a private function accessible only by other functions in the Transaction module.
Input: Transaction ID
Output: status

Transaction.ClearDatabase()
Description:
This is a private function accessible only by other functions in the Transaction module.
Input: Transaction ID
Output: status


Transaction Summary Module

TransactionSummary.Report()
Description:
Generate a header for a given report containing Report Summary information.
Input: Transaction Summary.
Output: none


Delivery Module

Delivery.Add()
Description:
Adds a delivery record to the Deliveries database.
Input: Delivery
Output: none

Delivery.Report()
Description:
Prepares a report of all deliveries of fuel to the main gas tanks.
Input: Deliveries
Output: none

Delivery.BackupDatabase()
Description:
This is a private function accessible only by other functions in the Transaction module.
Input: Delivery ID
Output: none

Delivery.ClearDatabase()
Description:
This is a private function accessible only by other functions in the Transaction module.
Input: Delivery ID
Output: none


RejectedCreditCard Module

RejectedCreditCard.Add()
Description:
Add a rejected credit card entry to the database.
Input: Rejected Credit Card
Output: none

RejectedCreditCard.Report()
Description:
Generates report of all rejected credit cards.
Input: Rejected Credit Cards
Output: none

RejectedCreditCard.BackupDatabase()
Description:
This is a private function accessible only by other functions in the Transaction module.
Input: Rejected Credit Card ID
Output: none

RejectedCreditCard.ClearDatabase()
Description:
This is a private function accessible only by other functions in the Transaction module.
Input: Rejected Credit Card ID
Output: none


Tax Module

Tax.setGST()
Description:
This function allows the current GST tax rate to be set. This function is called by the Remote Operations Interface by a User with the appropriate Access Level.
Input: A real indicating the new GST tax rate.
Output: None.

Tax.getGST()
Description:
This function is an accessor function that returns the current GST tax rate. This function is called by the Gas Pump Interface when calculating the Tax Total and Transaction Total fields for a Transaction.
Input: None.
Output: A real indicating the current GST tax rate.

Tax.setPST()
Description:
This function allows the current PST tax rate to be set. This function is called by the Remote Operations Interface by a User with the appropriate Access Level.
Input: A real indicating the new PST tax rate.
Output: None.

Tax.getPST()
Description:
This function is an accessor function that returns the current PST tax rate. This function is called by the Gas Pump Interface when calculating the Tax Total and Transaction Total fields for a Transaction.
Input: None.
Output: A real indicating the current PST tax rate.


Fuel Module

Fuel.addFuel()
Description:
This function is used when a new type of Fuel is added to the system. It creates a new type of Fuel in the Fuel Database and allows the Automated Gas Station to start tracking the Price per Litre of the new type of Fuel. This function is called by the Remote Operations Interface, by a User with the appropriate Access Level.
Input: An emunerated type integer indicating the Fuel Type, and a real indicating the Price per Litre.
Output: A boolean indicating success or failure to add a new type of Fuel.

Fuel.deleteFuel()
Description:
This function is used when a type of Fuel is removed from the system. It removes the type of Fuel from the Fuel Database. This function is called by the Remote Operations Interface, by a User with the appropriate Access Level.
Input: An enumerated type indicating the Fuel Type.
Output: A boolean indicating success or failure to remove the type of Fuel.

Fuel.setFuelPrice()
Description:
This function allows the Price per Litre to be set for a specific type of Fuel. It updates the Fuel Database with the new Price per Litre. This function is called by the Remote Operations Interface, by a User with the Appropriate Access Level.
Input: An enumerated type indicating the Fuel Type, and a real indicating the new Price per Litre.
Output: A boolean indicating success or failure of setting the Price per Litre of the type of Fuel.

Fuel.getFuelPrice()
Description:
This function allows access to the Price per Litre for a specific type of Fuel. It returns the current Price per Litre from the Fuel Database. This function is called by the Pump Interface, when calculating the Tax Total and Transaction Total fields for a Transaction.
Input: An enumerated type indicating the Fuel Type.
Output: A real indicating the current Price per Litre of the Fuel Type.


Pump Module

Pump.addPump()
Description:
This function is used when a new Pump is added to the system after a new Pump has been installed or a Pump has been down for repairs. It creates a Pump in the Pump Database and allows the Automated Gas Station to start accepting Transactions from the Pump. This function is called by the Remote Operations Interface, by a User with the appropriate Access Level.
Input: An enumerated type indicating the Pump Status.
Output: A boolean indicating success or failure to add a new Pump

Pump.deletePump()
Description:
This function is used when a Pump is removed from the system for removal or repairs. It removes the Pump from the Pump Database. This function is called by the Remote Operations Interface, by a User with the appropriate Access Level.
Input: An unsigned integer indicating the Pump Number.
Output: A boolean indicating success or failure to remove the Pump.

Pump.setPumpStatus()
Description:
This function allows the Pump Status to be set for a specific Pump to allow the Pump to be turned on or off. It updates the Pump Database with the new Pump Status. This function is called by the Remote Operations Interface, by a User with the Appropriate Access Level.
Input: An unsigned integer indicating the Pump Number, and an enumerated type indicating the new Pump Status.
Output: A boolean indicating success or failure of setting the Price per Litre of the type of Fuel

Pump.getPumpStatus()
Description:
This function allows access to the Pump Status for a specific Pump. It returns the current Pump Status from the Pump Database. This function is called by the Pump Interface, when checking whether the Pump should be on or off, and by the Remote Operations Interface, by a User with the appropriate Access Level.
Input: An unsigned integer indicating the Pump Number.
Output: An enumerated type indicating the current Pump Status of the Pump.


Tank Module

Tank.addTank()
Description:
This function is used when a new Tank is added to the system after a new Tank has been installed or a Tank has been down for repairs. It creates a Tank in the Tank Database and allows the Automated Gas Station to start tracking the status of the new Tank. This function is called by the Remote Operations Interface, by a User with the appropriate Access Level.
Input: An enumerated type indicating the fuel type for the Tank, an enumerated type indicating the current status of the Tank, and a real indicating the amount of fuel currently in the Tank.
Output: A boolean indicating success or failure to add a new Tank.

Tank.deleteTank()
Description:
This function is used when a Tank is removed from the system for removal or repairs. It removes the Tank from the Tank Database. This function is called by the Remote Operations Interface, by a User with the appropriate Access Level.
Input: An unsigned integer indicating the TankNumber.
Output: A boolean indicating success or failure to remove the Tank.

Tank.getTankStatus()
Description:
This function allows access to the Tank Status for a specific Tank. It returns the current Tank Status from the Tank Database which is updated via a sensor inside the Tank. This function is called by the Pump Interface, when checking whether their is Fuel in a specific Tank, and by the Remote Operations Interface, by a User with the appropriate Access Level.
Input: An unsigned integer indicating the TankNumber.
Output: An enumerated type indicating the current Tank Status of the Tank.


Login Module

Login.addLogin()
Description:
This function is used when a new Login account is added to the system. It creates a Login account in the Login Database and allows a user to log into the new account via the Remote Operations Interface. This function is called by the Remote Operations Interface, by a User with the appropriate Access Level.
Input: None.
Output: A boolean indicating success or failure to add a new Login.

Login.deleteLogin()
Description:
This function is used when a Login account is removed from the system. It removes the Login account from the Login Database. This function is called by the Remote Operations Interface, by a User with the appropriate Access Level.
Input: A string integer indicating the User of the Login account.
Output: A boolean indicating success or failure to remove the Login.

Login.setLoginPassword()
Description:
This function allows the Password for a specific Login account to be set. It updates the Login Database with the new Password. This function is called by the Remote Operations Interface, by a User with the Appropriate Access Level.
Input: A string indicating the User of the Login account.
Output: A boolean indicating success or failure of setting the Password of a User's Login account.

Login.getLoginPassword()
Description:
This function allows access to the Password for a specific Login account. It returns the current Password from the Login Database. This function is called by the Remote Operations Interface when a user attempts to log into the system.
Input: A string indicating the User of the Login account.
Output: A string indicating the Password that corresponds to the User's Login account.

Login.setLoginAccess()
Description:
This function allows the Access Level for a specific Login account to be set. It updates the Login Database with the new Access Level. This function is called by the Remote Operations Interface, by a User with the Appropriate Access Level.
Input: A string indicating the User of the Login account.
Output: A boolean indicating success or failure of setting the Price per Litre of the type of Fuel.

Login.getLoginAccess()
Description:
This function allows access to the Access Level for a specific Login account. It returns the current Access Level from the Login Database. This function is called by the Remote Operations Interface when a user attempts to log into the system.
Input: A string indicating the User of the Login account.
Output: A string indicating the Access Level that corresponds to the User's Login account.


Statistics Module

Statistics.Report()
Description:
This is the only function in the Statistics module. This function generates a report on all the Automated Gas Station Statistics. This includes:

Input: None.
Output: A formatted report of all the Fuels, Pumps, Tank, and Tax settings of the Automated Gas Station.


Report Module

Report.addReport()
Description:
This function is used when a new Report time is added to the system. It creates a Report time entry in the Report Database and allows reports to be generated at specific times. This function is called by the Remote Operations Interface, by a User with the appropriate Access Level.
Input: Adate/time indicating the Report Date, and an enumerated type indicating the report Type.
Output: A boolean indicating success or failure to add a new Login.

Report.deleteReport()
Description:
This function is used when a Report time is removed from the system. It removes the Report time from the Report Database. This function is called by the Remote Operations Interface, by a User with the appropriate Access Level.
Input: A date/time indicating the Report Date.
Output: A boolean indicating success or failure to remove the Login.


Batch Processing System

Following is the speciication for the Batch Processing System. This system is completly self contained and performs all taks without user-input. Configuration of this system is done through the Remote Operations Interface


Data Flow Diagram

The DFD for the Batch Processing System is very simple. It consists of only two processes. The first process (1.1) continually checks the Reports database to see if it is time to generate a report. If it is it sends the Report information to the second process (1.2) which gathers to appropriate information, generates the report, and sends it to the Head Office.

Batch Processing System DFD


Process Specifications

These Process Specifications correspond with the above DFD for the Batch Processing System.

1.1 SendReport()
Description:
This function is continually polled once every minute. It checks to see if it is time for the Batch Processing System to send out a report.
Input: None.
Output: A boolean indicating it is time to send a report, and if TRUE the Report to be genreated is returned.

1.2 GenerateReport()
Description:
This is the function that is called if ReportTime() returned TRUE. It generates the appropriate report and sends it to the Head Office.
Input: The Report Tye to be generated.
Output: A boolean indicating success or failure to send the report to Head Office.


Authors: Paul Werbicki, and Vlad Levin


Send Comments toSupplier Group 11

Back


Last updated 02/11/97
by Carey Bingham
e-mail : bingham@cpsc.ucalgary.ca