net.yadaframework.commerce.persistence.entity.YadaOrderStatus Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of yadawebcommerce Show documentation
Show all versions of yadawebcommerce Show documentation
Yada Framework for E-Commerce sites
The newest version!
package net.yadaframework.commerce.persistence.entity;
import java.util.Locale;
import org.springframework.context.MessageSource;
import net.yadaframework.core.YadaLocalEnum;
import net.yadaframework.persistence.entity.YadaPersistentEnum;
public enum YadaOrderStatus implements YadaLocalEnum {
UNPAID("yada.orderStatus.unpaid"), // New order, waiting for payment
PAID("yada.orderStatus.paid"), // Payment ok, can be processed
PROCESSING("yada.orderStatus.processing"), // Someone is working on the order
SHIPPED("yada.orderStatus.shipped"), // Items shipped
CANCELLED("yada.orderStatus.cancelled"), // Order cancelled for any reason
WAITING("yada.orderStatus.waiting"), // Waiting on some condition, e.g. item availability
CONFIRMED("yada.orderStatus.confirmed") // Customer confirmed order reception
;
private String messageKey;
private YadaPersistentEnum yadaPersistentEnum;
private YadaOrderStatus(String messageKey) {
this.messageKey = messageKey;
}
@Override
public YadaPersistentEnum toYadaPersistentEnum() {
return yadaPersistentEnum;
}
@Override
public void setYadaPersistentEnum(YadaPersistentEnum yadaPersistentEnum) {
this.yadaPersistentEnum = yadaPersistentEnum;
}
@Override
public String toString(MessageSource messageSource, Locale locale) {
return messageSource.getMessage(messageKey, null, locale);
}
}