-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #103 from refactor-group/more_refactoring
More refactoring
- Loading branch information
Showing
49 changed files
with
356 additions
and
564 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
|
||
This diagram represents the dependency structure of the crates in this project. Each arrow indicates a dependency relationship between the crates. For example, the `web` crate depends on both the `domain` and `service` crates, while the `entity_api` crate depends on the `entity` and `service` crates. | ||
|
||
```mermaid | ||
graph TD; | ||
web-->domain; | ||
web-->service; | ||
domain-->entity_api; | ||
entity_api-->entity; | ||
entity_api-->service; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
use crate::actions::Model; | ||
use crate::error::Error; | ||
use entity_api::IntoQueryFilterMap; | ||
use entity_api::{actions, query}; | ||
use sea_orm::DatabaseConnection; | ||
|
||
pub use entity_api::action::{create, delete_by_id, find_by_id, update, update_status}; | ||
|
||
pub async fn find_by( | ||
db: &DatabaseConnection, | ||
params: impl IntoQueryFilterMap, | ||
) -> Result<Vec<Model>, Error> { | ||
let actions = | ||
query::find_by::<actions::Entity, actions::Column>(db, params.into_query_filter_map()) | ||
.await?; | ||
|
||
Ok(actions) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,20 @@ | ||
use crate::agreements::Model; | ||
use crate::error::Error; | ||
use entity::agreements::Model; | ||
pub use entity_api::agreement::{create, delete_by_id, find_by_id, update}; | ||
use entity_api::{agreement, IntoQueryFilterMap}; | ||
use entity_api::IntoQueryFilterMap; | ||
use entity_api::{agreements, query}; | ||
use sea_orm::DatabaseConnection; | ||
|
||
pub use entity_api::agreement::{create, delete_by_id, find_by_id, update}; | ||
|
||
pub async fn find_by( | ||
db: &DatabaseConnection, | ||
params: impl IntoQueryFilterMap, | ||
) -> Result<Vec<Model>, Error> { | ||
let agreements = agreement::find_by(db, params.into_query_filter_map()).await?; | ||
let agreements = query::find_by::<agreements::Entity, agreements::Column>( | ||
db, | ||
params.into_query_filter_map(), | ||
) | ||
.await?; | ||
|
||
Ok(agreements) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
use crate::coaching_relationships::Model; | ||
use crate::error::Error; | ||
use entity_api::IntoQueryFilterMap; | ||
use entity_api::{coaching_relationships, query}; | ||
use sea_orm::DatabaseConnection; | ||
|
||
pub use entity_api::coaching_relationship::{ | ||
create, find_by_id, find_by_organization_with_user_names, find_by_user, | ||
get_relationship_with_user_names, CoachingRelationshipWithUserNames, | ||
}; | ||
|
||
pub async fn find_by( | ||
db: &DatabaseConnection, | ||
params: impl IntoQueryFilterMap, | ||
) -> Result<Vec<Model>, Error> { | ||
let coaching_relationships = query::find_by::< | ||
coaching_relationships::Entity, | ||
coaching_relationships::Column, | ||
>(db, params.into_query_filter_map()) | ||
.await?; | ||
|
||
Ok(coaching_relationships) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,27 @@ | ||
//! This module re-exports `IntoQueryFilterMap` and `QueryFilterMap` from the `entity_api` crate. | ||
//! This module re-exports various items from the `entity_api` crate. | ||
//! | ||
//! The purpose of this re-export is to ensure that consumers of the `domain` crate do not need to | ||
//! directly depend on the `entity_api` crate. By re-exporting these items, we provide a clear and | ||
//! consistent interface for working with query filters within the domain layer, while encapsulating | ||
//! the underlying implementation details remain in the `entity_api` crate. | ||
pub use entity_api::{IntoQueryFilterMap, QueryFilterMap}; | ||
|
||
// Re-exports from `entity` | ||
pub use entity_api::user::{AuthSession, Backend, Credentials}; | ||
pub use entity_api::{ | ||
actions, agreements, coachees, coaches, coaching_relationships, coaching_sessions, jwts, notes, | ||
organizations, overarching_goals, users, Id, | ||
}; | ||
|
||
pub mod action; | ||
pub mod agreement; | ||
pub mod coaching_relationship; | ||
pub mod coaching_session; | ||
pub mod error; | ||
pub mod jwt; | ||
pub mod note; | ||
pub mod organization; | ||
pub mod overarching_goal; | ||
pub mod user; | ||
|
||
pub(crate) mod gateway; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
pub use entity_api::note::{create, find_by, find_by_id, update}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
pub use entity_api::organization::{ | ||
create, delete_by_id, find_all, find_by, find_by_id, find_by_user, update, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
use crate::error::Error; | ||
use crate::overarching_goals::Model; | ||
use entity_api::IntoQueryFilterMap; | ||
use entity_api::{overarching_goals, query}; | ||
use sea_orm::DatabaseConnection; | ||
|
||
pub use entity_api::overarching_goal::{create, find_by_id, update, update_status}; | ||
|
||
pub async fn find_by( | ||
db: &DatabaseConnection, | ||
params: impl IntoQueryFilterMap, | ||
) -> Result<Vec<Model>, Error> { | ||
let overarching_goals = query::find_by::<overarching_goals::Entity, overarching_goals::Column>( | ||
db, | ||
params.into_query_filter_map(), | ||
) | ||
.await?; | ||
|
||
Ok(overarching_goals) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
pub use entity_api::user::{create, find_by_email}; |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.