Commit 4feca6c7 authored by Karel Slaný's avatar Karel Slaný Committed by Martin Straka

Added GovService::canSend() pure virtual method.

parent 540b1d44
......@@ -103,6 +103,12 @@ const QString &GovMvCrrVbh::dmFileDescr(void) const
return dmFileDescr;
}
bool GovMvCrrVbh::canSend(enum Isds::Type::DbType dbType) const
{
/* TODO -- Check all required types. */
return (dbType == Isds::Type::BT_FO);
}
#define DRILIC_KEY "drivingLicenceId"
QList<RequiredInput> GovMvCrrVbh::requiredFields(void) const
......@@ -133,7 +139,7 @@ bool GovMvCrrVbh::setRequiredField(const QString &key, const QString &val)
return true;
}
bool GovMvCrrVbh::haveAllRequiredFields(void) const
bool GovMvCrrVbh::haveAllMandatoryFields(void) const
{
return !m_drivingLicenceId.isEmpty();
}
......
......@@ -65,6 +65,9 @@ public:
virtual
const QString &dmFileDescr(void) const Q_DECL_OVERRIDE;
virtual
bool canSend(enum Isds::Type::DbType dbType) const Q_DECL_OVERRIDE;
virtual
QList<RequiredInput> requiredFields(void) const Q_DECL_OVERRIDE;
......@@ -72,7 +75,7 @@ public:
bool setRequiredField(const QString &key, const QString &val) Q_DECL_OVERRIDE;
virtual
bool haveAllRequiredFields(void) const Q_DECL_OVERRIDE;
bool haveAllMandatoryFields(void) const Q_DECL_OVERRIDE;
virtual
QByteArray binaryXmlContent(
......
......@@ -27,8 +27,9 @@
#include <QList>
#include <QString>
#include "src/datovka_shared/isds/message_interface.h"
#include "src/datovka_shared/isds/box_interface.h"
#include "src/datovka_shared/isds/message_interface.h"
#include "src/datovka_shared/isds/types.h"
/* Správa základních registrů */
#define GOV_SZR_FULL_NAME "Automat ZR (Správa základních registrů)"
......@@ -38,10 +39,6 @@
#define GOV_MV_FULL_NAME "Automat CzP (Ministerstvo vnitra)"
#define GOV_MV_DB_ID "xhzkdqv"
#define GOV_MV_XML_FILE_NAME "czpathome.xml"
/* Required XML external information */
#define GOV_SRV_XML_ICO "ic"
#define GOV_SRV_XML_DATE "date"
#define GOV_SRV_XML_RPID "rpid"
/*!
* @brief Describes a form field.
......@@ -126,6 +123,12 @@ public:
virtual
const QString &dmFileDescr(void) const = 0;
/*!
* @brief Check whether a box of the given type ran send this request.
*/
virtual
bool canSend(enum Isds::Type::DbType dbType) const = 0;
/*!
* @brief Return gov service additional information.
*
......@@ -144,8 +147,13 @@ public:
virtual
bool setRequiredField(const QString &key, const QString &val) = 0;
/*!
* @brief Check whether all mandatory data are set.
*
* @return True if all mandatory fields are set.
*/
virtual
bool haveAllRequiredFields(void) const = 0;
bool haveAllMandatoryFields(void) const = 0;
/*!
* @brief Create GOV ISDS message.
......
......@@ -214,8 +214,8 @@ bool Gov::sendGovRequest(const QString &userName,
ri.key.toUtf8().constData());
}
}
if (!govService->haveAllRequiredFields()) {
logErrorNL("The gov service '%s' is missing some required data.",
if (!govService->haveAllMandatoryFields()) {
logErrorNL("The gov service '%s' is missing some mandatory data.",
govService->internalId().toUtf8().constData());
return false;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment