Uecko_ERP/modules/customer-invoices/src/api/application/services/participantFinder.ts
2025-06-12 08:55:17 +02:00

22 lines
844 B
TypeScript

/* import { IAdapter, RepositoryBuilder } from "@/contexts/common/domain";
import { UniqueID } from "@shared/contexts";
import { ICustomerInvoiceParticipantRepository } from "../../domain";
import { CustomerInvoiceCustomer } from "../../domain/entities/customer-invoice-customer/customer-invoice-customer";
export const participantFinder = async (
participantId: UniqueID,
adapter: IAdapter,
repository: RepositoryBuilder<ICustomerInvoiceParticipantRepository>
): Promise<CustomerInvoiceCustomer | undefined> => {
if (!participantId || (participantId && participantId.isNull())) {
return Promise.resolve(undefined);
}
const participant = await adapter
.startTransaction()
.complete((t) => repository({ transaction: t }).getById(participantId));
return Promise.resolve(participant ? participant : undefined);
};
*/