Files
speckle-server/packages/server/modules/core/events/projectsEmitter.ts
T
Alessandro Magionami a0224e2f40 Alessandro/web 1660 workspace cost items subtotal and currency (#2793)
* chore(workspaces): workspace cost schema

* chore(workspaces): test helper for workspace cost

* feat(workspaces): workspace billing cost

* fix(workspaces): fix onProjectCreated failing for the project creator if the creator is a member

* refactor(workspaces): change workspace cost calculation to a simpler query

* test(workspaceCost): fix costing logic and tests

* fix(workspaceTests): project emmiter needs owner now

---------

Co-authored-by: Gergő Jedlicska <gergo@jedlicska.com>
2024-08-29 13:45:04 +02:00

20 lines
613 B
TypeScript

import { StreamRecord } from '@/modules/core/helpers/types'
import { initializeModuleEventEmitter } from '@/modules/shared/services/moduleEventEmitterSetup'
export const ProjectEvents = {
Created: 'created'
} as const
export type ProjectEvents = (typeof ProjectEvents)[keyof typeof ProjectEvents]
export type ProjectEventsPayloads = {
[ProjectEvents.Created]: { project: StreamRecord; ownerId: string }
}
const { emit, listen } = initializeModuleEventEmitter<ProjectEventsPayloads>({
moduleName: 'core',
namespace: 'projects'
})
export const ProjectsEmitter = { emit, listen, events: ProjectEvents }