Commit graph

29 commits

Author SHA1 Message Date
Adam Moussa
ca3b3096fc
Skip DST guard on manual workflow_dispatch triggers (#26) 2026-05-01 14:49:01 -04:00
Adam Moussa
b08a532da3
Polish version notifications and sync changelog canvas (#21) (#25)
Reworks the daily version bump workflow to:
- Pull merged PR titles via gh CLI instead of raw commit messages
- Post a polished, non-technical channel message with a link to the
  changelog canvas
- Prepend the new version entry to the Slack canvas via canvases.edit
  API so the canvas stays in sync automatically

Channel message format:
  "After-Hours Scheduler has been updated to vXXXX.XX.XX
   Here's a brief summary of what changed:
   • ...
   Click here to read the full changelog"
2026-05-01 14:47:16 -04:00
Adam Moussa
769b9e5acd
Change deploy notifications to daily version bumps (#24)
Replaces per-push notifications with a daily 6pm ET cron job that
batches all commits since the last version tag into a single Slack
message. Tags main with a date-based version (v2026.05.01) so there
is at most one version bump per day. Includes DST guard matching the
pattern used by the other scheduled Lambdas.
2026-05-01 14:37:54 -04:00
Adam Moussa
5e052d424d
Add GitHub Actions workflow for deploy notifications (#23)
Posts a Slack message to the schedule channel whenever code is pushed
to main. Uses the existing Slack bot token stored as a GitHub secret.
2026-05-01 14:32:53 -04:00
Adam Moussa
7b2275a430
Post shift change notifications to the schedule channel (#21) (#22)
Slash command handlers (drop, pick, swap) were posting notifications to
command["channel_id"] — wherever the command was run. If someone ran
/oncall drop from a DM, the notification went there instead of the
schedule channel. Pickup buttons didn't have this problem because
body["channel"]["id"] is always the channel where the button lives.

Added SHIFT_CHANNEL_PARAM to the SlackBotFunction env vars, read it on
cold start, and route all slash command shift-change notifications to
the configured schedule channel.

Closes #21
2026-05-01 14:15:56 -04:00
Adam Moussa
1e90e0eaa2
Fix race condition allowing multiple people to pick up the same shift (#19) (#20)
The pickup button handler used an unconditional put_item, so concurrent
clicks would both succeed with last-write-wins. Added claim_open_shift()
which uses a DynamoDB ConditionExpression to only write if the shift is
still OPEN. The button handler now returns an ephemeral "already taken"
message when the condition fails.

Closes #19
2026-05-01 14:09:39 -04:00
Adam Moussa
fe6b780e12
Fix weekly schedule starting from today instead of Monday (#18)
The handler passed `now` as start_date, so mid-week runs showed
14 days from today instead of Mon–Sun x2. Also, day names were
derived from a static index (DAY_ORDER[i%7]) which assumed
index 0 = Monday — when start_date wasn't Monday, Saturday and
Sunday were mislabeled as Monday and Tuesday.

Fix: pass this week's Monday from the handler, and derive day
names from the actual date via strftime instead of a static list.

Fixes #17
2026-04-08 13:36:34 -04:00
Adam Moussa
14f9723a87
Change pay report recipient to payroll@seahaven.com (#16)
Update PAYROLL_RECIPIENTS env var from adam@seahaven.com to
payroll@seahaven.com so weekly Bonus Pay Summary emails go
directly to the payroll team. Fixes #12
2026-04-08 13:24:45 -04:00
Adam Moussa
6ad952c498
Remove shift count column from pay email, update footer text (#15)
- Remove the Shifts column from the Bonus Pay Summary email table (fixes #14)
- Change footer from "After-Hours Shift Manager" to "Sea Haven Industries" (fixes #13)
- Update README with pay report email section
2026-04-08 13:22:28 -04:00
Adam Moussa
9e2eab6953 DM pay reports to admin, rename email to Bonus Pay Summary
- Pay summary sent as DM to designated user instead of channel
- Email shows only per-person totals, no shift breakdown
- Renamed email subject/header to "Bonus Pay Summary"
2026-04-07 19:07:44 -04:00
Adam Moussa
a570a96311 Broaden SES permission to all verified identities 2026-04-07 19:01:12 -04:00
Adam Moussa
65d35281b2 Fix DynamoDB float error — use Decimal for pay records 2026-04-07 18:59:52 -04:00
Adam Moussa
f8ceb1dc83 Add force flag to weekly post handler for manual testing 2026-04-07 18:58:03 -04:00
Adam Moussa
b0aec78b8f
Merge pull request #11 from Sea-Haven-Industries/feature/payroll-email
feat: Email weekly pay summary to payroll via SES
2026-04-07 18:54:41 -04:00
Adam Moussa
9deb8bf251 Email weekly pay summary to payroll via SES on Mondays
Sends an HTML pay summary email to configured payroll recipients
alongside the existing Slack post. Uses SES with noreply@seahaven.com
as sender. Recipients configured via PAYROLL_RECIPIENTS env var
(set to adam@seahaven.com for testing, switch to payroll@seahaven.com
for production).

Closes #3
2026-04-07 18:54:19 -04:00
Adam Moussa
093bb43e71 Add force flag to roster sync DST guard 2026-04-07 18:46:26 -04:00
Adam Moussa
81b1a8d061
Merge pull request #10 from Sea-Haven-Industries/feature/3cx-roster-sync
feat: Auto-update roster via 3CX API
2026-04-07 18:43:39 -04:00
Adam Moussa
ac3bd455e7 Add 3CX roster sync Lambda with daily EventBridge trigger
Syncs DynamoDB roster from a configured 3CX group daily at 6am ET
(before the 7am schedule post). Includes ThreeCXClient for XAPI
authentication and group member queries. Preserves existing
slack_user_id links and guards against accidental roster wipes.

Closes #4
2026-04-07 18:43:19 -04:00
Adam Moussa
bd3d27f774
Merge pull request #9 from Sea-Haven-Industries/feature/weekend-day-shifts
feat: Add weekend day shifts and exclude ext 100 from pay
2026-04-07 18:23:16 -04:00
Adam Moussa
7eb0443866 Add weekend day shifts and exclude fallback ext from pay
Saturdays and Sundays now have two shift slots: a day shift (8am–5pm)
and the existing after-hours shift. Extension 100 (fallback) is
excluded from pay calculations. Pickup buttons and schedule display
updated to handle both shift types.
2026-04-07 18:22:56 -04:00
Adam Moussa
9782cd98ee
Merge pull request #8 from Sea-Haven-Industries/feature/oncall-rate-command
feat: Add /oncall rate command for managing pay rates
2026-04-07 18:16:08 -04:00
Adam Moussa
e28f591816 Add /oncall rate command to manage shift pay rates from Slack
- /oncall rate — view current default and per-person rates
- /oncall rate default <amount> — set the global fallback rate
- /oncall rate <extension> <amount> — set a person-specific rate
2026-04-07 18:15:41 -04:00
Adam Moussa
7718feb17e
Merge pull request #7 from Sea-Haven-Industries/feature/per-person-pay-rate
feat: Support per-person shift pay rates
2026-04-07 18:12:48 -04:00
Adam Moussa
1399be7e74 Support per-person shift pay rates
Each roster entry can now have its own shift_rate, falling back to the
global CONFIG rate when not set. Pay breakdowns show individual rates
per shift and per-person totals.
2026-04-07 18:12:32 -04:00
Adam Moussa
57c411824c
Merge pull request #6 from Sea-Haven-Industries/feature/weekly-pay-calculation
feat: Add weekly pay calculation for after-hours shifts
2026-04-07 18:09:36 -04:00
Adam Moussa
d569621c72 Add weekly pay calculation with configurable flat rate
Calculates after-hours pay per shift using a configurable rate stored
in DynamoDB CONFIG. Pay summaries are computed on Monday mornings for
the previous week, stored in DynamoDB (PK=PAY), and posted to Slack.
Adds /oncall pay command for on-demand viewing.

Closes #2
2026-04-07 18:09:19 -04:00
Adam Moussa
23e4f7edf6
Merge pull request #5 from Sea-Haven-Industries/feature/extend-schedule-two-weeks
feat: Extend schedule to 2 full weeks at a time
2026-04-07 18:01:33 -04:00
Adam Moussa
3a51b52ffc Extend schedule display to show 2 full weeks
Anchors to the current week's Monday and shows 14 consecutive days.
Updates /oncall next to jump forward by 2 weeks accordingly.

Closes #1
2026-04-07 18:01:10 -04:00
Adam Moussa
4d0cdb5cfb Initial commit: after-hours shift manager Slack bot
Slack Bolt app on Lambda for managing on-call shifts. Employees can
pick up, drop, and swap shifts via /oncall commands. Changes update
3CX ring group 800 routing in real time for same-day shifts.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-03 18:32:32 -04:00