Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This page outlines the technical details of the holiday web service.

Assumptions:* We do not handle administrative holidays or student breaks (e.g. spring break).

  • We handle all holidays defined by DHRD (http://hawaii.gov/hrd) plus bank holidays(https://www.boh.com/customer-service/1035.asp)
    • New Year’s Day (Federal, UH, Bank)
    • Martin Luther King Jr. Day (Federal, UH, Bank)
    • President’s Day (Federal, UH, Bank)
    • Prince Kuhio Day (State, UH)
    • Good Friday (UH)
    • Memorial Day (Federal, UH, Bank)
    • King Kamehameha Day (State, UH)
    • Independence Day (Federal, UH, Bank)
    • Statehood Day (State, UH)
    • Labor Day (Federal, UH, Bank)
    • Columbus Day (Federal, Bank)
    • Veteran’s Day (Federal, UH, Bank)
    • Thanksgiving (Federal, UH, Bank)
    • Christmas (Federal, UH, Bank)
    • Election Day (Federal, UH, Bank)
  • All holidays are one day in length (since we ignore admin holidays and student breaks).
  • Changes to the holiday dates do not need to be tracked/logged.
  • All holidays will be categorized to these types: state/federal/bank/UH.
  • A holiday can be multiple types (e.g. all Federal holidays are also Bank holidays).
  • State Holidays are defined as those that are unique to the State of Hawaii, so State and Federal never overlap.

public class Holiday {*
    private Date observedDate;
    private Date officialDate;
    private String description;
    private List<String> holidayTypes; // tells if it’s state/federal/bank

    // basic getters/setters for above fields
    get/setObservedDate, get/setOfficialDate, get/setDescription, get/setHolidayTypes, isUHHoliday, isBankHoliday, isFederalHoliday, isStateHoliday, isHolidayOfType
}

WebService Methods:
For the following methods, these parameters mean the same across them all* boolean isObserved - Used to indicate if the user is referring to the date the holiday is observed (true), or the official date (false).

...

Holiday Tables

These tables organize the different holidays and their respective types.  Holiday table for the holidays, type table for the different holiday types, and holiday_type to link the different holidays to their types.

Create database holidays;

create table holiday (
    id int not null auto_increment,

...


    description varchar(63) not null,

...


    official_date datetime not null,

...


    observed_date datetime not null

...

,

...


    primary key(id, observed_date),

...

    index off_idx(official_date),

...

    index obs_idx(observed_date)
) Engine=InnoDB;

create table type (
    id int not null auto_increment,
    description varchar(63) not null,
    primary key(id)
) Engine=InnoDB;

insert into type (description) values ("Federal");
insert into type (description) values ("State");
insert into type (description) values ("UH");

create table holiday_date type (
holiday     holiday_id int not null,
, official_date datetime     type_id int not null
, observed_date datetime not null   
, primary
    primary key(holiday_id, observedtype_dateid),
, index off     index type_idx(officialtype_dateid),
, index obs_idx(observed_date)     FOREIGN KEY (holiday_id) REFERENCES holiday(id) ON DELETE CASCADE,
    FOREIGN KEY (type_id) REFERENCES type(id) ON DELETE CASCADE
) Engine=InnoDB;

User Tables

These tables are similar to the holiday tables in that there is one table for users, one table for user roles (admin and user), and one table connecting users to their role.

create table type user (
 id     id int not null auto_increment
 , description varchar(7,
    account_expired boolean not null,
    account_locked boolean not null,
    enabled boolean not null,
    password varchar(255) not null,
    password_expired boolean not null,
    username varchar(255) not null,
, primary     unique(username),
    primary key(id)
) Engine=InnoDB;insert into type (description) values ("Bank");
insert into type (description) values ("Federal")

create table role (
    id int not null auto_increment,
    authority varchar(63) not null,
    unique(authority),
    primary key(id)
) Engine=InnoDB;

insert into type role (descriptionauthority) values ("StateROLE_ADMIN");
insert into type role (descriptionauthority) values ("UHROLE_USER");

create table holidayuser_type role (
holiday     role_id int not null,
, type     user_id int not null,
, primary     primary key(holidayrole_id, typeuser_id)
, index type_idx(type_id)
, FOREIGN
    FOREIGN KEY (holidayrole_id) REFERENCES holidayrole(id) ON DELETE CASCADE,
, FOREIGN     FOREIGN KEY (typeuser_id) REFERENCES typeuser(id) ON DELETE CASCADE
) Engine=InnoDB;