feat: define type aliases for billing ports&adapters

This commit is contained in:
Aravinth Manivannan 2024-12-18 18:10:59 +05:30
parent 44a3362679
commit f22ce33a35
Signed by: realaravinth
GPG key ID: F8F50389936984FF

View 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>;