Akinon Release Notes (05/12/2025) are now live! Click here to learn what's new.
LogoLogo
API Reference
  • Home
  • Quick Start
  • Tutorials
  • Technical Guides
  • Release Notes
  • Glossary
  • Welcome to Akinon Technical Guides
  • ACC
    • ACC CLI
    • Create Application via CLI
    • Deploy Environment Variables
    • App Store for Developers
  • Omnitron
    • Product Types
    • Product Categorization
    • Splitting a Merged Order Item
  • Commerce
    • Shipping Rules Calculator
    • Data Source Shipping Options
    • Attribute Based Shipping Options
    • Filtering Products
    • Conversation & Messages
    • Sitemap Configuration
    • Weight-Based Product Sales
    • Group Attribute Sets
    • Contract Management
    • Find in Store for Whippy Ware
    • Plugins
    • Remote Price
    • E-mail Templates
    • Loyalty Accounts
    • Search Structure
    • User Segmentation & Rules
    • Promotions
  • OMS
    • Getting Started with OMS
    • Basic Setup
    • Scenarios
    • Capacity Feature
    • Package Management
      • Packages
      • Transfer
      • States
    • Commands
      • Packages
        • Package Command Parameters
        • DeAllocate Package Reservations Command
        • Channel Based Complete Packaging without Shipment Command
        • Complete Packaging with Shipment Command
        • Complete Packaging without Shipment Command
        • Package Refuse with Denial Reason Command
        • Product Not Found & Wrong Product Command
        • Product Not Found & Wrong Product Command Advanced
        • Package Packed for Refund Command
        • Block The Package For Action Command
        • Unblock the Package For Action Command
        • Update The Package’s Invoice
        • Manual Planning Command
      • Transfer
        • Transfer Order Advanced Command
        • Product for Transfer Not Found & Wrong Product Command
        • Transfer Delivered Command
        • Transfer Dispatch Command
        • Transfer Ready for Dispatch Command
        • Transfer Out Of Stock
      • Shipment
        • Shipment Order Command
        • Package Advanced Shipment Command
        • Ship The Package Command
        • Ship The Package without Shipment Integration Command
        • Update The Package’s Shipment Status Command
        • Update Shipment Info of Package Command
    • Inventory Locations & Engine
      • Properties & Domain Relation
      • Customization
      • Inventory Engine
    • Fulfillment
      • Shipments
      • Invoice Integration
    • Webhooks
      • Webhook Examples
        • Order Webhook
        • Package Webhook
        • Shipment Webhook
        • Stock Location Webhook
        • Transfer Webhook
    • Integrating OMS with Seller Center
  • Instore
    • Getting Started
    • Cash Register Integration
    • OTP (One Time Password) Process
    • Services
      • Password Reset Services
  • Marketplace Dashboard
    • N11 Marketplace Setup Configurations
    • Trendyol Marketplace Setup Configurations
    • Walmart Marketplace Setup Configurations
    • Amazon Marketplace Setup Configurations
    • Hepsiburada Marketplace Setup Configurations
  • Project Zero
    • Django
      • Basic Setup
      • Project Structure
        • Templates & Components
        • Private Dependencies
        • Omnife Project Submodule
        • Webpack
        • ESLint Rules
        • Bundles
        • Multilanguage & Translation
        • Environmental File
        • Custom Error Pages
        • Icon Font
      • Page Types
        • Static Pages & Flatpages
        • Account Page
          • Template Rendering in Account Pages
          • Forms & Validation
        • Basket Page
          • Redux Basket State
          • Basket Page - View
        • Checkout
          • Redux Checkout State
          • View & Template Rendering
          • Masking & Validation
      • Theming & Styling
      • Widgets
      • SEO Management
      • Extending Project Zero
    • Next.js
      • Basic Setup
      • Deployment
      • Static Assets
      • Plugins
      • Widgets
      • Icons
      • Localization
      • SEO Management
      • Advanced Usage
      • Data Fetching
        • Client
          • Account
          • Address
          • Basket
          • Checkout
          • Misc
          • Product
          • User
          • Wishlist
        • Server
          • Category
          • Flat Page
          • List
          • Menu
          • Product
          • SEO
          • Special Page
          • Widget
  • App Maker
    • Setup Your Environment
    • Plugin Quickstart
    • Create Project
    • Setup Existing Project
    • Deploy Project
    • Users and Roles
    • Add Public Key
    • App Maker CLI
    • Create App on Stores
      • Creating App on Apple App Store
      • Creating App on Google Play Store
    • Mobile App Framework
      • Configuration
      • Framework
      • Project Structure
        • Structure
        • Data Containers
        • Pages
      • Dependency Integration
        • Plugins
        • Akinon Plugin Adapter
  • Akifast
    • HPP
      • Getting Started
      • Authorization
      • Payment Session Creation
        • Key Points Before Creating a Payment Session
        • Creating Payment Session
        • Redirecting to the Payment Page
        • Errors Encountered During Payment Session Creation
      • Merchant Services
        • Shipping Query URL
        • Agreement Query URL
        • Other URLs
  • B2B
    • Getting Started
    • B2B Setup
  • Adds-on
    • Invoicer
      • Introduction
      • Invoice & Pay On Delivery Service
  • Channel App Template
    • Introduction
    • Installation and Usage
    • Development Steps
      • Folder Structure
      • Starting Step
      • Encoding the Sales Channel
        • Introduction
        • Setup
        • Products
        • Product Price
        • Product Stock
        • Product Image
        • Orders
        • Product Data
      • Adding a New Command to Akinon
      • Listening for External Requests
    • Architecture
      • Introduction
      • Integration
      • Services (Flows)
        • Introduction
        • Product Service
        • Price Service
        • Stock Service
        • Image Service
        • Order Service
  • Multi Regional Settings
    • Multi Regional Settings
