Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Mock function import of API_CV_ATTACHMENT_SRV
  • Loading branch information
gregorwolf committed May 25, 2021
1 parent c91088b commit 8fa7725
Show file tree
Hide file tree
Showing 6 changed files with 1,253 additions and 0 deletions.
4 changes: 4 additions & 0 deletions package.json
Expand Up @@ -104,6 +104,10 @@
"destination": "flow",
"requestTimeout": 30000
}
},
"API_CV_ATTACHMENT_SRV": {
"kind": "odata",
"model": "srv/external/API_CV_ATTACHMENT_SRV"
}
},
"[dev-uaa]": {
Expand Down
19 changes: 19 additions & 0 deletions srv/cv-attachment-service.cds
@@ -0,0 +1,19 @@
using {API_CV_ATTACHMENT_SRV as external} from './external/API_CV_ATTACHMENT_SRV.csn';

service AttachmentContentService @(path : '/API_CV_ATTACHMENT_SRV') {
@cds.persistence.skip : false
@cds.persistence.table
entity AttachmentContentSet : external.AttachmentContentSet {}

@cds.persistence.skip : false
@cds.persistence.table
entity A_DocumentInfoRecordAttch : external.A_DocumentInfoRecordAttch {
DocumentInfoRecordToAttachmentNavigation : Association to many AttachmentContentSet
on DocumentInfoRecordDocType = DocumentInfoRecordToAttachmentNavigation.DocumentInfoRecordDocType
and DocumentInfoRecordDocNumber = DocumentInfoRecordToAttachmentNavigation.DocumentInfoRecordDocNumber
and DocumentInfoRecordDocVersion = DocumentInfoRecordToAttachmentNavigation.DocumentInfoRecordDocVersion
and DocumentInfoRecordDocPart = DocumentInfoRecordToAttachmentNavigation.DocumentInfoRecordDocPart;
}

function GetAttachmentCount(BusinessObjectTypeName : String, LinkedSAPObjectKey : String, SemanticObject : String) returns external.AttachmentsCount
};
8 changes: 8 additions & 0 deletions srv/cv-attachment-service.js
@@ -0,0 +1,8 @@
const cds = require("@sap/cds");

module.exports = cds.service.impl((srv) => {
srv.on("GetAttachmentCount", async (req) => {
console.log(req.data);
return { AttachmentCount: 2 };
});
});

0 comments on commit 8fa7725

Please sign in to comment.