Develop#16
Merged
Merged
Conversation
Feature/scaffold
…d database migrations
…onnection in API server
…de migrations directory in image
Feature/docker postgres
…, and handler layers
…d refactor update validation
Feature/books crud
…ts on email/phone/nationalCode, and indexes
…SON field naming to camelCase
…ed errors.go and renaming to ErrBookNotFound/ErrCustomerNotFound
…ness validation, and rename List to GetAll in repository
…mpty slice in repository GetAll, and update service error messages to camelCase
… book validation to use validator package, and remove email comments
…ield naming to camelCase
…n fields, add error logging to all book handler methods, fix RemoveCopies error response, and update ISBN uniqueness constraint name
…tion to Docker builds - Change PORT environment variable from `Port` to `PORT` in .env.example for consistency - Add VERSION build argument to Dockerfile with default value "dev" - Update Docker build command to inject version using ldflags with stripping flags (-s -w) - Pass VERSION environment variable to docker compose build in Makefile - Add VERSION build arg to docker-compose.yml with fallback to "dev" - Update Makefile help
…on environments - Add comments to .env.example explaining connection string differences for local/Docker/production - Change Redis port from 6379 to 6380 in .env.example for local development (maps to container port 6379) - Add Configuration section to README documenting environment-specific connection strings - Add REDIS_URL and ELASTICSEARCH_URL environment overrides to docker-compose.yml with fallback defaults - Add redis and elasticsearch health
- Remove verbose configuration comments from .env.example for DATABASE_URL, REDIS_URL, and ELASTICSEARCH_URL
- Add HOST_PORT environment variable to .env.example for Docker host port mapping
- Add section comments for Application Port configuration
- Set PORT=8080 explicitly in docker-compose.yml app service environment
- Change docker-compose.yml port mapping from ${PORT} to ${HOST_PORT} for host side
- Add spacing between configuration sections in
- Add NationalCode field to CustomerSignupInput struct in auth_dom.go - Add NationalCode field to Customer creation in SignupCustomer service method - Add required validation for nationalCode in Signup handler - Add API documentation for required nationalCode field in signup endpoint - Standardize JSON field naming to camelCase in CreateEmployeeInput (firstName, lastName)
- Change ISBN field from string to *string (pointer) in Book and CreateBookInput structs - Add omitempty JSON tag to ISBN field for optional serialization - Add unique index on book title in migration (idx_books_title) - Create generic PostgreSQL error mapper (pg_mapper.go) for constraint violations - Add ConstraintMap type for mapping database constraints to application errors - Implement MapPgError function to handle unique violations (23505),
…ror handling in Delete - Add MapPgError call in RemoveCopies to handle database constraint violations - Fix ignored error from RowsAffected() in Delete method - Add error check after RowsAffected() call with appropriate error wrapping - Add blank line for readability in RemoveCopies error handling
…code - Add unique index on national_code in customers table migration (idx_customers_national_code) - Add ErrCustomerNationalCodeExists error code constant - Add i18n mapping for national code exists error to MsgValidationFailed - Add customerConstraints map with handlers for email, mobile, and national code duplicates - Add MapPgError calls in Create, Update, and UpdateProfile methods to handle constraint violations - Fix context
- Fix WithContext field names in customer repository from "title" to "mobile" and "national_code" - Add employeeConstraints map with handlers for email, mobile, and national code duplicates - Add unique indexes for employee mobile and national_code in migration with WHERE clauses - Rename ErrEmployeeNationalExists to ErrEmployeeNationalCodeExists for consistency - Update error code references in employee service and tests -
- Replace `customError` import alias with direct `errors` package import in recommendation_repo.go, report_repo.go, report_srv.go, and token_repo.go - Rename standard library `errors` import to `stderrors` in token_repo.go to avoid naming conflict - Update all error constructor calls to use `errors.` prefix instead of `customError.` - Add tokenConstraints map with handler for refresh_tokens_token_hash_key unique constraint - Add Map
…o employee repository - Fix INSERT query parameter count from $10 to $9 in Create method (removed extra placeholder) - Add MapPgError calls in Create and Update methods to handle database constraint violations - Add syntax error (42601) handling to PostgreSQL error mapper with detail context - Fix indentation in pg_mapper.go to use tabs consistently
… pointer type - Remove NationalCode field from CustomerSignupInput struct in auth_dom.go - Change NationalCode field from string to *string (pointer) in CreateCustomerInput struct - Remove nationalCode required validation from Signup handler - Remove nationalCode from API documentation in Signup endpoint - Update nationalCode validation in Create handler to handle pointer type with nil check - Update SignupCustomer service to not set NationalCode during signup - Fix national
…nter types - Change Email, EmailShowcase, NationalCode, and Mobile fields from string to *string in Customer struct - Change Email, EmailShowcase, Mobile, and Address fields from string to *string in CreateCustomerInput - Change NationalCode field from string to *string in UpdateCustomerProfileInput and SafeCustomer - Update all customer and employee repository constraint error contexts to use camelCase field names - Remove NOT
…point path - Add domain.RoleSuperAdmin to RequireRole middleware in backoffice router - Fix duplicate :id parameter in borrows endpoint from "/:id/customers/:id" to "/customers/:id" - Change book pages validation from Required(strconv.Itoa()) to Min() with value 1 - Fix whitespace alignment in Customer and related structs (Email, EmailShowcase, NationalCode, Mobile fields) - Add blank line before TODO comment in customer_dom.go - Remove
- Change firstName and lastName fields from snake_case to camelCase in Swagger documentation - Add required fields list to signup endpoint API documentation - Fix whitespace and indentation in CustomerSignupInput struct - Add period to TODO comments for consistency - Remove unused isUniqueViolation helper function from book service - Remove unused imports (errors, pgconn) from book service - Fix indentation in AddCopies error handling
…handling - Remove book availability and duplicate borrow checks from service layer - Add constraint map to borrow repository for unified error handling - Implement PostgreSQL error mapping for constraint violations (active borrow, customer/book not found) - Move duplicate borrow detection to database unique constraint validation - Replace NotFound error with Conflict error for inactive customer status - Add ErrCustomerInactive error code and i18n translations (EN/FA) - Simplify service layer by delegating validation to repository Create method - Clean up TODO comment and improve code formatting
…uld be compatible with go 1.26
…uld be compatible with go 1.26
Chore/clean up
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.
No description provided.