Skip to content

Add p_type_rvo field to SRM catalogue#341

Merged
SvenVw merged 2 commits into
mainfrom
hotfix/FDM340
Nov 20, 2025
Merged

Add p_type_rvo field to SRM catalogue#341
SvenVw merged 2 commits into
mainfrom
hotfix/FDM340

Conversation

@SvenVw
Copy link
Copy Markdown
Collaborator

@SvenVw SvenVw commented Nov 20, 2025

Summary by CodeRabbit

  • New Features

    • Enriched SRM catalogue items with additional data attributes for improved fertilizer metadata.
  • Chores

    • Version updates: fdm-data 0.18.1, fdm-core 0.26.1, fdm-app 0.24.2 with updated interdependencies.

✏️ Tip: You can customize this high-level summary in your review settings.

Closes #340

@SvenVw SvenVw self-assigned this Nov 20, 2025
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Nov 20, 2025

⚠️ No Changeset found

Latest commit: bb4ba07

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@codecov
Copy link
Copy Markdown

codecov Bot commented Nov 20, 2025

Codecov Report

❌ Patch coverage is 75.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 93.28%. Comparing base (f21c180) to head (ed53b86).

Files with missing lines Patch % Lines
fdm-data/src/fertilizers/catalogues/srm.ts 75.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #341      +/-   ##
==========================================
- Coverage   93.29%   93.28%   -0.01%     
==========================================
  Files          96       96              
  Lines       15356    15360       +4     
  Branches     1561     1562       +1     
==========================================
+ Hits        14326    14329       +3     
- Misses       1028     1029       +1     
  Partials        2        2              
