Projects >> platform >>59141a37b44bb2d5ac723fe97ecb522f66e851d3

Chunk
Conflicting content
import com.fb.platform.promotion.model.Promotion;
import com.fb.platform.promotion.model.UserPromotionUsesEntry;
import com.fb.platform.promotion.model.coupon.Coupon;
<<<<<<< HEAD
import com.fb.platform.promotion.model.coupon.UserCouponUsesEntry;
=======
import com.fb.platform.promotion.model.coupon.CouponType;
>>>>>>> 993c2b25a5d39e0b9ff5ad9234451f5e3be94754
import com.fb.platform.promotion.rule.RuleConfigItem;
import com.fb.platform.promotion.rule.RuleConfiguration;
Solution content
import com.fb.platform.promotion.model.Promotion;
import com.fb.platform.promotion.model.UserPromotionUsesEntry;
import com.fb.platform.promotion.model.coupon.Coupon;
import com.fb.platform.promotion.model.coupon.UserCouponUsesEntry;
import com.fb.platform.promotion.model.coupon.CouponType;
import com.fb.platform.promotion.rule.RuleConfigItem;
import com.fb.platform.promotion.rule.RuleConfiguration;
File
PromotionAdminDaoJdbcImpl.java
Developer's decision
Concatenation
Kind of conflict
Import
Chunk
Conflicting content
				}
				
				
<<<<<<< HEAD
				createCouponLimitsConfig(	coupon.getLimitsConfig().getMaxUses(), 
											coupon.getLimitsConfig().getMaxAmount(), 
											coupon.getLimitsConfig().getMaxUsesPerUser(), 
											coupon.getLimitsConfig().getMaxAmountPerUser(), 
											couponId);

				for (UserCouponUsesEntry couponUse : coupon.getCouponUses()) {
					createUserCouponUses(couponUse, couponId);
				}

				for (Integer userId : coupon.getUsers()) {
					assignUserToCoupon(userId, couponId);
				}
=======
>>>>>>> 993c2b25a5d39e0b9ff5ad9234451f5e3be94754
			}
		}
	}
Solution content
				}
			}
		}
	}
File
PromotionAdminDaoJdbcImpl.java
Developer's decision
Manual
Kind of conflict
For statement
Method invocation
Chunk
Conflicting content
		log.info("coupon_limit_config id : " + couponLimitConfigKeyHolder.getKey().intValue());
		
	}
<<<<<<< HEAD

	/*
			"INSERT INTO " +
			"	user_coupon_uses " +
			"		(coupon_id, " +
			"		user_id, " +
			"		order_id, " +
			"		discount_amount, " +
			"		created_on, " +
			"		last_modified_on) " +
			"VALUES (?, ?, ?, ?, ?, ?)";
	 */
	private void createUserCouponUses(UserCouponUsesEntry couponUse, int couponId) {

		int rowsUpdated = jdbcTemplate.update(CREATE_USER_COUPON_USES_SQL, 
				couponId, 
				couponUse.getUserId(),
				couponUse.getOrderId(), 
				couponUse.getDiscountAmount().getAmount(), 
				new java.sql.Timestamp(couponUse.getCreatedDate().getMillis()), 
				new java.sql.Timestamp(System.currentTimeMillis()));

		if (rowsUpdated != 1) {
			throw new PlatformException("Unable to create entry in user_coupon_uses for couponId : " + couponId + ", userId : " + couponUse.getUserId());
		}
	}

	/*
			"INSERT INTO " +
			"	user_promotion_uses " +
			"		(promotion_id, " +
			"		user_id, " +
			"		order_id, " +
			"		discount_amount, " +
			"		created_on, " +
			"		last_modified_on) " +
			"VALUES (?, ?, ?, ?, ?, ?)";
	 */
	private void createUserPromotionUses(UserPromotionUsesEntry promotionUse, int promotionId) {
		int rowsUpdated = jdbcTemplate.update(CREATE_USER_PROMOTION_USES_SQL, 
				promotionId, 
				promotionUse.getUserId(),
				promotionUse.getOrderId(), 
				promotionUse.getDiscountAmount().getAmount(),
				new java.sql.Timestamp(promotionUse.getCreatedDate().getMillis()), 
				new java.sql.Timestamp(System.currentTimeMillis()));

		if (rowsUpdated != 1) {
			throw new PlatformException("Unable to create entry in user_promotion_uses for promotionId : " + promotionId + ", userId : " + promotionUse.getUserId());
		}
	}

	private void assignUserToCoupon(int userId, int couponId) {
		int rowsUpdated = jdbcTemplate.update(CREATE_COUPON_USER_MAPPING_SQL, couponId, userId, 0);
		if (rowsUpdated != 1) {
			throw new PlatformException("Unable to create entry in platform_coupon_user for couponId : " + couponId + ", userId : " + userId);
		}
	}

=======
	
>>>>>>> 993c2b25a5d39e0b9ff5ad9234451f5e3be94754
	public void setJdbcTemplate(JdbcTemplate jdbcTemplate) {
		this.jdbcTemplate = jdbcTemplate;
	}
Solution content
		log.info("coupon_limit_config id : " + couponLimitConfigKeyHolder.getKey().intValue());
		
	}

	private void createUserCouponUses(UserCouponUsesEntry couponUse, int couponId) {

		int rowsUpdated = jdbcTemplate.update(CREATE_USER_COUPON_USES_SQL, 
				couponId, 
				couponUse.getUserId(),
				couponUse.getOrderId(), 
				couponUse.getDiscountAmount().getAmount(), 
				new java.sql.Timestamp(couponUse.getCreatedDate().getMillis()), 
				new java.sql.Timestamp(System.currentTimeMillis()));

		if (rowsUpdated != 1) {
			throw new PlatformException("Unable to create entry in user_coupon_uses for couponId : " + couponId + ", userId : " + couponUse.getUserId());
		}
	}


	private void createUserPromotionUses(UserPromotionUsesEntry promotionUse, int promotionId) {
		int rowsUpdated = jdbcTemplate.update(CREATE_USER_PROMOTION_USES_SQL, 
				promotionId, 
				promotionUse.getUserId(),
				promotionUse.getOrderId(), 
				promotionUse.getDiscountAmount().getAmount(),
				new java.sql.Timestamp(promotionUse.getCreatedDate().getMillis()), 
				new java.sql.Timestamp(System.currentTimeMillis()));

		if (rowsUpdated != 1) {
			throw new PlatformException("Unable to create entry in user_promotion_uses for promotionId : " + promotionId + ", userId : " + promotionUse.getUserId());
		}
	}

	private void assignUserToCoupon(int userId, int couponId) {
		int rowsUpdated = jdbcTemplate.update(CREATE_COUPON_USER_MAPPING_SQL, couponId, userId, 0);
		if (rowsUpdated != 1) {
			throw new PlatformException("Unable to create entry in platform_coupon_user for couponId : " + couponId + ", userId : " + userId);
		}
	}

	public void setJdbcTemplate(JdbcTemplate jdbcTemplate) {
		this.jdbcTemplate = jdbcTemplate;
	}
File
PromotionAdminDaoJdbcImpl.java
Developer's decision
Combination
Kind of conflict
Comment
Method declaration