Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(contracts):1025 - refactored contract agreements #1245

Merged
merged 3 commits into from
Jul 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,10 @@
package org.eclipse.tractusx.traceability.contracts.application.service;

import org.eclipse.tractusx.irs.edc.client.contract.model.exception.ContractAgreementException;
import org.eclipse.tractusx.traceability.contracts.domain.model.ContractAgreement;
import org.eclipse.tractusx.traceability.contracts.domain.model.ContractType;

import java.util.List;

public interface ContractService {

void saveContractAgreements(List<String> contractAgreementIds, ContractType contractType) throws ContractAgreementException;

void saveAll(List<ContractAgreement> contractAgreements);
void saveContractAgreementFromNotification(String contractAgreementId, ContractType contractType) throws ContractAgreementException;

}
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
import org.eclipse.tractusx.traceability.common.request.PageableFilterRequest;
import org.eclipse.tractusx.traceability.contracts.domain.model.Contract;

import java.util.List;

public interface ContractServiceReadOnly {
PageResult<Contract> getContracts(PageableFilterRequest pageableFilterRequest);
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,8 @@
import org.eclipse.tractusx.irs.edc.client.contract.model.exception.ContractAgreementException;
import org.eclipse.tractusx.traceability.contracts.domain.model.ContractType;

import java.util.List;

public interface ContractRepository<T> {


void saveAllContractAgreements(List<String> contractAgreementIds, ContractType contractType) throws ContractAgreementException;

void saveAll(List<T> contractAgreements);
void saveContractAgreementFromNotification(String contractAgreementId, ContractType contractType) throws ContractAgreementException;

}

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -20,27 +20,23 @@

import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.eclipse.tractusx.traceability.contracts.application.mapper.ContractFieldMapper;
import org.eclipse.tractusx.traceability.contracts.domain.repository.ContractRepository;
import org.eclipse.tractusx.irs.edc.client.contract.model.exception.ContractAgreementException;
import org.eclipse.tractusx.traceability.contracts.application.service.ContractService;
import org.eclipse.tractusx.traceability.contracts.domain.model.ContractType;
import org.eclipse.tractusx.traceability.contracts.infrastructure.repository.ContractNotificationRepositoryImpl;
import org.springframework.stereotype.Component;

@Slf4j
@Component
@RequiredArgsConstructor
public class ContractNotificationServiceImpl extends AbstractContractBaseService {
public class ContractNotificationServiceImpl implements ContractService {

private final ContractNotificationRepositoryImpl contractNotificationRepository;
private final ContractFieldMapper contractFieldMapper;
private final ContractViewServiceImpl contractViewService;

@Override
protected ContractRepository getContractRepository() {
return contractNotificationRepository;
}

@Override
protected ContractFieldMapper getContractFieldMapper() {
return contractFieldMapper;
public void saveContractAgreementFromNotification(String contractAgreementId, ContractType contractType) throws ContractAgreementException {
contractNotificationRepository.saveContractAgreementFromNotification(contractAgreementId, contractType);
}

}

This file was deleted.

This file was deleted.

This file was deleted.

Loading
Loading