Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tune description & repair mistakes #185

Merged
merged 8 commits into from
Jun 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified 00-high-level/basic-feature-sets.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified 00-high-level/derived-feature-sets.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified 00-high-level/source/qgate-model.EAP
Binary file not shown.
12 changes: 6 additions & 6 deletions generator/basic_account.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,24 +37,24 @@ def generate(self, count):

model=self.model_item()

# "name": "account-id",
# "name": "account_id",
# "description": "Unique account identificator",
model['account_id']=str(uuid.uuid4())

# "name": "party_id",
# "description": "Party identificator",
model['party_id']=party['party_id']

# "name": "account-type",
# "name": "account_type",
# "description": "Type of party account (saving account, current account, etc.)",
model['account_type']=self.rnd_choose(["Current account", "Saving account"], [0.93, 0.07])

# "name": "account-state",
# "name": "account_state",
# "description": "Account state (e.g. active, closed, etc.)",
model['account_state']=self.rnd_choose(["Active", "Closed", "Blocked"], [0.98, 0.018, 0.002])
self.apply_none_value(model, 'account_state', "Closed",lower_probability=0.2)

# "name": "account-createdate",
# "name": "account_createdate",
# "description": "Date for account creation",
if model['account_state']=="Active":
active_account_count=active_account_count+1
Expand All @@ -68,14 +68,14 @@ def generate(self, count):
# account is in state closed or blocked date will be between today and date for countrparty established
model['account_createdate']=self.fake.date_between_dates(party['party_typedate'],datetime.date.today())

# "name": "account-nonactivedate",
# "name": "account_nonactivedate",
# "description": "Date when account state was closed or blocked",
if model['account_state']=="Active":
model['account_nonactivedate']=self.MAX_DATE
else:
model['account_nonactivedate']=self.fake.date_between_dates(model['account_createdate'],datetime.date.today())

# "name": "record-date",
# "name": "record_date",
# "description": "The date when the record was created",
model['record_date']=self.gmodel["NOW"]

Expand Down
10 changes: 5 additions & 5 deletions generator/basic_communication.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@ def generate(self, count):
# add new model
model = self.model_item()

# "name": "communication-id",
# "name": "communication_id",
model['communication_id'] = str(uuid.uuid4())

# "name": "session-id",
# "name": "session_id",
model['session_id'] = session_id

# "name": "party_id",
Expand All @@ -85,18 +85,18 @@ def generate(self, count):
model['content_sentiment'] = str(session_sentiment).replace('Sentiment.','')
self.apply_none_value(model, 'content_sentiment', "Neutral", lower_probability=0.10)

# "name": "content-type",
# "name": "content_type",
model['content_type'] = "Text"
self.apply_none_value(model, 'content_type', "Text", lower_probability=0.01)

# "name": "channel",
model['channel'] = self.rnd_choose(["Email", "Chat"], [0.8, 0.2])

# "name": "communication-date",
# "name": "communication_date",
session_datetime = session_datetime + datetime.timedelta(seconds=float(self.rnd_int(0,13)))
model['communication_date']=session_datetime.strftime("%Y-%m-%d %H:%M:%S")

# "name": "record-date"
# "name": "record_date"
model['record_date'] = self.gmodel["NOW"]

self.model.append(model)
Expand Down
8 changes: 4 additions & 4 deletions generator/basic_contact.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def generate(self, count):
# add new model
model = self.model_item()

# "name": "contact-id",
# "name": "contact_id",
model['contact_id']=str(uuid.uuid4())

# "name": "party_id",
Expand All @@ -52,19 +52,19 @@ def generate(self, count):
contact_detail=ContactEnum.Full if party['party_type']=="Customer" else ContactEnum.Email \
if self.rnd_bool() else ContactEnum.Phone

# "name": "contact-email"
# "name": "contact_email"
if contact_detail & ContactEnum.Email:
model['contact_email'] = self.fake.email()
else:
model['contact_email'] = ""

# "name": "contact-phone"
# "name": "contact_phone"
if contact_detail & ContactEnum.Phone:
model['contact_phone'] = self.fake.phone_number()
else:
model['contact_phone'] = ""

# "name": "contact-state"
# "name": "contact_state"
if count==0:
model['contact_state']= "Active"
elif count==1:
Expand Down
16 changes: 8 additions & 8 deletions generator/basic_event.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,10 @@ def generate(self, count):
# add new model
model = self.model_item()

# "name": "event-id",
# "name": "event_id",
model['event_id'] = str(uuid.uuid4())

# "name": "session-id",
# "name": "session_id",
model['session_id'] = session_id

# "name": "party_id",
Expand All @@ -129,25 +129,25 @@ def generate(self, count):
group_category_name=str.format("{0}/{1}", group,category)
action = self.rnd_choose(self.event_actions[group_category_name][0], self.event_actions[group_category_name][1])

