Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
118 commits
Select commit Hold shift + click to select a range
b57842f
feat: Initial version of `fdm-rvo` that that provides the logic for f…
SvenVw Dec 10, 2025
c2bdafe
docs: add typedocs and readme for fdm-rvo
SvenVw Dec 10, 2025
81dd1b6
docs: add the reference for fdm-rvo
SvenVw Dec 10, 2025
8fa4cb0
refactor: rename to RVO Import Review
SvenVw Dec 10, 2025
fd0a675
feat: Add the option to import fields from RVO in farm create wizard …
SvenVw Dec 10, 2025
b901fc7
refactor: move processing the rvo import review results into fdm-rvo
SvenVw Dec 10, 2025
734a751
Merge branch 'development' into FDM373
SvenVw Dec 11, 2025
6a78f3b
refactor: lot of improvements to get rvo import working in fdm-app
SvenVw Dec 11, 2025
7106e77
feat: add Acties to farm overview page
SvenVw Dec 11, 2025
62dff30
fix: use selected calendar instead of current year for requesting fields
SvenVw Dec 11, 2025
d93d24a
feat: add importing of cultivation as well
SvenVw Dec 11, 2025
0cb023c
refactor: be consistent with year
SvenVw Dec 11, 2025
c851ab1
refactor: more improvements
SvenVw Dec 11, 2025
49d701e
feat: add action to close field if local field is not in rvo list
SvenVw Dec 12, 2025
ae7bf72
test: add unit tests for fdm-rvo and include it in the gh actions
SvenVw Dec 12, 2025
8a9c7ef
Merge remote-tracking branch 'origin/development' into FDM373
SvenVw Dec 15, 2025
85b4b9a
fix: improve texts at rvo import
SvenVw Dec 15, 2025
faab0b8
feat: add dialog to provide summary and confirm changes
SvenVw Dec 15, 2025
7e43640
fix: ignore fields that have ended before requested
SvenVw Dec 15, 2025
c9027a0
fix: improve text for gebruikstitel
SvenVw Dec 15, 2025
d4b221b
fix: show continue button in case of no changes
SvenVw Dec 15, 2025
e7cd91b
fix
SvenVw Dec 15, 2025
dcee237
fix: improve text for not active fields
SvenVw Dec 16, 2025
5c2feca
Merge branch 'development' into FDM373
SvenVw Dec 17, 2025
3e9b915
refactor: improve displaying kvk number and show also when not known
SvenVw Dec 17, 2025
6284eb2
Merge branch 'development' into FDM373
SvenVw Dec 22, 2025
79bca9b
fix: do not set sampling date when using estimates
SvenVw Dec 22, 2025
34f2452
Merge branch 'development' into FDM373
SvenVw Dec 22, 2025
a22167b
Merge branch 'development' into FDM373
SvenVw Mar 6, 2026
4e68501
chore: rename the organization
SvenVw Mar 6, 2026
5780878
chore: even more renaming
SvenVw Mar 6, 2026
0e99021
refactor: implement change for breaking change
SvenVw Mar 6, 2026
9409ab6
fix: config issue of fdm-rvo
SvenVw Mar 6, 2026
ae2c187
fix: type issues
SvenVw Mar 6, 2026
49ab56e
Merge branch 'development' into FDM373
SvenVw Mar 17, 2026
489f888
fix: lockfile
SvenVw Mar 17, 2026
6d222c6
chore: update fdm-rvo packages
SvenVw Mar 17, 2026
69f765f
feat: request regelingsPercelenMest as well
SvenVw Mar 17, 2026
c0a6776
fix: tsbuild
SvenVw Mar 17, 2026
eeec06f
feat: add column in rvo fields table if the field is designated as bu…
SvenVw Mar 17, 2026
10d49eb
refactor: modernize and consolidate monorepo ts configuration
SvenVw Mar 17, 2026
70c1c27
fix: fix various issues regarding the merge conflict
SvenVw Mar 17, 2026
043c545
Merge branch 'development' into FDM373
SvenVw Mar 19, 2026
50dcdf0
fix: path for compilier option
SvenVw Mar 19, 2026
80ea3ed
fix: lockfile
SvenVw Mar 19, 2026
97ee246
chore: update fdm-rvo packages
SvenVw Mar 19, 2026
7629e04
fix: request both services
SvenVw Mar 19, 2026
64cc7b7
feat: support collecting information about bufferstrips for a field
SvenVw Mar 19, 2026
1c82ab5
feat: improve page names
SvenVw Mar 19, 2026
327b51b
fix: show buffer strip status
SvenVw Mar 19, 2026
89b67a6
fix: compare buffer strip state
SvenVw Mar 19, 2026
09e6609
refactor: check filepath
SvenVw Mar 19, 2026
654465e
refactor: improve accesibilty
SvenVw Mar 19, 2026
06382bc
fix: typo
SvenVw Mar 19, 2026
d5ff3af
refactor: improve state handling
SvenVw Mar 19, 2026
f25facc
refactor: improve the button position
SvenVw Mar 19, 2026
378cb89
fix: pnpm version
SvenVw Mar 19, 2026
24ca2a0
fix: typo
SvenVw Mar 19, 2026
903b9bd
chore: remove blank line
SvenVw Mar 19, 2026
20c4623
refactor: move import to top of file
SvenVw Mar 19, 2026
319cb08
refactor: rename and use client side environmental
SvenVw Mar 19, 2026
8b48910
fix: Add path alias for @nmi-agro/fdm-rvo
SvenVw Mar 19, 2026
c8fb3c7
fix: pnpm version
SvenVw Mar 19, 2026
5f08e2c
docs: fix
SvenVw Mar 19, 2026
47d82ec
fix: retrieving the rvo-connector package
SvenVw Mar 19, 2026
a9a9652
fix: Avoid non-unique "unknown" IDs in review-item
SvenVw Mar 19, 2026
46db84e
fix: set rvoCultivation to undefined for NEW_REMOTE when CropTypeCode…
SvenVw Mar 19, 2026
daae303
fix: provide error message in case file reading fails
SvenVw Mar 19, 2026
ca23e2b
fix: Handle the "no RVO parcels found" case explicitly
SvenVw Mar 19, 2026
899e0e5
fix: throw readable error
SvenVw Mar 19, 2026
99106a5
fix: Reject invalid calendar params before starting the import
SvenVw Mar 19, 2026
1acd9f3
fix: disabled RVO card is still keyboard-activatable.
SvenVw Mar 19, 2026
f7963a6
fix: overly permissive CSP
SvenVw Mar 19, 2026
713dfcd
fix: path checking
SvenVw Mar 19, 2026
3596d6a
fix: error logging
SvenVw Mar 19, 2026
f0b567b
refactor: switch to deep check
SvenVw Mar 19, 2026
8007dad
fix: sync version
SvenVw Mar 19, 2026
9df9ddd
docs: explain matching
SvenVw Mar 19, 2026
f8c03ad
fix: improve checks
SvenVw Mar 19, 2026
292592e
refactor: create shared function for rvoClient creation
SvenVw Mar 19, 2026
093938a
refactor: use shared function to parseBufferstrips
SvenVw Mar 19, 2026
d46f986
refactor: improve types
SvenVw Mar 19, 2026
13a9378
refactor: use fixed types
SvenVw Mar 19, 2026
4e317d3
refactor: add null check
SvenVw Mar 20, 2026
6e066cd
refacoctor: remove unused import
SvenVw Mar 20, 2026
0cb6ca8
fix: parameter mismatch
SvenVw Mar 20, 2026
07659a0
fix: Treat null/undefined as equal if both are missing
SvenVw Mar 20, 2026
5557e77
refactor: add fallback in case no start date
SvenVw Mar 20, 2026
2698c45
refactor: add year validation
SvenVw Mar 20, 2026
51d7ad5
fix: initial value is unused
SvenVw Mar 20, 2026
5bcbb14
tests: fix
SvenVw Mar 20, 2026
e5b74c2
refactor: improve tsconfig
SvenVw Mar 20, 2026
7eb98c8
refactor: more improvements to tsconfig
SvenVw Mar 20, 2026
d53a9ac
refactor: implement review feedback
SvenVw Mar 20, 2026
b37e24f
fixes
SvenVw Mar 20, 2026
2b41552
Merge branch 'development' into FDM373
SvenVw Mar 24, 2026
98207cf
refactor: remove unused parameter
SvenVw Mar 24, 2026
25eb409
refactor: use consistent response
SvenVw Mar 24, 2026
485193b
fix: typo
SvenVw Mar 24, 2026
dbfce9a
refactor: use consistent imports
SvenVw Mar 24, 2026
d22dc68
refactor: use transactions to process RVO fields
SvenVw Mar 24, 2026
82a13e5
fix: build with code split
SvenVw Mar 24, 2026
b9d39d8
Merge branch 'development' into FDM373
SvenVw Mar 25, 2026
97af0a1
fix: add missing year validation
SvenVw Mar 25, 2026
0f259fc
refactor: remove useless assignment
SvenVw Mar 25, 2026
25e7402
refactor: Simplify conditional rendering.
SvenVw Mar 25, 2026
3d3762f
feat: add warning if user tries to refresh rvo page and thus data nee…
SvenVw Mar 25, 2026
89f208c
refactor: remove duplicate env
SvenVw Mar 25, 2026
3b833e9
refactor: reorder envs
SvenVw Mar 25, 2026
21d8953
refactor: guard against no kvk
SvenVw Mar 25, 2026
44c96b5
docs: update readme
SvenVw Mar 25, 2026
eb0fa45
fix: update cultivation when missing
SvenVw Mar 25, 2026
a9d4045
refactor: add validation
SvenVw Mar 25, 2026
1cf04e6
docs: fix
SvenVw Mar 25, 2026
99c76d0
refactor: use consistent naming
SvenVw Mar 25, 2026
f237b59
test: fix
SvenVw Mar 25, 2026
3e287bf
docs: improvements
SvenVw Mar 25, 2026
d6a9091
docs: another improvement
SvenVw Mar 25, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/chatty-bananas-sink.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@nmi-agro/fdm-app": minor
---

