Files
standardnotes-server/packages/syncing-server/src/Domain/Group/Service/GroupServiceInterface.ts
T
2023-05-31 11:42:36 -05:00

32 lines
794 B
TypeScript

import { GroupUser } from './../../GroupUser/Model/GroupUser'
import { Group } from '../Model/Group'
export type CreateGroupDTO = {
userUuid: string
groupUuid: string
specifiedItemsKeyUuid: string
}
export type CreateGroupResult = {
group: Group
groupUser: GroupUser
}
export type UpdateGroupDTO = {
originatorUuid: string
groupUuid: string
specifiedItemsKeyUuid: string
}
export interface GroupServiceInterface {
createGroup(dto: CreateGroupDTO): Promise<CreateGroupResult | null>
updateGroup(dto: UpdateGroupDTO): Promise<Group | null>
deleteGroup(dto: { groupUuid: string; originatorUuid: string }): Promise<boolean>
getGroup(dto: { groupUuid: string }): Promise<Group | null>
getGroups(dto: { userUuid: string; lastSyncTime?: number }): Promise<Group[]>
}