indice-co / indice-co/EDI.Net

Avoid ambiguities between segments

Open
#120 7 comments 0 reactions 0 assignees View on GitHub
question
Dominant language
C#
Stars
490
Forks
173
PR merge metrics
No merged PRs in 30d

Description

Hi,

I have structure:
`List NUMs` (Condition type: I, status: TOT)

NUM:
`Number` - NUM/0/0
`Type` - NUM/0/1
`Status` - NUM/1/0
`Additional` - NUM segment with NUM/0/0 and NUM/0/1
`DUM` - segment to avoid ambiguities between NUM
`DEC` - DEC/0/0
`List Infos` (Condition code: A,B,C,D)

Info:
`Code` - PTS/0/0
`InfoNumber` - NUM segment with NUM/0/0 and NUM/0/1 (Condition type: R)
`DEC` - DEC/0/0 and DEC/0/1
`Text` - TXF/0/0

```
SDI+TT'
NUM+123456789:I+TOT'
NUM+123454554:I'
DUM+'
DEC+2'
PTS+A+'
NUM+123456788:R'
DEC+2:C'
TXF+TEXT'
PTS+C'
NUM+123456777:R'
DEC+1:C'
TXF+TEXT'
NUM+123456789:I+TOT'
DUM+'
DEC+2'
PTS+A+'
NUM+123456838:R'
DEC+2:D'
TXF+TEXT'
SPR+ETD'
```

But is not work, it is my code. It extract group from num to num.
My code:

```csharp
[EdiCondition("I", Path = "NUM/0/1")]
public List NUMs { get; set; }

[EdiSegmentGroup("NUM", SequenceEnd = "SPR")]
public class NUM
{
[EdiValue("X(35)", Path = "NUM/0", Mandatory = true)]
public string Number { get; set; }

[EdiValue("X(3)", Path = "NUM/0/1", Mandatory = true)]
public string Type { get; set; }

[EdiValue("X(3)", Path = "NUM/1", Mandatory = true)]
public string Status { get; set; }

public DUM DUM { get; set; }

public DEC DEC { get; set; }

[EdiCondition("A", Path = "PTS/1/0")]
[EdiCondition("B", Path = "PTS/1/0")]
[EdiCondition("C", Path = "PTS/1/0")]
[EdiAny]
public List Infos { get; set; }
}

[EdiSegmentGroup("PTS")]
public class Info
{
[EdiValue("X(3)", Path = "PTS/1/0")]
public string Code { get; set; }

[EdiValue("X(3)", Path = "PTS/2/0")]
public string CodeT { get; set; }

[EdiCondition("J", Path = "NUM/0/1")]
public NumberDetails Details { get; set; }

public DEC DEC { get; set; }

[EdiCondition("4", Path = "TXF/0/0")]
public string Text { get; set; }
}

[EdiSegment, EdiPath("DEC")]
public class DEC
{
[EdiValue("X(6)", Path = "DEC/0/0", Mandatory = true)]
public string Number { get; set; }

[EdiValue("X(3)", Path = "DEC/0/1")]
public string Status { get; set; }

}
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Use the supplied EDI message and the NUM, Info, DEC, and DUM model declarations as the reproduction case, focusing on how NUM groups are extracted across DUM and nested segments. Done means the message parses into the intended NUM groups and their associated Info and DEC values without segment ambiguity.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.