def handle(self, cmd): reporter = IssueReporter(cmd.reporter_name, cmd.reporter_email) issue = Issue(reporter, cmd.problem_description) with self.uowm.start() as tx: tx.issues.add(issue) tx.commit()
def report_issue(start_uow, cmd): reporter = IssueReporter(cmd.reporter_name, cmd.reporter_email) issue = Issue(cmd.issue_id, reporter, cmd.problem_description) with start_uow() as tx: tx.issues.add(issue) tx.commit()
def given_a_new_issue(self): reporter = IssueReporter('John', '*****@*****.**') self.issue_id = uuid.uuid4() self.issue = Issue(self.issue_id, reporter, 'how do I even?') self.uow.issues.add(self.issue)