|
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'; |
0 commit comments