Compare commits
9 Commits
use-contex
...
uom
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7e1b33d423 | ||
|
|
6fa2aaee34 | ||
|
|
ccb61c9b69 | ||
|
|
169fda660b | ||
|
|
f3209da2e1 | ||
|
|
987611b009 | ||
|
|
ce1da7fce9 | ||
|
|
395587b1bf | ||
|
|
bab7827000 |
@@ -9,7 +9,7 @@
|
|||||||
"index.cds"
|
"index.cds"
|
||||||
],
|
],
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@cap-js/sqlite": "*"
|
"@cap-js/sqlite": ">=1"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@sap/cds": ">=7",
|
"@sap/cds": ">=7",
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
"@sap-cloud-sdk/resilience": "^4",
|
"@sap-cloud-sdk/resilience": "^4",
|
||||||
"@sap/cds": ">=5",
|
"@sap/cds": ">=5",
|
||||||
"express": "^4.17.1",
|
"express": "^4.17.1",
|
||||||
"@cap-js/hana": "^1"
|
"@cap-js/hana": ">=1"
|
||||||
},
|
},
|
||||||
"cds": {
|
"cds": {
|
||||||
"requires": {
|
"requires": {
|
||||||
|
|||||||
13
common/currencies.cds
Normal file
13
common/currencies.cds
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
using { sap } from '@sap/cds/common';
|
||||||
|
|
||||||
|
extend sap.common.Currencies with {
|
||||||
|
// Currencies.code = ISO 4217 alphabetic three-letter code
|
||||||
|
// with the first two letters being equal to ISO 3166 alphabetic country codes
|
||||||
|
// See also:
|
||||||
|
// [1] https://www.iso.org/iso-4217-currency-codes.html
|
||||||
|
// [2] https://www.currency-iso.org/en/home/tables/table-a1.html
|
||||||
|
// [3] https://www.ibm.com/support/knowledgecenter/en/SSZLC2_7.0.0/com.ibm.commerce.payments.developer.doc/refs/rpylerl2mst97.htm
|
||||||
|
numcode : Integer;
|
||||||
|
exponent : Integer; //> e.g. 2 --> 1 Dollar = 10^2 Cent
|
||||||
|
minor : String; //> e.g. 'Cent'
|
||||||
|
}
|
||||||
6
common/data/sap.common-Weights.csv
Normal file
6
common/data/sap.common-Weights.csv
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
code;name
|
||||||
|
g;Grams
|
||||||
|
kg;Kilograms
|
||||||
|
mg;Milligrams
|
||||||
|
lb;Pounds
|
||||||
|
oz;Ounces
|
||||||
|
11
common/data/sap.common-Weights_texts.csv
Normal file
11
common/data/sap.common-Weights_texts.csv
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
code;locale;name
|
||||||
|
g;de;Gramm
|
||||||
|
kg;de;Kilogramm
|
||||||
|
mg;de;Milligramm
|
||||||
|
lb;de;Pfund
|
||||||
|
oz;de;Unze
|
||||||
|
g;fr;Grammes
|
||||||
|
kg;fr;Kilogrammes
|
||||||
|
mg;fr;Milligrammes
|
||||||
|
lb;fr;Livres
|
||||||
|
oz;fr;Onces
|
||||||
|
@@ -1,45 +1,3 @@
|
|||||||
using { sap } from '@sap/cds/common';
|
using from './currencies';
|
||||||
|
using from './regions';
|
||||||
extend sap.common.Currencies with {
|
using from './uom';
|
||||||
// Currencies.code = ISO 4217 alphabetic three-letter code
|
|
||||||
// with the first two letters being equal to ISO 3166 alphabetic country codes
|
|
||||||
// See also:
|
|
||||||
// [1] https://www.iso.org/iso-4217-currency-codes.html
|
|
||||||
// [2] https://www.currency-iso.org/en/home/tables/table-a1.html
|
|
||||||
// [3] https://www.ibm.com/support/knowledgecenter/en/SSZLC2_7.0.0/com.ibm.commerce.payments.developer.doc/refs/rpylerl2mst97.htm
|
|
||||||
numcode : Integer;
|
|
||||||
exponent : Integer; //> e.g. 2 --> 1 Dollar = 10^2 Cent
|
|
||||||
minor : String; //> e.g. 'Cent'
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The Code Lists below are designed as optional extensions to
|
|
||||||
* the base schema. Switch them on by adding an Association to
|
|
||||||
* one of the code list entities in your models or by:
|
|
||||||
* annotate sap.common.Countries with @cds.persistence.skip:false;
|
|
||||||
*/
|
|
||||||
|
|
||||||
context sap.common.countries {
|
|
||||||
|
|
||||||
extend sap.common.Countries {
|
|
||||||
regions : Composition of many Regions on regions._parent = $self.code;
|
|
||||||
}
|
|
||||||
|
|
||||||
entity Regions : sap.common.CodeList {
|
|
||||||
key code : String(5); // ISO 3166-2 alpha5 codes, e.g. DE-BW
|
|
||||||
children : Composition of many Regions on children._parent = $self.code;
|
|
||||||
cities : Composition of many Cities on cities.region = $self;
|
|
||||||
_parent : String(11);
|
|
||||||
}
|
|
||||||
entity Cities : sap.common.CodeList {
|
|
||||||
key code : String(11);
|
|
||||||
region : Association to Regions;
|
|
||||||
districts : Composition of many Districts on districts.city = $self;
|
|
||||||
}
|
|
||||||
entity Districts : sap.common.CodeList {
|
|
||||||
key code : String(11);
|
|
||||||
city : Association to Cities;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|||||||
22
common/regions.cds
Normal file
22
common/regions.cds
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
using { sap.common } from '@sap/cds/common';
|
||||||
|
namespace sap.common.countries;
|
||||||
|
|
||||||
|
extend common.Countries {
|
||||||
|
regions : Composition of many Regions on regions._parent = $self.code;
|
||||||
|
}
|
||||||
|
|
||||||
|
entity Regions : common.CodeList {
|
||||||
|
key code : String(5); // ISO 3166-2 alpha5 codes, e.g. DE-BW
|
||||||
|
children : Composition of many Regions on children._parent = $self.code;
|
||||||
|
cities : Composition of many Cities on cities.region = $self;
|
||||||
|
_parent : String(11);
|
||||||
|
}
|
||||||
|
entity Cities : common.CodeList {
|
||||||
|
key code : String(11);
|
||||||
|
region : Association to Regions;
|
||||||
|
districts : Composition of many Districts on districts.city = $self;
|
||||||
|
}
|
||||||
|
entity Districts : common.CodeList {
|
||||||
|
key code : String(11);
|
||||||
|
city : Association to Cities;
|
||||||
|
}
|
||||||
19
common/uom.cds
Normal file
19
common/uom.cds
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
using { sap.common.CodeList } from '@sap/cds/common';
|
||||||
|
namespace sap.common.uom;
|
||||||
|
|
||||||
|
entity PackagingUnits : CodeList {
|
||||||
|
key code : String(3); // e.g. pc for Piece(s)
|
||||||
|
abbrev : localized String(3); // e.g. st for Stück
|
||||||
|
}
|
||||||
|
|
||||||
|
entity Weights : CodeList {
|
||||||
|
key code : String(3); // e.g. kg for Kilogram(s)
|
||||||
|
}
|
||||||
|
|
||||||
|
entity Lengths : CodeList {
|
||||||
|
key code : String(3); // e.g. m for Meter(s)
|
||||||
|
}
|
||||||
|
|
||||||
|
type PackagingUnit : Association to PackagingUnits;
|
||||||
|
type Length : Association to Lengths;
|
||||||
|
type Weight : Association to Weights;
|
||||||
@@ -106,7 +106,7 @@
|
|||||||
"name": "sap.fe.templates.ObjectPage",
|
"name": "sap.fe.templates.ObjectPage",
|
||||||
"options": {
|
"options": {
|
||||||
"settings" : {
|
"settings" : {
|
||||||
"contextPath" : "/Books",
|
"entitySet" : "Books",
|
||||||
"navigation" : {
|
"navigation" : {
|
||||||
"Authors" : {
|
"Authors" : {
|
||||||
"detail" : {
|
"detail" : {
|
||||||
@@ -123,7 +123,7 @@
|
|||||||
"name": "sap.fe.templates.ObjectPage",
|
"name": "sap.fe.templates.ObjectPage",
|
||||||
"options": {
|
"options": {
|
||||||
"settings" : {
|
"settings" : {
|
||||||
"contextPath" : "/Authors"
|
"entitySet" : "Authors"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -142,4 +142,4 @@
|
|||||||
"registrationIds": [],
|
"registrationIds": [],
|
||||||
"archeType": "transactional"
|
"archeType": "transactional"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -99,7 +99,7 @@
|
|||||||
"name": "sap.fe.templates.ListReport",
|
"name": "sap.fe.templates.ListReport",
|
||||||
"options": {
|
"options": {
|
||||||
"settings": {
|
"settings": {
|
||||||
"contextPath": "/Books",
|
"entitySet": "Books",
|
||||||
"initialLoad": true,
|
"initialLoad": true,
|
||||||
"navigation": {
|
"navigation": {
|
||||||
"Books": {
|
"Books": {
|
||||||
@@ -117,7 +117,7 @@
|
|||||||
"name": "sap.fe.templates.ObjectPage",
|
"name": "sap.fe.templates.ObjectPage",
|
||||||
"options": {
|
"options": {
|
||||||
"settings": {
|
"settings": {
|
||||||
"contextPath": "/Books"
|
"entitySet": "Books"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -79,8 +79,6 @@ aspect Hierarchy {
|
|||||||
LimitedDescendantCount : Integer64 = null;
|
LimitedDescendantCount : Integer64 = null;
|
||||||
DistanceFromRoot : Integer64 = null;
|
DistanceFromRoot : Integer64 = null;
|
||||||
DrillState : String = null;
|
DrillState : String = null;
|
||||||
Matched : Boolean = null;
|
|
||||||
MatchedDescendantCount : Integer64 = null;
|
|
||||||
LimitedRank : Integer64 = null;
|
LimitedRank : Integer64 = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -88,8 +86,6 @@ annotate Hierarchy with @Capabilities.FilterRestrictions.NonFilterableProperties
|
|||||||
'LimitedDescendantCount',
|
'LimitedDescendantCount',
|
||||||
'DistanceFromRoot',
|
'DistanceFromRoot',
|
||||||
'DrillState',
|
'DrillState',
|
||||||
'Matched',
|
|
||||||
'MatchedDescendantCount',
|
|
||||||
'LimitedRank'
|
'LimitedRank'
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -97,8 +93,6 @@ annotate Hierarchy with @Capabilities.SortRestrictions.NonSortableProperties: [
|
|||||||
'LimitedDescendantCount',
|
'LimitedDescendantCount',
|
||||||
'DistanceFromRoot',
|
'DistanceFromRoot',
|
||||||
'DrillState',
|
'DrillState',
|
||||||
'Matched',
|
|
||||||
'MatchedDescendantCount',
|
|
||||||
'LimitedRank'
|
'LimitedRank'
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -121,8 +115,6 @@ annotate my.Genres with @Hierarchy.RecursiveHierarchy #GenreHierarchy: {
|
|||||||
LimitedDescendantCount: LimitedDescendantCount,
|
LimitedDescendantCount: LimitedDescendantCount,
|
||||||
DistanceFromRoot : DistanceFromRoot,
|
DistanceFromRoot : DistanceFromRoot,
|
||||||
DrillState : DrillState,
|
DrillState : DrillState,
|
||||||
Matched : Matched,
|
|
||||||
MatchedDescendantCount: MatchedDescendantCount,
|
|
||||||
LimitedRank : LimitedRank
|
LimitedRank : LimitedRank
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
"express": "^4.17.1"
|
"express": "^4.17.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@cap-js/sqlite": "^1"
|
"@cap-js/sqlite": ">=1"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "cds-serve",
|
"start": "cds-serve",
|
||||||
|
|||||||
@@ -23,8 +23,8 @@
|
|||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script id="sap-ushell-bootstrap" src="https://sapui5.hana.ondemand.com/test-resources/sap/ushell/bootstrap/sandbox.js"></script>
|
<script id="sap-ushell-bootstrap" src="https://ui5.sap.com/test-resources/sap/ushell/bootstrap/sandbox.js"></script>
|
||||||
<script id="sap-ui-bootstrap" src="https://sapui5.hana.ondemand.com/resources/sap-ui-core.js"
|
<script id="sap-ui-bootstrap" src="https://ui5.sap.com/resources/sap-ui-core.js"
|
||||||
data-sap-ui-libs="sap.m, sap.ushell, sap.collaboration, sap.ui.layout"
|
data-sap-ui-libs="sap.m, sap.ushell, sap.collaboration, sap.ui.layout"
|
||||||
data-sap-ui-compatVersion="edge"
|
data-sap-ui-compatVersion="edge"
|
||||||
data-sap-ui-theme="sap_horizon"
|
data-sap-ui-theme="sap_horizon"
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
"name": "@capire/orders",
|
"name": "@capire/orders",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@cap-js/hana": "^1",
|
"@cap-js/hana": ">=1",
|
||||||
"@capire/common": "*",
|
"@capire/common": "*",
|
||||||
"@sap/cds": ">=5",
|
"@sap/cds": ">=5",
|
||||||
"@sap/xssec": "^4"
|
"@sap/xssec": "^4"
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
"index.cds"
|
"index.cds"
|
||||||
],
|
],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@cap-js/hana": "^1",
|
"@cap-js/hana": ">=1",
|
||||||
"@sap/cds": ">=5",
|
"@sap/cds": ">=5",
|
||||||
"@sap/xssec": "^4.2.7",
|
"@sap/xssec": "^4.2.7",
|
||||||
"express": "^4.17.1"
|
"express": "^4.17.1"
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@cap-js/sqlite": "^1"
|
"@cap-js/sqlite": "*"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user