local r=game:GetService("\082\101\112\108\105\099\097\116\101\100\083\116\111\114\097\103\101")local P=require((r:WaitForChild("\080\114\111\106\101\099\116")):WaitForChild("\082\101\112\108\105\099\097\116\101\100\083\116\111\114\097\103\101"))local v=P:GetResource("\071\097\109\101\068\097\116\097\046\073\116\101\109\046\083\116\111\114\101")return function(r)local P={}local f={}for r,v in pairs(v)do table.insert(P,v.TransactionName)f[v.TransactionName]=r end local Q={Transform=function(v,f)return(r.Cmdr.Util.MakeFuzzyFinder(P))(v)end,Validate=function(r)return#r>0,"\078\111 \105\116\101\109\115 \119\101\114\101 \102\111\117\110\100 \109\097\116\099\104\105\110\103 \116\104\097\116 \113\117\101\114\121\046"end,Autocomplete=function(r)return r end;Parse=function(r)return f[r[1]]end}r.Cmdr.Registry:RegisterType("\103\097\109\101\083\116\111\114\101\084\114\097\110\115\097\099\116\105\111\110",Q)end
--[[
TheNexusAvenger

Enum type for the store transactions.
--]]

local ReplicatedStorage = game:GetService("ReplicatedStorage")

local ReplicatedStorageProject = require(ReplicatedStorage:WaitForChild("Project"):WaitForChild("ReplicatedStorage"))
local StoreItems = ReplicatedStorageProject:GetResource("GameData.Item.Store")




return function(NexusAdminAPI)
    --Compile the list of transactions.
    local TransactionNames = {}
    local TransactionNamesToId = {}
	for Id,Transaction in pairs(StoreItems) do
        table.insert(TransactionNames,Transaction.TransactionName)
        TransactionNamesToId[Transaction.TransactionName] = Id
    end

    --Create the item type.
    local GameItemType = {
        --[[
        Transforms the string to a list of store transactions.
        --]]
        Transform = function(Text,Executor)
            return NexusAdminAPI.Cmdr.Util.MakeFuzzyFinder(TransactionNames)(Text)
        end,

        --[[
        Returns if the input is valid and an error message
        for when it is invalid.
        --]]
        Validate = function(Items)
            return #Items > 0,"No items were found matching that query."
        end,
    
        --[[
        Returns the results for auto completing.
        --]]
        Autocomplete = function(Items)
            return Items
        end,
    
        --[[
        Returns the value to use.
        --]]
        Parse = function(Items)
            return TransactionNamesToId[Items[1]]
        end,
    }

    --Register the types.
    NexusAdminAPI.Cmdr.Registry:RegisterType("gameStoreTransaction",GameItemType)
end