class MarriageDocumentTypeService {

	public ResponseEntity<?> createAsync(MarriageDocTypeRequest marriageDocTypeRequest) {
		log.info("Service:: MarriageDocTypeRequest: " + marriageDocTypeRequest);
		RequestInfo requestInfo = marriageDocTypeRequest.getRequestInfo();
		List<MarriageDocumentType> marriageDocumentTypes = marriageDocTypeRequest.getMarriageDocTypes();
		Integer size = marriageDocumentTypes.size();

		/**
		 * @Get Ids From SequenceGenService
		 */
		List<Long> ids = sequenceIdGenService.idSeqGen(size, "seq_marriage_document_type");
		for (int index = 0; index < size; index++) {
			marriageDocumentTypes.get(index).setId(ids.get(index));
		}

		List<Long> codes = sequenceIdGenService.codeSeqGen(size, "seq_marriage_document_type_code");
		for (int index = 0; index < size; index++) {
			marriageDocumentTypes.get(index).setCode(codes.get(index).toString());
		}

		log.info("Service after IDs set:: MarriageDocTypeRequest: " + marriageDocTypeRequest);
		kafkaTemplate.send(propertiesManager.getCreateMarriageDocumentTypeTopicName(), marriageDocTypeRequest);
		return getSuccessResponse(marriageDocTypeRequest.getMarriageDocTypes(), requestInfo);
	}

}