6 Regional_ce business rules
6.1 Introduction to business rules
The following are a list of business rules applying to the
regional_ce database. A business rule is a written statement
specifying what the information system (i.e., any system that is
designed to handle regional catch effort data) must do or how it must
be structured.
There are three recognised types of business rules:
Fact Certainty or an existence in the information system.
Formula Calculation employed in the information system.
Validation Constraint on a value in the information system.
Fact rules are shown on the ERD by the cardinality (e.g.,
one-to-many) of table relationships.
Formula and Validation rules are implemented by referential
constraints, range checks, and algorithms both in the database and
during validation.
Validation rules may be part of the preloading checks on the data
as opposed to constraints or checks imposed by the database. These
rules sometimes state that a value should be within a certain range.
All such rules containing the word 'should' are conducted by
preloading software. The use of the word 'should' in relation to
these validation checks means that a warning message is generated
when a value falls outside this range and the data are then checked
further in relation to this value. Hence in a small number of cases
values may legitimately be outside the range of business rules
containing the word 'should'.
6.2 Summary of rules
Observer trip record (t_trip)
|
trip_no
|
Must be a unique integer.
|
|
vessel_key
|
Must be a valid vessel key as allocated for the vessel by the
Ministry of Fisheries.
|
|
version_no
|
Must be an integer greater than zero.
|
|
start_datetime
|
The start date of the trip must be a valid date.
|
|
end_datetime
|
The end date of the trip must be a valid date.
|
|
|
Multiple column checks on date:
The start date must not be later than the finish date.
The dates should be within a period of 180 days of each other.
|
|
land_date
|
The land date of the trip must be a valid date.
|
|
fads
|
Must be an integer greater than zero.
|
|
tender
|
Must be Y or N.
|
Trip comment record (t_trip_comment)
|
trip_no
|
Must be equal to a trip number as listed in the t_trip
table.
|
|
version_no
|
Must be an integer greater than zero.
|
Permit record (t_permits)
|
trip_no
|
Must be equal to a trip number as listed in the t_trip
table.
|
|
version_no
|
Must be an integer greater than zero.
|
|
grp_no
|
Must be an integer greater than zero.
|
Station record (t_effort)
|
trip_no
|
Must be equal to a trip number held in the t_trip
table.
|
|
station_no
|
Each station number must be a unique integer within all
station records, for a given trip number.
|
|
version_no
|
Must be an integer greater than zero.
|
|
datetime_s
|
The start date of the station must be a legitimate date and
the start time must be a valid 24-hour time of between 0000 -
2359.
|
|
|
Multiple column checks on station start date, trip start
date and trip finish date:
The station start date must fall within the range of the trip
start and finish dates.
The station start date should be sequential between stations,
for a given trip.
|
|
target_sp
|
Must be a valid species code as listed in the curr_spp
table in the rdb database, or a CCAMLR Target Species Codes as
listed in Appendix 2
|
|
latitude_s
|
Must be a valid latitude and degrees should fall within the
range of 0 - 80.
|
|
longitude_s
|
Must be a valid longitude.
|
|
depth_bottom_ s
|
Bottom depth at start, should fall within the range of 10 -
2000 meters.
|
|
datetime_e
|
The end date of the set must be a legitimate date and the end
time must be a valid 24-hour time between 0000 - 2359.
|
|
|
Multiple column checks on station finish date, trip start
date and trip finish date:
The station end date must fall within the range of the trip
start and finish dates.
|
|
|
Multiple column checks on station start date/time and
station finish date/time:
The station finish date/time must not be before the station
start date/time.
|
|
latitude_e
|
Latitude degree at end, must be a valid latitude and degrees
should fall within the range of 0 - 80.
|
|
longitude_e
|
Longitude end must be a valid longitude in the range 0 -359
degrees.
|
|
|
Multiple column checks on station start and finish
positions:
The start and finish positions should be within a defined
maximum distance.
The validation parameter for the distance between positions is
set at 25 nautical miles.
The distance between stations should be within a distance that
could be covered by the vessel in the elapsed time period between
stations.
|
|
depth_bottom_ e
|
Bottom depth at finish, should fall within the range of 10 -
2000 meters.
|
|
method
|
Fishing method must be a valid code, as listed in Appendix 2.
|
|
depth_fishing_s
|
Depth at start, should fall within the reasonable range of 10
- 2000 meters.
|
|
depth_fishing_e
|
Depth at end, should fall within the reasonable range of 10 -
2000 meters.
|
|
hooks_baited
|
Percent baited must be a value within the range 0 - 100.
|
|
hook_spacing
|
Must be an integer greater than zero.
|
|
line_length
|
Must be an integer greater than zero.
|
|
num_hooks
|
The number of hooks should fall within the range of 10 -
15000.
|
|
form_type
|
Must be a valid form type code as listed in Appendix 2.
|
|
regional_ce
|
catch record (t_catch) trip_no Must be equal to
a trip number as listed in the t_trip table.
|
|
|
Multiple column checks on trip and station number: The
combination of trip and station_no must exist in the
t_effort table.
|
|
version_no
|
Must be an integer greater than zero.
|
|
species
|
Must be a valid species code as listed in the curr_spp
table in the rdb database or a valid CCAMLR species code.
|
|
discard
|
Must be a valid code, indicating discard status, as listed in
Appendix 2.
|
|
weight
|
Must be a number greater than zero.
|
|
number_caught
|
Must be a number greater than zero.
|
|
average_weight
|
Must be a number greater than zero.
|
regional_ce landings record (t_landings)
|
rip_no
|
Must be equal to a trip number as listed in the t_trip
table.
|
|
version_no
|
Must be an integer greater than zero.
|
|
species
|
Must be a valid species code as listed in the curr_spp
table in the rdb database
|
|
green_wt
|
Must be a number greater than zero.
|
|
dated
|
Must be a valid date.
|