@@ -29,14 +29,14 @@ func (ch *AccountCommandHandler) handleCreateAccount(ctx context.Context, data c
2929 data .SetCustomExtension (ctx , "create" , "false" )
3030 cmd := data .Command .(* CreateAccountCommand )
3131
32- accountData , err := ch .Repo .Get (ctx , cmd .C_AggregateID )
32+ accountData , err := ch .Repo .Get (ctx , cmd .AggregateID () )
3333 if err != nil {
3434 logger .Error (err .Error ())
3535 return err
3636 }
3737
3838 newAccountData , err := CreateAccount (accountData , AccountInfo {
39- ID : cmd .C_AggregateID ,
39+ ID : cmd .AggregateID () ,
4040 Name : cmd .Name ,
4141 })
4242 if err != nil {
@@ -57,13 +57,13 @@ func (ch *AccountCommandHandler) handleDeposit(ctx context.Context, data command
5757 data .SetCustomExtension (ctx , "update" , "true" )
5858 cmd := data .Command .(* DepositCommand )
5959
60- accountData , err := ch .Repo .Get (ctx , cmd .C_AggregateID )
60+ accountData , err := ch .Repo .Get (ctx , cmd .AggregateID () )
6161 if err != nil {
6262 logger .Error (err .Error ())
6363 return err
6464 }
6565 if accountData == nil {
66- return fmt .Errorf ("%w: %s" , ErrAccounteNotExists , cmd .C_AggregateID )
66+ return fmt .Errorf ("%w: %s" , ErrAccounteNotExists , cmd .AggregateID () )
6767 }
6868
6969 err = accountData .Deposit (cmd .Amount )
@@ -85,13 +85,13 @@ func (ch *AccountCommandHandler) handleWithdraw(ctx context.Context, data comman
8585 data .SetCustomExtension (ctx , "update" , "true" )
8686 cmd := data .Command .(* WithdrawCommand )
8787
88- accountData , err := ch .Repo .Get (ctx , cmd .C_AggregateID )
88+ accountData , err := ch .Repo .Get (ctx , cmd .AggregateID () )
8989 if err != nil {
9090 logger .Error (err .Error ())
9191 return err
9292 }
9393 if accountData == nil {
94- return fmt .Errorf ("%w: %s" , ErrAccounteNotExists , cmd .C_AggregateID )
94+ return fmt .Errorf ("%w: %s" , ErrAccounteNotExists , cmd .AggregateID () )
9595 }
9696
9797 err = accountData .WithDraw (cmd .Amount )
@@ -113,7 +113,7 @@ func (ch *AccountCommandHandler) handleRemoveAccount(ctx context.Context, data c
113113 data .SetCustomExtension (ctx , "delete" , "true" )
114114 cmd := data .Command .(* RemoveAccountCommand )
115115
116- accountData , err := ch .Repo .Get (ctx , cmd .C_AggregateID )
116+ accountData , err := ch .Repo .Get (ctx , cmd .AggregateID () )
117117 if err != nil {
118118 logger .Error (err .Error ())
119119 return err
0 commit comments