Skip to content

Commit 3a999b2

Browse files
hf-kkleinKonstantin
andauthored
fix: segmentgroup_ids always start w/ SG, neither SGSG nor <no SG> (#135)
Co-authored-by: Konstantin <[email protected]>
1 parent d10fe0d commit 3a999b2

File tree

5 files changed

+301
-298
lines changed

5 files changed

+301
-298
lines changed

src/fundamend/sqlmodels/create_ahbtabellen_view.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ SELECT c.id as id,
3636
c.id_path,
3737
c.kommunikation_von as direction,
3838
c.beschreibung as description,
39-
'SG' || c.segmentgroup_id as segmentgroup_key, -- eg 'SG6'
39+
c.segmentgroup_id as segmentgroup_key, -- eg 'SG6'
4040
c.segment_id as segment_code, -- e.g 'NAD'
4141
c.dataelement_id as data_element, -- e.g 'D_3035'
4242
--CASE

src/fundamend/sqlmodels/materialize_ahb_view.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ WITH RECURSIVE
143143
h.edifact_format_version,
144144
h.anwendungshandbuch_primary_key,
145145

146-
child.id,
146+
'SG' || child.id,
147147
child.name,
148148
child.ahb_status,
149149
child.position,

unittests/__snapshots__/test_ahbesser_view.ambr

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@
286286
'pruefidentifikator': '25001',
287287
'qualifier': None,
288288
'segment_code': None,
289-
'segmentgroup_key': 'SGSG2',
289+
'segmentgroup_key': 'SG2',
290290
'sort_path': '00003-',
291291
}),
292292
dict({
@@ -305,7 +305,7 @@
305305
'pruefidentifikator': '25001',
306306
'qualifier': None,
307307
'segment_code': 'NAD',
308-
'segmentgroup_key': 'SGSG2',
308+
'segmentgroup_key': 'SG2',
309309
'sort_path': '00003-00000-',
310310
}),
311311
dict({
@@ -324,7 +324,7 @@
324324
'pruefidentifikator': '25001',
325325
'qualifier': 'MS',
326326
'segment_code': 'NAD',
327-
'segmentgroup_key': 'SGSG2',
327+
'segmentgroup_key': 'SG2',
328328
'sort_path': '00003-00000-00000-00000-',
329329
}),
330330
dict({
@@ -343,7 +343,7 @@
343343
'pruefidentifikator': '25001',
344344
'qualifier': None,
345345
'segment_code': 'NAD',
346-
'segmentgroup_key': 'SGSG2',
346+
'segmentgroup_key': 'SG2',
347347
'sort_path': '00003-00000-00001-00000-',
348348
}),
349349
dict({
@@ -362,7 +362,7 @@
362362
'pruefidentifikator': '25001',
363363
'qualifier': '9',
364364
'segment_code': 'NAD',
365-
'segmentgroup_key': 'SGSG2',
365+
'segmentgroup_key': 'SG2',
366366
'sort_path': '00003-00000-00001-00001-00000-',
367367
}),
368368
dict({
@@ -381,7 +381,7 @@
381381
'pruefidentifikator': '25001',
382382
'qualifier': '293',
383383
'segment_code': 'NAD',
384-
'segmentgroup_key': 'SGSG2',
384+
'segmentgroup_key': 'SG2',
385385
'sort_path': '00003-00000-00001-00001-00001-',
386386
}),
387387
dict({

0 commit comments

Comments
 (0)