@chevre/domain
Version:
Chevre Domain Library for Node.js
46 lines (45 loc) • 1.48 kB
TypeScript
import { Connection, FilterQuery } from 'mongoose';
import * as factory from '../factory';
export type ISavingWebSite = Pick<factory.creativeWork.certification.webSite.ICertification, 'about' | 'certificationStatus' | 'project' | 'auditDate'> & {
id?: never;
datePublished?: never;
dateModified?: never;
certificationIdentification?: never;
};
interface IUnset {
$unset?: {
[key: string]: 1;
};
}
type IWebSiteWithId = factory.creativeWork.certification.webSite.ICertification & {
id: string;
};
type IKeyOfProjection = keyof factory.creativeWork.certification.webSite.ICertification;
/**
* web site repository
*/
export declare class WebSiteRepo {
private readonly webSiteModel;
constructor(connection: Connection);
static CREATE_FILTER_QUERY(params: factory.creativeWork.certification.webSite.ISearchConditions): FilterQuery<factory.creativeWork.certification.webSite.ICertification>[];
save(params: {
id?: string;
attributes: ISavingWebSite & IUnset;
}): Promise<{
id: string;
}>;
certifyById(params: {
id: string;
project: {
id: string;
};
}): Promise<void>;
projectFields(conditions: factory.creativeWork.certification.webSite.ISearchConditions, inclusion: IKeyOfProjection[]): Promise<IWebSiteWithId[]>;
deleteById(params: {
id: string;
project: {
id: string;
};
}): Promise<void>;
}
export {};