# "name": "event-group",
# "name": "event_group",
model['event_group'] = group

# "name": "event-category",
# "name": "event_category",
model['event_category'] = category

# "name": "event-action",
# "name": "event_action",
model['event_action'] = action

# "name": "event-detail",
# "name": "event_detail",
model['event_detail'] = "" # not used, right now

# "name": "event-date",
# "name": "event_date",
# random movement in second for next event
# new datetime for this event in session
session_datetime = session_datetime + datetime.timedelta(seconds=float(self.rnd_int(0,13)))
model['event_date']=session_datetime.strftime("%Y-%m-%d %H:%M:%S")

# "name": "record-date"
# "name": "record_date"
model['record_date']=self.gmodel["NOW"]

self.model.append(model)
Expand Down
2 changes: 1 addition & 1 deletion generator/basic_party.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def _generate(self):
# "description": "Party note",
model['party_note'] = ""

# "name": "record-date",
# "name": "record_date",
# "description": "The date when the record was created",
model['record_date']=self.gmodel["NOW"]

Expand Down
14 changes: 7 additions & 7 deletions generator/basic_relation.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,28 +42,28 @@ def generate(self, count):
# add new model
model = self.model_item()

# "name": "relation-id",
model['relation-id']=str(uuid.uuid4())
# "name": "relation_id",
model['relation_id']=str(uuid.uuid4())

# "name": "relation-parentid",
# "name": "relation_parentid",
model['party_id']=party['party_id']

# "name": "relation-childid",
# "name": "relation_childid",
while (True):
random_id = parties[self.rnd_int(0, len(parties))]['party_id']
if random_id != model['party_id']:
model['relation_childid'] = random_id
break

# "name": "relation-type",
# "name": "relation_type",
model['relation_type']=self.rnd_choose(["Family", "Job", "Social"], [0.5, 0.3, 0.2])
self.apply_none_value(model, 'relation_type', "Job",lower_probability=0.05)

# "name": "relation-date",
# "name": "relation_date",
# not used, right now
model['relation_date']=datetime.datetime(1970, 1, 1, 8, 0, 0).strftime("%Y-%m-%d %H:%M:%S")

# "name": "record-date"
# "name": "record_date"
model['record_date']=self.gmodel["NOW"]

self.model.append(model)
Expand Down
24 changes: 12 additions & 12 deletions generator/basic_transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,38 +54,38 @@ def generate(self, count):

model=self.model_item()

# "name": "transaction-id",
# "name": "transaction_id",
# "description": "Unique transaction identificator",
model['transaction_id']=str(uuid.uuid4())

# "name": "account-id",
# "name": "account?id",
# "description": "Relation to account identificator",
model['account_id']=account['account_id']

# "name": "transaction-direction",
# "name": "transaction_direction",
# "description": "Transaction direction e.g. incoming, outgoing",
# TODO: Add both directions
model['transaction_direction'] = "Incoming"

# "name": "transaction-type",
# "name": "transaction_type",
# "description": "Transaction type",
model['transaction_type']=self.rnd_choose(["Standard", "Instant"], [0.7, 0.3])
self.apply_none_value(model, 'transaction_type', "Instant", lower_probability=0.25)

# "name": "transaction-value",
# "name": "transaction_value",
# "description": "Transaction value",
#TODO: generate negative items also
model['transaction_value']=self.rnd_choose(range(1000, 5000))

# "name": "transaction-currency",
# "name": "transaction_currency",
# "description": "Transaction currency",
model['transaction_currency']="USD"

# "name": "transaction-description",
# "name": "transaction_description",
# "description": "Transaction description",
model["transaction_description"] = self._transaction_description(True)

# "name": "transaction-date",
# "name": "transaction_date",
# "description": "Transaction date",
model['transaction_date']=new_date

Expand All @@ -105,7 +105,7 @@ def generate(self, count):
iban=tmp_fake.iban()
model["counterparty_iban"]=iban

# "name": "counterparty-other",
# "name": "counterparty_other",
# "description": "Transaction counterparty other information",
# TODO: Add relevant value
model["counterparty_other"] = ""
Expand All @@ -118,15 +118,15 @@ def generate(self, count):
if self.rnd_bool():
fraud=True

# "name": "transaction-fraudanomaly",
# "name": "transaction_fraudanomaly",
# "description": "Possible fraud anomaly detection (min. 0 - without anomaly detection, max. 1)",
model["transaction_fraudanomaly"] = float(fraud_anomaly)

# "name": "transaction-fraud",
# "name": "transaction_fraud",
# "description": "Identification of fraud (True - fraud, False - without fraud)",
model["transaction_fraud"] = int(fraud)

# "name": "record-date",
# "name": "record_date",
# "description": "The date when the record was created",
model['record_date']=self.gmodel["NOW"]

Expand Down