UNPKG

@chevre/domain

Version:

Chevre Domain Library for Node.js

41 lines (40 loc) 1.55 kB
import type { Connection, FilterQuery } from 'mongoose'; import * as factory from '../factory'; type IUnset = { [key in keyof Pick<factory.customer.ICustomer, 'telephone' | 'url'>]?: 1; }; type IKeyOfProjection = keyof factory.customer.ICustomer; /** * 顧客リポジトリ */ export declare class CustomerRepo { private readonly customerModel; constructor(connection: Connection); static CREATE_MONGO_CONDITIONS(params: factory.customer.ISearchConditions): FilterQuery<factory.customer.ICustomer>[]; save(params: { id?: string; attributes: Omit<factory.customer.ICustomer, 'id'> & { id?: never; $unset?: IUnset; }; }): Promise<{ id: string; }>; /** * 顧客検索 */ projectFields(conditions: factory.customer.ISearchConditions, inclusion: IKeyOfProjection[]): Promise<factory.customer.ICustomer[]>; deleteById(params: { id: string; }): Promise<void>; getCursor(conditions: any, projection: any): import("mongoose").Cursor<import("mongoose").Document<unknown, {}, factory.customer.ICustomer> & factory.customer.ICustomer & { _id: import("mongoose").Types.ObjectId; }, import("mongoose").QueryOptions<import("mongoose").Document<unknown, {}, factory.customer.ICustomer> & factory.customer.ICustomer & { _id: import("mongoose").Types.ObjectId; }>>; unsetUnnecessaryFields(params: { filter: any; $unset: any; }): Promise<import("mongoose").UpdateWriteOpResult>; } export {};