package model

import (
	"github.com/google/uuid"
)

type SetNKodeResp struct {
	UserInterface []int `json:"user_interface"`
}

type NewCustomerPost struct {
	NKodePolicy NKodePolicy `json:"nkode_policy"`
}

type GenerateSignupInterfacePost struct {
	CustomerId  CustomerId `json:"customer_id"`
	AttrsPerKey int        `json:"attrs_per_key"`
	NumbOfKeys  int        `json:"numb_of_keys"`
	Username    Username   `json:"username"`
}

type SetNKodePost struct {
	CustomerId   CustomerId   `json:"customer_id"`
	KeySelection KeySelection `json:"key_selection"`
	SessionId    SessionId    `json:"session_id"`
}

type ConfirmNKodePost struct {
	CustomerId   CustomerId   `json:"customer_id"`
	KeySelection KeySelection `json:"key_selection"`
	SessionId    SessionId    `json:"session_id"`
}

type GetLoginInterfacePost struct {
	Username   Username   `json:"username"`
	CustomerId CustomerId `json:"customer_id"`
}

type LoginPost struct {
	CustomerId   CustomerId   `json:"customer_id"`
	Username     Username     `json:"username"`
	KeySelection KeySelection `json:"key_selection"`
}

type RenewAttributesPost struct {
	CustomerId CustomerId `json:"customer_id"`
}

type CreateNewCustomerResp struct {
	CustomerId CustomerId `json:"customer_id"`
}

type GenerateSignupInterfaceResp struct {
	SessionId     SessionId    `json:"session_id"`
	UserInterface IdxInterface `json:"user_interface"`
}

type GetLoginInterfaceResp struct {
	UserInterface IdxInterface `json:"user_interface"`
}

type KeySelection []int
type CustomerId uuid.UUID
type SessionId uuid.UUID
type UserId uuid.UUID

type Username string
type IdxInterface []int

type NKodeAPIInterface interface {
	CreateNewCustomer(NKodePolicy, *CustomerId) (*CustomerId, error)
	GenerateSignupInterface(Username, CustomerId, KeypadDimension) (*GenerateSignupInterfaceResp, error)
	SetNKode(CustomerId, SessionId, KeySelection) (IdxInterface, error)
	ConfirmNKode(CustomerId, SessionId, KeySelection) error
	GetLoginInterface(Username, CustomerId) (IdxInterface, error)
	Login(CustomerId, Username, KeySelection) error
	RenewAttributes(CustomerId) error
}

type EncipheredNKode struct {
	Code string
	Mask string
}
