Package ru.bitel.bgbilling.modules.megafon.server.utils

# Class MegafonUtils

java.lang.Object
ru.bitel.bgbilling.modules.megafon.server.utils.MegafonUtils

public class MegafonUtils extends Object

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `MegafonUtils()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static void`
  `addPaymentForActivateOption(int moduleId, ru.bitel.bgbilling.modules.megafon.server.api.MegafonApiClient apiClient, MegafonOption option, MegafonContractProduct contractProduct)`
  `static void`
  `addPaymentForActivateOption(ru.bitel.bgbilling.kernel.container.managed.ServerContext context, ru.bitel.bgbilling.modules.megafon.server.api.MegafonApiClient apiClient, MegafonOption option, MegafonContractProduct contractProduct)`
  `static void`
  `addPaymentForActivateProduct(int moduleId, ru.bitel.bgbilling.modules.megafon.server.api.MegafonApiClient megafonClient, MegafonProduct product, MegafonContractProduct contractProduct)`
  `static void`
  `addPaymentForActivateProduct(ru.bitel.bgbilling.kernel.container.managed.ServerContext context, ru.bitel.bgbilling.modules.megafon.server.api.MegafonApiClient megafonClient, MegafonProduct product, MegafonContractProduct contractProduct)`
  `static boolean`
  `allowBalance(Connection connection, BigDecimal price, int contractId)`
  `static void`
  `contractAddCharge(ru.bitel.bgbilling.kernel.container.managed.ServerContext context, ModuleSetup moduleSetup, int contractId, BigDecimal summa, String msg)`
  `static String`
  `defineCorrectMSISDN(MegafonContractProduct contractProduct)`
  `static BigDecimal`
  `defineCorrectProductPrice(int moduleId, BigDecimal productPrice)`
  `static BigDecimal`
  `getCurrentBalanceForMSISDN(ru.bitel.bgbilling.modules.megafon.server.api.MegafonApiClient megafonClient, String msisdn)`
  `static int`
  `getNpayMidOrThrow(ModuleSetup moduleSetup)`
  `static void`
  `npayServiceAdd(ModuleSetup moduleSetup, ru.bitel.bgbilling.kernel.container.managed.ServerContext context, int npayServiceId, IdTitle productOrOption, MegafonContractProduct megafonContractProduct)`
  Добавление указанной в продукте или в опции услуги модуля NPay на договор
  `static void`
  `npayServiceAdd(ModuleSetup moduleSetup, ru.bitel.bgbilling.kernel.container.managed.ServerContext context, int npayServiceId, IdTitle productOrOption, MegafonContractProduct megafonContractProduct, int npayServiceEntityId)`
  Добавление указанной в продукте или в опции услуги модуля NPay на договор
  `static void`
  `removeNpayService(ModuleSetup moduleSetup, ru.bitel.bgbilling.kernel.container.managed.ServerContext context, int npayServiceId, MegafonContractProduct megafonContractProduct, int npayServiceEntityId)`
  Закрытие услуги NPay на договоре при деактивации продукта или опции
  `static void`
  `saveContractProductHistoryEntry(Connection connection, int moduleId, MegafonContractProduct contractProduct, MegafonContractProductStatus oldStatus, String reason)`
  `static void`
  `saveContractProductHistoryEntry(Connection connection, int moduleId, MegafonContractProduct contractProduct, MegafonContractProductStatus oldStatus, String reason, int megafonOptionId)`
  `static void`
  `sendAlarm(String header, String msg)`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### MegafonUtils

    public MegafonUtils()

- ## Method Details

  - ### addPaymentForActivateOption

    public static void addPaymentForActivateOption(ru.bitel.bgbilling.kernel.container.managed.ServerContext context, ru.bitel.bgbilling.modules.megafon.server.api.MegafonApiClient apiClient, MegafonOption option, MegafonContractProduct contractProduct)

  - ### addPaymentForActivateOption

    public static void addPaymentForActivateOption(int moduleId, ru.bitel.bgbilling.modules.megafon.server.api.MegafonApiClient apiClient, MegafonOption option, MegafonContractProduct contractProduct)

  - ### addPaymentForActivateProduct

    public static void addPaymentForActivateProduct(ru.bitel.bgbilling.kernel.container.managed.ServerContext context, ru.bitel.bgbilling.modules.megafon.server.api.MegafonApiClient megafonClient, MegafonProduct product, MegafonContractProduct contractProduct)

  - ### addPaymentForActivateProduct

    public static void addPaymentForActivateProduct(int moduleId, ru.bitel.bgbilling.modules.megafon.server.api.MegafonApiClient megafonClient, MegafonProduct product, MegafonContractProduct contractProduct)

  - ### getCurrentBalanceForMSISDN

    public static BigDecimal getCurrentBalanceForMSISDN(ru.bitel.bgbilling.modules.megafon.server.api.MegafonApiClient megafonClient, String msisdn)

  - ### defineCorrectMSISDN

    public static String defineCorrectMSISDN(MegafonContractProduct contractProduct)

  - ### defineCorrectProductPrice

    public static BigDecimal defineCorrectProductPrice(int moduleId, BigDecimal productPrice)

  - ### sendAlarm

    public static void sendAlarm(String header, String msg)

  - ### npayServiceAdd

    public static void npayServiceAdd(ModuleSetup moduleSetup, ru.bitel.bgbilling.kernel.container.managed.ServerContext context, int npayServiceId, IdTitle productOrOption, MegafonContractProduct megafonContractProduct, int npayServiceEntityId) throws Exception
    Добавление указанной в продукте или в опции услуги модуля NPay на договор
    Throws:
      `Exception`

  - ### npayServiceAdd

    public static void npayServiceAdd(ModuleSetup moduleSetup, ru.bitel.bgbilling.kernel.container.managed.ServerContext context, int npayServiceId, IdTitle productOrOption, MegafonContractProduct megafonContractProduct) throws Exception
    Добавление указанной в продукте или в опции услуги модуля NPay на договор
    Throws:
      `Exception`

  - ### removeNpayService

    public static void removeNpayService(ModuleSetup moduleSetup, ru.bitel.bgbilling.kernel.container.managed.ServerContext context, int npayServiceId, MegafonContractProduct megafonContractProduct, int npayServiceEntityId) throws Exception
    Закрытие услуги NPay на договоре при деактивации продукта или опции
    Parameters:
      `npayServiceEntityId` - ID сущности к которой привязана абонплата на договоре (ID продукта или опции)
    Throws:
      `Exception`

  - ### getNpayMidOrThrow

    public static int getNpayMidOrThrow(ModuleSetup moduleSetup) throws ru.bitel.bgbilling.common.BGException
    Throws:
      `ru.bitel.bgbilling.common.BGException`

  - ### contractAddCharge

    public static void contractAddCharge(ru.bitel.bgbilling.kernel.container.managed.ServerContext context, ModuleSetup moduleSetup, int contractId, BigDecimal summa, String msg)

  - ### saveContractProductHistoryEntry

    public static void saveContractProductHistoryEntry(Connection connection, int moduleId, MegafonContractProduct contractProduct, MegafonContractProductStatus oldStatus, String reason)

  - ### saveContractProductHistoryEntry

    public static void saveContractProductHistoryEntry(Connection connection, int moduleId, MegafonContractProduct contractProduct, MegafonContractProductStatus oldStatus, String reason, int megafonOptionId)

  - ### allowBalance

    public static boolean allowBalance(Connection connection, BigDecimal price, int contractId)