# Changelog of Nordic Company Registry (`blackbuck/nordic-company-registry`) Actor

- **URL**: https://apify.com/blackbuck/nordic-company-registry/changelog.md
- **Full Actor documentation**: https://apify.com/blackbuck/nordic-company-registry.md

## Changelog

All notable changes to the Nordic Company Registry project will be documented in this file.

### \[Unreleased]

### \[3.5] - 2026-04-01

#### Fixed

- Fixed OOM during refreshData by removing orgLookup Map (~150MB saved); matched SCB records are skipped since BV already provides address data

### \[3.4] - 2026-04-01

#### Fixed

- Fixed Sweden search returning empty addresses, legalForm, registrationDate, and industryCode by storing enriched company data in the KV index
- Index entries now include Bolagsverket address/registration fields and SCB address/industry fields
- SCB data is merged into matched Bolagsverket entries during index build (phase 2)
- Backward compatible: old-format index entries still work but require `refreshData` re-run for full data

### \[3.0.3] - 2026-03-30

#### Fixed

- Fixed KV Store persist taking 13+ minutes by limiting concurrent writes to 25 (was unbounded ~2,000 parallel API calls)
- Added progress logging during shard persistence

### \[3.0.2] - 2026-03-29

#### Fixed

- Fixed `ERR_STRING_TOO_LONG` crash during Sweden `refreshData` bulk indexing; ZIP entries now stream in 64 KB chunks
- Fixed OOM crash during `refreshData` by building the sharded index directly from BV/SCB streams instead of materialising the full merger map
- Fixed KV Store key validation error for Swedish diacritics (å, ä, ö) by hex-encoding shard keys

### \[3.0.0] - 2026-03-29

#### Added

- Sweden (SE) country support via Bolagsverket bulk data files (free, no API key required)
- New `searchMode: "refreshData"` input mode for bulk data download and indexing
- `SwedishOrgNumber` branded type with 10-digit format + Luhn check digit validation
- Streaming parsers for Bolagsverket (`;`-delimited, UTF-8) and SCB (`\t`-delimited, ISO-8859-1) bulk files
- Data merger joining Bolagsverket + SCB records by organisation number
- Sharded search index persisted to Apify Named Key-Value Store for fast name lookups
- Sweden live tests verifying bulk file download and parsing
- 188 new tests (387 total, up from 199)

#### Changed

- Strengthened branded type validators: `cvrNumber` validates 8-digit format, `businessId` validates `\d{7}-\d` pattern
- `NordicCompanySchema` name field now requires min(1) length
- `nordicCompanyId()` now guards against empty country/regNum inputs
- Updated all schemas to include SE country code

#### Fixed

- Fixed Apify deploy: `actor.json` version format changed from semver to MAJOR.MINOR
- Fixed `output_schema.json` description that incorrectly referenced removed Sweden
- Fixed stale `./node_modules/.bin/vp` references in live test file comments
- Added `adm-zip` as explicit dependency (was transitive)
- Swedish dissolved companies now correctly populate `dissolutionDate`

### \[2.0.1] - 2024-07-15

#### Added

- Added 5 comprehensive edge case tests to achieve complete test coverage
- Tests for empty results from all countries simultaneously
- Tests for all countries failing simultaneously
- Tests for maxResults=1 boundary condition
- Tests for special characters in query handling
- Tests for very long company names trimming

#### Changed

- Expanded test suite from 194 to 199 tests
- Updated test coverage to 100% for all identified edge cases
- Improved error handling verification in edge scenarios

#### Fixed

- No bugs fixed - this is a test coverage enhancement release

### \[2.0] - 2024-07-10

#### Added

- Initial public release on Apify Store
- Support for Norway, Denmark, and Finland company registries
- Comprehensive input validation with Zod
- Robust error handling with tagged unions
- Rate limiting and exponential backoff
- Complete test suite with 194 tests

#### Changed

- Removed Sweden support (data source unavailable)
- Improved documentation and examples
- Enhanced error messages and logging

#### Fixed

- Various bug fixes from initial development
