Data Design

Please read the HCSS Terminology Guide if you have not yet.  Data at HCSS is generally divided into 3 levels: company-wide, business-unit-specific, and job-specific.  For example, when selecting an employee from a list, it may be useful to show only employees who are working on a particular job.  (i.e., a job-specific employee).  Employees are available at a company-wide, business-unit, and job level.  (as are equipment).

Other resources may only exist at one or two levels.  For example, materials exist at the business-unit and job levels only.  Pay classes have a company-wide and a business-unit-specific representation.  Cost codes only exist at the job level.  

Different fields may be available at each level.  For example, with materials, the material code is shared across a business unit, but the unit cost may be overridden for each job.  (so the unit cost field is only available at the job-level, and the material code is only writable at the business-unit-level)

This design provides some flexibility, but can be a little bit complex.  We've designed the APIs so that it is generally obvious at what "level" you are accessing the resource.  Here are some sample endpoints for employees:

Company-wide:/api/v1/employees
Business-unit-specific:/api/v1/businessUnits/{id}/employees
Job-specific:/api/v1/jobs/{id}/employees