Skip to content

Dev 6#118

Merged
DRAGOR75 merged 2 commits into
masterfrom
dev-6
Jun 1, 2026
Merged

Dev 6#118
DRAGOR75 merged 2 commits into
masterfrom
dev-6

Conversation

@DRAGOR75

@DRAGOR75 DRAGOR75 commented Jun 1, 2026

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

  • New Features

    • Added gender field support to bulk employee uploads with automatic value normalization.
    • Introduced new electrical technician and specialist electrician designations for workforce categorization.
  • Updates

    • Updated CSV download template and supported headers guidance for bulk uploads.

@vercel

vercel Bot commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
templtrainingportal Ready Ready Preview, Comment Jun 1, 2026 4:48am

@coderabbitai

coderabbitai Bot commented Jun 1, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 6abb99eb-86ee-497e-be81-5f468820d658

📥 Commits

Reviewing files that changed from the base of the PR and between 9fbc357 and d2e5c4d.

📒 Files selected for processing (3)
  • app/actions/bulk-upload.ts
  • app/admin/upload-tni/page.tsx
  • prisma/seed-designations.ts

📝 Walkthrough

Walkthrough

This PR adds gender support to the bulk employee upload flow: the import parser now captures and normalizes Gender/Sex columns into MALE, FEMALE, or OTHER enums persisted in the employee upsert. The upload UI sample and help text are updated, and the designation seed data is extended with new roles.

Changes

Gender Support in Bulk Upload

Layer / File(s) Summary
Gender field contract and normalization
app/actions/bulk-upload.ts
EmployeeImportRow interface extended with optional Gender and Sex fields; processEmployeeUpload normalizes gender inputs by leading character (M→MALE, F→FEMALE, other→OTHER) and includes the resulting genderEnum in the employee upsert payload.
Bulk upload formatting and email persistence
app/actions/bulk-upload.ts
Non-functional whitespace adjustments in date parsing and program-parsing sections; email conditional in the upsert update payload retains its "set only when input email was provided" behavior with minor formatting change.
Sample CSV and dropzone help text
app/admin/upload-tni/page.tsx
downloadSample() refactored to build CSV from explicit headers and rowData arrays instead of hardcoded string; dropzone help text updated from "Must include headers" to "Supported headers:" with revised column list.
Designation seed data extension
prisma/seed-designations.ts
Seed script imports dotenv/config at startup; designationData array extended with new Workman roles (Fitter, Electrician, Asst/Duty/Senior Electrician, Apprentice Electrician) and Executive designations (Specialist/Expert Electrician).

Possibly related PRs

  • DRAGOR75/TEIPL-Training-Portal#116: Extends employee creation and update actions to persist the gender field, completing the end-to-end gender data flow started by this PR's bulk upload parsing.
  • DRAGOR75/TEIPL-Training-Portal#110: Modifies the same bulk upload implementation to add program ID and nomination creation logic alongside this PR's gender feature.
  • DRAGOR75/TEIPL-Training-Portal#108: Also extends processEmployeeUpload CSV parsing with case-insensitive program ID lookups in parallel with this PR's gender normalization feature.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 A gender field hops into the form,
M and F take their norm,
Others default smooth,
The sample CSV sings new truth,
And seeds sprout fresh designations warm.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dev-6

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@sonarqubecloud

sonarqubecloud Bot commented Jun 1, 2026

Copy link
Copy Markdown

@DRAGOR75 DRAGOR75 merged commit 8d39616 into master Jun 1, 2026
3 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant