<commit_before>package condense

import java.util.Date;

import condense.SupportTier.TierType;

class ProductOverride {
	
	Long startQuantity
	OverrideType overrideType
	BigDecimal amount
	
	/* Automatic timestamping of GORM */
	Date dateCreated
	Date lastUpdated
	
	static belongsTo = [
		pricingSet: PricingSet,
		product: Product
	]
	

    static constraints = {
		startQuantity blank: false
		overrideType blank: false
		amount blank: false
    }
	
	public String toString() {
		return "${pricingSet.name} - ${product.name} - ${startQuantity} - ${overrideType} - ${amount}";
	}
	
	boolean equals(o) {
		if (this.is(o)) return true
		if (getClass() != o.class) return false
		ProductOverride productOverride = (ProductOverride) o
		if (id != null && id == productOverride.id) return true
		if (pricingSet != productOverride.pricingSet || startQuantity != productOverride.startQuantity) return false
		return true
	}
	
	int hashCode() {
		return toString().hashCode()
	}
	
	enum OverrideType {
		PERCENT,
		DELTA,
		FIXED
		
		static OverrideType valueOfName(String name) {<commit_msg>New includedQuantity property for the ProductOverride domain<commit_after>package condense

import java.util.Date;

import condense.SupportTier.TierType;

class ProductOverride {
	
	Long includedQuantity
	Long startQuantity
	OverrideType overrideType
	BigDecimal amount
	
	/* Automatic timestamping of GORM */
	Date dateCreated
	Date lastUpdated
	
	static belongsTo = [
		pricingSet: PricingSet,
		product: Product
	]
	

    static constraints = {
		includedQuantity nullable: true
		startQuantity blank: false
		overrideType blank: false
		amount blank: false
    }
	
	public String toString() {
		return "${pricingSet.name} - ${product.name} - ${startQuantity} - ${overrideType} - ${amount}";
	}
	
	boolean equals(o) {
		if (this.is(o)) return true
		if (getClass() != o.class) return false
		ProductOverride productOverride = (ProductOverride) o
		if (id != null && id == productOverride.id) return true
		if (pricingSet != productOverride.pricingSet || startQuantity != productOverride.startQuantity) return false
		return true
	}
	
	int hashCode() {
		return toString().hashCode()
	}
	
	enum OverrideType {
		PERCENT,
		DELTA,
		FIXED
		
		static OverrideType valueOfName(String name) {
{'fraction_non_alphanumeric': 0.09438103599648814, 'fraction_numerical': 0.0, 'mean_word_length': 4.053215077605321, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3864282', 'n_tokens_mistral': 757, 'n_tokens_neox': 671, 'n_words': 195}