<commit_before>﻿#if VOUCHERIFYSERVER || VOUCHERIFYCLIENT
using Newtonsoft.Json;
using System;
using Voucherify.Core.DataModel;

namespace Voucherify.DataModel
{
    [JsonObject]
    public class Discount : ApiObject
    {
        [JsonProperty(PropertyName = "type", NullValueHandling = NullValueHandling.Ignore)]
        public DiscountType Type { get; private set; }

        [JsonProperty(PropertyName = "amount_off", NullValueHandling = NullValueHandling.Ignore)]
        public long? AmountOff { get; private set; }

        [JsonProperty(PropertyName = "percent_off", NullValueHandling = NullValueHandling.Ignore)]
        public double? PercentOff { get; private set; }

        [JsonProperty(PropertyName = "unit_off", NullValueHandling = NullValueHandling.Ignore)]
        public double? UnitOff { get; private set; }

        [JsonProperty(PropertyName = "unit_type", NullValueHandling = NullValueHandling.Ignore)]
        public string UnitType { get; private set; }

        [JsonProperty(PropertyName = "discount_amount_limit", NullValueHandling = NullValueHandling.Ignore)]
        public long? AmountLimit { get; private set; }

        public Discount() { }

        public override string ToString()
        {
            return string.Format("Discount(Type={0},AmountOff={1},PercentOff={2),UnitOff={3}", this.Type, this.AmountOff, this.PercentOff, this.UnitOff);
        }

        public static Discount From(DiscountType type, int value)
        {
            Discount discount = new Discount() { Type = type };
<commit_msg>Fix(mapping): fix incorrect amount limit mapping (#64)<commit_after>﻿#if VOUCHERIFYSERVER || VOUCHERIFYCLIENT
using Newtonsoft.Json;
using System;
using Voucherify.Core.DataModel;

namespace Voucherify.DataModel
{
    [JsonObject]
    public class Discount : ApiObject
    {
        [JsonProperty(PropertyName = "type", NullValueHandling = NullValueHandling.Ignore)]
        public DiscountType Type { get; private set; }

        [JsonProperty(PropertyName = "amount_off", NullValueHandling = NullValueHandling.Ignore)]
        public long? AmountOff { get; private set; }

        [JsonProperty(PropertyName = "percent_off", NullValueHandling = NullValueHandling.Ignore)]
        public double? PercentOff { get; private set; }

        [JsonProperty(PropertyName = "unit_off", NullValueHandling = NullValueHandling.Ignore)]
        public double? UnitOff { get; private set; }

        [JsonProperty(PropertyName = "unit_type", NullValueHandling = NullValueHandling.Ignore)]
        public string UnitType { get; private set; }

        [JsonProperty(PropertyName = "amount_limit", NullValueHandling = NullValueHandling.Ignore)]
        public long? AmountLimit { get; private set; }

        public Discount() { }

        public override string ToString()
        {
            return string.Format("Discount(Type={0},AmountOff={1},PercentOff={2),UnitOff={3}", this.Type, this.AmountOff, this.PercentOff, this.UnitOff);
        }

        public static Discount From(DiscountType type, int value)
        {
            Discount discount = new Discount() { Type = type };

{'fraction_non_alphanumeric': 0.10192307692307692, 'fraction_numerical': 0.003205128205128205, 'mean_word_length': 3.516642547033285, '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': '3814741', 'n_tokens_mistral': 881, 'n_tokens_neox': 863, 'n_words': 208}