package com.yn.bftl.thirdparty.common.service;

import org.springframework.stereotype.Component;

import java.time.LocalDate;
import java.time.ZonedDateTime;

@Component
public class AppBaseServiceImpl implements AppBaseService {

  protected static String DEFAULT_LOCALE = "en";

  /**
   * Get the today date time Get the value defined in User if not null, Else get the valued defined
   * in Base app Else get the server current date time
   */
  @Override
  public ZonedDateTime getTodayDateTime() {
    ZonedDateTime todayDateTime = ZonedDateTime.now();
    return todayDateTime;
  }

  /**
   * Get the today date Get the value defined in User if not null, Else get the valued defined in
   * Base app Else get the server current date
   */
  @Override
  public LocalDate getTodayDate() {

    return getTodayDateTime().toLocalDate();
  }
}
