Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
its: Added issue_management_context_use_case
- Loading branch information
Showing
2 changed files
with
54 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,21 @@ | ||
use use_case::{issue_management_context_use_case, IssueManagementContextCommand}; | ||
|
||
use crate::{ | ||
entity::IssueTitle, | ||
use_case::{create_issue_workflow, CreateIssue}, | ||
use_case::{create_issue_use_case, CreateIssue}, | ||
}; | ||
|
||
mod entity; | ||
mod use_case; | ||
|
||
#[argopt::subcmd(name = "issue-create")] | ||
fn issue_create(#[opt(long = "title")] title: Option<String>) { | ||
let title = IssueTitle::try_from(title.unwrap_or_default()).unwrap(); | ||
let command = CreateIssue::new(title); | ||
let event = create_issue_workflow(command); | ||
fn issue_create(#[opt(long = "title")] title: Option<String>) -> anyhow::Result<()> { | ||
let issue_title = IssueTitle::try_from(title.unwrap_or_default()).unwrap(); | ||
let command = IssueManagementContextCommand::CreateIssue(CreateIssue { issue_title }); | ||
let event = issue_management_context_use_case(command)?; | ||
println!("issue created : {:?}", event); | ||
Ok(()) | ||
} | ||
|
||
#[argopt::cmd_group(commands = [issue_create])] | ||
fn main() {} | ||
fn main() -> anyhow::Result<()> {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters