Skip to content

Conversation

ryanaidilp
Copy link
Contributor

Release v2.3.0

This release introduces national cases pagination support and resolves various linter issues.

Summary of Changes

  • Pagination Support: Added comprehensive pagination for national cases endpoint
  • Linter Fixes: Standardized error handling patterns across repositories
  • Model Updates: Fixed nullable pointer field handling in tests
  • Documentation: Updated Swagger documentation with new pagination parameters
  • Testing: Enhanced integration tests and mock implementations

New Features

  • National cases endpoint now supports pagination with limit, offset, page parameters
  • Added all=true parameter for backward compatibility
  • Paginated responses include metadata (total count, page info, navigation flags)

Bug Fixes

  • Standardized error handling in province case repository
  • Fixed compilation errors in model tests for nullable fields
  • Added missing newlines to various files for linter compliance

API Changes

  • /national endpoint now returns paginated responses by default
  • Use ?all=true to get all data without pagination (backward compatible)
  • New pagination metadata in responses

Documentation

  • Regenerated Swagger documentation with pagination parameters
  • Updated CLAUDE.md with go expert usage guidelines

ryanaidilp and others added 5 commits September 8, 2025 22:45
…improvements

fix: resolve linter issues and add national pagination support
- Add pagination parameters (limit, offset, page, all) to national endpoint
- Update API documentation to reflect new paginated responses
- Include PaginatedResponse model in swagger specs
- Add instruction to always use go expert for this project
  - Update version to 2.3.0 in source files
  - Generate release changelog using generate-changelog.rb
  - Regenerate API documentation with new version

  This commit prepares the release/v2.3.0 branch for release.
Copy link
Contributor

github-actions bot commented Sep 8, 2025

📊 Code Coverage Report

Total Coverage: 49.6%

Coverage by Package

Package Coverage
cmd 0.0%
docs 0.0%
internal/config 0.0%
internal/handler 76.3%
internal/middleware 57.5%
internal/models 99.1%
internal/repository 54.6%
internal/service 30.4%
pkg/database 0.0%
pkg/utils 57.1%

Detailed Coverage

Click to expand detailed coverage
github.com/banua-coder/pico-api-go/cmd/main.go:47:					main						0.0%
github.com/banua-coder/pico-api-go/docs/docs.go:866:					init						0.0%
github.com/banua-coder/pico-api-go/internal/config/config.go:42:			Load						0.0%
github.com/banua-coder/pico-api-go/internal/config/config.go:72:			getEnv						0.0%
github.com/banua-coder/pico-api-go/internal/config/config.go:79:			getEnvAsInt					0.0%
github.com/banua-coder/pico-api-go/internal/config/config.go:88:			getEnvAsDuration				0.0%
github.com/banua-coder/pico-api-go/internal/config/config.go:97:			getEnvAsBool					0.0%
github.com/banua-coder/pico-api-go/internal/handler/covid_handler.go:19:		NewCovidHandler					100.0%
github.com/banua-coder/pico-api-go/internal/handler/covid_handler.go:45:		GetNationalCases				88.2%
github.com/banua-coder/pico-api-go/internal/handler/covid_handler.go:86:		GetLatestNationalCase				77.8%
github.com/banua-coder/pico-api-go/internal/handler/covid_handler.go:115:		GetProvinces					69.2%
github.com/banua-coder/pico-api-go/internal/handler/covid_handler.go:158:		GetProvinceCases				64.6%
github.com/banua-coder/pico-api-go/internal/handler/covid_handler.go:297:		HealthCheck					64.7%
github.com/banua-coder/pico-api-go/internal/handler/covid_handler.go:354:		GetAPIIndex					100.0%
github.com/banua-coder/pico-api-go/internal/handler/response.go:16:			writeJSONResponse				75.0%
github.com/banua-coder/pico-api-go/internal/handler/response.go:24:			writeSuccessResponse				100.0%
github.com/banua-coder/pico-api-go/internal/handler/response.go:31:			writeErrorResponse				100.0%
github.com/banua-coder/pico-api-go/internal/handler/routes.go:12:			SetupRoutes					0.0%
github.com/banua-coder/pico-api-go/internal/middleware/cors.go:7:			CORS						0.0%
github.com/banua-coder/pico-api-go/internal/middleware/logging.go:15:			WriteHeader					0.0%
github.com/banua-coder/pico-api-go/internal/middleware/logging.go:20:			Write						0.0%
github.com/banua-coder/pico-api-go/internal/middleware/logging.go:26:			Logging						0.0%
github.com/banua-coder/pico-api-go/internal/middleware/ratelimit.go:22:			writeRateLimitError				80.0%
github.com/banua-coder/pico-api-go/internal/middleware/ratelimit.go:51:			NewRateLimiter					100.0%
github.com/banua-coder/pico-api-go/internal/middleware/ratelimit.go:68:			Stop						100.0%
github.com/banua-coder/pico-api-go/internal/middleware/ratelimit.go:76:			cleanup						75.0%
github.com/banua-coder/pico-api-go/internal/middleware/ratelimit.go:88:			cleanOldClients					100.0%
github.com/banua-coder/pico-api-go/internal/middleware/ratelimit.go:107:		getClientIP					100.0%
github.com/banua-coder/pico-api-go/internal/middleware/ratelimit.go:134:		isAllowed					92.3%
github.com/banua-coder/pico-api-go/internal/middleware/ratelimit.go:183:		RateLimit					100.0%
github.com/banua-coder/pico-api-go/internal/middleware/recovery.go:10:			Recovery					0.0%
github.com/banua-coder/pico-api-go/internal/models/national_case.go:29:			Scan						92.3%
github.com/banua-coder/pico-api-go/internal/models/national_case.go:53:			Value						100.0%
github.com/banua-coder/pico-api-go/internal/models/national_case_response.go:51:	TransformToResponse				100.0%
github.com/banua-coder/pico-api-go/internal/models/national_case_response.go:88:	TransformSliceToResponse			100.0%
github.com/banua-coder/pico-api-go/internal/models/national_case_response.go:97:	calculatePercentages				100.0%
github.com/banua-coder/pico-api-go/internal/models/pagination.go:21:			CalculatePaginationMeta				100.0%
github.com/banua-coder/pico-api-go/internal/models/province_case_response.go:68:	TransformToResponse				100.0%
github.com/banua-coder/pico-api-go/internal/models/province_case_response.go:128:	TransformToResponse				100.0%
github.com/banua-coder/pico-api-go/internal/models/province_case_response.go:133:	TransformProvinceCaseSliceToResponse		100.0%
github.com/banua-coder/pico-api-go/internal/repository/national_case_repository.go:26:	NewNationalCaseRepository			100.0%
github.com/banua-coder/pico-api-go/internal/repository/national_case_repository.go:30:	GetAll						100.0%
github.com/banua-coder/pico-api-go/internal/repository/national_case_repository.go:35:	GetAllSorted					76.5%
github.com/banua-coder/pico-api-go/internal/repository/national_case_repository.go:70:	GetByDateRange					100.0%
github.com/banua-coder/pico-api-go/internal/repository/national_case_repository.go:75:	GetByDateRangeSorted				76.5%
github.com/banua-coder/pico-api-go/internal/repository/national_case_repository.go:112:	GetLatest					87.5%
github.com/banua-coder/pico-api-go/internal/repository/national_case_repository.go:133:	GetByDay					87.5%
github.com/banua-coder/pico-api-go/internal/repository/province_case_repository.go:37:	NewProvinceCaseRepository			100.0%
github.com/banua-coder/pico-api-go/internal/repository/province_case_repository.go:41:	GetAll						100.0%
github.com/banua-coder/pico-api-go/internal/repository/province_case_repository.go:46:	GetAllSorted					100.0%
github.com/banua-coder/pico-api-go/internal/repository/province_case_repository.go:62:	GetAllPaginated					0.0%
github.com/banua-coder/pico-api-go/internal/repository/province_case_repository.go:67:	GetAllPaginatedSorted				0.0%
github.com/banua-coder/pico-api-go/internal/repository/province_case_repository.go:100:	GetByProvinceID					100.0%
github.com/banua-coder/pico-api-go/internal/repository/province_case_repository.go:117:	GetByProvinceIDPaginated			0.0%
github.com/banua-coder/pico-api-go/internal/repository/province_case_repository.go:152:	GetByProvinceIDAndDateRange			100.0%
github.com/banua-coder/pico-api-go/internal/repository/province_case_repository.go:169:	GetByProvinceIDAndDateRangePaginated		0.0%
github.com/banua-coder/pico-api-go/internal/repository/province_case_repository.go:204:	GetByDateRange					0.0%
github.com/banua-coder/pico-api-go/internal/repository/province_case_repository.go:221:	GetByDateRangePaginated				0.0%
github.com/banua-coder/pico-api-go/internal/repository/province_case_repository.go:256:	GetLatestByProvinceID				85.7%
github.com/banua-coder/pico-api-go/internal/repository/province_case_repository.go:282:	queryProvinceCases				78.9%
github.com/banua-coder/pico-api-go/internal/repository/province_case_repository.go:327:	buildOrderClause				70.0%
github.com/banua-coder/pico-api-go/internal/repository/province_case_repository.go:361:	GetByProvinceIDSorted				0.0%
github.com/banua-coder/pico-api-go/internal/repository/province_case_repository.go:365:	GetByProvinceIDPaginatedSorted			0.0%
github.com/banua-coder/pico-api-go/internal/repository/province_case_repository.go:369:	GetByProvinceIDAndDateRangeSorted		0.0%
github.com/banua-coder/pico-api-go/internal/repository/province_case_repository.go:373:	GetByProvinceIDAndDateRangePaginatedSorted	0.0%
github.com/banua-coder/pico-api-go/internal/repository/province_case_repository.go:377:	GetByDateRangeSorted				0.0%
github.com/banua-coder/pico-api-go/internal/repository/province_case_repository.go:381:	GetByDateRangePaginatedSorted			0.0%
github.com/banua-coder/pico-api-go/internal/repository/province_repository.go:20:	NewProvinceRepository				100.0%
github.com/banua-coder/pico-api-go/internal/repository/province_repository.go:24:	GetAll						76.5%
github.com/banua-coder/pico-api-go/internal/repository/province_repository.go:54:	GetByID						100.0%
github.com/banua-coder/pico-api-go/internal/service/covid_service.go:44:		NewCovidService					100.0%
github.com/banua-coder/pico-api-go/internal/service/covid_service.go:56:		GetNationalCases				100.0%
github.com/banua-coder/pico-api-go/internal/service/covid_service.go:64:		GetNationalCasesSorted				0.0%
github.com/banua-coder/pico-api-go/internal/service/covid_service.go:72:		GetNationalCasesByDateRange			90.0%
github.com/banua-coder/pico-api-go/internal/service/covid_service.go:90:		GetNationalCasesByDateRangeSorted		0.0%
github.com/banua-coder/pico-api-go/internal/service/covid_service.go:108:		GetLatestNationalCase				75.0%
github.com/banua-coder/pico-api-go/internal/service/covid_service.go:116:		GetProvinces					75.0%
github.com/banua-coder/pico-api-go/internal/service/covid_service.go:124:		GetProvincesWithLatestCase			0.0%
github.com/banua-coder/pico-api-go/internal/service/covid_service.go:154:		GetProvinceCases				75.0%
github.com/banua-coder/pico-api-go/internal/service/covid_service.go:162:		GetProvinceCasesByDateRange			70.0%
github.com/banua-coder/pico-api-go/internal/service/covid_service.go:180:		GetAllProvinceCases				75.0%
github.com/banua-coder/pico-api-go/internal/service/covid_service.go:188:		GetAllProvinceCasesSorted			0.0%
github.com/banua-coder/pico-api-go/internal/service/covid_service.go:196:		GetAllProvinceCasesByDateRange			70.0%
github.com/banua-coder/pico-api-go/internal/service/covid_service.go:214:		GetProvinceCasesPaginated			0.0%
github.com/banua-coder/pico-api-go/internal/service/covid_service.go:222:		GetProvinceCasesByDateRangePaginated		0.0%
github.com/banua-coder/pico-api-go/internal/service/covid_service.go:240:		GetAllProvinceCasesPaginated			0.0%
github.com/banua-coder/pico-api-go/internal/service/covid_service.go:248:		GetAllProvinceCasesByDateRangePaginated		0.0%
github.com/banua-coder/pico-api-go/internal/service/covid_service.go:266:		GetAllProvinceCasesPaginatedSorted		0.0%
github.com/banua-coder/pico-api-go/internal/service/covid_service.go:274:		GetAllProvinceCasesByDateRangeSorted		0.0%
github.com/banua-coder/pico-api-go/internal/service/covid_service.go:292:		GetAllProvinceCasesByDateRangePaginatedSorted	0.0%
github.com/banua-coder/pico-api-go/internal/service/covid_service.go:310:		GetProvinceCasesSorted				0.0%
github.com/banua-coder/pico-api-go/internal/service/covid_service.go:318:		GetProvinceCasesPaginatedSorted			0.0%
github.com/banua-coder/pico-api-go/internal/service/covid_service.go:326:		GetProvinceCasesByDateRangeSorted		0.0%
github.com/banua-coder/pico-api-go/internal/service/covid_service.go:344:		GetProvinceCasesByDateRangePaginatedSorted	0.0%
github.com/banua-coder/pico-api-go/pkg/database/mysql.go:28:				NewMySQLConnection				0.0%
github.com/banua-coder/pico-api-go/pkg/database/mysql.go:41:				NewMySQLConnectionWithConfig			0.0%
github.com/banua-coder/pico-api-go/pkg/database/mysql.go:101:				DefaultConnectionConfig				0.0%
github.com/banua-coder/pico-api-go/pkg/database/mysql.go:113:				HealthCheck					0.0%
github.com/banua-coder/pico-api-go/pkg/database/mysql.go:131:				GetConnectionStats				0.0%
github.com/banua-coder/pico-api-go/pkg/utils/query.go:10:				ParseIntQueryParam				100.0%
github.com/banua-coder/pico-api-go/pkg/utils/query.go:25:				ParseBoolQueryParam				100.0%
github.com/banua-coder/pico-api-go/pkg/utils/query.go:30:				ParseStringArrayQueryParam			100.0%
github.com/banua-coder/pico-api-go/pkg/utils/query.go:57:				ParseSortParam					0.0%
github.com/banua-coder/pico-api-go/pkg/utils/query.go:91:				IsValidSortField				0.0%
github.com/banua-coder/pico-api-go/pkg/utils/query.go:109:				GetSQLOrderClause				0.0%
github.com/banua-coder/pico-api-go/pkg/utils/query.go:138:				ValidatePaginationParams			100.0%
total:											(statements)					49.6%

@ryanaidilp ryanaidilp self-assigned this Sep 8, 2025
@ryanaidilp ryanaidilp merged commit 4ac42b8 into main Sep 8, 2025
4 checks passed
github-actions bot added a commit that referenced this pull request Sep 8, 2025
Automated back-merge of release v2.3.0 from main branch.

Original PR: #30
Merged commit: 4ac42b8
Tag created: v2.3.0
Branch: chore/back-merge-v2.3.0-to-develop
@github-actions github-actions bot deleted the release/v2.3.0 branch September 8, 2025 14:57
Copy link
Contributor

github-actions bot commented Sep 8, 2025

🚀 Release Process Completed Successfully

The complete Git Flow release process has finished:

✅ Completed Actions

🔄 Deployment Pipeline

The deployment workflow is now running and will:

  1. Build the application
  2. Deploy to production
  3. Run health checks
  4. Create GitHub release

🎉 Git Flow Complete

Your release is now deployed! Monitor the deployment progress and merge the back-merge PR when ready.

Copy link
Contributor

github-actions bot commented Sep 8, 2025

🔄 Back-merge PR Created

A back-merge PR has been automatically created to sync the develop branch:

Please review and merge the back-merge PR to complete the release process.

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