Add the option to import fields from RVO in farm create wizard and also at the fields page of the farm
5 changes: 5 additions & 0 deletions .changeset/public-llamas-clap.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@nmi-agro/fdm-docs": minor
---

Add the reference for fdm-rvo
5 changes: 5 additions & 0 deletions .changeset/tangy-ways-win.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@nmi-agro/fdm-rvo": minor
---

Initial version of `fdm-rvo` that provides the logic for fdm-app to connect to RVO and sync fields with fdm-core
2 changes: 2 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ jobs:
- name: Publish Snapshot
if: github.ref == 'refs/heads/development'
run: |
echo "//npm.pkg.github.com/:_authToken=\${NODE_AUTH_TOKEN}" >> .npmrc
pnpm changeset version --snapshot
pnpm changeset publish --tag development
env:
Expand All @@ -68,6 +69,7 @@ jobs:
if: github.ref == 'refs/heads/main'
shell: bash
run: |
echo "//npm.pkg.github.com/:_authToken=\${NODE_AUTH_TOKEN}" >> .npmrc
# Build packages
pnpm build --filter="!@nmi-agro/fdm-app"

Expand Down
95 changes: 92 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
registry-url: 'https://npm.pkg.github.com'
cache: 'pnpm'

- name: Install Dependencies
Expand Down Expand Up @@ -152,7 +151,6 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
registry-url: 'https://npm.pkg.github.com'
cache: 'pnpm'

