Feature/purchase history#40
Open
NoamBenShimon wants to merge 32 commits into
Open
Conversation
# 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
…ature/purchase-history
Signed-off-by: Noam Ben Shimon <Noambs2999@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
cartEntry,apply) to snake_case (e.g.,cart_entry,cart_item) for consistency and to match SQL naming conventions. [1] [2] [3] [4]go.modand the binary name inMakefiletomotzklist-backendfor clarity and alignment with the project naming. [1] [2]New Feature: User Purchase History:
OrderandOrderIteminmain.goto represent user orders and their items.db_api.goto fetch and return a user's order history and order items, and added an HTTP handler/api/historyto serve this data as JSON. [1] [2]Codebase Cleanups:
Timestampfield from theCartEntrystruct and corresponding mock data inmock_db.go. [1] [2] [3]These changes improve the maintainability of the codebase, provide new functionality for users, and ensure consistency in naming and structure.