from decimal import Decimal

import regex


TITLE_REGEX = regex.compile(r"^[\p{L}\p{N} _-]+$")


# NAME
NAME_MAX_LENGTH = 300
NAME_MIN_LENGTH = 5

NAME_REGEX = TITLE_REGEX


# SLUG
SLUG_MAX_LENGTH = 300

# INFORMATION
INFORMATION_MAX_LENGTH = 5000

# DESCRIPTION
DESCRIPTION_MAX_LENGTH = 5000

# DISCOUNTS
DISCOUNT_MAX = Decimal("100")
DISCOUNT_MIN = Decimal("0")

# PRICE
ANY_PRICE_MIN = Decimal("0")


# ==== =====


DECIMAL_BALANCE_DIGITS = 30
DECIMAL_BALANCE_PLACES = 4

LONG_DECIMAL_DIGITS = 30
LONG_DECIMAL_PLACES = 4

DECIMAL_PRICE_DIGITS = 14
DECIMAL_PRICE_PLACES = 4

DECIMAL_RATE_DIGITS = 12
DECIMAL_RATE_PLACES = 6

DECIMAL_DISCOUNT_DIGITS = 5
DECIMAL_DISCOUNT_PLACES = 2
