Files
backend/src/space/dtos/create-allocations.dto.ts
ZaydSkaff 689a38ee0c Revamp/space management (#409)
* task: add getCommunitiesV2

* task: update getOneSpace API to match revamp structure

* refactor: implement modifications to pace management APIs

* refactor: remove space link
2025-06-18 10:34:29 +03:00

30 lines
929 B
TypeScript

import { SpaceEntity } from '@app/common/modules/space/entities/space.entity';
import { SubspaceEntity } from '@app/common/modules/space/entities/subspace/subspace.entity';
import { QueryRunner } from 'typeorm';
import { CreateProductAllocationDto } from './create-product-allocation.dto';
export enum AllocationsOwnerType {
SPACE = 'space',
SUBSPACE = 'subspace',
}
export class BaseCreateAllocationsDto {
productAllocations: CreateProductAllocationDto[];
projectUuid: string;
queryRunner: QueryRunner;
type: AllocationsOwnerType;
}
export class CreateSpaceAllocationsDto extends BaseCreateAllocationsDto {
space: SpaceEntity;
type: AllocationsOwnerType.SPACE;
}
export class CreateSubspaceAllocationsDto extends BaseCreateAllocationsDto {
subspace: SubspaceEntity;
type: AllocationsOwnerType.SUBSPACE;
}
export type CreateAllocationsDto =
| CreateSpaceAllocationsDto
| CreateSubspaceAllocationsDto;