Chapter 4. Person Module

4.1. Requirements

This chapter is $Revision: 1.1 $ $Date: 2003/01/05 00:00:29 $.

4.1.7. Business Object Definition

					
# $RCSfile: person.html,v $ - Definition of person module.
#                  
# Copyright (C) 2001 Free Software Foundation, Inc.
#
# This file is part of GNU Enterprise.
#
# GNU Enterprise is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# 
# GNU Enterprise is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GNU Enterprise; see the file COPYING.  If not, write to the
# Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
# 02111-1307 USA.
#
# This file originally written by Neil Tiffin (neilt@gnue.org).
#
# $Revision: 1.1 $ $Date: 2003/01/05 00:00:29 $ $Author: psu_gnue $
#

include "../../../base/location/classes/address.gcd"
include "../../../base/language/classes/language.gcd"

module person
{

  # ----------------------------------------------
  # list of personal titles placed before name
  # and are acceptable for this installation.
  # ----------------------------------------------
  class name_prefix
  {
    language::language *language;
    
    char    prefix<25>;  # Mr. Ms Dr. etc.
                         # AR. ADir i.R.
                         # Dr. phi. h.c. HR Dipl.-Ing.
  };
  
  # ----------------------------------------------
  # list of characters that follow the name
  # and are acceptable for this installation.
  # ----------------------------------------------
  class name_suffix
  {
    language::language *language;
    
    char    suffix<8>;  # Jr. III Sr. etc.
  };
  
  # ----------------------------------------------
  # comm_type - phone, fax, email etc.
  # ----------------------------------------------
  class comm_type
  {
    char   code<8>;
    char   format<70>;  # format of comm::address
                        # for decoding the address
                        # example:
                        # 1-630-555-1212
                        # cc-a/c-number
                        # usage TBD (to be determined)
    char   descr<35>;
  };
  
  # ----------------------------------------------
  # comm - communications: phone, fax, email etc.
  # ----------------------------------------------
  class comm
  {
    person::comm_type    *atype;
    char         address<70>;
    char         remark<70>;
  };
  
  # ----------------------------------------------
  # class to instantiate address type
  # ----------------------------------------------
  class address
  {
    location::address address;
  };

  # ----------------------------------------------
  # person - 
  # ----------------------------------------------
  type person
  {
    char    name_prefix<8>;     # Mr. Ms Dr.
    char    name_first<25>;     # given or first name
    char    name_middle<25>;    # other name(s), not surname or first
    char    name_last<25>;      # surname or family name
    char    name_suffix<8>;     # Jr.  Sr.  III
    char    name_informal<25>;   # nickname
    
    char    work_title<25>;     # president, vice president
    
    person::address [] address;     # home, work address
    person::comm    [] comm;        # email, phone, fax, web
    
    text get_full_name();   # Mr. Frank N. Furter Sr.
    text get_polite_name(); # Mr. Furter
  };
  
  # ----------------------------------------------
  # department - 
  # ----------------------------------------------
  class department
  {
    char  code<8>;
    char  descr<35>;
  };
  
  # ----------------------------------------------
  # employee - 
  # ----------------------------------------------
  class employee
  {
    char        code<8>;     # employee designation
    person::person      person;
    person::department  *department;
  };
};