Skip to content
This repository was archived by the owner on Aug 29, 2025. It is now read-only.

Commit 987611b

Browse files
committed
cosmetics
1 parent ce1da7f commit 987611b

File tree

3 files changed

+37
-45
lines changed

3 files changed

+37
-45
lines changed

common/currencies.cds

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
using { sap } from '@sap/cds/common';
2+
3+
extend sap.common.Currencies with {
4+
// Currencies.code = ISO 4217 alphabetic three-letter code
5+
// with the first two letters being equal to ISO 3166 alphabetic country codes
6+
// See also:
7+
// [1] https://www.iso.org/iso-4217-currency-codes.html
8+
// [2] https://www.currency-iso.org/en/home/tables/table-a1.html
9+
// [3] https://www.ibm.com/support/knowledgecenter/en/SSZLC2_7.0.0/com.ibm.commerce.payments.developer.doc/refs/rpylerl2mst97.htm
10+
numcode : Integer;
11+
exponent : Integer; //> e.g. 2 --> 1 Dollar = 10^2 Cent
12+
minor : String; //> e.g. 'Cent'
13+
}

common/index.cds

Lines changed: 2 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,2 @@
1-
using { sap } from '@sap/cds/common';
2-
3-
extend sap.common.Currencies with {
4-
// Currencies.code = ISO 4217 alphabetic three-letter code
5-
// with the first two letters being equal to ISO 3166 alphabetic country codes
6-
// See also:
7-
// [1] https://www.iso.org/iso-4217-currency-codes.html
8-
// [2] https://www.currency-iso.org/en/home/tables/table-a1.html
9-
// [3] https://www.ibm.com/support/knowledgecenter/en/SSZLC2_7.0.0/com.ibm.commerce.payments.developer.doc/refs/rpylerl2mst97.htm
10-
numcode : Integer;
11-
exponent : Integer; //> e.g. 2 --> 1 Dollar = 10^2 Cent
12-
minor : String; //> e.g. 'Cent'
13-
}
14-
15-
16-
/**
17-
* The Code Lists below are designed as optional extensions to
18-
* the base schema. Switch them on by adding an Association to
19-
* one of the code list entities in your models or by:
20-
* annotate sap.common.Countries with @cds.persistence.skip:false;
21-
*/
22-
23-
context sap.common.countries {
24-
25-
extend sap.common.Countries {
26-
regions : Composition of many Regions on regions._parent = $self.code;
27-
}
28-
29-
entity Regions : sap.common.CodeList {
30-
key code : String(5); // ISO 3166-2 alpha5 codes, e.g. DE-BW
31-
children : Composition of many Regions on children._parent = $self.code;
32-
cities : Composition of many Cities on cities.region = $self;
33-
_parent : String(11);
34-
}
35-
entity Cities : sap.common.CodeList {
36-
key code : String(11);
37-
region : Association to Regions;
38-
districts : Composition of many Districts on districts.city = $self;
39-
}
40-
entity Districts : sap.common.CodeList {
41-
key code : String(11);
42-
city : Association to Cities;
43-
}
44-
45-
}
1+
using from './currencies';
2+
using from './regions';

common/regions.cds

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
using { sap.common } from '@sap/cds/common';
2+
namespace sap.common.countries;
3+
4+
extend common.Countries {
5+
regions : Composition of many Regions on regions._parent = $self.code;
6+
}
7+
8+
entity Regions : common.CodeList {
9+
key code : String(5); // ISO 3166-2 alpha5 codes, e.g. DE-BW
10+
children : Composition of many Regions on children._parent = $self.code;
11+
cities : Composition of many Cities on cities.region = $self;
12+
_parent : String(11);
13+
}
14+
entity Cities : common.CodeList {
15+
key code : String(11);
16+
region : Association to Regions;
17+
districts : Composition of many Districts on districts.city = $self;
18+
}
19+
entity Districts : common.CodeList {
20+
key code : String(11);
21+
city : Association to Cities;
22+
}

0 commit comments

Comments
 (0)