package mservice

import "github.com/tech/sendico/pkg/merrors"

type Type = string

const (
	Accounts             Type = "accounts"               // Represents user accounts in the system
	Confirmations        Type = "confirmations"          // Represents confirmation code flows
	Amplitude            Type = "amplitude"              // Represents analytics integration with Amplitude
	Discovery            Type = "discovery"              // Represents service discovery registry
	Site                 Type = "site"                   // Represents public site endpoints
	Changes              Type = "changes"                // Tracks changes made to resources
	Clients              Type = "clients"                // Represents client information
	ChainGateway         Type = "chain_gateway"          // Represents chain gateway microservice
	MntxGateway          Type = "mntx_gateway"           // Represents Monetix gateway microservice
	PaymentGateway       Type = "payment_gateway"        // Represents payment gateway microservice
	FXOracle             Type = "fx_oracle"              // Represents FX oracle microservice
	FeePlans             Type = "fee_plans"              // Represents fee plans microservice
	BillingDocuments     Type = "billing_documents"      // Represents billing documents microservice
	FilterProjects       Type = "filter_projects"        // Represents comments on tasks or other resources
	Invitations          Type = "invitations"            // Represents invitations sent to users
	Invoices             Type = "invoices"               // Represents invoices
	Logo                 Type = "logo"                   // Represents logos for organizations or projects
	Ledger               Type = "ledger"                 // Represents ledger microservice
	LedgerAccounts       Type = "ledger_accounts"        // Represents ledger accounts microservice
	LedgerBalances       Type = "ledger_balances"        // Represents ledger account balances microservice
	LedgerEntries        Type = "ledger_journal_entries" // Represents ledger journal entries microservice
	LedgerOutbox         Type = "ledger_outbox"          // Represents ledger outbox microservice
	LedgerParties        Type = "ledger_parties"         // Represents ledger account owner parties microservice
	LedgerPlines         Type = "ledger_posting_lines"   // Represents ledger journal posting lines microservice
	PaymentOrchestrator  Type = "payment_orchestrator"   // Represents payment orchestration microservice
	ChainAssets          Type = "chain_assets"           // Represents managed chain assets
	ChainWallets         Type = "chain_wallets"          // Represents managed chain wallets
	ChainWalletBalances  Type = "chain_wallet_balances"  // Represents managed chain wallet balances
	ChainTransfers       Type = "chain_transfers"        // Represents chain transfers
	ChainDeposits        Type = "chain_deposits"         // Represents chain deposits
	Notifications        Type = "notifications"          // Represents notifications sent to users
	Organizations        Type = "organizations"          // Represents organizations in the system
	Payments             Type = "payments"               // Represents payments service
	PaymentRoutes        Type = "payment_routes"         // Represents payment routing definitions
	PaymentPlanTemplates Type = "payment_plan_templates" // Represents payment plan templates
	PaymentMethods       Type = "payment_methods"        // Represents payment methods service
	Permissions          Type = "permissions"            // Represents permissiosns service
	Policies             Type = "policies"               // Represents access control policies
	PolicyAssignements   Type = "policy_assignments"     // Represents policy assignments database
	Recipients           Type = "recipients"             // Represents payment recipients
	RefreshTokens        Type = "refresh_tokens"         // Represents refresh tokens for authentication
	Roles                Type = "roles"                  // Represents roles in access control
	Storage              Type = "storage"                // Represents statuses of tasks or projects
	TgSettle             Type = "tgsettle_gateway"       // Represents tg settlement gateway
	Tenants              Type = "tenants"                // Represents tenants managed in the system
	Wallets              Type = "wallets"                // Represents workflows for tasks or projects
	Workflows            Type = "workflows"              // Represents workflows for tasks or projects
)

func StringToSType(s string) (Type, error) {
	switch Type(s) {
	case Accounts, Confirmations, Amplitude, Site, Changes, Clients, ChainGateway, ChainWallets, ChainWalletBalances,
		ChainTransfers, ChainDeposits, MntxGateway, PaymentGateway, FXOracle, FeePlans, BillingDocuments, FilterProjects, Invitations, Invoices, Logo, Ledger,
		LedgerAccounts, LedgerBalances, LedgerEntries, LedgerOutbox, LedgerParties, LedgerPlines, Notifications,
		Organizations, Payments, PaymentRoutes, PaymentPlanTemplates, PaymentOrchestrator, Permissions, Policies, PolicyAssignements,
		RefreshTokens, Roles, Storage, Tenants, Workflows, Discovery:
		return Type(s), nil
	default:
		return "", merrors.InvalidArgument("invalid service type", s)
	}
}
