From e28b27ff1e3bc4bc6cd7e781fa55909f9429f37c Mon Sep 17 00:00:00 2001 From: lza_menace Date: Sun, 28 Mar 2021 21:00:02 -0700 Subject: [PATCH] adding changes so far --- Makefile | 3 +++ app/cli.py | 12 ++++++++---- app/models.py | 1 + 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 5455452..016fae0 100644 --- a/Makefile +++ b/Makefile @@ -19,3 +19,6 @@ logs: init: ./bin/cmd init + +dbshell: + docker-compose exec db psql -U salesbot diff --git a/app/cli.py b/app/cli.py index dd9eeec..396170a 100644 --- a/app/cli.py +++ b/app/cli.py @@ -29,8 +29,8 @@ def populate_dev_data(): from datetime import datetime, timedelta options = { 'types': ['intro_call', 'saod_call', 'scoping_call', 'proposal_work', 'proposal_call'], - 'sas': ['gary', 'dave', 'mark', 'jd'], - 'channels': [namegenerator.gen() for i in range(100)] + 'sas': ['gary', 'dave', 'mark', 'jd', 'victor'], + 'channels': [namegenerator.gen() for i in range(30)] } for cx in options['channels']: sa = choice(options['sas']) @@ -38,9 +38,9 @@ def populate_dev_data(): sc_months = randrange(1, 6) sc_weeks = sc_months * 4 if sc_months > 2: - scoping_calls = randrange(2, 4) + scoping_calls = randrange(1, 5) else: - scoping_calls = randrange(1, 3) + scoping_calls = randrange(0, 2) saods = 1 proposal_work = randrange(1, 3) proposal_call = 1 @@ -57,6 +57,7 @@ def populate_dev_data(): work_type='saod_call', start_date=start_date, end_date=datetime(2021, start_month, start_day, start_hour + 1, start_min), + hours_spent=1, user=sa, ) db.session.add(saod) @@ -70,6 +71,7 @@ def populate_dev_data(): work_type='scoping_call', start_date=new_start, end_date=new_start + timedelta(hours=1), + hours_spent=randrange(1, 2), user=sa, ) db.session.add(sc) @@ -83,6 +85,7 @@ def populate_dev_data(): work_type='proposal_work', start_date=pw_start, end_date=pw_start + timedelta(hours=1), + hours_spent=1, user=sa, ) db.session.add(pw) @@ -95,6 +98,7 @@ def populate_dev_data(): work_type='proposal_call', start_date=pc_date, end_date=pc_date + timedelta(hours=1), + hours_spent=1, user=sa, ) db.session.add(pc) diff --git a/app/models.py b/app/models.py index 15731e0..dded27b 100644 --- a/app/models.py +++ b/app/models.py @@ -13,6 +13,7 @@ class WorkEvent(db.Model): work_type = db.Column(db.String(50)) start_date = db.Column(db.DateTime) end_date = db.Column(db.DateTime) + hours_spent = db.Column(db.Integer) def __repr__(self): return self.id