validate method

  1. @override
void validate()
override

Метод проверяет валидность данных

Implementation

@override
void validate() {
  final String? _operationName = operationName;
  if (agentSign == AgentSign.bankPayingAgent ||
      agentSign == AgentSign.bankPayingSubagent) {
    assert(_operationName != null && _operationName.length <= 64);
  }

  final List<String>? _phones = phones;
  if (agentSign == AgentSign.bankPayingAgent ||
      agentSign == AgentSign.bankPayingSubagent ||
      agentSign == AgentSign.payingAgent ||
      agentSign == AgentSign.payingSubagent) {
    assert(_phones != null && _phones.isNotEmpty && _phones.length <= 19);
  }

  final List<String>? _receiverPhones = receiverPhones;
  if (agentSign == AgentSign.payingAgent ||
      agentSign == AgentSign.payingSubagent) {
    assert(_receiverPhones != null &&
        _receiverPhones.isNotEmpty &&
        _receiverPhones.length <= 19);
  }

  final List<String>? _transferPhones = transferPhones;
  if (agentSign == AgentSign.bankPayingAgent ||
      agentSign == AgentSign.bankPayingSubagent) {
    assert(_transferPhones != null &&
        _transferPhones.isNotEmpty &&
        _transferPhones.length <= 19);
  }

  final String? _operatorName = operatorName;
  if (agentSign == AgentSign.bankPayingAgent ||
      agentSign == AgentSign.bankPayingSubagent) {
    assert(_operatorName != null && _operatorName.length <= 64);
  }

  final String? _operatorAddress = operatorAddress;
  if (agentSign == AgentSign.bankPayingAgent ||
      agentSign == AgentSign.bankPayingSubagent) {
    assert(_operatorAddress != null && _operatorAddress.length <= 243);
  }

  final String? _operatorInn = operatorInn;
  if (agentSign == AgentSign.bankPayingAgent ||
      agentSign == AgentSign.bankPayingSubagent) {
    assert(_operatorInn != null &&
        _operatorInn.length >= 10 &&
        _operatorInn.length <= 12);
  }
}