import { UmbDuplicateDocumentTypeServerDataSource } from './document-type-duplicate.server.data-source.js';
import { UMB_NOTIFICATION_CONTEXT } from '../../../../../core/notification/index.js';
import { UmbRepositoryBase } from '../../../../../core/repository/index.js';
export class UmbDuplicateDocumentTypeRepository extends UmbRepositoryBase {
    #duplicateSource = new UmbDuplicateDocumentTypeServerDataSource(this);
    async requestDuplicateTo(args) {
        const { error } = await this.#duplicateSource.duplicateTo(args);
        if (!error) {
            const notificationContext = await this.getContext(UMB_NOTIFICATION_CONTEXT);
            if (!notificationContext) {
                throw new Error('Notification context not found');
            }
            const notification = { data: { message: `Duplicated` } };
            notificationContext.peek('positive', notification);
        }
        return { error };
    }
}
export { UmbDuplicateDocumentTypeRepository as api };
