| import ns ${{BASIC_PROJECT_NAME}}.model.entities.Currency |
| import ns ${{BASIC_PROJECT_NAME}}.model.entities.CurrencyDay |
| import ns ${{BASIC_PROJECT_NAME}}.model.entities.CurrencyNames |
| import ns ${{BASIC_PROJECT_NAME}}.model.entities.CurrencyNamesStream |
| import ns ${{BASIC_PROJECT_NAME}}.model.entities.CurrencyStream |
| import ns ${{BASIC_PROJECT_NAME}}.model.entities.Customer |
| import ns ${{BASIC_PROJECT_NAME}}.model.entities.Department |
| import ns ${{BASIC_PROJECT_NAME}}.model.entities.EDIOrderCustomer |
| import ns ${{BASIC_PROJECT_NAME}}.model.entities.EDIOrderHeader |
| import ns ${{BASIC_PROJECT_NAME}}.model.entities.EDIOrderItem |
| import ns ${{BASIC_PROJECT_NAME}}.model.entities.EDIOrders |
| import ns ${{BASIC_PROJECT_NAME}}.model.entities.Employee |
| import ns ${{BASIC_PROJECT_NAME}}.model.entities.Position |
| import ns ${{BASIC_PROJECT_NAME}}.model.entities.Product |
| import ns ${{BASIC_PROJECT_NAME}}.model.entities.ProductClass |
| import ns ${{BASIC_PROJECT_NAME}}.model.entities.Promotion |
| import ns ${{BASIC_PROJECT_NAME}}.model.entities.Region |
| import ns ${{BASIC_PROJECT_NAME}}.model.entities.Store |
| import ns ${{BASIC_PROJECT_NAME}}.model.entities.Supplier |
| import ns ${{BASIC_PROJECT_NAME}}.model.entities.Warehouse |
| import ns ${{BASIC_PROJECT_NAME}}.model.entities.WarehouseClass |
| |
| package ${{MODEL_PROJECT_PACKAGE_NAME}} { |
| |
| |
| group DataInterchange { |
| |
| interchange CurrencyNames persist file CSV "src/smooksresources/ISOCurrencyCodes081507.csv" delimiter ";" skipLines 1 path { |
| entity CurrencyNamesStream latestImport latest expression { |
| assign importDate with NowDate as Date |
| } |
| entity CurrencyNames mapping { |
| map isoCode to "Code" map name to "Currency" map countries to "Locations" |
| } |
| } |
| |
| interchange CurrencyRates describedBy "european central bank currency exchange rates based on euro" persist elementSize 50 file |
| //XML "https://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml" |
| XML "src/smooksresources/eurofxref-hist-90d.xml" |
| mapByAttribute path { |
| entity CurrencyStream createOn "/Envelope/Cube" latestImport latest expression { |
| assign importDate with NowDate as Date |
| } |
| entity CurrencyDay createOn "/Envelope/Cube/Cube" format { |
| for ratingDate coding "yyyy-MM-dd" |
| } |
| mapping { |
| map ratingDate to "time" |
| } |
| entity Currency createOn "/Envelope/Cube/Cube/Cube" expression { |
| copy currencyDate from CurrencyDay property ratingDate |
| } |
| lookup { |
| for currencyName in CurrencyNames createOn "/Envelope/Cube/Cube/Cube" mapFrom "currency" allowNoResult markerPath { |
| markerEntity CurrencyNamesStream markedBy latest |
| } |
| mapTo isoCode cacheSize 300 |
| } |
| mapping { |
| map conversionRatio to "rate" |
| } |
| } |
| |
| interchange EDIOrders describedBy "edi orders" persist elementSize 50 file |
| EDI "src/smooksresources/orders.edi" locale "en-US" mappingModel "src/smooksmappings/edi-order-mapping.xml" validate |
| path { |
| entity EDIOrders createOn "Order" latestImport latest expression { |
| assign importDate with NowDate as Date |
| } |
| entity EDIOrderHeader createOn "/Order/header" format { |
| for hdrDate coding "EEE MMM dd HH:mm:ss zzz yyyy" |
| } |
| mapping { |
| map orderId to "order-id" |
| map statusCode to "status-code" |
| map netAmount to "net-amount" |
| map totalAmount to "total-amount" |
| map taxAmount to "tax" |
| map hdrDate to "date" |
| } |
| entity EDIOrderCustomer createOn "/Order/customer-details" mapping { |
| map country to "state" |
| map firstName to "name/firstName" |
| map lastName to "name/lastName" |
| map userName to "userName" |
| } |
| entity EDIOrderItem createOn "/Order/order-item" mapping { |
| map position to "position" |
| map quantity to "quantity" |
| map sku to "product-id" |
| map ^title to "title" |
| map price to "price" |
| } |
| } |
| |
| interchange Stores merge elementSize 83 file |
| XML "src/smooksresources/stores.xml" locale "de_DE" |
| path { |
| entity Region keys { |
| key salesCountry |
| key salesRegion |
| key salesCity |
| } |
| entity Store referencedBy stores format { |
| for firstOpenedDate coding "dd.MM.yyyy" |
| for lastRemodelDate coding "dd.MM.yyyy" |
| for frozenSqft coding "####,#####################" |
| for meatSqft coding "####,#####################" |
| } |
| keys { |
| key storeNumber |
| } |
| entity Warehouse |
| keys { |
| key warehouseName |
| } |
| } |
| |
| interchange Warehouses merge elementSize 80 file |
| XML "src/smooksresources/warehouses.xml" |
| path { |
| entity WarehouseClass |
| entity Warehouse |
| } |
| |
| interchange Products merge elementSize 80 file |
| XML "src/smooksresources/products.xml"locale "de_DE" |
| path { |
| entity ProductClass |
| entity Product format { |
| for srp coding "####,#####################" |
| for grossWeight coding "####,#####################" |
| for netWeight coding "####,#####################" |
| for shelfWidth coding "####,#####################" |
| for shelfHeight coding "####,#####################" |
| for shelfDepth coding "####,#####################" |
| } |
| } |
| |
| interchange EmployeesDepartment merge elementSize 80 file |
| XML "src/smooksresources/employeesdepartment.xml" |
| path { |
| entity Department |
| } |
| |
| interchange EmployeesPosition merge elementSize 80 file |
| XML "src/smooksresources/employeesposition.xml" locale "de_DE" |
| path { |
| entity Position |
| entity Employee |
| lookup { |
| for department in Department createOn "vector/Position/Employee/Department" |
| mapFrom "departmentDescription" allowNoResult mapTo departmentDescription cacheSize 20 |
| } |
| format { |
| for birthDate coding "dd.MM.yyyy" |
| for hireDate coding "dd.MM.yyyy" |
| for endDate coding "dd.MM.yyyy" |
| } |
| } |
| |
| interchange Customer merge elementSize 80 file |
| XML "src/smooksresources/customer.xml" |
| path { |
| entity Customer format { |
| for birthdate coding "dd.MM.yyyy" |
| for dateAccntOpened coding "yyyy-MM-dd" |
| } |
| } |
| |
| interchange Promotion merge elementSize 80 file |
| XML "src/smooksresources/promotion.xml" locale "de_DE" |
| path { |
| entity Promotion format { |
| for startDate coding "dd.MM.yyyy" |
| for endDate coding "dd.MM.yyyy" |
| for cost coding "####,#####################" |
| } |
| } |
| |
| interchange Suppliers merge elementSize 50 file |
| XML "src/smooksresources/suppliers.xml" |
| path { |
| entity Supplier format { |
| for firstContract coding "yyyy-MM-dd" |
| for lastOrder coding "yyyy-MM-dd" |
| } |
| } |
| } |
| } |