Flag Coverage Δ
fdm-calculator 95.44% <ø> (ø)
fdm-core 91.65% <ø> (ø)
fdm-data 93.55% <75.00%> (-0.24%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions
Copy link
Copy Markdown
Contributor

👋 Hotfix Branch PR Detected!

Before merging this Pull Request into main, please ensure you have finalized the hotfix by manually running the 'Release' workflow on this hotfix/FDM340 branch.

This will:

  1. Bump package versions.
  2. Generate changelogs.
  3. Create Git tags.

You can trigger the workflow from the 'Actions' tab, selecting the 'Release' workflow, and choosing this hotfix/FDM340 branch.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Nov 20, 2025

Walkthrough

This PR adds the missing p_type_rvo field to SRM catalogue entries in the JSON dataset and implements TypeScript handling for this new optional field. Version numbers are incremented across fdm-data, fdm-core, and fdm-app packages with corresponding changelog entries.

Changes

Cohort / File(s) Change Summary
SRM Catalogue Data & Handler
fdm-data/src/fertilizers/catalogues/srm.json, fdm-data/src/fertilizers/catalogues/srm.ts
Added p_type_rvo integer field to SRM catalogue entries; updated TypeScript handler to parse and assign p_type_rvo as a string when defined or null when undefined.
Package Version Bumps
fdm-data/package.json, fdm-core/package.json, fdm-app/package.json
Incremented versions: fdm-data 0.18.0 → 0.18.1, fdm-core 0.26.0 → 0.26.1, fdm-app 0.24.1 → 0.24.2; updated fdm-core's devDependency on fdm-data.
Changelog Entries
fdm-data/CHANGELOG.md, fdm-core/CHANGELOG.md, fdm-app/CHANGELOG.md
Added patch version entries documenting the new p_type_rvo field addition and dependency updates.

Sequence Diagram(s)

sequenceDiagram
    participant App as fdm-app
    participant Core as fdm-core
    participant Data as fdm-data
    
    Note over App,Data: Before: p_type_rvo field missing
    
    App->>Core: Request catalogue
    Core->>Data: getCatalogueSrm()
    Data->>Data: Parse SRM JSON (p_type_rvo now present)
    Data-->>Core: Return CatalogueFertilizerItem with p_type_rvo
    Core-->>App: Catalogue data with all fields
    
    Note over App,Data: After: p_type_rvo field populated<br/>(no calculation errors for legacy farms)
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

  • Repetitive version bumping across multiple package.json files
  • Straightforward data field addition with minimal logic changes
  • No complex control flow or error-handling modifications
  • Changelog entries are standard documentation updates

Areas requiring attention:

  • Verify that p_type_rvo values in srm.json are correct and complete across all affected entries
  • Confirm TypeScript coercion to string is the intended behavior for the field

Possibly related PRs

Suggested reviewers

  • gerardhros

Poem

🐰 A catalogue once stood incomplete,
With p_type_rvo missing from the beat,
Now data flows through fields so new,
Old farms rejoice—their sums ring true!
Version bumps cascade down the stack,
No more errors holding farmers back! 🌾

Pre-merge checks and finishing touches

✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely summarizes the main change: adding the p_type_rvo field to the SRM catalogue, which directly addresses the primary objective.
Linked Issues check ✅ Passed The PR successfully addresses issue #340 by adding p_type_rvo to the SRM catalogue data and implementation, preventing errors for legacy farms using this catalogue.
Out of Scope Changes check ✅ Passed All changes are in-scope: data augmentation in srm.json, field handling in srm.ts, and version bumps across packages documenting the changes. No unrelated modifications present.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch hotfix/FDM340

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ed53b86 and bb4ba07.

📒 Files selected for processing (6)
  • fdm-app/CHANGELOG.md (1 hunks)
  • fdm-app/package.json (1 hunks)
  • fdm-core/CHANGELOG.md (1 hunks)
  • fdm-core/package.json (2 hunks)
  • fdm-data/CHANGELOG.md (1 hunks)
  • fdm-data/package.json (1 hunks)
✅ Files skipped from review due to trivial changes (4)
  • fdm-core/CHANGELOG.md
  • fdm-app/CHANGELOG.md
  • fdm-data/package.json
  • fdm-app/package.json
🧰 Additional context used
🧠 Learnings (7)
📓 Common learnings
Learnt from: SvenVw
Repo: SvenVw/fdm PR: 67
File: fdm-app/app/routes/farm.create.$b_id_farm.fields.$b_id.tsx:601-610
Timestamp: 2025-01-31T15:05:14.310Z
Learning: The `updateField` function in fdm-core has optional parameters after `fdm` and `b_id`. The TypeScript definitions might show 8 required parameters due to a potential version mismatch.
Learnt from: SvenVw
Repo: SvenVw/fdm PR: 279
File: fdm-app/app/routes/farm.$b_id_farm.$calendar.norms.tsx:277-283
Timestamp: 2025-09-26T08:34:50.413Z
Learning: In the fdm project, fdm-core and fdm-app are updated together as part of a monorepo structure, which eliminates legacy data concerns when new fields like b_isproductive are introduced. Both packages are synchronized, so there's no need for defensive coding against undefined values for newly introduced database fields.
Learnt from: SvenVw
Repo: SvenVw/fdm PR: 0
File: :0-0
Timestamp: 2025-08-13T10:33:05.313Z
Learning: In the fdm project, fdm-calculator integration for new features like b_lu_variety is handled in separate updates from the core data model changes. When fdm-core functions are updated to support new fields, fdm-calculator can consume these enhanced APIs without requiring changes in the same PR that introduces the core functionality.
Learnt from: SvenVw
Repo: SvenVw/fdm PR: 233
File: fdm-app/app/integrations/nmi.ts:54-0
Timestamp: 2025-08-11T11:55:26.053Z
Learning: The NMI API Estimates endpoint (`https://api.nmi-agro.nl/estimates`) always returns the fields `b_gwl_ghg`, `b_gwl_glg`, and `cultivations` according to its specification. These fields should be kept as required (not optional) in the TypeScript return type and Zod validation schema in `fdm-app/app/integrations/nmi.ts`.
Learnt from: SvenVw
Repo: SvenVw/fdm PR: 6
File: fdm-app/vite.config.ts:5-9
Timestamp: 2024-11-25T12:42:32.783Z
Learning: In the `fdm-app` project, SvenVw is preparing for migration to Remix v3 and may include type declarations or configurations for v3 features in advance, such as in `vite.config.ts`.
📚 Learning: 2025-09-26T08:34:50.413Z
Learnt from: SvenVw
Repo: SvenVw/fdm PR: 279
File: fdm-app/app/routes/farm.$b_id_farm.$calendar.norms.tsx:277-283
Timestamp: 2025-09-26T08:34:50.413Z
Learning: In the fdm project, fdm-core and fdm-app are updated together as part of a monorepo structure, which eliminates legacy data concerns when new fields like b_isproductive are introduced. Both packages are synchronized, so there's no need for defensive coding against undefined values for newly introduced database fields.

Applied to files:

  • fdm-data/CHANGELOG.md
  • fdm-core/package.json
📚 Learning: 2025-08-13T10:33:05.313Z
Learnt from: SvenVw
Repo: SvenVw/fdm PR: 0
File: :0-0
Timestamp: 2025-08-13T10:33:05.313Z
Learning: In the fdm project, fdm-calculator integration for new features like b_lu_variety is handled in separate updates from the core data model changes. When fdm-core functions are updated to support new fields, fdm-calculator can consume these enhanced APIs without requiring changes in the same PR that introduces the core functionality.

Applied to files:

  • fdm-data/CHANGELOG.md
  • fdm-core/package.json
📚 Learning: 2024-11-25T12:42:32.783Z
Learnt from: SvenVw
Repo: SvenVw/fdm PR: 6
File: fdm-app/vite.config.ts:5-9
Timestamp: 2024-11-25T12:42:32.783Z
Learning: In the `fdm-app` project, SvenVw is preparing for migration to Remix v3 and may include type declarations or configurations for v3 features in advance, such as in `vite.config.ts`.

Applied to files:

  • fdm-core/package.json
📚 Learning: 2025-05-28T07:57:19.217Z
Learnt from: SvenVw
Repo: SvenVw/fdm PR: 147
File: fdm-docs/package.json:39-39
Timestamp: 2025-05-28T07:57:19.217Z
Learning: In pnpm workspaces, the syntax `"typescript": "catalog:"` is valid and correct. It references the version defined in the workspace's catalog section in pnpm-workspace.yaml, allowing consistent dependency versions across packages in a monorepo.

Applied to files:

  • fdm-core/package.json
📚 Learning: 2025-05-28T07:57:19.217Z
Learnt from: SvenVw
Repo: SvenVw/fdm PR: 147
File: fdm-docs/package.json:39-39
Timestamp: 2025-05-28T07:57:19.217Z
Learning: In pnpm workspaces, the syntax `"typescript": "catalog:"` is valid and correct. It references the version defined in the workspace's catalog section in pnpm-workspace.yaml, allowing consistent dependency versions across packages in a monorepo. The catalog: syntax without a package name is the shorthand for referencing the default catalog.

Applied to files:

  • fdm-core/package.json
📚 Learning: 2025-01-24T11:46:49.990Z
Learnt from: SvenVw
Repo: SvenVw/fdm PR: 49
File: fdm-data/rollup.config.js:7-17
Timestamp: 2025-01-24T11:46:49.990Z
Learning: When suggesting external dependencies in Rollup configuration, only include packages that are actually listed in the package's dependencies or peerDependencies.

Applied to files:

  • fdm-core/package.json
🔇 Additional comments (3)
fdm-data/CHANGELOG.md (1)

3-7: Changelog entry is well-formatted and accurate.

The version bump to 0.18.1 is appropriate for this patch fix, and the commit message clearly documents the addition of p_type_rvo to the SRM catalogue. The entry follows the existing changelog structure.

fdm-core/package.json (2)

4-4: Version bump is semantically correct.

Patch release (0.26.0→0.26.1) appropriately reflects the dependency update from fdm-data (v0.18.0→v0.18.1).


53-53: Dependency version correctly updated.

The devDependency update to workspace:^0.18.1 aligns with the fdm-data patch release and uses the correct monorepo workspace syntax. The caret constraint allows appropriate patch updates.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot changed the title @coderabbitai Add p_type_rvo field to SRM catalogue Nov 20, 2025
@coderabbitai coderabbitai Bot added branch:main An issue, affecting the main branch, that requires an hotfix bug Something isn't working fdm-data labels Nov 20, 2025
@SvenVw SvenVw merged commit c95addd into main Nov 20, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

branch:main An issue, affecting the main branch, that requires an hotfix bug Something isn't working fdm-data

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant