Skip to content

Feature/ci docs polish#14

Merged
mohammad-farrokhnia merged 13 commits into
developfrom
feature/ci-docs-polish
Jun 1, 2026
Merged

Feature/ci docs polish#14
mohammad-farrokhnia merged 13 commits into
developfrom
feature/ci-docs-polish

Conversation

@mohammad-farrokhnia

Copy link
Copy Markdown
Owner

No description provided.

…out middleware

- Add golangci linter configuration with 19 enabled linters for code quality checks
- Implement timeout middleware to enforce request deadline limits
- Implement security headers middleware (X-Content-Type-Options, X-Frame-Options, X-XSS-Protection, etc.)
- Implement CORS middleware with configurable allowed origins and methods
- Implement rate limiting middleware using Redis with per-IP request tracking
- Add rate limit configuration to Config struct (RequestTimeout, AllowedOrigins, RateLimitRequests, RateLimitWindow)
- Update router setup to apply all middleware in correct order
- Add gin-contrib/cors dependency to go.mod
- Add i18n message code for rate limit exceeded error
- Update English and Farsi i18n translations with new error messages
… optimizations

- Refactor health check endpoint to include dependency status checks for Postgres, Redis, and Elasticsearch
- Add HealthHandler struct with dependency injection for db, redis, elasticsearch clients
- Update health check response to include version, app name, and individual service status
- Add HTTP status codes based on health state (200/206/503)
- Add REQUEST_TIMEOUT, ALLOWED_ORIGINS, RATE_LIMIT_REQUESTS, and RATE_LIMIT_WINDOW
- Add architecture.md documenting layered architecture, request lifecycle, and error propagation
- Add CI workflow badge to README
- Add Redis badge to README technology stack
- Document middleware chain execution order and two API surface patterns
…outer files

- Convert spaces to tabs in backoffice_router.go, portal_router.go, and router.go
- Fix indentation in configs package files (config.go, db.go, redis.go)
- Standardize indentation in domain test files (book_dom_test.go, customer_dom_test.go, query_test.go)
- Remove trailing whitespace and extra blank lines
- Fix struct field alignment in domain files (customer_dom.go, employee_dom.go, query.go)
- Align import statements formatting
- Update godot linter configuration to exclude lines starting with '@'
- Change comment style from `// Section` to `// Section.` in error codes
- Change comment style from `// Section` to `// Section.` in i18n message codes
- Change comment style from `// Section` to `// Section.` in i18n error mapping
- Remove redundant "Mock repository" and "Mock password hasher" comments from test files
…rsing

- Rename `SearchParams` to `Params` and `SearchResult` to `Result` in search package
- Add error handling for `fmt.Sscanf` in `getEnvInt` with fallback on parse failure
- Replace unused context parameters with underscore in test mock functions
- Update all references to renamed search types in handlers and tests
…iles

- Replace `ctx context.Context` with `_ context.Context` in mock repository methods
- Replace `id string`, `email string`, `mobile string`, `input domain.*Input` with underscored parameters in unused mock functions
- Add context import to middleware_test.go for http.NewRequestWithContext
- Update all http.NewRequest calls to http.NewRequestWithContext in middleware tests
- Remove explanatory comments from test files (section
… usage

- Add TestMockCustomerRepoForAuth_Used to validate mock repository integration
- Test login flow using mockCustomerRepoForAuth with onGetByEmail callback
- Verify HTTP 200 response for successful authentication request
- Replace full integration test with mock method verification in customer_auth_handler_test.go
- Skip health check test when infrastructure dependencies are unavailable
- Add ISBN field to book creation in borrow flow test to satisfy unique constraint
- Add retry logic with backoff for database ping to handle postgres initialization delay
- Fix migration URL construction using strings.Replace instead of manual substring
- Remove book_requests from cleanup tables truncate statement
…lp documentation

- Add VERSION variable to Makefile using git describe with fallback to "dev"
- Add LDFLAGS variable for consistent version injection across build targets
- Update run-api and build-api targets to use LDFLAGS for version embedding
- Add Version variable to main.go with "dev" default value
- Update startup log to include version information
- Add tidy target to .PHONY declaration
- Refactor help target to show categorized command documentation instead of parsing comments
@mohammad-farrokhnia mohammad-farrokhnia self-assigned this Jun 1, 2026
@mohammad-farrokhnia mohammad-farrokhnia merged commit 6a6c91f into develop Jun 1, 2026
1 of 3 checks passed
@mohammad-farrokhnia mohammad-farrokhnia deleted the feature/ci-docs-polish branch June 1, 2026 10:14
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