Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
117 commits
Select commit Hold shift + click to select a range
37a81b1
feat: add shared component library for frontend-v2
CK-7vn Feb 14, 2026
264d274
feat: port type system, API client, and utility libraries
CK-7vn Feb 14, 2026
4bf3ebe
feat: port auth, session management, and context providers
CK-7vn Feb 14, 2026
680aa40
feat: port custom hooks and route loaders
CK-7vn Feb 14, 2026
ba678e7
feat: port shadcn/ui component library with design tokens
CK-7vn Feb 14, 2026
9ba6710
feat: port layout shell, navigation, and core components
CK-7vn Feb 14, 2026
d1a7419
feat: configure router, route definitions, and app entry
CK-7vn Feb 14, 2026
5c273f5
feat: add auth pages and form components
CK-7vn Feb 14, 2026
6d163ef
feat: add admin management pages
CK-7vn Feb 14, 2026
a2131b2
feat: add program management and event attendance pages
CK-7vn Feb 14, 2026
20a8198
feat: add student pages and learning components
CK-7vn Feb 14, 2026
8d35e09
feat: add knowledge center pages and components
CK-7vn Feb 14, 2026
8d8b867
feat: add insights, schedule, and remaining pages
CK-7vn Feb 14, 2026
54f4eb0
fix: resolve React ref forwarding, render-body side effects, and ifra…
CK-7vn Feb 15, 2026
050bd40
feat: v2 class page added
CK-7vn Feb 16, 2026
b05c989
fix: program and class pages closer to redesign
CK-7vn Feb 16, 2026
a9eb7a0
feat: add side navbar
CK-7vn Feb 16, 2026
de68a90
fix: lock navbar
CK-7vn Feb 16, 2026
0e8dcd6
fix: remove video
CK-7vn Feb 16, 2026
6c334e5
feat: add necessary wiring and formatting to make page mirror figma
carddev81 Feb 18, 2026
ae0a9eb
feat: add necessary wiring and formatting to make page mirror figma
carddev81 Feb 19, 2026
3717a80
fix: started working page
corypride Feb 19, 2026
35c5328
fix: labels and added todos
corypride Feb 20, 2026
fcb25ff
fix: Pagination
corypride Feb 20, 2026
689851c
fix: create program functionality
corypride Feb 20, 2026
453a57d
fix: removed extra padding
corypride Feb 20, 2026
3600ade
fix: missing sortOption
corypride Feb 20, 2026
291166b
fix: removed comments
corypride Feb 20, 2026
dae4b05
fix: remove file commited accidently
corypride Feb 20, 2026
5116714
fix: archived filter
corypride Feb 20, 2026
6875d64
fix: card view metrics
corypride Feb 20, 2026
ee3a820
fix: adjusted missing styling
corypride Feb 24, 2026
223249f
fix: stat card fix
corypride Feb 24, 2026
eb6614d
fix: linting errors
corypride Feb 24, 2026
a85d2b1
feat: add necessary wiring and formatting to make department admin da…
carddev81 Feb 20, 2026
c4572fd
fix: add changes per requests
carddev81 Mar 3, 2026
7ae0c12
fix: add changes per requests
carddev81 Mar 3, 2026
2e24c0d
feat: Dept_admin view ProgramsPage
corypride Feb 25, 2026
66ce33b
refactor: Enrolled column shows (currently / all-time)
corypride Feb 25, 2026
5ec42e5
refactor: Facilities count is clickable
corypride Feb 25, 2026
e0cf91b
refactor: view, edit, delete added to Action column
corypride Feb 26, 2026
9d0b4f3
fix: Programs Mgt -> Programs and removed the facility name for dept_…
corypride Mar 2, 2026
80e1bf4
fix: hover cursor on button
corypride Mar 3, 2026
1287015
fix: resized text area
corypride Mar 3, 2026
d95c11d
fix: made funding types
corypride Mar 3, 2026
8a7fb32
fix: removed actions column
corypride Mar 3, 2026
89ba5bd
fix: border facilities offered
corypride Mar 3, 2026
6b5c811
fix: underline facilities
corypride Mar 3, 2026
954b860
fix: programs to items
corypride Mar 3, 2026
9de50d2
fix: utilization
corypride Mar 3, 2026
a9f3c9c
fix: modify focus ring on checkboxes
carddev81 Mar 3, 2026
384a8f3
fix: modify focus ring on filters and input fields
carddev81 Mar 3, 2026
fb4f30d
fix: change create button logic to make button active
carddev81 Mar 3, 2026
7c5e118
feat: add necessary wiring and formatting to make fac admin program d…
carddev81 Mar 4, 2026
4d4519c
fix: add changes per request
carddev81 Mar 4, 2026
98c0b7e
fix: add changes per request
carddev81 Mar 4, 2026
9125684
fix: add changes per requestv
carddev81 Mar 4, 2026
1db33cb
fix: add changes per requestv
carddev81 Mar 4, 2026
5bdf1ac
feat: add changes per carolinas updates
carddev81 Mar 4, 2026
4afb2e2
feat: add changes per carolinas updates
carddev81 Mar 4, 2026
2bbe228
feat: add changes per carolinas updates
carddev81 Mar 4, 2026
dd83096
feat: add changes per pr review requests
carddev81 Mar 5, 2026
881e122
fix: add css for fixing grey background
carddev81 Mar 5, 2026
df97260
fix: upgrade Tailwind CSS v3 to v4
CK-7vn Mar 5, 2026
4c0122a
chore: untrack node_modules
CK-7vn Mar 7, 2026
68d160f
fix: bump go version
CK-7vn Mar 7, 2026
3b57bb6
chore: updated ENV GOTOOLCHAIN to auto to allow go.mod to control the…
corypride Mar 10, 2026
1f21770
Ck 7vn/total refactor classes (#1087)
CK-7vn Mar 12, 2026
2359d1e
fix: add back css to align breadcrumbs to be exact
carddev81 Mar 16, 2026
2e98561
feat: add styling and code for program details for department admins
carddev81 Mar 16, 2026
45a1b45
fix: add missing archiving and reactivate pieces found by reviewer
carddev81 Mar 21, 2026
dbc44a4
feat: add styling and code for facilities screen for department admins
carddev81 Mar 23, 2026
5cedaca
feat: resident profile
CK-7vn Apr 3, 2026
b8085b6
feat: class details
CK-7vn Apr 3, 2026
a3b0e0a
feat: add new landing page to have login and password
carddev81 Apr 3, 2026
a8e9c82
fix: replace CSS hex to match branding per request
carddev81 Apr 15, 2026
1a75c00
feat: residents page refactor
CK-7vn Apr 20, 2026
9e53a41
feat: knowledge center
CK-7vn Apr 27, 2026
80354c4
feat: move faq into redesign
corypride Apr 28, 2026
d412e7c
feat: add schedule and refactor for code reuse and efficiency
carddev81 Apr 30, 2026
4472e19
fix: add reason length check
carddev81 May 7, 2026
ee3e12b
fix: dead code layout merge regression fix (#1119)
CK-7vn May 7, 2026
64fd98b
fix: military to am-pm (#1116)
CK-7vn May 7, 2026
2925921
fix: defensive case for deleteion of users
CK-7vn Apr 28, 2026
73c7346
fix: add account overview to resident page
CK-7vn Apr 29, 2026
ccd91ae
fix: account overview
CK-7vn Apr 30, 2026
f785ea6
fix: go bump to 1.26.3
CK-7vn May 8, 2026
fe3a430
fix: add delete guards
CK-7vn May 1, 2026
074291d
fix: update index, queries, tests
CK-7vn May 8, 2026
4eec9b0
fix: logic in program_classes.go hook that prevented enrolled_ended_a…
corypride May 4, 2026
8949b69
fix: applied bug fixes according to 2 code rabbit comments
corypride May 7, 2026
40bda3c
fix: upgrade pgx/v5 and x/net to resolve govulncheck CVEs
corypride May 8, 2026
3be3c4d
fix: bump GitHub Actions checkout to v4 and setup-go to v5 for Node 2…
corypride May 8, 2026
6be5fbc
fix: upgrade pgx/v5 to v5.9.0 in migrations and seeder modules
corypride May 8, 2026
944522d
feat: add admin redesign page
carddev81 May 8, 2026
a1d09b9
fix: add version change for golang
carddev81 May 8, 2026
ebf9c27
fix: add changes per code rabbit
carddev81 May 11, 2026
73dafd7
fix: add url change to fix create class flow per Carolina and to matc…
carddev81 May 7, 2026
39b0cfb
feat: add instructor and room strikethrough feature per ticket ID-620
carddev81 May 7, 2026
4d33913
feat: add instructor and room strikethrough feature per ticket ID-620
carddev81 May 7, 2026
ec3d895
fix: add changes per code rabbit
carddev81 May 11, 2026
ddab0d2
feat: add new redesign files to frontend folder and remove old v2 fol…
carddev81 May 11, 2026
353d9fd
refactor: add and remove logic to consolidate schedule popout to remo…
carddev81 May 12, 2026
781e356
fix: add missing condition check
carddev81 May 13, 2026
96c36e4
fix: remove unused code (#1127)
CK-7vn May 13, 2026
6a8755f
refactor: Pagination component to be used site wide
corypride May 13, 2026
e3d8c62
fix: linting errors
corypride May 13, 2026
58114e3
fix: removed unused totalPages variable
corypride May 14, 2026
d15dca1
fix: resolved code rabbit requested changes
corypride May 14, 2026
18c37b9
fix: suggested changes
corypride May 18, 2026
e768e99
refactor: add changes to account for split 2 ticket ID 654
carddev81 May 18, 2026
47241bd
fix: add changes to utilize the PageHeader versus the DashboardHeader…
carddev81 May 18, 2026
ba67638
refactor: split 3
CK-7vn May 19, 2026
e9d823f
refactor: add changes to account for split 1 form and modals ticket I…
carddev81 May 19, 2026
ed088aa
fix: add changes to fix code rabbit requests
carddev81 May 20, 2026
437969e
refactor: global css
CK-7vn May 26, 2026
8959f85
merge: bring main into total-refactor
CK-7vn May 26, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions .github/workflows/container_builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 3

Expand Down Expand Up @@ -62,7 +62,7 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set Image Version
run: |
Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/eslint.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
name: Run ESLint and build frontend
name: Build frontend

on: pull_request

jobs:
frontend:
name: Lint and build JS
name: Build JS
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'yarn'
cache-dependency-path: frontend/yarn.lock
- run: |
cd frontend && \
corepack install -g yarn && \
yarn && \
yarn lint-staged && \
yarn build
4 changes: 2 additions & 2 deletions .github/workflows/go_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ jobs:
tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: "1.26.3"

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/security-frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
node-version: '22'
cache: 'yarn'
cache-dependency-path: frontend/yarn.lock

Expand Down
9 changes: 7 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,30 @@
.claude
.idea
.claude/*
node_modules/
Claude.md
AGENTS.md
.github/workflows/test.yml
/frontend/.husky/staged-files
jar
/config/logs
/logs/*.log
/logs/*.json
/frontend/dist/
/frontend/node_modules/
/frontend/.vite/
/frontend/public/build
/frontend/public/thumbnails/*
/frontend/public/*.mp4
/frontend/public/videos/*
*.tsbuildinfo
/migrations/migrations
/provider-middleware/providers.db
/backend/server
/provider-middleware/middleware
/provider-middleware/provider-middleware
/provider-middleware/bin
/backend/bin
/bin/*
/tmp
/csvs/zims/*.zim
/.claude
/.claude
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ reset: ascii_art

init: ascii_art
@echo 'Installing dependencies...'
go install github.com/pressly/goose/v3/cmd/goose@latest && go install github.com/air-verse/air@latest && cd frontend && yarn install && yarn prepare && cd ..
go install github.com/pressly/goose/v3/cmd/goose@latest && go install github.com/air-verse/air@latest && cd frontend && yarn install && cd ..
@echo 'Dependencies installed successfully.'
./config/zims.sh
docker compose up $(BUILD_RECREATE)
Expand Down
12 changes: 6 additions & 6 deletions backend/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ require (
github.com/sirupsen/logrus v1.9.4
github.com/stretchr/testify v1.11.1
github.com/teambition/rrule-go v1.8.2
golang.org/x/net v0.49.0 // indirect
golang.org/x/net v0.53.0 // indirect
golang.org/x/oauth2 v0.34.0
gorm.io/driver/postgres v1.6.0
gorm.io/gorm v1.31.1
Expand Down Expand Up @@ -65,7 +65,7 @@ require (
github.com/go-playground/universal-translator v0.18.1 // indirect
github.com/jackc/pgpassfile v1.0.0 // indirect
github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 // indirect
github.com/jackc/pgx/v5 v5.8.0 // indirect
github.com/jackc/pgx/v5 v5.9.0 // indirect
github.com/jackc/puddle/v2 v2.2.2 // indirect
github.com/jinzhu/inflection v1.0.0 // indirect
github.com/jinzhu/now v1.1.5 // indirect
Expand All @@ -86,11 +86,11 @@ require (
github.com/robfig/cron/v3 v3.0.1 // indirect
github.com/sethvargo/go-retry v0.3.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/crypto v0.47.0 // indirect
golang.org/x/crypto v0.50.0 // indirect
golang.org/x/exp v0.0.0-20260112195511-716be5621a96 // indirect
golang.org/x/sync v0.19.0 // indirect
golang.org/x/sys v0.40.0 // indirect
golang.org/x/text v0.33.0 // indirect
golang.org/x/sync v0.20.0 // indirect
golang.org/x/sys v0.43.0 // indirect
golang.org/x/text v0.36.0 // indirect
google.golang.org/protobuf v1.36.11 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
modernc.org/libc v1.67.7 // indirect
Expand Down
32 changes: 16 additions & 16 deletions backend/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsI
github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg=
github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 h1:iCEnooe7UlwOQYpKFhBabPMi4aNAfoODPEFNiAnClxo=
github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761/go.mod h1:5TJZWKEWniPve33vlWYSoGYefn3gLQRzjfDlhSJ9ZKM=
github.com/jackc/pgx/v5 v5.8.0 h1:TYPDoleBBme0xGSAX3/+NujXXtpZn9HBONkQC7IEZSo=
github.com/jackc/pgx/v5 v5.8.0/go.mod h1:QVeDInX2m9VyzvNeiCJVjCkNFqzsNb43204HshNSZKw=
github.com/jackc/pgx/v5 v5.9.0 h1:T/dI+2TvmI2H8s/KH1/lXIbz1CUFk3gn5oTjr0/mBsE=
github.com/jackc/pgx/v5 v5.9.0/go.mod h1:mal1tBGAFfLHvZzaYh77YS/eC6IX9OWbRV1QIIM0Jn4=
github.com/jackc/puddle/v2 v2.2.2 h1:PR8nw+E/1w0GLuRFSmiioY6UooMp6KJv0/61nB7icHo=
github.com/jackc/puddle/v2 v2.2.2/go.mod h1:vriiEXHvEE654aYKXXjOvZM39qJ0q+azkZFrfEOc3H4=
github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E=
Expand Down Expand Up @@ -164,27 +164,27 @@ go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
go.yaml.in/yaml/v2 v2.4.3 h1:6gvOSjQoTB3vt1l+CU+tSyi/HOjfOjRLJ4YwYZGwRO0=
go.yaml.in/yaml/v2 v2.4.3/go.mod h1:zSxWcmIDjOzPXpjlTTbAsKokqkDNAVtZO0WOMiT90s8=
golang.org/x/crypto v0.47.0 h1:V6e3FRj+n4dbpw86FJ8Fv7XVOql7TEwpHapKoMJ/GO8=
golang.org/x/crypto v0.47.0/go.mod h1:ff3Y9VzzKbwSSEzWqJsJVBnWmRwRSHt/6Op5n9bQc4A=
golang.org/x/crypto v0.50.0 h1:zO47/JPrL6vsNkINmLoo/PH1gcxpls50DNogFvB5ZGI=
golang.org/x/crypto v0.50.0/go.mod h1:3muZ7vA7PBCE6xgPX7nkzzjiUq87kRItoJQM1Yo8S+Q=
golang.org/x/exp v0.0.0-20260112195511-716be5621a96 h1:Z/6YuSHTLOHfNFdb8zVZomZr7cqNgTJvA8+Qz75D8gU=
golang.org/x/exp v0.0.0-20260112195511-716be5621a96/go.mod h1:nzimsREAkjBCIEFtHiYkrJyT+2uy9YZJB7H1k68CXZU=
golang.org/x/image v0.25.0 h1:Y6uW6rH1y5y/LK1J8BPWZtr6yZ7hrsy6hFrXjgsc2fQ=
golang.org/x/image v0.25.0/go.mod h1:tCAmOEGthTtkalusGp1g3xa2gke8J6c2N565dTyl9Rs=
golang.org/x/mod v0.32.0 h1:9F4d3PHLljb6x//jOyokMv3eX+YDeepZSEo3mFJy93c=
golang.org/x/mod v0.32.0/go.mod h1:SgipZ/3h2Ci89DlEtEXWUk/HteuRin+HHhN+WbNhguU=
golang.org/x/net v0.49.0 h1:eeHFmOGUTtaaPSGNmjBKpbng9MulQsJURQUAfUwY++o=
golang.org/x/net v0.49.0/go.mod h1:/ysNB2EvaqvesRkuLAyjI1ycPZlQHM3q01F02UY/MV8=
golang.org/x/mod v0.34.0 h1:xIHgNUUnW6sYkcM5Jleh05DvLOtwc6RitGHbDk4akRI=
golang.org/x/mod v0.34.0/go.mod h1:ykgH52iCZe79kzLLMhyCUzhMci+nQj+0XkbXpNYtVjY=
golang.org/x/net v0.53.0 h1:d+qAbo5L0orcWAr0a9JweQpjXF19LMXJE8Ey7hwOdUA=
golang.org/x/net v0.53.0/go.mod h1:JvMuJH7rrdiCfbeHoo3fCQU24Lf5JJwT9W3sJFulfgs=
golang.org/x/oauth2 v0.34.0 h1:hqK/t4AKgbqWkdkcAeI8XLmbK+4m4G5YeQRrmiotGlw=
golang.org/x/oauth2 v0.34.0/go.mod h1:lzm5WQJQwKZ3nwavOZ3IS5Aulzxi68dUSgRHujetwEA=
golang.org/x/sync v0.19.0 h1:vV+1eWNmZ5geRlYjzm2adRgW2/mcpevXNg50YZtPCE4=
golang.org/x/sync v0.19.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI=
golang.org/x/sync v0.20.0 h1:e0PTpb7pjO8GAtTs2dQ6jYa5BWYlMuX047Dco/pItO4=
golang.org/x/sync v0.20.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.40.0 h1:DBZZqJ2Rkml6QMQsZywtnjnnGvHza6BTfYFWY9kjEWQ=
golang.org/x/sys v0.40.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
golang.org/x/text v0.33.0 h1:B3njUFyqtHDUI5jMn1YIr5B0IE2U0qck04r6d4KPAxE=
golang.org/x/text v0.33.0/go.mod h1:LuMebE6+rBincTi9+xWTY8TztLzKHc/9C1uBCG27+q8=
golang.org/x/tools v0.41.0 h1:a9b8iMweWG+S0OBnlU36rzLp20z1Rp10w+IY2czHTQc=
golang.org/x/tools v0.41.0/go.mod h1:XSY6eDqxVNiYgezAVqqCeihT4j1U2CCsqvH3WhQpnlg=
golang.org/x/sys v0.43.0 h1:Rlag2XtaFTxp19wS8MXlJwTvoh8ArU6ezoyFsMyCTNI=
golang.org/x/sys v0.43.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw=
golang.org/x/text v0.36.0 h1:JfKh3XmcRPqZPKevfXVpI1wXPTqbkE5f7JA92a55Yxg=
golang.org/x/text v0.36.0/go.mod h1:NIdBknypM8iqVmPiuco0Dh6P5Jcdk8lJL0CUebqK164=
golang.org/x/tools v0.43.0 h1:12BdW9CeB3Z+J/I/wj34VMl8X+fEXBxVR90JeMX5E7s=
golang.org/x/tools v0.43.0/go.mod h1:uHkMso649BX2cZK6+RpuIPXS3ho2hZo4FVwfoy1vIk0=
google.golang.org/protobuf v1.36.11 h1:fV6ZwhNocDyBLK0dj+fg8ektcVegBBuEolpbTQyBNVE=
google.golang.org/protobuf v1.36.11/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
Expand Down
6 changes: 6 additions & 0 deletions backend/migrations/00065_add_instructor_to_overrides.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
-- +goose Up
ALTER TABLE public.program_class_event_overrides
ADD COLUMN instructor_id INTEGER REFERENCES public.users(id);

-- +goose Down
ALTER TABLE public.program_class_event_overrides DROP COLUMN IF EXISTS instructor_id;
16 changes: 16 additions & 0 deletions backend/migrations/00066_create_user_notes.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
-- +goose Up
CREATE TABLE IF NOT EXISTS public.user_notes (
id SERIAL PRIMARY KEY,
user_id INTEGER NOT NULL REFERENCES public.users(id) ON DELETE CASCADE,
note TEXT NOT NULL,
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
deleted_at TIMESTAMPTZ,
create_user_id INTEGER NOT NULL REFERENCES public.users(id),
update_user_id INTEGER REFERENCES public.users(id)
);

CREATE INDEX IF NOT EXISTS idx_user_notes_user_id ON public.user_notes(user_id);

-- +goose Down
DROP TABLE IF EXISTS public.user_notes;
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
-- +goose Up
-- +goose StatementBegin
ALTER TABLE public.program_class_events
ADD COLUMN instructor_id INTEGER REFERENCES public.users(id) ON DELETE SET NULL,
ADD COLUMN reason CHARACTER VARYING(255) DEFAULT NULL,
ADD COLUMN is_cancelled BOOLEAN NOT NULL DEFAULT FALSE;

UPDATE public.program_class_events pce
SET instructor_id = pc.instructor_id
FROM public.program_classes pc
WHERE pce.class_id = pc.id
AND pc.instructor_id IS NOT NULL;

DROP INDEX IF EXISTS idx_program_classes_instructor_id;
ALTER TABLE public.program_classes DROP COLUMN IF EXISTS instructor_id;

CREATE INDEX idx_program_class_events_instructor_id ON public.program_class_events(instructor_id);

COMMENT ON COLUMN public.program_class_events.instructor_id IS 'Foreign key to users table; migrated from program_classes.instructor_id as the authoritative location for per-event instructor assignment';
COMMENT ON COLUMN public.program_class_events.reason IS 'Optional reason recorded when the event was created or modified (e.g. room change, instructor change, reschedule)';
COMMENT ON COLUMN public.program_class_events.is_cancelled IS 'Used for cancelling an entire series of events when requested';
-- +goose StatementEnd

-- +goose Down
-- +goose StatementBegin
DROP INDEX IF EXISTS idx_program_class_events_instructor_id;

-- Restore instructor_id on program_classes
ALTER TABLE public.program_classes
ADD COLUMN instructor_id INTEGER REFERENCES public.users(id) ON DELETE SET NULL;

-- Backfill program_classes.instructor_id from program_class_events
UPDATE public.program_classes pc
SET instructor_id = pce.instructor_id
FROM public.program_class_events pce
WHERE pce.class_id = pc.id
AND pce.instructor_id IS NOT NULL;

CREATE INDEX idx_program_classes_instructor_id ON public.program_classes(instructor_id);

ALTER TABLE public.program_class_events
DROP COLUMN IF EXISTS instructor_id,
DROP COLUMN IF EXISTS reason,
DROP COLUMN IF EXISTS is_cancelled;
-- +goose StatementEnd
11 changes: 11 additions & 0 deletions backend/migrations/00068_add_delete_guard_indexes.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
-- +goose Up
CREATE INDEX IF NOT EXISTS idx_program_completions_program_class_id
ON public.program_completions (program_class_id)
WHERE deleted_at IS NULL;

CREATE INDEX IF NOT EXISTS idx_program_classes_history_table_name_parent_ref_id
ON public.program_classes_history (table_name, parent_ref_id);

-- +goose Down
DROP INDEX IF EXISTS idx_program_completions_program_class_id;
DROP INDEX IF EXISTS idx_program_classes_history_table_name_parent_ref_id;
3 changes: 1 addition & 2 deletions backend/migrations/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module migrations
go 1.26.3

require (
github.com/jackc/pgx/v5 v5.7.6
github.com/jackc/pgx/v5 v5.9.0
github.com/joho/godotenv v1.5.1
github.com/nats-io/nats.go v1.37.0
github.com/ory/kratos-client-go v1.2.0
Expand All @@ -23,7 +23,6 @@ require (
github.com/nats-io/nkeys v0.4.7 // indirect
github.com/nats-io/nuid v1.0.1 // indirect
github.com/sethvargo/go-retry v0.3.0 // indirect
github.com/stretchr/testify v1.11.1 // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/crypto v0.45.0 // indirect
golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8 // indirect
Expand Down
4 changes: 2 additions & 2 deletions backend/migrations/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsI
github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg=
github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 h1:iCEnooe7UlwOQYpKFhBabPMi4aNAfoODPEFNiAnClxo=
github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761/go.mod h1:5TJZWKEWniPve33vlWYSoGYefn3gLQRzjfDlhSJ9ZKM=
github.com/jackc/pgx/v5 v5.7.6 h1:rWQc5FwZSPX58r1OQmkuaNicxdmExaEz5A2DO2hUuTk=
github.com/jackc/pgx/v5 v5.7.6/go.mod h1:aruU7o91Tc2q2cFp5h4uP3f6ztExVpyVv88Xl/8Vl8M=
github.com/jackc/pgx/v5 v5.9.0 h1:T/dI+2TvmI2H8s/KH1/lXIbz1CUFk3gn5oTjr0/mBsE=
github.com/jackc/pgx/v5 v5.9.0/go.mod h1:mal1tBGAFfLHvZzaYh77YS/eC6IX9OWbRV1QIIM0Jn4=
github.com/jackc/puddle/v2 v2.2.2 h1:PR8nw+E/1w0GLuRFSmiioY6UooMp6KJv0/61nB7icHo=
github.com/jackc/puddle/v2 v2.2.2/go.mod h1:vriiEXHvEE654aYKXXjOvZM39qJ0q+azkZFrfEOc3H4=
github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E=
Expand Down
4 changes: 1 addition & 3 deletions backend/seeder/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,10 @@ require (
require (
github.com/jackc/pgpassfile v1.0.0 // indirect
github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 // indirect
github.com/jackc/pgx/v5 v5.7.6 // indirect
github.com/jackc/pgx/v5 v5.9.0 // indirect
github.com/jackc/puddle/v2 v2.2.2 // indirect
github.com/jinzhu/inflection v1.0.0 // indirect
github.com/jinzhu/now v1.1.5 // indirect
github.com/stretchr/testify v1.11.1 // indirect
golang.org/x/crypto v0.45.0 // indirect
golang.org/x/sync v0.18.0 // indirect
golang.org/x/text v0.31.0 // indirect
)
9 changes: 7 additions & 2 deletions backend/seeder/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@ github.com/go-faker/faker/v4 v4.6.0/go.mod h1:ZmrHuVtTTm2Em9e0Du6CJ9CADaLEzGXW62
github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM=
github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg=
github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 h1:iCEnooe7UlwOQYpKFhBabPMi4aNAfoODPEFNiAnClxo=
github.com/jackc/pgx/v5 v5.7.6 h1:rWQc5FwZSPX58r1OQmkuaNicxdmExaEz5A2DO2hUuTk=
github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761/go.mod h1:5TJZWKEWniPve33vlWYSoGYefn3gLQRzjfDlhSJ9ZKM=
github.com/jackc/pgx/v5 v5.9.0 h1:T/dI+2TvmI2H8s/KH1/lXIbz1CUFk3gn5oTjr0/mBsE=
github.com/jackc/pgx/v5 v5.9.0/go.mod h1:mal1tBGAFfLHvZzaYh77YS/eC6IX9OWbRV1QIIM0Jn4=
github.com/jackc/puddle/v2 v2.2.2 h1:PR8nw+E/1w0GLuRFSmiioY6UooMp6KJv0/61nB7icHo=
github.com/jackc/puddle/v2 v2.2.2/go.mod h1:vriiEXHvEE654aYKXXjOvZM39qJ0q+azkZFrfEOc3H4=
github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E=
github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc=
github.com/jinzhu/now v1.1.5 h1:/o9tlHleP7gOFmsnYNz3RGnqzefHA47wQpKrrdTIwXQ=
Expand All @@ -20,11 +23,13 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
github.com/teambition/rrule-go v1.8.2 h1:lIjpjvWTj9fFUZCmuoVDrKVOtdiyzbzc93qTmRVe/J8=
github.com/teambition/rrule-go v1.8.2/go.mod h1:Ieq5AbrKGciP1V//Wq8ktsTXwSwJHDD5mD/wLBGl3p4=
golang.org/x/crypto v0.45.0 h1:jMBrvKuj23MTlT0bQEOBcAE0mjg8mK9RXFhRH6nyF3Q=
golang.org/x/sync v0.18.0 h1:kr88TuHDroi+UVf+0hZnirlk8o8T+4MrK6mr60WkH/I=
golang.org/x/sync v0.18.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI=
golang.org/x/text v0.31.0 h1:aC8ghyu4JhP8VojJ2lEHBnochRno1sgL6nEi9WGFGMM=
golang.org/x/text v0.31.0/go.mod h1:tKRAlv61yKIjGGHX/4tP1LTbc13YSec1pxVEWXzfoeM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
Expand Down
7 changes: 3 additions & 4 deletions backend/seeder/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -641,10 +641,9 @@ func createFacilityPrograms(db *gorm.DB) ([]models.ProgramClass, error) {
log.Printf("Failed to create program credit type: %v", err)
}
class := models.ProgramClass{
Capacity: capacities[rand.Intn(len(capacities))],
Name: programs[i].Name,
InstructorName: faker.Name(),
Description: programClassDescriptions[programs[i].Name],
Capacity: capacities[rand.Intn(len(capacities))],
Name: programs[i].Name,
Description: programClassDescriptions[programs[i].Name],
Status: models.Scheduled, //this will change during new class development
StartDt: time.Now().Add(14 * 24 * time.Hour),
EndDt: &endDates[rand.Intn(len(endDates))],
Expand Down
4 changes: 2 additions & 2 deletions backend/src/database/activity.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ func (db *DB) GetTotalStudentsEnrolled(facilityID *uint) (int, error) {
func (db *DB) GetTotalHourlyActivity(facilityID *uint) (int, error) {
var totalActivity int
subQry := db.Table("activities a").
Select("CAST(COALESCE(ROUND(SUM(a.total_time)/3600, 0), 0) AS INTEGER) AS total_activity_time").
Select("CAST(COALESCE(ROUND(SUM(a.time_delta)/3600, 0), 0) AS INTEGER) AS total_activity_time").
Joins("INNER JOIN users u ON u.id = a.user_id")
if facilityID != nil {
subQry = subQry.Where("u.facility_id = ?", facilityID)
Expand Down Expand Up @@ -151,7 +151,7 @@ func (db *DB) GetLearningInsights(facilityID *uint) ([]models.LearningInsight, e
c.name,
COUNT(DISTINCT ue.user_id) AS enrollments,
(SELECT COUNT(DISTINCT o.user_id) FROM outcomes o WHERE o.course_id = c.id) AS completions,
(SELECT ROUND(COALESCE(SUM(a.total_time) / 3600, 0), 2)
(SELECT ROUND(COALESCE(SUM(a.time_delta) / 3600, 0), 2)
FROM activities a WHERE a.course_id = c.id) AS activity_hours
FROM courses c
LEFT JOIN user_enrollments ue ON ue.course_id = c.id
Expand Down
Loading
Loading