Formal Bayes rule for the bandit problem

We have two slot machines, $$B_1$$ and $$B_2$$. We've played the first machine $$n_1$$ times and gotten the rewards $$R_1^1, \dots, R_1^{n_1}$$ and played the second machine $$n_2$$ times and gotten the rewards $$R_2^1, \dots, R_2^{n_2}$$.

Based on the data $$x = \{ R_1^1, \dots, R_1^{n_1},R_2^1, \dots, R_2^{n_2} \}$$ we want to decide if we should play $$B_1$$ or $$B_2$$ next. The action space is $$\aleph ={1,2}$$ and our parameter is $$Y=(R_1, R_2)$$, the next reward for each machine. We consider two loss functions, $$L_1(Y,a) = -R_a$$ and $$L_2(Y,a) = 1_{R_a = 0}$$. Find the formal Bayes rule for each loss function.

Attempted solution for $$L_1$$:

The expected loss for action $$a$$ is given by the integral of the loss function weighted by the posterior distribution:

$$E[L_1(Y,a)∣x]=\int L_1(y,a)P_{Y|X}(y|x) dy$$

To minimize this expected loss, we choose the action $$a$$ that minimizes the integral. The Bayes rule is then given by:

$$\hat{a}(x)=arg⁡min⁡_a∫(−R_a)⋅P(Y=y∣x)$$

For $$L_2$$:

The expected loss for action $$a$$ is given by the sum of the probabilities of the loss occurring:

$$E[L_2(Y,a)∣x]=P(R_a=0∣x)$$

To minimize this expected loss, we choose the action aa that minimizes the probability of $$R_a = 0$$. The Bayes rule is then given by:

$$\hat{a}(x)=arg⁡min⁡_a P(R_a=0∣x)$$

Am I out in the woods or on to something?

Best regards