Search in sources :

Example 1 with UserRepository

use of de.metas.user.UserRepository in project metasfresh-webui-api by metasfresh.

the class PurchaseRowsLoaderTest method init.

@BeforeEach
public void init() {
    AdempiereTestHelper.get().init();
    availabilityCheckService = Mockito.mock(AvailabilityCheckService.class);
    org = newInstance(I_AD_Org.class);
    saveRecord(org);
    final I_C_UOM uom = newInstance(I_C_UOM.class);
    uom.setUOMSymbol("testUOMSympol");
    saveRecord(uom);
    this.TEN = Quantity.of(BigDecimal.TEN, uom);
    warehouse = newInstance(I_M_Warehouse.class);
    saveRecord(warehouse);
    final I_M_Product_Category productCategory = newInstance(I_M_Product_Category.class);
    saveRecord(productCategory);
    product = newInstance(I_M_Product.class);
    product.setM_Product_Category_ID(productCategory.getM_Product_Category_ID());
    product.setC_UOM_ID(uom.getC_UOM_ID());
    saveRecord(product);
    final I_C_BPartner bPartnerCustomer = newInstance(I_C_BPartner.class);
    bPartnerCustomer.setName("bPartnerCustomer.Name");
    saveRecord(bPartnerCustomer);
    salesOrderRecord = newInstance(I_C_Order.class);
    salesOrderRecord.setC_BPartner_ID(bPartnerCustomer.getC_BPartner_ID());
    salesOrderRecord.setPreparationDate(SystemTime.asTimestamp());
    salesOrderRecord.setC_PaymentTerm_ID(30);
    saveRecord(salesOrderRecord);
    bPartnerVendor = newInstance(I_C_BPartner.class);
    bPartnerVendor.setName("bPartnerVendor.Name");
    saveRecord(bPartnerVendor);
    currencyId = PlainCurrencyDAO.createCurrencyId(CurrencyCode.EUR);
    // wire together a SalesOrder2PurchaseViewFactory
    final PurchaseCandidateRepository purchaseCandidateRepository = new PurchaseCandidateRepository(new PurchaseItemRepository(), new ReferenceGenerator(), new BPPurchaseScheduleService(new BPPurchaseScheduleRepository()));
    final DoNothingPurchaseProfitInfoServiceImpl purchaseProfitInfoService = new DoNothingPurchaseProfitInfoServiceImpl();
    final PurchaseDemandWithCandidatesService purchaseDemandWithCandidatesService = new PurchaseDemandWithCandidatesService(purchaseCandidateRepository, new BPPurchaseScheduleService(new BPPurchaseScheduleRepository()), new VendorProductInfoService(new BPartnerBL(new UserRepository())), purchaseProfitInfoService);
    final PurchaseRowFactory purchaseRowFactory = new PurchaseRowFactory(new AvailableToPromiseRepository(), purchaseProfitInfoService);
    salesOrder2PurchaseViewFactory = new SalesOrder2PurchaseViewFactory(purchaseDemandWithCandidatesService, // mocked
    availabilityCheckService, purchaseCandidateRepository, purchaseRowFactory, new SalesOrderLineRepository(new OrderLineRepository()));
}
Also used : BPPurchaseScheduleService(de.metas.purchasecandidate.BPPurchaseScheduleService) AvailabilityCheckService(de.metas.purchasecandidate.availability.AvailabilityCheckService) I_C_Order(org.compiere.model.I_C_Order) AvailableToPromiseRepository(de.metas.material.dispo.commons.repository.atp.AvailableToPromiseRepository) I_M_Product(org.compiere.model.I_M_Product) I_AD_Org(org.compiere.model.I_AD_Org) SalesOrderLineRepository(de.metas.purchasecandidate.SalesOrderLineRepository) OrderLineRepository(de.metas.order.OrderLineRepository) SalesOrderLineRepository(de.metas.purchasecandidate.SalesOrderLineRepository) BPartnerBL(de.metas.bpartner.service.impl.BPartnerBL) I_M_Warehouse(org.compiere.model.I_M_Warehouse) PurchaseDemandWithCandidatesService(de.metas.purchasecandidate.PurchaseDemandWithCandidatesService) I_M_Product_Category(org.compiere.model.I_M_Product_Category) PurchaseItemRepository(de.metas.purchasecandidate.purchaseordercreation.remotepurchaseitem.PurchaseItemRepository) UserRepository(de.metas.user.UserRepository) BPPurchaseScheduleRepository(de.metas.purchasecandidate.BPPurchaseScheduleRepository) ReferenceGenerator(de.metas.purchasecandidate.ReferenceGenerator) PurchaseCandidateRepository(de.metas.purchasecandidate.PurchaseCandidateRepository) VendorProductInfoService(de.metas.purchasecandidate.VendorProductInfoService) I_C_UOM(org.compiere.model.I_C_UOM) I_C_BPartner(org.compiere.model.I_C_BPartner) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 2 with UserRepository

