TLTan LeBackend & automation · CalgaryLet’s talk
← All systemsStaffing · Staffpoint (DeloLogic)

Workforce scheduling platform

Ongoing backend work on a staffing and scheduling platform — most recently the Google Calendar sync for personnel assignments and a responsive retrofit of a legacy WebForms app.

  1. 01
    Shift exists?and a staff member is assigned
  2. 02
    Connected?Google configured, user has linked a calendar
  3. 03
    In window?tomorrow onward — same-day and past shifts skipped
  4. 04
    Status?valid shift status for syncing
  5. 05
    Actcreate, update or delete the event

The problem

Staffpoint is a workforce-management system for staffing agencies. Staff wanted their shifts on their own Google Calendar — created when they are assigned, updated when anything changes, removed when a shift is cancelled.

What I built

The entire sync state is one nullable googleCalendarEventId column on the shift. A single method, SyncGoogleCalendarForShift, applies five rules in order (shown above) and is called from every place that changes an assignment: assigning, editing times, confirming and cancelling.

  • OAuth tokens are stored as JSON on the staff record.
  • Each event carries the shift ID as a private extended property, so any calendar event can be traced back to its shift.
  • Sync runs inside the web request, wrapped so a Google failure never fails the user’s action.

What broke, and the fix

  • Expired tokens failed silently at first. Tokens now record IssuedUtc, refresh automatically, and invalid_grant is detected so the user can reconnect.
  • Orphan events. Clearing the event ID before deleting the event made cleanup impossible. IDs are now captured before the mutation, the database updated, then removals processed.
  • Reconnect backfill. A newly connected user gets every Assigned or Completed shift from tomorrow onward.

What I’d do next

Move sync to an async queue — synchronous execution is the main limitation — and encrypt stored tokens.

Contact · Let’s talk

Have a system that should run itself by now?

Tell me what people still do by hand every morning, or what breaks when nobody is watching. I'll map the shortest path to a job that just runs.

Project brief