Skip to content

Commit

Permalink
feat: added command product in root
Browse files Browse the repository at this point in the history
  • Loading branch information
maxwelbm committed Nov 14, 2024
1 parent 9c63088 commit d0c2f89
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
10 changes: 5 additions & 5 deletions components/mdz/pkg/cmd/product/product.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,20 @@ import (
"github.com/spf13/cobra"
)

type factoryPortfolio struct {
type factoryProduct struct {
factory *factory.Factory
}

func (f *factoryPortfolio) setCmds(cmd *cobra.Command) {
func (f *factoryProduct) setCmds(cmd *cobra.Command) {
cmd.AddCommand(newCmdProductCreate(newInjectFacCreate(f.factory)))
}

func NewCmdPortfolio(f *factory.Factory) *cobra.Command {
fOrg := factoryPortfolio{
func NewCmdProduct(f *factory.Factory) *cobra.Command {
fOrg := factoryProduct{
factory: f,
}
cmd := &cobra.Command{
Use: "portfolio",
Use: "product",
Short: "Manages the creation and maintenance of products for customer clustering.",
Long: utils.Format(
"The product command allows you to create and manage products, which",
Expand Down
3 changes: 2 additions & 1 deletion components/mdz/pkg/cmd/root/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"github.com/LerianStudio/midaz/components/mdz/pkg/cmd/login"
"github.com/LerianStudio/midaz/components/mdz/pkg/cmd/organization"
"github.com/LerianStudio/midaz/components/mdz/pkg/cmd/portfolio"
"github.com/LerianStudio/midaz/components/mdz/pkg/cmd/product"
"github.com/LerianStudio/midaz/components/mdz/pkg/cmd/utils"
"github.com/LerianStudio/midaz/components/mdz/pkg/cmd/version"
"github.com/LerianStudio/midaz/components/mdz/pkg/factory"
Expand All @@ -23,11 +24,11 @@ type factoryRoot struct {
func (f *factoryRoot) setCmds(cmd *cobra.Command) {
cmd.AddCommand(version.NewCmdVersion(f.factory))
cmd.AddCommand(login.NewCmdLogin(f.factory))

cmd.AddCommand(organization.NewCmdOrganization(f.factory))
cmd.AddCommand(ledger.NewCmdLedger(f.factory))
cmd.AddCommand(asset.NewCmdAsset(f.factory))
cmd.AddCommand(portfolio.NewCmdPortfolio(f.factory))
cmd.AddCommand(product.NewCmdProduct(f.factory))
}

func (f *factoryRoot) setFlags(cmd *cobra.Command) {
Expand Down

0 comments on commit d0c2f89

Please sign in to comment.