Subversion Repositories SmartDukaan

Rev

Rev 21924 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 21924 Rev 36376
Line 1... Line 1...
1
package com.spice.profitmandi.dao.enumuration.dtr;
1
package com.spice.profitmandi.dao.enumuration.dtr;
2
 
2
 
3
public enum AccountType {
3
public enum AccountType {
4
	saholic(0),
4
	saholic(0),
5
	gcm_regid(1),
5
	gcm_regid(1),
-
 
6
	/** Legacy: single cart per user. Still used for the PROCUREMENT cart (1:1 with partner).
-
 
7
	 *  Tertiary-sale billing drafts do NOT live here — they are queried from user.cart by
-
 
8
	 *  retailer_id + sale_type + lifecycle_status. */
6
	cartId(2);
9
	cartId(2),
-
 
10
	/** Alias for `cartId` — partner's procurement cart. */
-
 
11
	PROCUREMENT_CART_ID(3);
7
 
12
 
8
	private final int value;
13
	private final int value;
9
 
14
 
10
	private AccountType(int value) {
15
	private AccountType(int value) {
11
		this.value = value;
16
		this.value = value;
Line 13... Line 18...
13
 
18
 
14
	public int getValue() {
19
	public int getValue() {
15
		return value;
20
		return value;
16
	}
21
	}
17
 
22
 
18
	public static AccountType findByValue(int value) { 
23
	public static AccountType findByValue(int value) {
19
		switch (value) {
24
		switch (value) {
20
		case 0:
25
		case 0:
21
			return saholic;
26
			return saholic;
22
		case 1:
27
		case 1:
23
			return gcm_regid;
28
			return gcm_regid;
24
		case 2:
29
		case 2:
25
			return cartId;
30
			return cartId;
-
 
31
		case 3:
-
 
32
			return PROCUREMENT_CART_ID;
26
		default:
33
		default:
27
			return null;
34
			return null;
28
		}
35
		}
29
	}
36
	}
30
	
37
 
31
}
38
}