# SoftPOS Development Client Seed # Run with: INCLUDE_SOFT_POS=true mix run priv/repo/seeds_soft_pos.exs alias DaProductApp.SoftPos.OauthApplications # Generate credentials uid = "softpos_dev_client" secret = "dev_secret_123" # Create a development OAuth client client_attrs = %{ name: "SoftPOS Development Client", uid: uid, secret: secret, scopes: "transaction:write transaction:read", redirect_uri: "", # Not used for client_credentials grant } case OauthApplications.get_by_uid(uid) do nil -> case OauthApplications.create_application(client_attrs) do {:ok, _application} -> IO.puts("\n✅ Development OAuth client created successfully!") IO.puts(" Client ID: #{uid}") IO.puts(" Client Secret: #{secret}") IO.puts(" Scopes: transaction:write transaction:read\n") {:error, changeset} -> IO.puts("\n❌ Failed to create development client:") IO.inspect(changeset.errors) end _existing -> IO.puts("\n⚠️ Development client already exists, skipping...") end