1 min read

Customisations

Add custom data in Cart model

To add custom data to the Cart model you need to:

  1. Receive your custom data in the network model NetworkCart.
  2. Create a new implementation of Mapper<Any, Map<String, Any>>.
  3. Provide your new mapper via Koin using the name cartCustomMapToAnyMapperName.

Add custom data to CartItem Model

To add custom data to the CartItem model you need to:

  1. Receive your custom data in the network model NetworkCartItem.
  2. Create a new implementation of Mapper<Any, Map<String, Any>>.
  3. Provide your new mapper via Koin using the name cartItemCustomMapToAnyMapperName.

Add custom data to Applied Vouchers CartItem Model

To add custom data to the AppliedVoucherCartItem model you need to:

  1. Receive your custom data in the network model NetworkVoucher.
  2. Create a new implementation of Mapper<Any, Map<String, Any>>.
  3. Provide your new mapper via Koin using the name voucherCustomMapToAnyMapperName.

Add custom data to Promotions Model

To add custom data to the Promotion model you need to:

  1. Receive your custom data in the network model NetworkPromotion.
  2. Create a new implementation of Mapper<Any, Map<String, Any>>.
  3. Provide your new mapper via Koin using the name promotionCustomMapToAnyMapperName.

Send Custom Data in NetworkUpdateCartItem model

To send custom data in the NetworkUpdateCartItem model you need to:

  1. Set your extra data to UpdateCartItem.customData.
  2. Create a new implementation of Mapper<Map<String, Any, Any>>.
  3. Provide your new mapper via Koin using the name updateCartItemCustomAnyToMapMapperName.

Send Custom Data in NetworkAddVoucherRequest model

To send custom data in the NetworkAddVoucherRequest model you need to:

  1. Set your extra data to AddVoucherRequest.customData.
  2. Create a new implementation of Mapper<Map<String, Any, Any>>.
  3. Provide your new mapper via Koin using the name addVoucherCustomAnyToMapMapperName.