mirror of
https://github.com/gitpod-io/gitpod.git
synced 2025-12-08 17:36:30 +00:00
26 lines
1.4 KiB
TypeScript
26 lines
1.4 KiB
TypeScript
/**
|
|
* Copyright (c) 2021 Gitpod GmbH. All rights reserved.
|
|
* Licensed under the GNU Affero General Public License (AGPL).
|
|
* See License.AGPL.txt in the project root for license information.
|
|
*/
|
|
|
|
import { TeamSubscription, TeamSubscriptionSlot } from "@gitpod/gitpod-protocol/lib/team-subscription-protocol";
|
|
import { DeepPartial } from "typeorm";
|
|
|
|
export const TeamSubscriptionDB = Symbol("TeamSubscriptionDB");
|
|
export interface TeamSubscriptionDB {
|
|
storeTeamSubscriptionEntry(ts: TeamSubscription): Promise<void>;
|
|
findTeamSubscriptionById(id: string): Promise<TeamSubscription | undefined>;
|
|
findTeamSubscriptionBySlotId(slotId: string): Promise<TeamSubscription | undefined>;
|
|
findTeamSubscriptionByPaymentRef(userId: string, paymentReference: string): Promise<TeamSubscription | undefined>;
|
|
findTeamSubscriptionsForUser(userId: string, date: string): Promise<TeamSubscription[]>;
|
|
findTeamSubscriptions(partial: DeepPartial<TeamSubscription>): Promise<TeamSubscription[]>;
|
|
|
|
storeSlot(slot: TeamSubscriptionSlot): Promise<TeamSubscriptionSlot>;
|
|
findSlotById(id: string): Promise<TeamSubscriptionSlot | undefined>;
|
|
findSlotsByTeamSubscriptionId(teamSubscriptionId: string): Promise<TeamSubscriptionSlot[]>;
|
|
findSlotsByAssignee(assigneeId: string): Promise<TeamSubscriptionSlot[]>;
|
|
|
|
transaction<T>(code: (db: TeamSubscriptionDB) => Promise<T>): Promise<T>;
|
|
}
|