Skip to content

Commit

Permalink
allow transactions to specify an identifying field accordproject#21
Browse files Browse the repository at this point in the history
Signed-off-by: Dan Selman <[email protected]>
  • Loading branch information
dselman committed Oct 28, 2018
1 parent 4ace003 commit f1c2ae1
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 21 deletions.
4 changes: 0 additions & 4 deletions lib/introspect/transactiondeclaration.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,6 @@ class TransactionDeclaration extends ClassDeclaration {
systemTypeDeclared = hasSystemType;
}

if (!this.isSystemType() && this.idField && systemTypeDeclared) {
throw new IllegalModelException('Transaction should not specify an identifying field.', this.modelFile, this.ast.location);
}

// perform general validation after specific validation.
super.validate();
}
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 0 additions & 16 deletions test/introspect/transactiondeclaration.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,21 +59,5 @@ describe('TransactionDeclaration', () => {
td.validate();

});

it('should cover the other error paths', () => {
const model = `
namespace org.acme
transaction T identified by id{
o String id
}
`;

const modelFile = new ModelFile(modelManager, model);
let td = modelFile.getTransactionDeclaration('T');

(() => {
td.validate();
}).should.throw(/Transaction should not specify an identifying field./);
});
});
});

0 comments on commit f1c2ae1

Please sign in to comment.