2022-05-09 15:49:11 +02:00
|
|
|
import random
|
|
|
|
|
|
|
|
from data.ClientParams import ClientParams
|
|
|
|
from data.enum.CompanySize import CompanySize
|
|
|
|
|
|
|
|
|
2022-05-22 16:27:36 +02:00
|
|
|
class ClientParamsFactory:
|
2022-05-09 15:49:11 +02:00
|
|
|
|
2022-05-22 16:27:36 +02:00
|
|
|
@staticmethod
|
|
|
|
def getTrueMore(per_of_true: int) -> bool:
|
|
|
|
custom = random.randint(0, per_of_true)
|
2022-05-12 17:05:12 +02:00
|
|
|
|
|
|
|
return custom > 0
|
|
|
|
|
2022-05-22 16:27:36 +02:00
|
|
|
@staticmethod
|
|
|
|
def get_client_params() -> ClientParams:
|
2022-05-09 15:49:11 +02:00
|
|
|
payment_delay = random.randint(0, 14)
|
2022-05-22 16:27:36 +02:00
|
|
|
payed = ClientParamsFactory.getTrueMore(5)
|
2022-05-09 15:49:11 +02:00
|
|
|
net_worth = random.randint(0, 100)
|
2022-05-22 16:27:36 +02:00
|
|
|
is_skarbowka = not ClientParamsFactory.getTrueMore(5)
|
2022-05-09 15:49:11 +02:00
|
|
|
membership = random.getrandbits(1)
|
|
|
|
infuelnce_rate = random.randint(0, 100)
|
|
|
|
is_hat = random.getrandbits(1)
|
2022-05-22 16:27:36 +02:00
|
|
|
company_size = random.randint(1, 6)
|
2022-05-09 15:49:11 +02:00
|
|
|
|
|
|
|
return ClientParams(
|
|
|
|
payment_delay,
|
|
|
|
net_worth,
|
|
|
|
infuelnce_rate,
|
|
|
|
bool(payed),
|
|
|
|
bool(is_skarbowka),
|
|
|
|
bool(membership),
|
|
|
|
bool(is_hat),
|
|
|
|
CompanySize(company_size)
|
2022-05-22 16:27:36 +02:00
|
|
|
)
|