/** * 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; findTeamSubscriptionById(id: string): Promise; findTeamSubscriptionBySlotId(slotId: string): Promise; findTeamSubscriptionByPaymentRef(userId: string, paymentReference: string): Promise; findTeamSubscriptionsForUser(userId: string, date: string): Promise; findTeamSubscriptions(partial: DeepPartial): Promise; storeSlot(slot: TeamSubscriptionSlot): Promise; findSlotById(id: string): Promise; findSlotsByTeamSubscriptionId(teamSubscriptionId: string): Promise; findSlotsByAssignee(assigneeId: string): Promise; transaction(code: (db: TeamSubscriptionDB) => Promise): Promise; }