Skip to content

Conversation

@NewdlDewdl
Copy link
Contributor

@NewdlDewdl NewdlDewdl commented Feb 10, 2026

Overview

Implements the uploader for discount programs as requested in #122.

Changes

  • Created uploader/discountsUploader.go following existing uploader patterns
  • Updated main.go to handle -upload -discounts flag
  • Updated README.md with upload documentation
  • Enabled the discount pipeline in runners/weekly.sh
  • Added unit tests for the discounts uploader

Implementation Details

  • Uses UploadData[schema.DiscountProgram]
  • Collection name: discounts (matches discounts.json filename convention)
  • Handles file-not-found gracefully
  • Replaces existing data (consistent with other standalone uploaders)

Testing

  • Code builds successfully

Closes #122

- Add discountsUploader.go following existing uploader patterns
- Update main.go to handle -upload -discounts flag
- Update README.md with upload documentation
- Enable discount upload in weekly runner script
- Collection name: discounts (matches discounts.json filename)

Resolves UTDNebula#122
@NewdlDewdl
Copy link
Contributor Author

@mikehquan19 implemented the discounts uploader for #122.

Summary:

  • Added uploader/discountsUploader.go (supports -upload -discounts)
  • Updated docs and weekly runner
  • Added unit tests for the discounts uploader

Would appreciate a quick review when you have time.

@mikehquan19
Copy link
Contributor

Will do, thanks.

@NewdlDewdl
Copy link
Contributor Author

@mikehquan19 follow-up: re-reviewed #122 and confirmed this PR matches the request (uploader implementation + docs + runner).

Local MongoDB integration sanity check:

  • Started a temporary mongo:7 container
  • Set MONGODB_URI=mongodb://localhost:27018
  • Ran: ./api-tools -upload -discounts -i ./tmp/discounts_upload_test
  • Verified combinedDB.discounts.countDocuments() == 2

So the uploader path works end-to-end against MongoDB.

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.

Implement the uploader for discount programs

3 participants