adding changes so far

main
lza_menace 3 years ago
parent 1433f42dfc
commit e28b27ff1e

@ -19,3 +19,6 @@ logs:
init:
./bin/cmd init
dbshell:
docker-compose exec db psql -U salesbot

@ -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)

@ -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

Loading…
Cancel
Save