package cn.ysk.cashier.cons;

import lombok.Getter;

import java.util.Objects;

public interface TableConstant {

    String CART_SEAT_ID = "-999";

    class ShopTable {
        @Getter
        public enum State {
            IDLE("idle"), CLOSED("closed"), PAYING("paying"), PENDING("pending"), USING("using"), CLEANING("cleaning");
            private final String value;

            State(String value) {
                this.value = value;
            }
        }
    }

    class CashierCart {
        public static final String ID = "-999";

        @Getter
        public enum Status {
            REFUNDING("refunding"), REFUND("refund"), CLOSED("closed"), CREATE("create"),
            UNPAID("unpaid"), PAYING("paying"), RETURN("return"), CANCEL("cancel");
            private final String value;
            Status(String value) {
                this.value = value;
            }
            public boolean equalsVals(String value) {
                return this.value.equals(value);
            }
        }

        @Getter
        public enum UseType {
            TAKEOUT("takeout"),
            DINE_IN_AFTER("dine-in-after"),
            DINE_IN_BEFORE("dine-in-before");
            private final String value;

            UseType(String value) {
                this.value = value;
            }

            public boolean equalsVals(String value) {
                return this.value.equals(value);
            }
        }
    }

    class OrderInfo {
        @Getter
        public enum Status {
            REFUNDING("refunding"), REFUND("refund"), CLOSED("closed"), CREATE("create"),
            UNPAID("unpaid"), PAYING("paying"), RETURN("return"), FINAL("final");
            private final String value;

            Status(String value) {
                this.value = value;
            }

            public boolean equalsVals(String value) {
                return this.value.equals(value);
            }

        }

        @Getter
        public enum UseType {
            TAKEOUT("takeout"),
            DINE_IN_AFTER("dine-in-after"),
            DINE_IN_BEFORE("dine-in-before"), NONE_TABLE("dine-in");
            private final String value;

            UseType(String value) {
                this.value = value;
            }

            public boolean equalsVals(String value) {
                return this.value.equals(value);
            }
        }
    }

    class FreeDineRecord {
        @Getter
        public enum State {
            WAIT_PAY(0),
            SUCCESS_PAY(1),
            FAIL_PAY(2);
            private final Integer value;

            State(Integer value) {
                this.value = value;
            }
        }

        @Getter
        public enum UseType {
            TAKEOUT("takeout"),
            DINE_IN_AFTER("dine-in-after"),
            DINE_IN_BEFORE("dine-in-before");
            private final String value;

            UseType(String value) {
                this.value = value;
            }

            public boolean equalsVals(String value) {
                return this.value.equals(value);
            }
        }
    }

    class ShopInfo {
        @Getter
        public enum EatModel {
            TAKEOUT("takeout"),
            DINE_IN("dine-in");
            private final String value;

            EatModel(String value) {
                this.value = value;
            }

            public boolean equalsVals(String value) {
                return this.value.equals(value);
            }
        }
    }

    class MemberIn {
        @Getter
        public enum Type {
            NORMAL(0),
            FREE_DINE(1);
            private final Integer value;

            Type(Integer value) {
                this.value = value;
            }

            public boolean equalsVals(Integer value) {
                return Objects.equals(this.value, value);
            }
        }
    }

    class ActivateOutRecord {
        @Getter
        public enum Type {
            // 满减
            FULL_REDUCTION(1),
            // 商品
            PRODUCT(2);
            private final Integer value;

            Type(Integer value) {
                this.value = value;
            }

            public boolean equalsVals(Integer value) {
                return Objects.equals(this.value, value);
            }
        }
        @Getter
        public enum Status {
            CREATE("create"),
            CANCEL("cancel"),
            // 商品
            CLOSED("closed");
            private final String value;

            Status(String value) {
                this.value = value;
            }

            public boolean equalsVals(String value) {
                return this.value.equals(value);
            }
        }
    }
}
