forge
Explore
Log in

Don't you dare go Hollow

Re-point cross-lane calls after comms/misc merge (registration/event)

Browse files at this commit

9d34c84bbc0404af59eb183c5c74c6ad7cf03b67Ahmet Kaan GümüşParent: 4ab90d9
  • chore
    • re-point cross-lane calls after comms/misc merge (registration/event)
Show full message
🧹 chore: re-point cross-lane calls after comms/misc merge (registration/event)
src/db/event.rsmodified+2 -3
@@ -8,7 +8,6 @@ use crate::database::{Database, transaction_with_retry};
88 use crate::db::field_update::FieldUpdate;
99 use crate::domain::class_member::{ClassMember, ClassMemberId};
1010 use crate::domain::event::{Event, EventAudience, EventDescription, EventId, EventTitle};
11-use crate::domain::registration::Registration;
1211 use crate::domain::timestamp::{Timestamp, range_error};
1312 use crate::domain::user::{User, UserId};
1413 use crate::error::AppError;
@@ -42,7 +41,7 @@ pub async fn includes(
4241 Ok(member.is_some())
4342 }
4443 EventAudience::Registration { .. } => {
45- Ok(Registration::read_for_user(event, user.get_id(), db)
44+ Ok(crate::db::registration::read_for_user(db, event, user.get_id())
4645 .await?
4746 .is_some())
4847 }
@@ -83,7 +82,7 @@ pub async fn members(
8382 .iter()
8483 .map(|member| member.get_user().clone())
8584 .collect()),
86- EventAudience::Registration { .. } => Ok(Registration::list_for_event(event, db)
85+ EventAudience::Registration { .. } => Ok(crate::db::registration::list_for_event(db, event)
8786 .await?
8887 .iter()
8988 .map(|registration| registration.get_user().clone())
src/service/registration.rsmodified+3 -3
@@ -7,7 +7,7 @@ use crate::constant::REGISTRATION_COUNT_FIELD;
77 use crate::database::Database;
88 use crate::db::cap;
99 use crate::db::registration;
10-use crate::domain::event::{Event, EventId};
10+use crate::domain::event::EventId;
1111 use crate::domain::registration::{Registration, RegistrationId};
1212 use crate::domain::role::Role;
1313 use crate::domain::user::UserId;
@@ -43,7 +43,7 @@ pub async fn register(
4343 }
4444 // Read for its refusals only — the audience kind and the closing time.
4545 // The seat count itself is re-read by the claim.
46- Event::read(event, db)
46+ crate::db::event::read(db, event)
4747 .await?
4848 .ok_or(AppError::NotFound)?
4949 .registration_capacity()?;
@@ -80,7 +80,7 @@ pub async fn register(
8080 // the holder fell to parent while this ran — the conditional writes
8181 // match nothing (or throw) either way, and only this path pays for
8282 // the reads that tell them apart.
83- cap::Claimed::Full => match Event::read(event, db).await? {
83+ cap::Claimed::Full => match crate::db::event::read(db, event).await? {
8484 None => Err(AppError::NotFound),
8585 Some(_) => match crate::db::user::read(db, user).await? {
8686 Some(held) if held.get_role() == Role::Parent => Err(AppError::Forbidden(