package com.eactive.eai.common.util;

import com.eactive.eai.common.message.EAIMessageKeys;

// 요청/응답 거래의 로그시퀀스를 추출 
public final class TranLogUtil {
	private TranLogUtil() {

	}

	public static int getReqLogSeq(String svcPssTp, int svcPssSeq, boolean isComp) {
		if (EAIMessageKeys.SINGLE_PROCESS.equals(svcPssTp)) {
			return 200;
		} else {
			if (isComp) {
				return (300 + (svcPssSeq * 10) + 1);
			} else {
				return (200 + (svcPssSeq * 10) + 1);
			}
		}
	}
	
	public static int getResLogSeq(String svcPssTp, int svcPssSeq, boolean isComp) {
		if (EAIMessageKeys.SINGLE_PROCESS.equals(svcPssTp)) {
			return 300;
		} else {
			if (isComp) {
				return (300 + (svcPssSeq * 10) + 2);
			} else {
				return (200 + (svcPssSeq * 10) + 2);
			}
		}
	}
}