package processor

import (
	"context"

	"apskel-pos-be/internal/entities"

	"github.com/google/uuid"
)

// Repository interfaces for processors
type ChartOfAccountTypeRepository interface {
	Create(ctx context.Context, chartOfAccountType *entities.ChartOfAccountType) error
	GetByID(ctx context.Context, id uuid.UUID) (*entities.ChartOfAccountType, error)
	GetByCode(ctx context.Context, code string) (*entities.ChartOfAccountType, error)
	Update(ctx context.Context, chartOfAccountType *entities.ChartOfAccountType) error
	Delete(ctx context.Context, id uuid.UUID) error
	List(ctx context.Context, filters map[string]interface{}, page, limit int) ([]*entities.ChartOfAccountType, int, error)
	GetActive(ctx context.Context) ([]*entities.ChartOfAccountType, error)
}

type ChartOfAccountRepository interface {
	Create(ctx context.Context, chartOfAccount *entities.ChartOfAccount) error
	GetByID(ctx context.Context, id uuid.UUID) (*entities.ChartOfAccount, error)
	Update(ctx context.Context, chartOfAccount *entities.ChartOfAccount) error
	Delete(ctx context.Context, id uuid.UUID) error
	List(ctx context.Context, req *entities.ChartOfAccount) ([]*entities.ChartOfAccount, int, error)
	GetByOrganization(ctx context.Context, organizationID uuid.UUID, outletID *uuid.UUID) ([]*entities.ChartOfAccount, error)
	GetByType(ctx context.Context, organizationID uuid.UUID, chartOfAccountTypeID uuid.UUID, outletID *uuid.UUID) ([]*entities.ChartOfAccount, error)
	GetByCode(ctx context.Context, organizationID uuid.UUID, code string, outletID *uuid.UUID) (*entities.ChartOfAccount, error)
}

type AccountRepository interface {
	Create(ctx context.Context, account *entities.Account) error
	GetByID(ctx context.Context, id uuid.UUID) (*entities.Account, error)
	Update(ctx context.Context, account *entities.Account) error
	Delete(ctx context.Context, id uuid.UUID) error
	List(ctx context.Context, req *entities.Account) ([]*entities.Account, int, error)
	GetByOrganization(ctx context.Context, organizationID uuid.UUID, outletID *uuid.UUID) ([]*entities.Account, error)
	GetByChartOfAccount(ctx context.Context, chartOfAccountID uuid.UUID) ([]*entities.Account, error)
	GetByNumber(ctx context.Context, organizationID uuid.UUID, number string, outletID *uuid.UUID) (*entities.Account, error)
	UpdateBalance(ctx context.Context, id uuid.UUID, amount float64) error
	GetBalance(ctx context.Context, id uuid.UUID) (float64, error)
}
