22 lines
844 B
TypeScript
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);
|
|
};
|
|
*/
|