In a certain rest frame, we have a right cuboid box moving in the +x direction with velocity v. As measured in the rest frame the box has one axis aligned with the x axis and of length A and the other axes aligned with the Y and Z axes and of identical length B. At one point the center of the box coincides with the center of our coordinate system and a flash of light is emitted and bounces off a mirror at the leading edge of the box and returns to the center of the box. Also it hits a detector at the center of one of the faces parallel to the direction of the movement.
Question 1. Describe all events in the rest frame if the event where the center of the box coincides with the center of coordinate system is labeled as (T, 0, 0, 0).
Event O -- The light leaves the center of the cube
$$ O = (T, 0, 0, 0)$$
Event D -- the light hits the detector in the center of a face parallel to the direction of movement.
$$ D = \left(T + \frac{B}{2} \times \frac{1}{\sqrt{c^2 - v^2}} , \quad \frac{B}{2} \times \frac{v}{\sqrt{c^2 - v^2}}, \quad 0, \quad \frac{B}{2} \right)$$
Event M -- the light bounces off the mirror in the leading direction
$$M= \left(T + \frac{A}{2} \times \frac{1}{c - v} , \quad \frac{A}{2} \times \frac{c}{c - v}, \quad 0, \quad 0 \right)$$
Event R -- the bounced light returns to the center of the moving cube
$$R = \left(T + \frac{c A}{c^2 - v^2} , \quad \frac{c A v}{c^2 - v^2}, \quad 0, \quad 0 \right)$$
But none of these calculations relate to Special Relativity which is the assertion that all inertial coordinate systems are valid descriptions of the same physics and that the speed of light is the same for all directions in all inertial coordinate systems.
The theory of special relativity says the relations between these events have a
geometry.
Question 2. What are all the geometric constraints (according to the theory of special relativity) on these four events.
Here we compute $$\eta_{\mu\nu} a^{\mu} b^{\nu} = c^2 a^t b^t - a^x b^x - a^y b^y - a^z b^z$$ which are the invariants that are preserved by the Lorentz transform.
$$\begin{array}{rcl|cl}
( D - O ) & \cdot & ( D - O ) & 0 & D-O \; \textrm{is light-like}
( D - O ) & \cdot & ( M - O ) & \frac{A B}{4 \sqrt{1 - \frac{v^2}{c^2}}}
( D - O ) & \cdot & ( R - O ) & \frac{A B}{2 \sqrt{1 - \frac{v^2}{c^2}}}
( D - O ) & \cdot & ( M - D ) & \frac{A B}{4 \sqrt{1 - \frac{v^2}{c^2}}}
( D - O ) & \cdot & ( R - D ) & \frac{A B}{2 \sqrt{1 - \frac{v^2}{c^2}}}
( D - O ) & \cdot & ( R - M ) & \frac{A B}{4 \sqrt{1 - \frac{v^2}{c^2}}}
( M - O ) & \cdot & ( M - O ) & 0 & M-O \; \textrm{is light-like}
( M - O ) & \cdot & ( R - O ) & \frac{A^2}{2 \left( 1 - \frac{v^2}{c^2} \right) }
( M - O ) & \cdot & ( M - D ) & - \frac{A B}{4 \sqrt{1 - \frac{v^2}{c^2}}}
( M - O ) & \cdot & ( R - D ) & \frac{A^2}{2 \left( 1 - \frac{v^2}{c^2} \right) } - \frac{A B}{4 \sqrt{1 - \frac{v^2}{c^2}}}
( M - O ) & \cdot & ( R - M ) & \frac{A^2}{2 \left( 1 - \frac{v^2}{c^2} \right) }
( R - O ) & \cdot & ( R - O ) & \frac{A^2}{1 - \frac{v^2}{c^2}} & R-O \; \textrm{is time-like with a proper time of} \; \frac{A}{c \sqrt{1 - \frac{v^2}{c^2}}}
( R - O ) & \cdot & ( M - D ) & \frac{A^2}{2 \left( 1 - \frac{v^2}{c^2} \right) } -\frac{A B}{2 \sqrt{1 - \frac{v^2}{c^2}}}
( R - O ) & \cdot & ( R - D ) & \frac{A^2}{1 - \frac{v^2}{c^2}} - \frac{AB}{2 \sqrt{1 - \frac{v^2}{c^2}}}
( R - O ) & \cdot & ( R - M ) & \frac{A^2}{1 - \frac{v^2}{c^2}}
( M - D ) & \cdot & ( M - D ) & - \frac{A B}{2 \sqrt{1 - \frac{v^2}{c^2}}} & M - D \; \textrm{is time-like with a proper spatial separation of} \; \frac{\sqrt{A B}}{\sqrt{2} \sqrt[4]{1 - \frac{v^2}{c^2}}}
( M - D ) & \cdot & ( R - D ) & \frac{A^2}{2 \left( 1 - \frac{v^2}{c^2} \right) } -\frac{3 A B}{4 \sqrt{1 - \frac{v^2}{c^2}}}
( M - D ) & \cdot & ( R - M ) & \frac{A^2}{2 \left( 1 - \frac{v^2}{c^2} \right) } -\frac{A B}{4 \sqrt{1 - \frac{v^2}{c^2}}}
( R - D ) & \cdot & ( R - D ) & \frac{A^2}{1 - \frac{v^2}{c^2} } -\frac{A B}{\sqrt{1 - \frac{v^2}{c^2}}} & R - D \; \textrm{is light-like if} \; v = \pm \sqrt{1 - \frac{A^2}{B^2}} c
( R - D ) & \cdot & ( R - M ) & \frac{A^2}{2 \left( 1 - \frac{v^2}{c^2} \right) } -\frac{A B}{4 \sqrt{1 - \frac{v^2}{c^2}}}
( R - M ) & \cdot & ( R - M ) & 0 & R-M \; \textrm{is light-like}
\end{array}$$
That would be an error prone calculation to say the least, unless you exploit symmetry and the bilinearity of the inner product.
$$\begin{array}{c|cccccc} \cdot & D-O & M-O & R-O & M-D & R-D & R-M \\ \hline
D-O & 0 & \frac{1}{4} (\gamma A) B & \frac{1}{2} (\gamma A) B & \frac{1}{4} (\gamma A) B & \frac{1}{2} (\gamma A) B & \frac{1}{4} (\gamma A) B
M-O & \frac{1}{4} (\gamma A) B & 0 & \frac{1}{2} (\gamma A)^2 & - \frac{1}{4} (\gamma A) B & \frac{1}{2} (\gamma A) \left( \gamma A - \frac{1}{2} B \right) & \frac{1}{2} (\gamma A)^2
R-O & \frac{1}{2} (\gamma A) B & \frac{1}{2} (\gamma A)^2 & (\gamma A)^2 & \frac{1}{2} (\gamma A) ( \gamma A - B ) & (\gamma A) \left( \gamma A - \frac{1}{2} B \right) & \frac{1}{2} (\gamma A)^2
M-D & \frac{1}{4} (\gamma A) B & - \frac{1}{4} (\gamma A) B & \frac{1}{2} (\gamma A) ( \gamma A - B ) & - \frac{1}{2} (\gamma A) B & \frac{1}{2} (\gamma A) \left( \gamma A - \frac{3}{2} B \right) & \frac{1}{2} (\gamma A) \left( \gamma A - \frac{1}{2} B \right)
R-D & \frac{1}{2} (\gamma A) B & \frac{1}{2} (\gamma A) \left( \gamma A - \frac{1}{2} B \right) & (\gamma A) \left( \gamma A - \frac{1}{2} B \right) & \frac{1}{2} (\gamma A) \left( \gamma A - \frac{3}{2} B \right) & (\gamma A) ( \gamma A - B ) & \frac{1}{2} (\gamma A) \left( \gamma A - \frac{1}{2} B \right)
R-M & \frac{1}{4} (\gamma A) B & \frac{1}{2} (\gamma A)^2 & \frac{1}{2} (\gamma A)^2 & \frac{1}{2} (\gamma A) \left( \gamma A - \frac{1}{2} B \right) & \frac{1}{2} (\gamma A) \left( \gamma A - \frac{1}{2} B \right) & 0
\end{array}$$
Here -- in every case the quantity A is associated with a factor $$\gamma = \frac{1}{\sqrt{1 - \frac{v^2}{c^2}}}$$ which is related to the fact than in the rest frame of the cuboid (as reached by a Lorentz transform) the cuboid is longer in the X direction than when moving at velocity v.