- name: Install Dependencies
Expand Down Expand Up @@ -232,7 +230,6 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
registry-url: 'https://npm.pkg.github.com'
cache: 'pnpm'

- name: Install Dependencies
Expand All @@ -252,3 +249,95 @@ jobs:
files: ./fdm-data/coverage/coverage-final.json
flags: fdm-data
token: ${{ secrets.CODECOV_TOKEN }}

# Label of the container job for fdm-rvo
test-rvo:
name: rvo
# Containers must run in Linux based operating systems
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [24]
permissions:
contents: read
packages: write
# Docker Hub image that `container-job` executes in
container: node:${{ matrix.node-version }}-bookworm-slim

# Service containers to run with `container-job`
services:
# Label used to access the service container
postgres:
# Docker Hub image with postgis extension
image: postgis/postgis:17-3.5
# Provide the password for postgres
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5

steps:
# Include dependencies for codecov
- name: Install system dependencies
run: apt-get update && apt-get install -y git curl gpg

# Downloads a copy of the code in your repository before running CI tests
- name: Check out repository code
uses: actions/checkout@v4

- name: Cache turbo build setup
uses: actions/cache@v4
with:
path: .turbo
key: ${{ runner.os }}-turbo-${{ github.sha }}
restore-keys: |
${{ runner.os }}-turbo-

- name: Setup pnpm 10
uses: pnpm/action-setup@v4
with:
version: 10.32.1

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'

- name: Install Dependencies
run: pnpm i

- name: Build fdm-data
run: pnpm build
working-directory: ./fdm-data

- name: Build fdm-core
run: pnpm build
working-directory: ./fdm-core

- name: Run tests with coverage
run: pnpm test-coverage
working-directory: ./fdm-rvo
env:
# The hostname used to communicate with the PostgreSQL service container
POSTGRES_HOST: postgres
# The default PostgreSQL port
POSTGRES_PORT: 5432
# the default usernam
POSTGRES_USER: postgres
# the default password
POSTGRES_PASSWORD: postgres
# the default database
POSTGRES_DB: postgres

