Skip to content

Add collector for Norwich County Council#316

Open
moley-bot[bot] wants to merge 2 commits intomainfrom
collector/NorwichCountyCouncil-issue-314-1775989587
Open

Add collector for Norwich County Council#316
moley-bot[bot] wants to merge 2 commits intomainfrom
collector/NorwichCountyCouncil-issue-314-1775989587

Conversation

@moley-bot
Copy link
Copy Markdown
Contributor

@moley-bot moley-bot bot commented Apr 12, 2026

Summary

This PR adds a new bin collection data collector for Norwich County Council.

  • Implements ICollector interface
  • Adds integration tests
  • Successfully tested with example postcode from issue

Closes #314

Test Summary

 ==================== Test Summary ====================
 
 --------------------- Collector ----------------------
 
 Norwich County Council
 
 ------------------- Addresses (34) -------------------
 
 - 59, PELHAM ROAD, NORWICH, NORFOLK, NR3 3NE, 2026/04/12/KCGPOJU1LQB8H;21
 - 61, PELHAM ROAD, NORWICH, NORFOLK, NR3 3NE, 2026/04/12/KCGPOJU1LQB8H;22
 - 63, PELHAM ROAD, NORWICH, NORFOLK, NR3 3NE, 2026/04/12/KCGPOJU1LQB8H;7
 - 65, PELHAM ROAD, NORWICH, NORFOLK, NR3 3NE, 2026/04/12/KCGPOJU1LQB8H;8
 - 67, PELHAM ROAD, NORWICH, NORFOLK, NR3 3NE, 2026/04/12/KCGPOJU1LQB8H;16
 - ...
 
 --------------------- Bin Types ----------------------
 
 - Food Waste (Green Caddy)
 - General Waste (Black)
 - Recycling (Blue)
 
 -------------------- Bin Days (5) --------------------
 
 - 14/04/2026 (2 bins):
   - General Waste (Black)
   - Food Waste (Green Caddy)
 
 - 21/04/2026 (2 bins):
   - Food Waste (Green Caddy)
   - Recycling (Blue)
 
 - 28/04/2026 (2 bins):
   - General Waste (Black)
   - Food Waste (Green Caddy)
 
 - 06/05/2026 (2 bins):
   - Food Waste (Green Caddy)
   - Recycling (Blue)
 
 - 12/05/2026 (2 bins):
   - General Waste (Black)
   - Food Waste (Green Caddy)
 
 ======================================================

Bin Collections Page Screenshot

NorwichCountyCouncil Bin Collections


Generated automatically by Moley-Bot using Codex CLI

Closes #314

Generated with Codex CLI by Moley-Bot
@moley-bot moley-bot bot added the new collector Request for a new collector to be supported label Apr 12, 2026
@moley-bot moley-bot bot mentioned this pull request Apr 12, 2026
  Formatted by Moley-Bot
@BadgerHobbs
Copy link
Copy Markdown
Owner

/gemini review

@BadgerHobbs
Copy link
Copy Markdown
Owner

@claude review

@moley-bot
Copy link
Copy Markdown
Contributor Author

moley-bot bot commented Apr 12, 2026

Claude finished @BadgerHobbs's task in 1m 55s —— View job


Code Review

  • Gather context and read changed files
  • Review collector implementation
  • Review integration tests
  • Check against repo conventions and style guide
  • Post final review feedback

Overall the implementation is well-structured and follows the project conventions closely. Two issues found — one significant, one minor.


1. Incorrect Council Name (Bug)

NorwichCountyCouncil.cs:16

public string Name => "Norwich County Council";

Norwich is a City Council, not a County Council. The county-level authority for the area is Norfolk County Council, which is an entirely different entity. The GovUkId of "norwich" correctly points to Norwich City Council, but the Name property (and the class name itself) is wrong.

The Name, class name, filename, and test class should all be corrected to NorwichCityCouncil.

Fix this →


2. Postcode Not URL-Encoded in Form Body (Bug)

NorwichCountyCouncil.cs:104

var requestBody = $"address_postcode={postcode}";

UK postcodes contain a space (e.g. NR3 3NE), which is invalid in raw application/x-www-form-urlencoded bodies. The space must be encoded as %20 or +. The project already provides ProcessingUtilities.ConvertDictionaryToFormData which handles this via HttpUtility.UrlEncode.

Should be:

var requestBody = ProcessingUtilities.ConvertDictionaryToFormData(new()
{
    { "address_postcode", postcode },
});

Fix this →


Minor: _binTypes Initializer Style

NorwichCountyCouncil.cs:27-28

private readonly IReadOnlyCollection<Bin> _binTypes =
[

Other collectors in the project consistently place [ on the same line as =:

private readonly IReadOnlyCollection<Bin> _binTypes = [

Not a blocker, but worth aligning for consistency.


Integration Tests

The test file looks good — correct structure, uses the established TestSteps.EndToEnd pattern, and the postcode NR3 3NE matches the issue example. One note: the test class is public while the collector is internal sealed — this is consistent with the rest of the test suite.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds a new collector for Norwich County Council, which implements the ICollector interface and inherits from GovUkCollectorBase. The collector handles address lookups and bin day retrieval using a multi-step request flow and regular expressions for parsing. A corresponding integration test has also been included to ensure the collector functions correctly. I have no feedback to provide.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new collector Request for a new collector to be supported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Norwich County Council

1 participant