package com.nisum.mytime.model;

import java.util.Date;

import com.nisum.mytime.utils.MyTimeUtils;

import lombok.Getter;
import lombok.Setter;

@Setter
@Getter
public class AuditFields {
    String createdBy;
    String modifiedBy;
    Date createdOn;
    Date lastModifiedOn;

	public void setAuditFields(String loginEmpId, String action) {
		Date currentDate = new Date();
		if (MyTimeUtils.CREATE.equals(action)) {
			this.createdBy = loginEmpId;
			this.createdOn = currentDate;
		}
		this.modifiedBy = loginEmpId;
		this.lastModifiedOn = currentDate;
	}
}
