Build an API that issues event coupons. There's exactly one rule — each user may be issued a coupon only once. If a user who has already received one requests again, the request must be rejected. Complete CouponService.issue.
Complete an event-coupon issuance API built on Spring Boot 3 and JPA (in-memory H2). There is exactly one rule — each user may receive a coupon only once, and a user who already has one must be rejected on a repeat request. The controller handles only the HTTP boundary while the issuance rule lives in the service.
For an issuance with a fixed limit like "one per user," the key topic is whether the result stays the same when the same request arrives again. It is common for a button to be pressed twice, or for a request to be resent as a mobile network drops and reconnects. So for a write like issuance, the server itself has to take responsibility for how that limit is upheld. This problem deals with that limit rule within a single-instance, single-threaded scope.