Skip to main content

backbone_inventory/application/service/
mod.rs

1//! Application services
2//!
3//! Generated by metaphor-schema. Do not edit manually.
4//!
5//! Each entity service is a type alias over `GenericCrudService`.
6
7pub mod error;
8pub use error::{ServiceError, ServiceResult};
9
10pub mod picking_batch_service;
11pub mod delivery_note_service;
12pub mod delivery_note_item_service;
13pub mod inventory_company_setting_service;
14pub mod landed_cost_service;
15pub mod landed_cost_line_service;
16pub mod landed_cost_adjustment_line_service;
17pub mod location_service;
18pub mod stock_move_service;
19pub mod stock_move_line_service;
20pub mod operation_type_service;
21pub mod transfer_service;
22pub mod route_service;
23pub mod route_rule_service;
24pub mod reordering_rule_service;
25pub mod purchase_receipt_service;
26pub mod purchase_receipt_item_service;
27pub mod quant_service;
28pub mod scrap_service;
29pub mod scrap_reason_tag_service;
30pub mod stock_entry_service;
31pub mod stock_entry_item_service;
32pub mod stock_ledger_entry_service;
33pub mod bin_service;
34pub mod stock_reconciliation_service;
35pub mod stock_reconciliation_item_service;
36pub mod package_type_service;
37pub mod storage_category_service;
38pub mod storage_category_capacity_service;
39pub mod putaway_rule_service;
40pub mod lot_service;
41pub mod package_service;
42pub mod warehouse_service;
43pub mod stock_item_service;
44
45
46pub use picking_batch_service::PickingBatchService;
47pub use delivery_note_service::DeliveryNoteService;
48pub use delivery_note_item_service::DeliveryNoteItemService;
49pub use inventory_company_setting_service::InventoryCompanySettingService;
50pub use landed_cost_service::LandedCostService;
51pub use landed_cost_line_service::LandedCostLineService;
52pub use landed_cost_adjustment_line_service::LandedCostAdjustmentLineService;
53pub use location_service::LocationService;
54pub use stock_move_service::StockMoveService;
55pub use stock_move_line_service::StockMoveLineService;
56pub use operation_type_service::OperationTypeService;
57pub use transfer_service::TransferService;
58pub use route_service::RouteService;
59pub use route_rule_service::RouteRuleService;
60pub use reordering_rule_service::ReorderingRuleService;
61pub use purchase_receipt_service::PurchaseReceiptService;
62pub use purchase_receipt_item_service::PurchaseReceiptItemService;
63pub use quant_service::QuantService;
64pub use scrap_service::ScrapService;
65pub use scrap_reason_tag_service::ScrapReasonTagService;
66pub use stock_entry_service::StockEntryService;
67pub use stock_entry_item_service::StockEntryItemService;
68pub use stock_ledger_entry_service::StockLedgerEntryService;
69pub use bin_service::BinService;
70pub use stock_reconciliation_service::StockReconciliationService;
71pub use stock_reconciliation_item_service::StockReconciliationItemService;
72pub use package_type_service::PackageTypeService;
73pub use storage_category_service::StorageCategoryService;
74pub use storage_category_capacity_service::StorageCategoryCapacityService;
75pub use putaway_rule_service::PutawayRuleService;
76pub use lot_service::LotService;
77pub use package_service::PackageService;
78pub use warehouse_service::WarehouseService;
79pub use stock_item_service::StockItemService;
80pub use picking_batch_service::PickingBatchRowRules;
81pub use delivery_note_service::DeliveryNoteRowRules;
82pub use delivery_note_item_service::DeliveryNoteItemRowRules;
83pub use landed_cost_service::LandedCostRowRules;
84pub use landed_cost_line_service::LandedCostLineRowRules;
85pub use landed_cost_adjustment_line_service::LandedCostAdjustmentLineRowRules;
86pub use location_service::LocationRowRules;
87pub use stock_move_service::StockMoveRowRules;
88pub use stock_move_line_service::StockMoveLineRowRules;
89pub use operation_type_service::OperationTypeRowRules;
90pub use transfer_service::TransferRowRules;
91pub use route_service::RouteRowRules;
92pub use route_rule_service::RouteRuleRowRules;
93pub use reordering_rule_service::ReorderingRuleRowRules;
94pub use purchase_receipt_service::PurchaseReceiptRowRules;
95pub use purchase_receipt_item_service::PurchaseReceiptItemRowRules;
96pub use quant_service::QuantRowRules;
97pub use scrap_service::ScrapRowRules;
98pub use scrap_reason_tag_service::ScrapReasonTagRowRules;
99pub use stock_entry_service::StockEntryRowRules;
100pub use stock_entry_item_service::StockEntryItemRowRules;
101pub use stock_ledger_entry_service::StockLedgerEntryRowRules;
102pub use bin_service::BinRowRules;
103pub use stock_reconciliation_service::StockReconciliationRowRules;
104pub use stock_reconciliation_item_service::StockReconciliationItemRowRules;
105pub use package_type_service::PackageTypeRowRules;
106pub use storage_category_service::StorageCategoryRowRules;
107pub use storage_category_capacity_service::StorageCategoryCapacityRowRules;
108pub use putaway_rule_service::PutawayRuleRowRules;
109pub use lot_service::LotRowRules;
110pub use package_service::PackageRowRules;
111pub use warehouse_service::WarehouseRowRules;
112pub use stock_item_service::StockItemRowRules;
113
114/// A `PickingBatchService` over `repository` with its write guard attached: the way to build it, so its writes are
115/// served only with the rules the schema declares.
116pub fn build_picking_batch_service(
117    repository: std::sync::Arc<crate::infrastructure::persistence::PickingBatchRepository>,
118) -> PickingBatchService {
119    PickingBatchService::with_repository(repository).with_guard(std::sync::Arc::new(PickingBatchRowRules))
120}
121
122/// A `DeliveryNoteService` over `repository` with its write guard attached: the way to build it, so its writes are
123/// served only with the rules the schema declares.
124pub fn build_delivery_note_service(
125    repository: std::sync::Arc<crate::infrastructure::persistence::DeliveryNoteRepository>,
126) -> DeliveryNoteService {
127    DeliveryNoteService::with_repository(repository).with_guard(std::sync::Arc::new(DeliveryNoteRowRules))
128}
129
130/// A `DeliveryNoteItemService` over `repository` with its write guard attached: the way to build it, so its writes are
131/// served only with the rules the schema declares.
132pub fn build_delivery_note_item_service(
133    repository: std::sync::Arc<crate::infrastructure::persistence::DeliveryNoteItemRepository>,
134) -> DeliveryNoteItemService {
135    DeliveryNoteItemService::with_repository(repository).with_guard(std::sync::Arc::new(DeliveryNoteItemRowRules))
136}
137
138/// A `InventoryCompanySettingService` over `repository`: the way to build it, so its writes are
139/// served only with the rules the schema declares.
140pub fn build_inventory_company_setting_service(
141    repository: std::sync::Arc<crate::infrastructure::persistence::InventoryCompanySettingRepository>,
142) -> InventoryCompanySettingService {
143    InventoryCompanySettingService::with_repository(repository)
144}
145
146/// A `LandedCostService` over `repository` with its write guard attached: the way to build it, so its writes are
147/// served only with the rules the schema declares.
148pub fn build_landed_cost_service(
149    repository: std::sync::Arc<crate::infrastructure::persistence::LandedCostRepository>,
150) -> LandedCostService {
151    LandedCostService::with_repository(repository).with_guard(std::sync::Arc::new(LandedCostRowRules))
152}
153
154/// A `LandedCostLineService` over `repository` with its write guard attached: the way to build it, so its writes are
155/// served only with the rules the schema declares.
156pub fn build_landed_cost_line_service(
157    repository: std::sync::Arc<crate::infrastructure::persistence::LandedCostLineRepository>,
158) -> LandedCostLineService {
159    LandedCostLineService::with_repository(repository).with_guard(std::sync::Arc::new(LandedCostLineRowRules))
160}
161
162/// A `LandedCostAdjustmentLineService` over `repository` with its write guard attached: the way to build it, so its writes are
163/// served only with the rules the schema declares.
164pub fn build_landed_cost_adjustment_line_service(
165    repository: std::sync::Arc<crate::infrastructure::persistence::LandedCostAdjustmentLineRepository>,
166) -> LandedCostAdjustmentLineService {
167    LandedCostAdjustmentLineService::with_repository(repository).with_guard(std::sync::Arc::new(LandedCostAdjustmentLineRowRules))
168}
169
170/// A `LocationService` over `repository` with its write guard attached: the way to build it, so its writes are
171/// served only with the rules the schema declares.
172pub fn build_location_service(
173    repository: std::sync::Arc<crate::infrastructure::persistence::LocationRepository>,
174) -> LocationService {
175    LocationService::with_repository(repository).with_guard(std::sync::Arc::new(LocationRowRules))
176}
177
178/// A `StockMoveService` over `repository` with its write guard attached: the way to build it, so its writes are
179/// served only with the rules the schema declares.
180pub fn build_stock_move_service(
181    repository: std::sync::Arc<crate::infrastructure::persistence::StockMoveRepository>,
182) -> StockMoveService {
183    StockMoveService::with_repository(repository).with_guard(std::sync::Arc::new(StockMoveRowRules))
184}
185
186/// A `StockMoveLineService` over `repository` with its write guard attached: the way to build it, so its writes are
187/// served only with the rules the schema declares.
188pub fn build_stock_move_line_service(
189    repository: std::sync::Arc<crate::infrastructure::persistence::StockMoveLineRepository>,
190) -> StockMoveLineService {
191    StockMoveLineService::with_repository(repository).with_guard(std::sync::Arc::new(StockMoveLineRowRules))
192}
193
194/// A `OperationTypeService` over `repository` with its write guard attached: the way to build it, so its writes are
195/// served only with the rules the schema declares.
196pub fn build_operation_type_service(
197    repository: std::sync::Arc<crate::infrastructure::persistence::OperationTypeRepository>,
198) -> OperationTypeService {
199    OperationTypeService::with_repository(repository).with_guard(std::sync::Arc::new(OperationTypeRowRules))
200}
201
202/// A `TransferService` over `repository` with its write guard attached: the way to build it, so its writes are
203/// served only with the rules the schema declares.
204pub fn build_transfer_service(
205    repository: std::sync::Arc<crate::infrastructure::persistence::TransferRepository>,
206) -> TransferService {
207    TransferService::with_repository(repository).with_guard(std::sync::Arc::new(TransferRowRules))
208}
209
210/// A `RouteService` over `repository` with its write guard attached: the way to build it, so its writes are
211/// served only with the rules the schema declares.
212pub fn build_route_service(
213    repository: std::sync::Arc<crate::infrastructure::persistence::RouteRepository>,
214) -> RouteService {
215    RouteService::with_repository(repository).with_guard(std::sync::Arc::new(RouteRowRules))
216}
217
218/// A `RouteRuleService` over `repository` with its write guard attached: the way to build it, so its writes are
219/// served only with the rules the schema declares.
220pub fn build_route_rule_service(
221    repository: std::sync::Arc<crate::infrastructure::persistence::RouteRuleRepository>,
222) -> RouteRuleService {
223    RouteRuleService::with_repository(repository).with_guard(std::sync::Arc::new(RouteRuleRowRules))
224}
225
226/// A `ReorderingRuleService` over `repository` with its write guard attached: the way to build it, so its writes are
227/// served only with the rules the schema declares.
228pub fn build_reordering_rule_service(
229    repository: std::sync::Arc<crate::infrastructure::persistence::ReorderingRuleRepository>,
230) -> ReorderingRuleService {
231    ReorderingRuleService::with_repository(repository).with_guard(std::sync::Arc::new(ReorderingRuleRowRules))
232}
233
234/// A `PurchaseReceiptService` over `repository` with its write guard attached: the way to build it, so its writes are
235/// served only with the rules the schema declares.
236pub fn build_purchase_receipt_service(
237    repository: std::sync::Arc<crate::infrastructure::persistence::PurchaseReceiptRepository>,
238) -> PurchaseReceiptService {
239    PurchaseReceiptService::with_repository(repository).with_guard(std::sync::Arc::new(PurchaseReceiptRowRules))
240}
241
242/// A `PurchaseReceiptItemService` over `repository` with its write guard attached: the way to build it, so its writes are
243/// served only with the rules the schema declares.
244pub fn build_purchase_receipt_item_service(
245    repository: std::sync::Arc<crate::infrastructure::persistence::PurchaseReceiptItemRepository>,
246) -> PurchaseReceiptItemService {
247    PurchaseReceiptItemService::with_repository(repository).with_guard(std::sync::Arc::new(PurchaseReceiptItemRowRules))
248}
249
250/// A `QuantService` over `repository` with its write guard attached: the way to build it, so its writes are
251/// served only with the rules the schema declares.
252pub fn build_quant_service(
253    repository: std::sync::Arc<crate::infrastructure::persistence::QuantRepository>,
254) -> QuantService {
255    QuantService::with_repository(repository).with_guard(std::sync::Arc::new(QuantRowRules))
256}
257
258/// A `ScrapService` over `repository` with its write guard attached: the way to build it, so its writes are
259/// served only with the rules the schema declares.
260pub fn build_scrap_service(
261    repository: std::sync::Arc<crate::infrastructure::persistence::ScrapRepository>,
262) -> ScrapService {
263    ScrapService::with_repository(repository).with_guard(std::sync::Arc::new(ScrapRowRules))
264}
265
266/// A `ScrapReasonTagService` over `repository` with its write guard attached: the way to build it, so its writes are
267/// served only with the rules the schema declares.
268pub fn build_scrap_reason_tag_service(
269    repository: std::sync::Arc<crate::infrastructure::persistence::ScrapReasonTagRepository>,
270) -> ScrapReasonTagService {
271    ScrapReasonTagService::with_repository(repository).with_guard(std::sync::Arc::new(ScrapReasonTagRowRules))
272}
273
274/// A `StockEntryService` over `repository` with its write guard attached: the way to build it, so its writes are
275/// served only with the rules the schema declares.
276pub fn build_stock_entry_service(
277    repository: std::sync::Arc<crate::infrastructure::persistence::StockEntryRepository>,
278) -> StockEntryService {
279    StockEntryService::with_repository(repository).with_guard(std::sync::Arc::new(StockEntryRowRules))
280}
281
282/// A `StockEntryItemService` over `repository` with its write guard attached: the way to build it, so its writes are
283/// served only with the rules the schema declares.
284pub fn build_stock_entry_item_service(
285    repository: std::sync::Arc<crate::infrastructure::persistence::StockEntryItemRepository>,
286) -> StockEntryItemService {
287    StockEntryItemService::with_repository(repository).with_guard(std::sync::Arc::new(StockEntryItemRowRules))
288}
289
290/// A `StockLedgerEntryService` over `repository` with its write guard attached: the way to build it, so its writes are
291/// served only with the rules the schema declares.
292pub fn build_stock_ledger_entry_service(
293    repository: std::sync::Arc<crate::infrastructure::persistence::StockLedgerEntryRepository>,
294) -> StockLedgerEntryService {
295    StockLedgerEntryService::with_repository(repository).with_guard(std::sync::Arc::new(StockLedgerEntryRowRules))
296}
297
298/// A `BinService` over `repository` with its write guard attached: the way to build it, so its writes are
299/// served only with the rules the schema declares.
300pub fn build_bin_service(
301    repository: std::sync::Arc<crate::infrastructure::persistence::BinRepository>,
302) -> BinService {
303    BinService::with_repository(repository).with_guard(std::sync::Arc::new(BinRowRules))
304}
305
306/// A `StockReconciliationService` over `repository` with its write guard attached: the way to build it, so its writes are
307/// served only with the rules the schema declares.
308pub fn build_stock_reconciliation_service(
309    repository: std::sync::Arc<crate::infrastructure::persistence::StockReconciliationRepository>,
310) -> StockReconciliationService {
311    StockReconciliationService::with_repository(repository).with_guard(std::sync::Arc::new(StockReconciliationRowRules))
312}
313
314/// A `StockReconciliationItemService` over `repository` with its write guard attached: the way to build it, so its writes are
315/// served only with the rules the schema declares.
316pub fn build_stock_reconciliation_item_service(
317    repository: std::sync::Arc<crate::infrastructure::persistence::StockReconciliationItemRepository>,
318) -> StockReconciliationItemService {
319    StockReconciliationItemService::with_repository(repository).with_guard(std::sync::Arc::new(StockReconciliationItemRowRules))
320}
321
322/// A `PackageTypeService` over `repository` with its write guard attached: the way to build it, so its writes are
323/// served only with the rules the schema declares.
324pub fn build_package_type_service(
325    repository: std::sync::Arc<crate::infrastructure::persistence::PackageTypeRepository>,
326) -> PackageTypeService {
327    PackageTypeService::with_repository(repository).with_guard(std::sync::Arc::new(PackageTypeRowRules))
328}
329
330/// A `StorageCategoryService` over `repository` with its write guard attached: the way to build it, so its writes are
331/// served only with the rules the schema declares.
332pub fn build_storage_category_service(
333    repository: std::sync::Arc<crate::infrastructure::persistence::StorageCategoryRepository>,
334) -> StorageCategoryService {
335    StorageCategoryService::with_repository(repository).with_guard(std::sync::Arc::new(StorageCategoryRowRules))
336}
337
338/// A `StorageCategoryCapacityService` over `repository` with its write guard attached: the way to build it, so its writes are
339/// served only with the rules the schema declares.
340pub fn build_storage_category_capacity_service(
341    repository: std::sync::Arc<crate::infrastructure::persistence::StorageCategoryCapacityRepository>,
342) -> StorageCategoryCapacityService {
343    StorageCategoryCapacityService::with_repository(repository).with_guard(std::sync::Arc::new(StorageCategoryCapacityRowRules))
344}
345
346/// A `PutawayRuleService` over `repository` with its write guard attached: the way to build it, so its writes are
347/// served only with the rules the schema declares.
348pub fn build_putaway_rule_service(
349    repository: std::sync::Arc<crate::infrastructure::persistence::PutawayRuleRepository>,
350) -> PutawayRuleService {
351    PutawayRuleService::with_repository(repository).with_guard(std::sync::Arc::new(PutawayRuleRowRules))
352}
353
354/// A `LotService` over `repository` with its write guard attached: the way to build it, so its writes are
355/// served only with the rules the schema declares.
356pub fn build_lot_service(
357    repository: std::sync::Arc<crate::infrastructure::persistence::LotRepository>,
358) -> LotService {
359    LotService::with_repository(repository).with_guard(std::sync::Arc::new(LotRowRules))
360}
361
362/// A `PackageService` over `repository` with its write guard attached: the way to build it, so its writes are
363/// served only with the rules the schema declares.
364pub fn build_package_service(
365    repository: std::sync::Arc<crate::infrastructure::persistence::PackageRepository>,
366) -> PackageService {
367    PackageService::with_repository(repository).with_guard(std::sync::Arc::new(PackageRowRules))
368}
369
370/// A `WarehouseService` over `repository` with its write guard attached: the way to build it, so its writes are
371/// served only with the rules the schema declares.
372pub fn build_warehouse_service(
373    repository: std::sync::Arc<crate::infrastructure::persistence::WarehouseRepository>,
374) -> WarehouseService {
375    WarehouseService::with_repository(repository).with_guard(std::sync::Arc::new(WarehouseRowRules))
376}
377
378/// A `StockItemService` over `repository` with its write guard attached: the way to build it, so its writes are
379/// served only with the rules the schema declares.
380pub fn build_stock_item_service(
381    repository: std::sync::Arc<crate::infrastructure::persistence::StockItemRepository>,
382) -> StockItemService {
383    StockItemService::with_repository(repository).with_guard(std::sync::Arc::new(StockItemRowRules))
384}
385
386// This directory's extension (hand-written; ADR-0031).
387include!("mod.ext.rs");