add purchasing in analytics endpoint

This commit is contained in:
2026-05-19 14:45:26 +07:00
parent 6d735c20cb
commit 35e7152abb
15 changed files with 839 additions and 1 deletions
@@ -114,6 +114,14 @@ func (m *MockTableRepository) GetByID(ctx context.Context, id uuid.UUID) (*entit
return args.Get(0).(*entities.Table), args.Error(1)
}
func (m *MockTableRepository) GetByToken(ctx context.Context, token string) (*entities.Table, error) {
args := m.Called(ctx, token)
if args.Get(0) == nil {
return nil, args.Error(1)
}
return args.Get(0).(*entities.Table), args.Error(1)
}
func (m *MockTableRepository) GetByOutletID(ctx context.Context, outletID uuid.UUID) ([]entities.Table, error) {
args := m.Called(ctx, outletID)
if args.Get(0) == nil {
@@ -182,6 +190,11 @@ func (m *MockTableRepository) GetByOrderID(ctx context.Context, orderID uuid.UUI
return args.Get(0).(*entities.Table), args.Error(1)
}
func (m *MockTableRepository) UpdateToken(ctx context.Context, tableID uuid.UUID, token string) error {
args := m.Called(ctx, tableID, token)
return args.Error(0)
}
func TestCreateOrderWithTableOccupation(t *testing.T) {
// Setup
ctx := context.Background()