blob: 97346b9e989b41ccc38f1cc89bea0a53ac6c864d [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<entitymodel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/entitymodel.xsd">
<!-- ========================================================= -->
<!-- ======================== Defaults ======================= -->
<!-- ========================================================= -->
<title>OLAP entities for the Order component</title>
<description>None</description>
<!-- ========================================================= -->
<!-- Facts -->
<!-- ========================================================= -->
<entity entity-name="SalesOrderItemFact" package-name="org.ofbiz.bi.fact.order" title="Sales Order Item Fact">
<description>A transaction fact entity with order item grain.</description>
<field name="orderId" type="id-ne"></field> <!-- degenerate dimension -->
<field name="orderItemSeqId" type="id-ne"></field> <!-- degenerate dimension -->
<field name="orderDateDimId" type="id-ne"></field>
<field name="productDimId" type="id-ne"></field>
<field name="origCurrencyDimId" type="id-ne"></field>
<field name="billToCustomerDimId" type="id-ne"></field> <!-- TODO: implement the dimension -->
<field name="productCategoryId" type="id-ne"></field>
<field name="productStoreId" type="id-ne"></field>
<field name="salesChannelEnumId" type="id-ne"></field>
<field name="statusId" type="id-ne"></field>
<field name="brand" type="name"></field>
<field name="pod" type="name"></field>
<field name="account" type="name"></field>
<field name="quantity" type="fixed-point">
<description>Quantity order. From OrderItem.quantity</description>
</field>
<field name="extGrossAmount" type="currency-precise">
<description>Extended gross amount: quantity item multiplied by the unit price.</description>
</field>
<field name="extGrossCost" type="currency-precise">
<description>Extended gross cost: quantity item multiplied by the last price.</description>
</field>
<field name="extDiscountAmount" type="currency-precise">
<description>Extended discount amount.</description>
</field>
<field name="extNetAmount" type="currency-precise">
<description>Extended net amount: gross amount less discounts.</description>
</field>
<field name="extShippingAmount" type="currency-precise">
<description>Extended shipping amount.</description>
</field>
<field name="extTaxAmount" type="currency-precise">
<description>Extended tax amount.</description>
</field>
<field name="GS" type="currency-precise">
<description>Gross Sales: Gross Amount plus Shipping Amount.</description>
</field>
<field name="GMS" type="currency-precise">
<description>Gross Merchandize Sales: Gross Amount.</description>
</field>
<field name="GMP" type="currency-precise">
<description>Gross Merchandize Profit: Gross Merchandize Sales less Gross Cost.</description>
</field>
<field name="GSS" type="currency-precise">
<description>Gross Shipping Sales: Shipping Amount</description>
</field>
<field name="GSC" type="currency-precise">
<description>Gross Shipping Cost</description>
</field>
<field name="GSP" type="currency-precise">
<description>Gross Shipping Profit: Gross Shipping Sales less Gross Shipping Cost.</description>
</field>
<field name="GP" type="currency-precise">
<description>Gross Profit: Gross Merchandize Profit less Gross Shipping Profit.</description>
</field>
<field name="countOrder" type="fixed-point">
<description>Count of order.</description>
</field>
<prim-key field="orderId"/>
<prim-key field="orderItemSeqId"/>
<relation type="one" fk-name="SOIF_ORDERDATE" rel-entity-name="DateDimension">
<key-map field-name="orderDateDimId" rel-field-name="dimensionId"/>
</relation>
<relation type="one" fk-name="SOIF_CURRENCY" rel-entity-name="CurrencyDimension">
<key-map field-name="origCurrencyDimId" rel-field-name="dimensionId"/>
</relation>
<relation type="one" fk-name="SOIF_PRODUCT" rel-entity-name="ProductDimension">
<key-map field-name="productDimId" rel-field-name="dimensionId"/>
</relation>
</entity>
<!-- ========================================================= -->
<!-- Star Schemas -->
<!-- ========================================================= -->
<view-entity entity-name="SalesOrderItemStarSchema" package-name="org.ofbiz.bi.starschema.order" title="Sales Order Item Star Schema">
<description>Order Item star schema (Profit and Loss Statement).</description>
<member-entity entity-alias="SOIF" entity-name="SalesOrderItemFact"/>
<member-entity entity-alias="ODD" entity-name="DateDimension"/>
<member-entity entity-alias="PD" entity-name="ProductDimension"/>
<member-entity entity-alias="CD" entity-name="CurrencyDimension"/>
<alias-all entity-alias="ODD" prefix="orderDate" group-by="true">
<exclude field="dimensionId"/>
</alias-all>
<alias-all entity-alias="PD" prefix="product" group-by="true">
<exclude field="dimensionId"/>
</alias-all>
<alias-all entity-alias="CD" prefix="currency" group-by="true">
<exclude field="dimensionId"/>
</alias-all>
<alias-all entity-alias="SOIF" function="sum">
<exclude field="orderId"/>
<exclude field="orderItemSeqId"/>
<exclude field="orderDateDimId"/>
<exclude field="productDimId"/>
<exclude field="origCurrencyDimId"/>
<exclude field="billToCustomerDimId"/>
<exclude field="productCategoryId"/>
<exclude field="productStoreId"/>
<exclude field="salesChannelEnumId"/>
<exclude field="statusId"/>
<exclude field="brand"/>
<exclude field="pod"/>
<exclude field="account"/>
</alias-all>
<alias entity-alias="SOIF" name="orderId" group-by="true">
<description>Order id</description>
</alias>
<alias entity-alias="SOIF" name="orderItemSeqId" group-by="true"/>
<alias entity-alias="SOIF" name="productCategoryId" group-by="true"/>
<alias entity-alias="SOIF" name="productStoreId" group-by="true"/>
<alias entity-alias="SOIF" name="salesChannelEnumId" group-by="true"/>
<alias entity-alias="SOIF" name="statusId" group-by="true"/>
<alias entity-alias="SOIF" name="brand" group-by="true"/>
<alias entity-alias="SOIF" name="pod" group-by="true"/>
<alias entity-alias="SOIF" name="account" group-by="true"/>
<view-link entity-alias="SOIF" rel-entity-alias="ODD">
<key-map field-name="orderDateDimId" rel-field-name="dimensionId"/>
</view-link>
<view-link entity-alias="SOIF" rel-entity-alias="PD">
<key-map field-name="productDimId" rel-field-name="dimensionId"/>
</view-link>
<view-link entity-alias="SOIF" rel-entity-alias="CD">
<key-map field-name="origCurrencyDimId" rel-field-name="dimensionId"/>
</view-link>
</view-entity>
</entitymodel>