feat: define type aliases for billing ports&adapters
This commit is contained in:
parent
0a12f8938f
commit
ea2931990c
1 changed files with 45 additions and 0 deletions
45
src/billing/adapters/types.rs
Normal file
45
src/billing/adapters/types.rs
Normal file
|
@ -0,0 +1,45 @@
|
||||||
|
// SPDX-FileCopyrightText: 2024 Aravinth Manivannan <realaravinth@batsense.net>
|
||||||
|
//
|
||||||
|
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||||
|
|
||||||
|
// SPDX-FileCopyrightText: 2024 Aravinth Manivannan <realaravinth@batsense.net>
|
||||||
|
//
|
||||||
|
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||||
|
#![allow(dead_code)]
|
||||||
|
|
||||||
|
use std::sync::Arc;
|
||||||
|
|
||||||
|
use actix_web::web::Data;
|
||||||
|
use cqrs_es::persist::ViewRepository;
|
||||||
|
use postgres_es::PostgresCqrs;
|
||||||
|
|
||||||
|
use crate::billing::{
|
||||||
|
adapters::{
|
||||||
|
input::web::RoutesRepository,
|
||||||
|
output::db::postgres::{
|
||||||
|
bill_view::BillView, line_item_view::LineItemView, store_view::StoreView,
|
||||||
|
BillingDBPostgresAdapter,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
application::services::BillingServicesObj,
|
||||||
|
domain::{bill_aggregate::Bill, line_item_aggregate::LineItem, store_aggregate::Store},
|
||||||
|
};
|
||||||
|
|
||||||
|
pub type WebBillingRoutesRepository = Data<Arc<RoutesRepository>>;
|
||||||
|
|
||||||
|
pub type WebBillingServiceObj = Data<BillingServicesObj>;
|
||||||
|
|
||||||
|
pub type BillingBillCqrsExec = Arc<PostgresCqrs<Bill>>;
|
||||||
|
pub type WebBillingBillCqrsExec = Data<BillingBillCqrsExec>;
|
||||||
|
pub type BillingBillCqrsView = Arc<dyn ViewRepository<BillView, Bill>>;
|
||||||
|
pub type WebBillingBillCqrsView = Data<BillingBillCqrsView>;
|
||||||
|
|
||||||
|
pub type BillingLineItemCqrsExec = Arc<PostgresCqrs<LineItem>>;
|
||||||
|
pub type WebBillingLineItemCqrsExec = Data<BillingLineItemCqrsExec>;
|
||||||
|
pub type BillingLineItemCqrsView = Arc<dyn ViewRepository<LineItemView, LineItem>>;
|
||||||
|
pub type WebBillingLineItemCqrsView = Data<BillingLineItemCqrsView>;
|
||||||
|
|
||||||
|
pub type BillingStoreCqrsExec = Arc<PostgresCqrs<Store>>;
|
||||||
|
pub type WebBillingStoreCqrsExec = Data<BillingStoreCqrsExec>;
|
||||||
|
pub type BillingStoreCqrsView = Arc<dyn ViewRepository<StoreView, Store>>;
|
||||||
|
pub type WebBillingStoreCqrsView = Data<BillingStoreCqrsView>;
|
Loading…
Add table
Reference in a new issue