indice-co / indice-co/EDI.Net

How to use SegmentGroup

Open
#214 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

question
Dominant language
C#
Stars
490
Forks
173
PR merge metrics
No merged PRs in 30d

Description

Hi everyone,

I´m trying to implement the EDIFACT VERMAS D16B, and I´m having a hard time understanding/using SegmentGroup.

image

I´ve created classes for Elements and Segments, for example my CTA Segment is defined as

    [EdiSegment, EdiPath("CTA")]
    public class CTA
    {
        [EdiValue("X(3)", Path = "CTA/0")]
        public string ContactFunctionCoded { get; set; }

        [EdiElement, EdiPath("CTA/1")]
        public C056 ContactDetails { get; set; }
    }

and the C506 Element

    [EdiElement]
    public class C056
    {
        [EdiValue("X(17)", Path = "*/*/0")]
        public string ContactIdentifier { get; set; }

        [EdiValue("X(256)", Path = "*/*/1")]
        public string ContactName { get; set; }
    }

My question is what would be the best/correct way to implement the GRP2 class?

  • NAD is mandatory, so should I use EdiSegment(Mandatory=true)? Wouldn´t that force GRP3 List to be mandatory also?
  • How should I define the SegmentGroup? EdiSegmentGroup("NAD", "GRP3") or EdiSegmentGroup("NAD", "CTA", "COM")
  • Should I decorate public List<GRP3> GRP3{ get; set; } with any attribute? For example [EdiSegment]
    [EdiSegment(Mandatory=true), EdiSegmentGroup("NAD", ""GRP3")]
    public class GRP2: NAD
    {
        public List<GRP3> GRP3{ get; set; }

        public GRP2()
        {
            GRP3= new List<GRP3>();
        }
    }

Thank you for your help!

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start from the EdiSegmentGroup and EdiSegment attributes shown in the GRP2, CTA, and C056 declarations, along with the GRP3 list property. Determine how mandatory NAD and repeated GRP3 groups are represented, then document the correct declaration and the expected parsed structure.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
backend
Issue type
Documentation
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.