use of de.metas.user.UserRepository in project metasfresh-webui-api by metasfresh.

the class DataEntryTabLoaderTest method createDataEntryTabLoader.

private static DataEntryTabLoader createDataEntryTabLoader() {
    final WindowId windowId = WindowId.of(5);
    final DataEntryWebuiTools dataEntryWebuiTools = new DataEntryWebuiTools(new UserRepository());
    final JSONDataEntryRecordMapper jsonDataEntryRecordMapper = new JSONDataEntryRecordMapper();
    final DataEntryRecordRepository dataEntryRecordRepository = new DataEntryRecordRepository(jsonDataEntryRecordMapper);
    final DataEntrySubTabBindingDescriptorBuilder // 
    dataEntrySubTabBindingDescriptorBuilder = new DataEntrySubTabBindingDescriptorBuilder(dataEntryRecordRepository, dataEntryWebuiTools);
    return DataEntryTabLoader.builder().filterDescriptorsProvidersService(new DocumentFilterDescriptorsProvidersService(ImmutableList.of())).windowId(windowId).adWindowId(windowId.toAdWindowIdOrNull()).dataEntrySubTabBindingDescriptorBuilder(dataEntrySubTabBindingDescriptorBuilder).build();
}
Also used : DataEntryRecordRepository(de.metas.dataentry.data.DataEntryRecordRepository) DocumentFilterDescriptorsProvidersService(de.metas.ui.web.document.filter.provider.DocumentFilterDescriptorsProvidersService) UserRepository(de.metas.user.UserRepository) JSONDataEntryRecordMapper(de.metas.dataentry.data.json.JSONDataEntryRecordMapper) AdWindowId(org.adempiere.ad.element.api.AdWindowId) WindowId(de.metas.ui.web.window.datatypes.WindowId)

Example 3 with UserRepository

use of de.metas.user.UserRepository in project metasfresh-webui-api by metasfresh.

the class PickingV2TestHelper method createAndRegisterBPartnerBL.

private BPartnerBL createAndRegisterBPartnerBL() {
    final UserRepository userRepository = new UserRepository();
    final BPartnerBL bpartnersService = new BPartnerBL(userRepository);
    Services.registerService(IBPartnerBL.class, bpartnersService);
    return bpartnersService;
}
Also used : UserRepository(de.metas.user.UserRepository) IBPartnerBL(de.metas.bpartner.service.IBPartnerBL) BPartnerBL(de.metas.bpartner.service.impl.BPartnerBL)

Aggregations

UserRepository (de.metas.user.UserRepository)3 BPartnerBL (de.metas.bpartner.service.impl.BPartnerBL)2 IBPartnerBL (de.metas.bpartner.service.IBPartnerBL)1 DataEntryRecordRepository (de.metas.dataentry.data.DataEntryRecordRepository)1 JSONDataEntryRecordMapper (de.metas.dataentry.data.json.JSONDataEntryRecordMapper)1 AvailableToPromiseRepository (de.metas.material.dispo.commons.repository.atp.AvailableToPromiseRepository)1 OrderLineRepository (de.metas.order.OrderLineRepository)1 BPPurchaseScheduleRepository (de.metas.purchasecandidate.BPPurchaseScheduleRepository)1 BPPurchaseScheduleService (de.metas.purchasecandidate.BPPurchaseScheduleService)1 PurchaseCandidateRepository (de.metas.purchasecandidate.PurchaseCandidateRepository)1 PurchaseDemandWithCandidatesService (de.metas.purchasecandidate.PurchaseDemandWithCandidatesService)1 ReferenceGenerator (de.metas.purchasecandidate.ReferenceGenerator)1 SalesOrderLineRepository (de.metas.purchasecandidate.SalesOrderLineRepository)1 VendorProductInfoService (de.metas.purchasecandidate.VendorProductInfoService)1 AvailabilityCheckService (de.metas.purchasecandidate.availability.AvailabilityCheckService)1 PurchaseItemRepository (de.metas.purchasecandidate.purchaseordercreation.remotepurchaseitem.PurchaseItemRepository)1 DocumentFilterDescriptorsProvidersService (de.metas.ui.web.document.filter.provider.DocumentFilterDescriptorsProvidersService)1 WindowId (de.metas.ui.web.window.datatypes.WindowId)1 AdWindowId (org.adempiere.ad.element.api.AdWindowId)1 I_AD_Org (org.compiere.model.I_AD_Org)1