Skip to content

fix: segmentgroup_ids always start w/ SG, neither SGSG nor <no SG> #135

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion src/fundamend/sqlmodels/create_ahbtabellen_view.sql
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ SELECT c.id as id,
c.id_path,
c.kommunikation_von as direction,
c.beschreibung as description,
'SG' || c.segmentgroup_id as segmentgroup_key, -- eg 'SG6'
c.segmentgroup_id as segmentgroup_key, -- eg 'SG6'
c.segment_id as segment_code, -- e.g 'NAD'
c.dataelement_id as data_element, -- e.g 'D_3035'
--CASE
Expand Down
2 changes: 1 addition & 1 deletion src/fundamend/sqlmodels/materialize_ahb_view.sql
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ WITH RECURSIVE
h.edifact_format_version,
h.anwendungshandbuch_primary_key,

child.id,
'SG' || child.id,
child.name,
child.ahb_status,
child.position,
Expand Down
12 changes: 6 additions & 6 deletions unittests/__snapshots__/test_ahbesser_view.ambr
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@
'pruefidentifikator': '25001',
'qualifier': None,
'segment_code': None,
'segmentgroup_key': 'SGSG2',
'segmentgroup_key': 'SG2',
'sort_path': '00003-',
}),
dict({
Expand All @@ -305,7 +305,7 @@
'pruefidentifikator': '25001',
'qualifier': None,
'segment_code': 'NAD',
'segmentgroup_key': 'SGSG2',
'segmentgroup_key': 'SG2',
'sort_path': '00003-00000-',
}),
dict({
Expand All @@ -324,7 +324,7 @@
'pruefidentifikator': '25001',
'qualifier': 'MS',
'segment_code': 'NAD',
'segmentgroup_key': 'SGSG2',
'segmentgroup_key': 'SG2',
'sort_path': '00003-00000-00000-00000-',
}),
dict({
Expand All @@ -343,7 +343,7 @@
'pruefidentifikator': '25001',
'qualifier': None,
'segment_code': 'NAD',
'segmentgroup_key': 'SGSG2',
'segmentgroup_key': 'SG2',
'sort_path': '00003-00000-00001-00000-',
}),
dict({
Expand All @@ -362,7 +362,7 @@
'pruefidentifikator': '25001',
'qualifier': '9',
'segment_code': 'NAD',
'segmentgroup_key': 'SGSG2',
'segmentgroup_key': 'SG2',
'sort_path': '00003-00000-00001-00001-00000-',
}),
dict({
Expand All @@ -381,7 +381,7 @@
'pruefidentifikator': '25001',
'qualifier': '293',
'segment_code': 'NAD',
'segmentgroup_key': 'SGSG2',
'segmentgroup_key': 'SG2',
'sort_path': '00003-00000-00001-00001-00001-',
}),
dict({
Expand Down
Loading