From 9d34c84bbc0404af59eb183c5c74c6ad7cf03b67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Kaan=20G=C3=BCm=C3=BC=C5=9F?= Date: Fri, 11 Sep 2026 14:31:33 +0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=B9=20chore:=20re-point=20cross-lane?= =?UTF-8?q?=20calls=20after=20comms/misc=20merge=20(registration/event)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/db/event.rs | 5 ++--- src/service/registration.rs | 6 +++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/db/event.rs b/src/db/event.rs index 971bdca..27cc24e 100644 --- a/src/db/event.rs +++ b/src/db/event.rs @@ -8,7 +8,6 @@ use crate::database::{Database, transaction_with_retry}; use crate::db::field_update::FieldUpdate; use crate::domain::class_member::{ClassMember, ClassMemberId}; use crate::domain::event::{Event, EventAudience, EventDescription, EventId, EventTitle}; -use crate::domain::registration::Registration; use crate::domain::timestamp::{Timestamp, range_error}; use crate::domain::user::{User, UserId}; use crate::error::AppError; @@ -42,7 +41,7 @@ pub async fn includes( Ok(member.is_some()) } EventAudience::Registration { .. } => { - Ok(Registration::read_for_user(event, user.get_id(), db) + Ok(crate::db::registration::read_for_user(db, event, user.get_id()) .await? .is_some()) } @@ -83,7 +82,7 @@ pub async fn members( .iter() .map(|member| member.get_user().clone()) .collect()), - EventAudience::Registration { .. } => Ok(Registration::list_for_event(event, db) + EventAudience::Registration { .. } => Ok(crate::db::registration::list_for_event(db, event) .await? .iter() .map(|registration| registration.get_user().clone()) diff --git a/src/service/registration.rs b/src/service/registration.rs index 9550723..e3a00c7 100644 --- a/src/service/registration.rs +++ b/src/service/registration.rs @@ -7,7 +7,7 @@ use crate::constant::REGISTRATION_COUNT_FIELD; use crate::database::Database; use crate::db::cap; use crate::db::registration; -use crate::domain::event::{Event, EventId}; +use crate::domain::event::EventId; use crate::domain::registration::{Registration, RegistrationId}; use crate::domain::role::Role; use crate::domain::user::UserId; @@ -43,7 +43,7 @@ pub async fn register( } // Read for its refusals only — the audience kind and the closing time. // The seat count itself is re-read by the claim. - Event::read(event, db) + crate::db::event::read(db, event) .await? .ok_or(AppError::NotFound)? .registration_capacity()?; @@ -80,7 +80,7 @@ pub async fn register( // the holder fell to parent while this ran — the conditional writes // match nothing (or throw) either way, and only this path pays for // the reads that tell them apart. - cap::Claimed::Full => match Event::read(event, db).await? { + cap::Claimed::Full => match crate::db::event::read(db, event).await? { None => Err(AppError::NotFound), Some(_) => match crate::db::user::read(db, user).await? { Some(held) if held.get_role() == Role::Parent => Err(AppError::Forbidden(