2025-05-04 20:06:57 +00:00
|
|
|
/* import { IAdapter, RepositoryBuilder } from "@/contexts/common/domain";
|
2025-03-18 08:05:00 +00:00
|
|
|
import { UniqueID } from "@shared/contexts";
|
2025-06-11 15:13:44 +00:00
|
|
|
import { ICustomerInvoiceParticipantRepository } from "../../domain";
|
|
|
|
|
import { CustomerInvoiceCustomer } from "../../domain/entities/customerCustomerInvoice-customer/customerCustomerInvoice-customer";
|
2025-03-18 08:05:00 +00:00
|
|
|
|
|
|
|
|
export const participantFinder = async (
|
|
|
|
|
participantId: UniqueID,
|
|
|
|
|
adapter: IAdapter,
|
2025-06-11 15:13:44 +00:00
|
|
|
repository: RepositoryBuilder<ICustomerInvoiceParticipantRepository>
|
|
|
|
|
): Promise<CustomerInvoiceCustomer | undefined> => {
|
2025-03-18 08:05:00 +00:00
|
|
|
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);
|
|
|
|
|
};
|
2025-05-04 20:06:57 +00:00
|
|
|
*/
|