Skip to content

Commit d9f4421

Browse files
authored
Merge pull request #6 from cap-js/refactor/local_integration_test
refactor integration test and include index.cds
2 parents 9e53567 + 71effe9 commit d9f4421

File tree

2 files changed

+46
-59
lines changed

2 files changed

+46
-59
lines changed
Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,14 @@
11
namespace my.invoices;
22

33
using {cuid} from '@sap/cds/common';
4+
using { sap.print.Queues } from '@cap-js/print';
45

56
entity Invoice : cuid {
67
InvoiceNumber : String;
78
fileName : String;
89
fileContent : LargeBinary;
910
qName : Association to one Queues;
10-
qName1 : Association to one Queues;
1111
numberOfCopies : Integer;
12-
numberOfCopies1 : Integer;
13-
numberOfCopies2 : Integer;
1412
attachment : LargeBinary;
1513
attachmentName : String;
16-
document : LargeBinary;
17-
documentName : String;
18-
document1 : LargeBinary;
19-
documentName1 : String;
20-
document2 : LargeBinary;
21-
}
22-
23-
@cds.skip.peristance
24-
entity Queues {
25-
key ID : String;
26-
description : String;
2714
}

test/integration/testapp/srv/invoice-service.cds

Lines changed: 45 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
using {my.invoices as db} from '../db/schema';
2+
using { sap.print as sp } from '@cap-js/print';
23

34
@impl: './invoice-service.js'
45
service InvoiceService {
56
entity Invoices as projection on db.Invoice;
6-
entity Queues as projection on db.Queues;
77

88
entity Document as
99
projection on db.Invoice {
@@ -28,27 +28,27 @@ service InvoiceService {
2828
@print.numberOfCopies
2929
numberOfCopies,
3030

31-
@print.fileContent: {
32-
fileNameField: 'documentName', usedInAction: ['multipleMainDocument']
33-
}
34-
@print.MainDocument
35-
document,
36-
documentName,
37-
38-
@print.fileContent: {
39-
fileNameField: 'documentName1', usedInAction: [
40-
'multipleMainDocument',
41-
'usedInActionSuccess'
42-
]
43-
}
44-
@print.MainDocument
45-
document1,
46-
documentName1,
47-
48-
@print.fileContent: {
49-
usedInAction: ['fileNameFieldMissing']
50-
}
51-
document2
31+
// @print.fileContent: {
32+
// fileNameField: 'documentName', usedInAction: ['multipleMainDocument']
33+
// }
34+
// @print.MainDocument
35+
// document,
36+
// documentName,
37+
38+
// @print.fileContent: {
39+
// fileNameField: 'documentName1', usedInAction: [
40+
// 'multipleMainDocument',
41+
// 'usedInActionSuccess'
42+
// ]
43+
// }
44+
// @print.MainDocument
45+
// document1,
46+
// documentName1,
47+
48+
// @print.fileContent: {
49+
// usedInAction: ['fileNameFieldMissing']
50+
// }
51+
// document2
5252
}
5353
actions {
5454
@print
@@ -89,28 +89,28 @@ service InvoiceService {
8989
}
9090
numberOfCopies,
9191

92-
@print.queue : {
93-
SourceEntity: 'Queues', usedInAction: [
94-
'queueNotFilled',
95-
'noCopiesAnnotation',
96-
'copiesNotFilled',
97-
'queueUsedInActionSucess',
98-
'copiesUsedInActionSuccess',
99-
'copiesUsedInActionFail'
100-
]
101-
}
102-
qName1,
103-
104-
@print.numberOfCopies: {
105-
usedInAction: [
106-
'copiesNotFilled',
107-
'copiesUsedInActionSuccess',
108-
'queueUsedInActionFail',
109-
'queueUsedInActionSucess'
110-
]
111-
}
112-
numberOfCopies1,
113-
numberOfCopies2
92+
// @print.queue : {
93+
// SourceEntity: 'Queues', usedInAction: [
94+
// 'queueNotFilled',
95+
// 'noCopiesAnnotation',
96+
// 'copiesNotFilled',
97+
// 'queueUsedInActionSucess',
98+
// 'copiesUsedInActionSuccess',
99+
// 'copiesUsedInActionFail'
100+
// ]
101+
// }
102+
// qName1,
103+
104+
// @print.numberOfCopies: {
105+
// usedInAction: [
106+
// 'copiesNotFilled',
107+
// 'copiesUsedInActionSuccess',
108+
// 'queueUsedInActionFail',
109+
// 'queueUsedInActionSucess'
110+
// ]
111+
// }
112+
// numberOfCopies1,
113+
// numberOfCopies2
114114
}
115115
actions {
116116
@print
@@ -137,5 +137,5 @@ service InvoiceService {
137137
@print
138138
action copiesUsedInActionFail();
139139
}
140-
140+
entity Queues as projection on sp.Queues;
141141
}

0 commit comments

Comments
 (0)