- name: fdm-rvo - Upload results to Codecov
uses: codecov/codecov-action@v5
with:
files: ./fdm-rvo/coverage/coverage-final.json
flags: fdm-rvo
token: ${{ secrets.CODECOV_TOKEN }}
1 change: 0 additions & 1 deletion .github/workflows/typecheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
registry-url: 'https://npm.pkg.github.com'
cache: 'pnpm'

- name: Install Dependencies
Expand Down
2 changes: 0 additions & 2 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
sync-injected-deps-after-scripts[]=build
link-workspace-packages=true
@nmi-agro:registry=https://npm.pkg.github.com
//npm.pkg.github.com/:_authToken=${NODE_AUTH_TOKEN}
7 changes: 7 additions & 0 deletions fdm-app/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,13 @@ GOOGLE_CLIENT_SECRET=
MS_CLIENT_ID=
MS_CLIENT_SECRET=

# RVO OAuth Credentials (Optional: Leave empty to disable RVO Integration)
# Required: No
RVO_CLIENT_ID=
RVO_CLIENT_NAME=
RVO_PKIO_PRIVATE_KEY=
Comment thread
coderabbitai[bot] marked this conversation as resolved.
RVO_REDIRECT_URI=

# -------------------------------------
# Map & Data Configuration
# -------------------------------------
Expand Down
31 changes: 31 additions & 0 deletions fdm-app/app/components/blocks/fertilizer/utils.server.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { getFertilizerParametersDescription, type Fertilizer } from "@nmi-agro/fdm-core"

/**
* Retrieves RVO label and type mappings used across fertilizer forms and summaries.
* Centralizes the assembly of RVO metadata from the parameter descriptions and available fertilizers.
*
* @param fertilizers - Optional array of fertilizers to build the RVO-to-Type mapping for dynamic badge colors.
* @returns An object containing:
* - `rvoLabels`: A record mapping RVO codes to their descriptive labels (in Dutch).
* - `rvoToType`: A record mapping RVO codes to fertilizer types (manure, compost, etc.).
*/
export async function getRvoMappings(fertilizers: Partial<Fertilizer>[] = []) {
const fertilizerParameterDescription =
await getFertilizerParametersDescription("NL-nl")
const p_type_rvo_options =
fertilizerParameterDescription.find((x) => x.parameter === "p_type_rvo")
?.options ?? []

const rvoLabels = Object.fromEntries(
p_type_rvo_options.map((opt) => [String(opt.value), opt.label]),
)

const rvoToType: Record<string, string> = {}
for (const f of fertilizers) {
if (f.p_type_rvo && f.p_type) {
rvoToType[f.p_type_rvo] = f.p_type
}
}

return { rvoLabels, rvoToType }
}
38 changes: 0 additions & 38 deletions fdm-app/app/components/blocks/fertilizer/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,44 +64,6 @@ export function buildFertilizerDefaults(
}
}

/**
* Retrieves RVO label and type mappings used across fertilizer forms and summaries.
* Centralizes the assembly of RVO metadata from the parameter descriptions and available fertilizers.
*
* @param fertilizers - Optional array of fertilizers to build the RVO-to-Type mapping for dynamic badge colors.
* @returns An object containing:
* - `rvoLabels`: A record mapping RVO codes to their descriptive labels (in Dutch).
* - `rvoToType`: A record mapping RVO codes to fertilizer types (manure, compost, etc.).
*/
export async function getRvoMappings(fertilizers: Partial<Fertilizer>[] = []) {
if (typeof window !== "undefined") {
return { rvoLabels: {}, rvoToType: {} }
}

const { getFertilizerParametersDescription } = await import(
"@nmi-agro/fdm-core"
)

const fertilizerParameterDescription =
await getFertilizerParametersDescription("NL-nl")
const p_type_rvo_options =
fertilizerParameterDescription.find((x) => x.parameter === "p_type_rvo")
?.options ?? []

const rvoLabels = Object.fromEntries(
p_type_rvo_options.map((opt) => [String(opt.value), opt.label]),
)

const rvoToType: Record<string, string> = {}
for (const f of fertilizers) {
if (f.p_type_rvo && f.p_type) {
rvoToType[f.p_type_rvo] = f.p_type
}
}

return { rvoLabels, rvoToType }
}

/**
* Builds the payload for adding a fertilizer to the catalogue.
*
Expand Down
4 changes: 3 additions & 1 deletion fdm-app/app/components/blocks/fields/columns.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,9 @@ export const columns: ColumnDef<FieldExtended>[] = [
const field = row.original
return (
<p className="text-muted-foreground">
{`${field.a_som_loi.toFixed(2)} %`}
{field.a_som_loi !== null && field.a_som_loi !== undefined
? `${field.a_som_loi.toFixed(2)} %`
: "-"}
</p>
)
},
Expand Down
Loading
Loading