feat: preserve gear components through catch imports
CI / backend-and-migrations (push) Waiting to run
CI / astro-build (push) Waiting to run
CI / dependency-audit (push) Waiting to run
CI / compose-e2e (push) Waiting to run

This commit is contained in:
ik
2026-09-20 18:10:41 +07:00
parent 4e9895fbf4
commit 4f0c2d23de
15 changed files with 379 additions and 7 deletions
+3 -1
View File
@@ -11,7 +11,7 @@ from app.community_importer import CommunityImportError, stage_observations, upd
from app.community_review import ExternalReviewError, map_observation, publish_observation, suggest_aliases
from app.source_lifecycle import record_scheduled_source_check, record_source_check
from app.database import Base
from app.models import CatchReport, DataSource, ExternalEntityAlias, ExternalObservation, Fish, Waterbody
from app.models import CatchReport, CatchTackleComponent, DataSource, ExternalEntityAlias, ExternalObservation, Fish, Waterbody
from rf4_research.community_sources import parse_rf4db_catches, parse_rf4map_point, parse_rf4posts_spot
@@ -239,6 +239,8 @@ def test_changed_published_record_requires_review_and_reuses_report(db: Session)
assert updated.id == report_id
assert updated.weight_g == 6000
assert updated.moderation_status.value == "approved"
components = db.scalars(select(CatchTackleComponent).order_by(CatchTackleComponent.position)).all()
assert [(component.position, component.raw_value) for component in components] == [(0, "Приманка")]
assert db.scalar(select(func.count()).select_from(CatchReport)) == 1