Skip to content

Encapsulation is not working #29

@BackdoorTech

Description

@BackdoorTech

this is my data structure

const file = {
  'MNDTImf:InputMandateFile': {
    '@xmlns:MNDTImf': 'urn:MNDTImf:xsd:$MPEMndt',
    'MNDTImf:SndgInst': '',
    'MNDTImf:RcvgInst': '',
    'MNDTImf:FileRef': '',
    'MNDTImf:SrvcId': '',
    'MNDTImf:TstCode': '',
    'MNDTImf:FType': '',
    'MNDTImf:FDtTm': '',
    'MNDTImf:Num009CAPBlk': '',
    'MNDTImf:Num009SAPBlk': '',
    'MNDTImf:Num012CAPBlk': '',
    'MNDTImf:Num012SAPBlk': '',
    'MNDTImf:Num010Blk': '',
    'MNDTImf:Num011Blk': '',
    'MNDTImf:Pain011': '',
    'MNDTImf:Pain009SAP': {
      '@xmlns': 'urn:iso:std:iso:20022:tech:xsd:pain.009.001.05',
      'GrpHdr': {
        'MsgId': '',
        'CreDtTm': '',
        'InstgAgt':{
          'FinInstnId':{
            'BICFI': '' // BIC of the sender
          }
        },
        'InstdAgt': {
          'FinInstnId': {
            'BICFI': '' // BIC of the receiver
          }
        }
      },
      'Mndt': {
        'MndtId': '',
        'MndtReqId': '',
        'Tp': '',
        'Ocrncs': {
          'SeqTp': '',
          'Frqcy': '',
          'FrstColltnDt': '',
          'FnlColltnDt': ''
        },
        'TrckgInd': '',
        'MaxAmt': { // attribuite and value
          '@Ccy': 'AOA'
        },
        'Cdtr': {
          'Nm': '',
          'Id': {
            'OrgId': {
              'Othr': {
                'Id': ''
              }
            }
          }
        },
        'CdtrAcct':{
          'id': {
            'IBAN': ''
          }
        },
        'CdtrAgt': {
          'FinInstnId': {
            'BICFI': ''
          }
        },
        'Dbtr': {
          'Nm': '',
          'Id': {
            'OrgId': {
              'Othr': {
                'Id': ''
              }
            },
          }
        },
        'DbtrAcct': {
          'Id': ''
        },
        'DbtrAgt': {
          'FinInstnId':{
            'BICFI':''
          }
        },
        'DbtrAcct': {
          'Id': {
            'IBAN': ''
          }
        },
        'DbtrAgt': {
          'FinInstnId': {
            'BICFI': ''
          }
        },
        'RfrdDoc': {
          'CdtrRef': '',
          'RltdDt': ''
        }
      }
    }
  }
};

const v = Valid.make( file, rules);
TypeError: e.forEach is not a function
    at i.value (C:\Users\peter.maquiran\Desktop\TEST\node_modules\Validator\dist\Validator.js:1:4117)
    at i.value (C:\Users\peter.maquiran\Desktop\TEST\node_modules\Validator\dist\Validator.js:1:3914)
    at new i (C:\Users\peter.maquiran\Desktop\TEST\node_modules\Validator\dist\Validator.js:1:3503)
    at Function.value (C:\Users\peter.maquiran\Desktop\TEST\node_modules\Validator\dist\Validator.js:1:18595)
    at Object.<anonymous> (C:\Users\peter.maquiran\Desktop\TEST\index.js:29:17)
    at Module._compile (internal/modules/cjs/loader.js:1138:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10)
    at Module.load (internal/modules/cjs/loader.js:986:32)
    at Function.Module._load (internal/modules/cjs/loader.js:879:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions