@chevre/domain
Version:
Chevre Domain Library for Node.js
102 lines (101 loc) • 2.46 kB
TypeScript
import { Connection } from 'mongoose';
import * as factory from '../factory';
type IMemberProgramTier = Pick<factory.issuer.IMemberProgramTier, 'identifier' | 'typeOf'>;
type IMemberProgram = factory.issuer.IMemberProgram & {
hasTiers?: IMemberProgramTier[];
};
type IMemberProgramAsSearchResult = IMemberProgram & {
hostingOrganization: {
identifier: string;
};
};
type IMemberProgramTierAsSearchResult = IMemberProgramTier & {
isTierOf: {
identifier: string;
hostingOrganization: {
identifier: string;
};
};
};
/**
* メンバープログラムリポジトリ
*/
export declare class MemberProgramRepo {
private readonly issuerModel;
constructor(connection: Connection);
/**
* memberProgramを検索する
*/
projectMemberPrograms(params: {
limit?: number;
page?: number;
project?: {
id?: {
$eq?: string;
};
};
hostingOrganization?: {
id?: {
$eq?: string;
};
};
identifier?: {
$eq?: string;
$in?: string[];
};
}): Promise<IMemberProgramAsSearchResult[]>;
/**
* tierを検索する
*/
projectMemberProgramTiers(params: {
limit?: number;
page?: number;
project?: {
id?: {
$eq?: string;
};
};
isTierOf?: {
hostingOrganization?: {
id?: {
$eq?: string;
};
};
identifier?: {
$eq?: string;
};
};
identifier?: {
$eq?: string;
};
}): Promise<IMemberProgramTierAsSearchResult[]>;
create(params: {
project: {
id: string;
};
identifier: string;
hostingOrganization: {
id: string;
};
}): Promise<void>;
updateOne(params: {
project: {
id: string;
};
identifier: string;
hasTiers?: Pick<factory.issuer.IMemberProgramTier, 'identifier'>[];
hostingOrganization: {
id: string;
};
}): Promise<void>;
deleteOne(params: {
project: {
id: string;
};
identifier: string;
hostingOrganization: {
id: string;
};
}): Promise<void>;
}
export {};