- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
#include "document_validator_factory.h"
std::unique_ptr<ortax::DocumentValidator>
ortax::DocumentValidatorFactory::create_validator(ortax::DocumentType doc_type)
{
if (doc_type == DocumentType::RussianPassport) //21
{
return std::make_unique<BirthPlaceValidator>(
std::make_unique<DocIssuerValidator>(
std::make_unique<SubdivisionCodeValidator>(
std::make_unique<PassportExpireDateValidator>(
std::make_unique<RussianPassportValidator>()))));
}
else if (doc_type == DocumentType::MilitarySoldierTicket) //4
{
return std::make_unique<BirthPlaceValidator>(
std::make_unique<DocIssuerValidator>(
std::make_unique<DefaultDocumentValidator>()));
}
else if (doc_type == DocumentType::MilitarySoldierTicket) //7
{
return std::make_unique<BirthPlaceValidator>(
std::make_unique<DocIssuerValidator>(
std::make_unique<DefaultDocumentValidator>()));
}
else if (doc_type == DocumentType::SeamanPassport) //26
{
return std::make_unique<BirthPlaceValidator>(
std::make_unique<ExpireDateValidator>(
std::make_unique<DefaultDocumentValidator>()));
}
else if (doc_type == DocumentType::TemporaryIdentityCard) //14
{
return std::make_unique<BirthPlaceValidator>(
std::make_unique<ExpireDateValidator>(
std::make_unique<DefaultDocumentValidator>()));
}
else if (doc_type == DocumentType::ResidensePermitRu) //12
{
return std::make_unique<BirthPlaceValidator>(
std::make_unique<ExpireDateValidator>(
std::make_unique<DefaultDocumentValidator>()));
}
else if (doc_type == DocumentType::ForeignPassport) //10
{
return std::make_unique<BirthPlaceValidator>(
std::make_unique<DocIssuerValidator>(
std::make_unique<DefaultDocumentValidator>()));
}
else if (doc_type == DocumentType::ForeignPassport) //15
{
return std::make_unique<ExpireDateValidator>(
std::make_unique<DefaultDocumentValidator>());
}
else
{
return std::make_unique<DefaultDocumentValidator>();
}
}
а второй веселее )
зы: я знаю что не сработает, не занудствуйте
И так нихуя не было понятно, так теперь боюсь даже читать доки по этим всяким птр
и я сказал что он наивный