mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-07-15 02:15:21 +00:00

* task: add getCommunitiesV2 * task: update getOneSpace API to match revamp structure * refactor: implement modifications to pace management APIs * refactor: remove space link
30 lines
929 B
TypeScript
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;
|