Powered by GitBook

© 2025 Akinon. All rights reserved.

On this page
  • Introduction
  • Concept Definitions
  • Create New Container
  • Extend Framework Container

Was this helpful?

  1. App Maker
  2. Mobile App Framework
  3. Project Structure

Data Containers

Introduction

This layer carries out the state management, API call, and API response mapping processes for the application. For state management, Redux is used with thunk middleware. The data containers exported in the dataContainers/index.js path are sent to the createApp function as a parameter with the dataContainers key. The Redux store is created with the dataContainers sent with the createApp function parameter.

Concept Definitions

Actions

Redux actions are defined. A new class is created in the base action class and exported. Click for the base actions list.

Example

import { BasketActions } from '_dataContainers/baseContainers/basket';

class Action extends BasketActions {}

export default Action;

Constants

Redux action types are defined. A new instance is created in the base action class and exported. Click for the base constants list.

Example

import { BasketConstants } from '_dataContainers/baseContainers/basket';

class Constants extends BasketConstants {}

export default new Constants();

Model - Mappers

API responses are mapped based on integration maps configs. Base model is imported, and a new class is created with base maps and exported.

Click for the base models list.

Example

import { BasketModel } from '_dataContainers/baseContainers/basket';

const { BasketMappers } = BasketModel;

class Basket extends BasketMappers {}

export default Basket;

Model Binders

The action types in the redux are mapped with the functions in model-mappers, and the action’s payload is sent to the mapper function as a parameter. A new instance is created in the base model binders class and exported.

Click for the base model binders list.

Example

import { BasketModelBinders } from '_dataContainers/baseContainers/basket';

class ModelBinders extends BasketModelBinders {}

export default new ModelBinders();

Reducer

Redux reducers are defined.

A new instance is created in the base reducer class. The new instance is exported from the framework with the convertReducer utils.

Click for the base reducers list.

Example

import { BasketReducer } from '_dataContainers/baseContainers/basket';
import { convertReducer } from '_utils/dataContainer';

class Reducer extends BasketReducer {}

export default convertReducer(new Reducer());

Create New Container

Below is an example where data containers are created for the search feature.

The following folder structure is created in the dataContainers path for the custom container.

constants/index.js Redux action types are exported.

actions/index.js Redux actions are defined for the API call.

modelBinders/index.js Redux action types are mapped with the model mapper functions. If the defined action type is dispatched, the action payload is sent to the function as a parameter.

import constants from '../constants';

const { FETCH_SEARCH_FULFILLED_CUSTOM } = constants;

class ModelBinders {
 defaultBinders = {
   [FETCH_SEARCH_FULFILLED_CUSTOM]: 'searchMapper',
 };
}

export default new ModelBinders();

model/index.js The class instance or object including the functions defined in modal binders must be exported. The data retrieved from the action payload is sent to the function as a parameter. The API response is standardized with integration maps configs, and modeled data is sent to reducer with the data key.

reducer/index.js A class is created for the redux reducer, and this class must have a function named handleAction. Modeled action is sent to the handleAction function as a parameter. The created class instance is exported with the convertReducer function.

index.js The data container must be initialized and exported from the BaseContainer class with the keys seen below.

import BaseContainer from '@core/dataContainers/baseContainer';

import actions from './actions';
import model from './model';
import reducer from './reducer';
import constants from './constants';
import modelBinders from './modelBinders';

const basketContainer = new BaseContainer({
 reducer,
 model,
 actions,
 constants,
 modelBinders,
})

export default basketContainer;

Extend Framework Container

Base containers may not always fulfill requirements, and they can be expanded based on needs.

Exemplary Scenario:

The order cancel action within the application does not fulfill the needs of the customer. Order ID should be sent at the end of the URL instead of within the request body.

It’s possible to make the necessary changes to meet the customer’s needs by overriding the postCancelForm function in the OrderActions class.

// dataContainers/orders/actions/index.js

import { OrdersActions } from '_dataContainers/baseContainers/orders';
import { platformConfigs } from '_dependencies';
import { request } from '_core/request';
import { textGenerator } from '_utils/string';

const {
 integrationMaps: { urls: $urls },
} = platformConfigs;

class Action extends OrdersActions {
 postCancelForm = (orderItems, orderNumber, orderId) => (dispatch) => {
   dispatch(this.pending());
   request({
     method: 'post',
     url: textGenerator($urls.CANCELLATION_REQUEST, { orderNumber }),
     data: {
       cancel_order_items: orderItems.map((item) => ({
         order_item: item.id,
         reason: item.reason.id,
         cancellation_type: item.reason.type,
         description: item.reason.label || '',
       })),
     },
     headers: {
       'x-requested-with': 'XMLHttpRequest',
       'referer': `${$urls.BASE_URL}${$urls.ORDERS}`,
     },
   })
     .then(() => {
       dispatch(this.fetchOrderDetail(orderId));
       dispatch(this.orderItemCancellationRequest(orderItems));
     })
     .catch((error) => {
       dispatch(this.cancelRejected({ apiError: error }));
     });
 };
}
export default Action;

Here’s how to update the constants class created to add a new constant:

/ dataContainers/search/constants/index.js

import { SearchConstants } from '_dataContainers/baseContainers/search';

class Constants extends SearchConstants {
 constructor() {
   super();
   this.NEW_CONSTANT = 'NEW_CONSTANT'
 }
}
export default new Constants();
PreviousStructureNextPages

Was this helpful?