LanEventPropertyKey.java 3.33 KB
/*
 * Copyright Codecrew Ry
 * 
 * All rights reserved.
 * 
 * This license applies to any software containing a notice placed by the 
 * copyright holder. Such software is herein referred to as the Software. 
 * This license covers modification, distribution and use of the Software. 
 * 
 * Any distribution and use in source and binary forms, with or without 
 * modification is not permitted without explicit written permission from the 
 * copyright owner. 
 * 
 * A non-exclusive royalty-free right is granted to the copyright owner of the 
 * Software to use, modify and distribute all modifications to the Software in 
 * future versions of the Software. 
 * 
 */
package fi.codecrew.moya.model;

public enum LanEventPropertyKey {
	EVENT_LOGO(Type.DATA),
	INVITEMAIL_SUBJECT(Type.TEXT, "Invitation to Moya Online Youth Accumulator"),
	INVITEMAIL_CONTENT(Type.TEXT, "You have been invited to an event by {1}.\n\nYou can register to intranet at: {0}."),
	BILL_PAID_MAIL_SUBJECT(Type.TEXT, "[{0}] Lasku merkitty maksetuksi"),
	BILL_PAID_MAIL_CONTENT(Type.TEXT, "Laskusi numero {0} on merkitty maksetuksi. Voit nyt siirtyä lippukauppaan varamaan haluamasi paikat. Tervetuloa tapahtumaan!"),
	PORTAL_EMAIL_ADDRESS(Type.TEXT, "moya@codecrew.fi"),
	PORTAL_EMAIL_NAME(Type.TEXT, "Moya Online Youth Accumulator"),

	ADMIN_MAIL(Type.TEXT, "moya@codecrew.fi"),
	EVENT_LAYOUT(Type.TEXT, "primelayout"),
	SHOP_DEFAULT_CASH(Type.BOOL),
	PLACECODE_FROM_USER(Type.BOOL, "1"),
	PLACECODE_PRINT_ONLY_OWN(Type.BOOL),
	CHECK_BILL_STATS_PERMISSION(Type.BOOL),
	GATHER_OTHER_BILL_INFO(Type.BOOL),
	GATHER_SHIRT_SIZE(Type.BOOL),
	ALLOW_BILLING(Type.BOOL),
	BILL_EXPIRE_HOURS(Type.LONG, 1l),
	TEMPLATE_PROPERTY1(Type.TEXT),
	TEMPLATE_PROPERTY2(Type.TEXT),
	TEMPLATE_PROPERTY3(Type.TEXT),
	TEMPLATE_PROPERTY4(Type.TEXT),
	TEMPLATE_PROPERTY5(Type.TEXT),
	INVITE_ONLY_EVENT(Type.BOOL),
	USE_ETICKET(Type.BOOL, "1"),
	ETICKETMAIL_SUBJECT(Type.TEXT, "Your etickets to Moya Online Youth Accumulator"),
	ETICKETMAIL_CONTENT(Type.TEXT, "Hello {1},\n\nYou can find your etickets to an event from: {0}"),
	/**
	 * Should users be put to queue when reserving places from map, ie. only a
	 * limited number of people can reserve places at once.
	 */
	MAP_QUEUE(Type.BOOL),
	DISABLE_PHOTO_ON_KIOSK(Type.BOOL),
	/**
	 * How many percent of the available places can be locked by one unpaid and
	 * unexpired bill
	 */
	RESERVE_UNPAID_SLOT_PERCENT(Type.LONG, 10l),

	;

	private enum Type {
		TEXT, DATE, DATA, BOOL, LONG
	};

	private final String defaultvalue;
	private final Type type;
	private final long defaultLong;

	public boolean isText() {
		return Type.TEXT.equals(type);
	}

	public boolean isDate() {
		return Type.DATE.equals(type);
	}

	public boolean isData() {
		return Type.DATA.equals(type);
	}

	public boolean isBoolean() {
		return Type.BOOL.equals(type);
	}

	public boolean isLong() {
		return Type.LONG.equals(type);
	}

	private LanEventPropertyKey(Type t)
	{
		this.type = t;
		defaultvalue = null;
		defaultLong = 0;
	}

	private LanEventPropertyKey(Type t, String def)
	{
		this.type = t;
		defaultvalue = def;
		defaultLong = 0;
	}

	private LanEventPropertyKey(Type t, Long def)
	{
		this.type = t;
		defaultvalue = null;
		defaultLong = def;
	}

	public String getDefaultvalue() {
		return defaultvalue;
	}

	public Type getType() {
		return type;
	}

	public Long getDefaultLong() {
		return defaultLong;
	}
}