Skip to content

Commit

Permalink
MOSIP-28461 MOSIP-28369
Browse files Browse the repository at this point in the history
Signed-off-by: Balaji <[email protected]>
  • Loading branch information
ase-101 authored and balaji-alluru committed Jan 30, 2025
1 parent 399c3e4 commit 2e38d17
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import jakarta.transaction.Transactional;

import io.mosip.kernel.masterdata.dto.response.FilterResult;
import io.mosip.kernel.masterdata.utils.*;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.CacheEvict;
Expand Down Expand Up @@ -61,12 +62,6 @@
import io.mosip.kernel.masterdata.repository.DocumentTypeRepository;
import io.mosip.kernel.masterdata.repository.ValidDocumentRepository;
import io.mosip.kernel.masterdata.service.ValidDocumentService;
import io.mosip.kernel.masterdata.utils.MapperUtils;
import io.mosip.kernel.masterdata.utils.MasterDataFilterHelper;
import io.mosip.kernel.masterdata.utils.MasterdataSearchHelper;
import io.mosip.kernel.masterdata.utils.MetaDataUtils;
import io.mosip.kernel.masterdata.utils.OptionalFilter;
import io.mosip.kernel.masterdata.utils.PageUtils;
import io.mosip.kernel.masterdata.validator.FilterColumnValidator;
import io.mosip.kernel.masterdata.validator.FilterTypeEnum;
import io.mosip.kernel.masterdata.validator.FilterTypeValidator;
Expand Down Expand Up @@ -113,6 +108,9 @@ public class ValidDocumentServiceImpl implements ValidDocumentService {

@Autowired
private FilterTypeValidator filterTypeValidator;

@Autowired
private LanguageUtils languageUtils;

/*
* (non-Javadoc)
Expand All @@ -127,6 +125,7 @@ public ValidDocumentID createValidDocument(ValidDocumentDto document) {

ValidDocument validDocument = MetaDataUtils.setCreateMetaData(document, ValidDocument.class);
validDocument.setIsActive(true);
validDocument.setLangCode(languageUtils.getDefaultLanguage()); //setting lang-code, as its required to be non-null for pre-reg (<=1.2.0.1)
try {
validDocument = documentRepository.create(validDocument);
} catch (DataAccessLayerException | DataAccessException e) {
Expand Down
2 changes: 1 addition & 1 deletion db_scripts/mosip_master/ddl/master-valid_document.sql
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
CREATE TABLE master.valid_document(
doctyp_code character varying(36) NOT NULL,
doccat_code character varying(36) NOT NULL,
lang_code character varying(3),
lang_code character varying(3) NOT NULL,
is_active boolean NOT NULL,
cr_by character varying(256) NOT NULL,
cr_dtimes timestamp NOT NULL,
Expand Down

0 comments on commit 2e38d17

Please sign in to comment.