Thank you for your interest in contributing to POS API! This document provides guidelines and steps for contributing.
- Be respectful and inclusive
- Provide constructive feedback
- Focus on the best outcome for the project
- Fork the repository
- Clone your fork:
git clone <your-fork-url> - Create a branch:
git checkout -b feature/your-feature-name - Make your changes
- Submit a pull request
# Install dependencies
go mod tidy
# Run tests
make test
# Run linter (requires golangci-lint)
make lint
# Format code
make fmt- Follow Effective Go
- Use
gofmtfor formatting - Use meaningful variable and function names
- Write comments for exported functions
handler/- HTTP handlers (thin layer, validation only)service/- Business logicrepository/- Database accessdto/- Request/Response structuresmodels/- Domain models
// Good
if err != nil {
return fmt.Errorf("failed to create user: %w", err)
}
// Bad
if err != nil {
return err
}feature/- New featuresfix/- Bug fixesdocs/- Documentationrefactor/- Code refactoring
Follow Conventional Commits:
feat: add customer loyalty points
fix: resolve stock calculation bug
docs: update API documentation
refactor: simplify transaction service
- Write tests for new features
- Ensure all tests pass before submitting PR
- Aim for meaningful test coverage
# Run tests
make test
# Run tests with coverage
make test-coverage- Update documentation if needed
- Add/update tests
- Ensure CI passes
- Request review from maintainers
- Address feedback promptly
Open an issue for any questions or concerns.
Thank you for contributing! 🎉