Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
A AIS modular
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Metrics
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Matthew Chavez
  • AIS modular
  • Wiki
    • Hubstaff
  • Overview

Last edited by matte0 Jun 27, 2021
Page history

Overview

Overview

Hubstaff is created to consolidate and compile all ais hubstaff users.


📁 Hubstaff Related files:

THis is only the Hubstaff related files.

  • Controllers/Hubstaff.php - Contains all the function and logic used in hubstaff_attendance_report.
  • Pages/hubstaff/hubstaff_attendance_report.php - The page is used to consolidate all hubstaff AMTI users data.
  • Pages/hubstaff/hubstaff_management.php - This page is currently not in production as it is complete. See Hubstaff wiki for this tech debt.
  • application/cache/HUBSTAFF_* - All cached hubstaff files in inside the cache folder prefixed by HUBSTAFF_ keywork.

Hubstaff Flow

Functions of the Hubstaff

  • Daily of Hubstaff request (every 11:59pm)
graph LR;

ais[AIS Server]--request to hubstaff server-->a
a[1. Refresh access token and then cache]
a--returj response will be cache-->ais
ais--request to hubstaff server-->b[2. Cache Organization Members]
b--return response will be cached-->ais
ais--request hubstaff server-->c[3. Cache Users]
c--return response will be cached-->ais

The diagram above shows how the CRON job works. The code implementation below:

  /**
   * Update all the data cache of hubstaff
   * This function is used for the CRON JOB in server
   */
  public function hubstaffJobsDaily() {
      $this->refreshAccessToken();
      $this->cacheOrganizationMembers();
      $this->cacheUsers();
  }

POST API: cacheAttendanceShifts

This API is mostly used to get the hubstaff users current shift status. This is also used when the Payroll requests a certain range of date to be pulled from the API server.

Please also note that this API is called every hour to prevent multiple API requests when loading the Hubstaff modle page in the AIS.

Clone repository
  • Hubstaff
    • Common Support and Issues
    • Overview
  • Warehouse Delivery Tracking (WDT API Only)
    • Common Support and Issues
    • Overview
    • Technical Debt
  • clearance
    • Common Support and Issues
    • Overview
    • Technical Debt
  • Home