Skip to content

Feature/purchase history#40

Open
NoamBenShimon wants to merge 32 commits into
mainfrom
feature/purchase-history
Open

Feature/purchase history#40
NoamBenShimon wants to merge 32 commits into
mainfrom
feature/purchase-history

Conversation

@NoamBenShimon
Copy link
Copy Markdown
Contributor

This pull request introduces significant improvements to the backend, focusing on standardizing database table naming, updating the module and binary names, and adding a new purchase history feature for users. The changes also include various code cleanups and updates to ensure consistency across the codebase.

Database and Naming Standardization:

  • Updated all references to database tables from camelCase (e.g., cartEntry, apply) to snake_case (e.g., cart_entry, cart_item) for consistency and to match SQL naming conventions. [1] [2] [3] [4]
  • Updated the module name in go.mod and the binary name in Makefile to motzklist-backend for clarity and alignment with the project naming. [1] [2]

New Feature: User Purchase History:

  • Added new types Order and OrderItem in main.go to represent user orders and their items.
  • Implemented functions in db_api.go to fetch and return a user's order history and order items, and added an HTTP handler /api/history to serve this data as JSON. [1] [2]

Codebase Cleanups:

  • Removed the unused Timestamp field from the CartEntry struct and corresponding mock data in mock_db.go. [1] [2] [3]
  • Minor Dockerfile cleanup by removing an unused label.

These changes improve the maintainability of the codebase, provide new functionality for users, and ensure consistency in naming and structure.

Avnermond12344 and others added 30 commits December 4, 2025 20:49
# Conflicts:
#	SCHEMA.md
#	main.go
#	mock_db.go
Refactor database access methods to use actual DB queries instead of mock data. Implement functions to initialize the database connection and retrieve schools, grades, equipment, and user information from the database.
Refactor DB methods to use actual database queries
- Rename module to motzklist-backend
- Update cart table references (cartEntry -> cart_entry, apply -> cart_item)
- Update Makefile binary name to match module
- Fix .gitignore exe glob (.exe -> *.exe)
- Drop stale Dockerfile author label
Copy link
Copy Markdown
Contributor

@Avnermond12344 Avnermond12344 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks Good!

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.

3 participants