@venturialstd/project 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +278 -0
- package/dist/controllers/index.d.ts +2 -0
- package/dist/controllers/index.d.ts.map +1 -0
- package/dist/controllers/index.js +6 -0
- package/dist/controllers/index.js.map +1 -0
- package/dist/controllers/project.controller.d.ts +16 -0
- package/dist/controllers/project.controller.d.ts.map +1 -0
- package/dist/controllers/project.controller.js +116 -0
- package/dist/controllers/project.controller.js.map +1 -0
- package/dist/dtos/index.d.ts +2 -0
- package/dist/dtos/index.d.ts.map +1 -0
- package/dist/dtos/index.js +7 -0
- package/dist/dtos/index.js.map +1 -0
- package/dist/dtos/project.dto.d.ts +23 -0
- package/dist/dtos/project.dto.d.ts.map +1 -0
- package/dist/dtos/project.dto.js +130 -0
- package/dist/dtos/project.dto.js.map +1 -0
- package/dist/entities/index.d.ts +2 -0
- package/dist/entities/index.d.ts.map +1 -0
- package/dist/entities/index.js +6 -0
- package/dist/entities/index.js.map +1 -0
- package/dist/entities/organization-project.entity.d.ts +16 -0
- package/dist/entities/organization-project.entity.d.ts.map +1 -0
- package/dist/entities/organization-project.entity.js +108 -0
- package/dist/entities/organization-project.entity.js.map +1 -0
- package/dist/entities/project.entity.d.ts +15 -0
- package/dist/entities/project.entity.d.ts.map +1 -0
- package/dist/entities/project.entity.js +101 -0
- package/dist/entities/project.entity.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +15 -0
- package/dist/index.js.map +1 -0
- package/dist/project.module.d.ts +3 -0
- package/dist/project.module.d.ts.map +1 -0
- package/dist/project.module.js +26 -0
- package/dist/project.module.js.map +1 -0
- package/dist/services/index.d.ts +2 -0
- package/dist/services/index.d.ts.map +1 -0
- package/dist/services/index.js +6 -0
- package/dist/services/index.js.map +1 -0
- package/dist/services/organization-project.service.d.ts +16 -0
- package/dist/services/organization-project.service.d.ts.map +1 -0
- package/dist/services/organization-project.service.js +76 -0
- package/dist/services/organization-project.service.js.map +1 -0
- package/dist/services/project.service.d.ts +14 -0
- package/dist/services/project.service.d.ts.map +1 -0
- package/dist/services/project.service.js +54 -0
- package/dist/services/project.service.js.map +1 -0
- package/package.json +46 -0
package/README.md
ADDED
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
# @venturialstd/project
|
|
2
|
+
|
|
3
|
+
A NestJS module for managing organizational projects with CRUD operations and organization-specific project management.
|
|
4
|
+
|
|
5
|
+
## 📋 Table of Contents
|
|
6
|
+
|
|
7
|
+
- [Features](#features)
|
|
8
|
+
- [Installation](#installation)
|
|
9
|
+
- [Quick Start](#quick-start)
|
|
10
|
+
- [API Reference](#api-reference)
|
|
11
|
+
- [Examples](#examples)
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## ✨ Features
|
|
16
|
+
|
|
17
|
+
- 🏢 **Project Management**: Complete CRUD operations for projects
|
|
18
|
+
- 🏷️ **Project Attributes**: Support for keys, statuses, tags, and date ranges
|
|
19
|
+
- 📦 **Organization Isolation**: Each project belongs to a specific organization
|
|
20
|
+
- 🔄 **TypeORM Integration**: Full database support with TypeORM
|
|
21
|
+
- 📦 **Fully Typed**: Complete TypeScript support
|
|
22
|
+
- 🎯 **Archive Support**: Archive and unarchive projects
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## 📦 Installation
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
npm install @venturialstd/project
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### Peer Dependencies
|
|
33
|
+
|
|
34
|
+
```json
|
|
35
|
+
{
|
|
36
|
+
"@dataui/crud": "^6.0.0",
|
|
37
|
+
"@dataui/crud-typeorm": "^6.0.0",
|
|
38
|
+
"@nestjs/common": "^11.0.11",
|
|
39
|
+
"@nestjs/core": "^11.0.5",
|
|
40
|
+
"@nestjs/swagger": "^8.0.3",
|
|
41
|
+
"@nestjs/typeorm": "^10.0.0",
|
|
42
|
+
"class-transformer": "^0.5.1",
|
|
43
|
+
"class-validator": "^0.14.1",
|
|
44
|
+
"typeorm": "^0.3.20"
|
|
45
|
+
}
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
## 🚀 Quick Start
|
|
51
|
+
|
|
52
|
+
### 1. Import the Module
|
|
53
|
+
|
|
54
|
+
```typescript
|
|
55
|
+
import { Module } from '@nestjs/common';
|
|
56
|
+
import { ProjectModule } from '@venturialstd/project';
|
|
57
|
+
|
|
58
|
+
@Module({
|
|
59
|
+
imports: [ProjectModule],
|
|
60
|
+
})
|
|
61
|
+
export class AppModule {}
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### 2. Use the Services
|
|
65
|
+
|
|
66
|
+
```typescript
|
|
67
|
+
import { Injectable } from '@nestjs/common';
|
|
68
|
+
import {
|
|
69
|
+
OrganizationProjectService,
|
|
70
|
+
CreateProjectDto,
|
|
71
|
+
OrganizationProject,
|
|
72
|
+
} from '@venturialstd/project';
|
|
73
|
+
|
|
74
|
+
@Injectable()
|
|
75
|
+
export class YourService {
|
|
76
|
+
constructor(
|
|
77
|
+
private readonly projectService: OrganizationProjectService,
|
|
78
|
+
) {}
|
|
79
|
+
|
|
80
|
+
async createProject(organizationId: string, name: string) {
|
|
81
|
+
return this.projectService.createProjectForOrganization({
|
|
82
|
+
organizationId,
|
|
83
|
+
name,
|
|
84
|
+
description: 'My new project',
|
|
85
|
+
status: 'active',
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
async getProjects(organizationId: string) {
|
|
90
|
+
return this.projectService.getProjectsByOrganization(organizationId);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
97
|
+
## 📚 API Reference
|
|
98
|
+
|
|
99
|
+
### Services
|
|
100
|
+
|
|
101
|
+
#### OrganizationProjectService
|
|
102
|
+
|
|
103
|
+
```typescript
|
|
104
|
+
class OrganizationProjectService {
|
|
105
|
+
// Create a new project
|
|
106
|
+
createProjectForOrganization(dto: CreateProjectDto): Promise<OrganizationProject>
|
|
107
|
+
|
|
108
|
+
// Update a project
|
|
109
|
+
updateProject(id: string, dto: UpdateProjectDto): Promise<OrganizationProject | null>
|
|
110
|
+
|
|
111
|
+
// Get all projects for an organization
|
|
112
|
+
getProjectsByOrganization(
|
|
113
|
+
organizationId: string,
|
|
114
|
+
includeArchived?: boolean
|
|
115
|
+
): Promise<OrganizationProject[]>
|
|
116
|
+
|
|
117
|
+
// Get project by ID
|
|
118
|
+
getProjectById(id: string): Promise<OrganizationProject | null>
|
|
119
|
+
|
|
120
|
+
// Get active projects
|
|
121
|
+
getActiveProjectsByOrganization(organizationId: string): Promise<OrganizationProject[]>
|
|
122
|
+
|
|
123
|
+
// Archive a project
|
|
124
|
+
archiveProject(id: string): Promise<OrganizationProject | null>
|
|
125
|
+
|
|
126
|
+
// Delete a project
|
|
127
|
+
deleteProject(id: string): Promise<void>
|
|
128
|
+
}
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
### Entities
|
|
132
|
+
|
|
133
|
+
#### OrganizationProject
|
|
134
|
+
|
|
135
|
+
```typescript
|
|
136
|
+
class OrganizationProject {
|
|
137
|
+
id: string;
|
|
138
|
+
organizationId: string;
|
|
139
|
+
name: string;
|
|
140
|
+
description?: string;
|
|
141
|
+
key?: string; // Project key/code (e.g., "PROJ", "DEV")
|
|
142
|
+
status?: string; // e.g., "active", "completed", "archived", "on-hold"
|
|
143
|
+
startDate?: Date;
|
|
144
|
+
endDate?: Date;
|
|
145
|
+
ownerId?: string; // User who owns/leads the project
|
|
146
|
+
tags?: string[];
|
|
147
|
+
isArchived: boolean;
|
|
148
|
+
createdAt: Date;
|
|
149
|
+
updatedAt: Date;
|
|
150
|
+
}
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
### DTOs
|
|
154
|
+
|
|
155
|
+
#### CreateProjectDto
|
|
156
|
+
|
|
157
|
+
```typescript
|
|
158
|
+
class CreateProjectDto {
|
|
159
|
+
organizationId: string; // Required
|
|
160
|
+
name: string; // Required
|
|
161
|
+
description?: string;
|
|
162
|
+
key?: string;
|
|
163
|
+
status?: string;
|
|
164
|
+
startDate?: string; // ISO date string
|
|
165
|
+
endDate?: string; // ISO date string
|
|
166
|
+
ownerId?: string;
|
|
167
|
+
tags?: string[];
|
|
168
|
+
isArchived?: boolean;
|
|
169
|
+
}
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
#### UpdateProjectDto
|
|
173
|
+
|
|
174
|
+
```typescript
|
|
175
|
+
class UpdateProjectDto {
|
|
176
|
+
name?: string;
|
|
177
|
+
description?: string;
|
|
178
|
+
key?: string;
|
|
179
|
+
status?: string;
|
|
180
|
+
startDate?: string;
|
|
181
|
+
endDate?: string;
|
|
182
|
+
ownerId?: string;
|
|
183
|
+
tags?: string[];
|
|
184
|
+
isArchived?: boolean;
|
|
185
|
+
}
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
---
|
|
189
|
+
|
|
190
|
+
## 💻 Examples
|
|
191
|
+
|
|
192
|
+
### Example 1: Create and Configure a Project
|
|
193
|
+
|
|
194
|
+
```typescript
|
|
195
|
+
@Injectable()
|
|
196
|
+
export class ProjectSetupService {
|
|
197
|
+
constructor(
|
|
198
|
+
private readonly projectService: OrganizationProjectService,
|
|
199
|
+
) {}
|
|
200
|
+
|
|
201
|
+
async setupNewProject(organizationId: string, ownerId: string) {
|
|
202
|
+
const project = await this.projectService.createProjectForOrganization({
|
|
203
|
+
organizationId,
|
|
204
|
+
name: 'Q1 2024 Initiative',
|
|
205
|
+
description: 'Strategic goals for Q1 2024',
|
|
206
|
+
key: 'Q1-2024',
|
|
207
|
+
status: 'active',
|
|
208
|
+
startDate: '2024-01-01',
|
|
209
|
+
endDate: '2024-03-31',
|
|
210
|
+
ownerId,
|
|
211
|
+
tags: ['strategic', 'quarterly'],
|
|
212
|
+
});
|
|
213
|
+
|
|
214
|
+
return project;
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
### Example 2: Get Active Projects
|
|
220
|
+
|
|
221
|
+
```typescript
|
|
222
|
+
@Injectable()
|
|
223
|
+
export class DashboardService {
|
|
224
|
+
constructor(
|
|
225
|
+
private readonly projectService: OrganizationProjectService,
|
|
226
|
+
) {}
|
|
227
|
+
|
|
228
|
+
async getActiveDashboard(organizationId: string) {
|
|
229
|
+
const activeProjects = await this.projectService.getActiveProjectsByOrganization(
|
|
230
|
+
organizationId
|
|
231
|
+
);
|
|
232
|
+
|
|
233
|
+
return {
|
|
234
|
+
total: activeProjects.length,
|
|
235
|
+
projects: activeProjects,
|
|
236
|
+
};
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
### Example 3: Archive Completed Projects
|
|
242
|
+
|
|
243
|
+
```typescript
|
|
244
|
+
@Injectable()
|
|
245
|
+
export class ProjectMaintenanceService {
|
|
246
|
+
constructor(
|
|
247
|
+
private readonly projectService: OrganizationProjectService,
|
|
248
|
+
) {}
|
|
249
|
+
|
|
250
|
+
async archiveCompletedProjects(organizationId: string) {
|
|
251
|
+
const projects = await this.projectService.getProjectsByOrganization(
|
|
252
|
+
organizationId
|
|
253
|
+
);
|
|
254
|
+
|
|
255
|
+
const completedProjects = projects.filter(
|
|
256
|
+
p => p.status === 'completed' && !p.isArchived
|
|
257
|
+
);
|
|
258
|
+
|
|
259
|
+
for (const project of completedProjects) {
|
|
260
|
+
await this.projectService.archiveProject(project.id);
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
return { archived: completedProjects.length };
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
---
|
|
269
|
+
|
|
270
|
+
## 📄 License
|
|
271
|
+
|
|
272
|
+
MIT
|
|
273
|
+
|
|
274
|
+
---
|
|
275
|
+
|
|
276
|
+
## 🤝 Contributing
|
|
277
|
+
|
|
278
|
+
Contributions welcome! Please read the contributing guidelines before submitting PRs.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/controllers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ProjectController = void 0;
|
|
4
|
+
var project_controller_1 = require("./project.controller");
|
|
5
|
+
Object.defineProperty(exports, "ProjectController", { enumerable: true, get: function () { return project_controller_1.ProjectController; } });
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/controllers/index.ts"],"names":[],"mappings":";;;AAAA,2DAAyD;AAAhD,uHAAA,iBAAiB,OAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { CrudController } from '@dataui/crud';
|
|
2
|
+
import { CreateProjectDto, UpdateProjectDto } from '../dtos';
|
|
3
|
+
import { Project } from '../entities/project.entity';
|
|
4
|
+
import { ProjectService } from '../services/project.service';
|
|
5
|
+
export declare class ProjectController implements CrudController<Project> {
|
|
6
|
+
service: ProjectService;
|
|
7
|
+
constructor(service: ProjectService);
|
|
8
|
+
createProject(createProjectDto: CreateProjectDto): Promise<Project>;
|
|
9
|
+
updateProject(id: string, updateProjectDto: UpdateProjectDto): Promise<Project | null>;
|
|
10
|
+
getProjectById(id: string): Promise<Project | null>;
|
|
11
|
+
archiveProject(id: string): Promise<Project | null>;
|
|
12
|
+
deleteProject(id: string): Promise<{
|
|
13
|
+
success: boolean;
|
|
14
|
+
}>;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=project.controller.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project.controller.d.ts","sourceRoot":"","sources":["../../src/controllers/project.controller.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,cAAc,EAAE,MAAM,cAAc,CAAC;AAGpD,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAC7D,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAE7D,qBAsBa,iBAAkB,YAAW,cAAc,CAAC,OAAO,CAAC;IAC5C,OAAO,EAAE,cAAc;gBAAvB,OAAO,EAAE,cAAc;IAKpC,aAAa,CAAS,gBAAgB,EAAE,gBAAgB;IAOxD,aAAa,CAAc,EAAE,EAAE,MAAM,EAAU,gBAAgB,EAAE,gBAAgB;IAOjF,cAAc,CAAc,EAAE,EAAE,MAAM;IAOtC,cAAc,CAAc,EAAE,EAAE,MAAM;IAOtC,aAAa,CAAc,EAAE,EAAE,MAAM;;;CAI5C"}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.ProjectController = void 0;
|
|
16
|
+
const crud_1 = require("@dataui/crud");
|
|
17
|
+
const common_1 = require("@nestjs/common");
|
|
18
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
19
|
+
const dtos_1 = require("../dtos");
|
|
20
|
+
const project_entity_1 = require("../entities/project.entity");
|
|
21
|
+
const project_service_1 = require("../services/project.service");
|
|
22
|
+
let ProjectController = class ProjectController {
|
|
23
|
+
service;
|
|
24
|
+
constructor(service) {
|
|
25
|
+
this.service = service;
|
|
26
|
+
}
|
|
27
|
+
async createProject(createProjectDto) {
|
|
28
|
+
return this.service.createProject(createProjectDto);
|
|
29
|
+
}
|
|
30
|
+
async updateProject(id, updateProjectDto) {
|
|
31
|
+
return this.service.updateProject(id, updateProjectDto);
|
|
32
|
+
}
|
|
33
|
+
async getProjectById(id) {
|
|
34
|
+
return this.service.getProjectById(id);
|
|
35
|
+
}
|
|
36
|
+
async archiveProject(id) {
|
|
37
|
+
return this.service.archiveProject(id);
|
|
38
|
+
}
|
|
39
|
+
async deleteProject(id) {
|
|
40
|
+
await this.service.deleteProject(id);
|
|
41
|
+
return { success: true };
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
exports.ProjectController = ProjectController;
|
|
45
|
+
__decorate([
|
|
46
|
+
(0, common_1.Post)(),
|
|
47
|
+
(0, swagger_1.ApiOperation)({ summary: 'Create a new project' }),
|
|
48
|
+
(0, swagger_1.ApiResponse)({ status: 201, description: 'Project created successfully' }),
|
|
49
|
+
__param(0, (0, common_1.Body)()),
|
|
50
|
+
__metadata("design:type", Function),
|
|
51
|
+
__metadata("design:paramtypes", [dtos_1.CreateProjectDto]),
|
|
52
|
+
__metadata("design:returntype", Promise)
|
|
53
|
+
], ProjectController.prototype, "createProject", null);
|
|
54
|
+
__decorate([
|
|
55
|
+
(0, common_1.Patch)(':id'),
|
|
56
|
+
(0, swagger_1.ApiOperation)({ summary: 'Update a project' }),
|
|
57
|
+
(0, swagger_1.ApiResponse)({ status: 200, description: 'Project updated successfully' }),
|
|
58
|
+
__param(0, (0, common_1.Param)('id')),
|
|
59
|
+
__param(1, (0, common_1.Body)()),
|
|
60
|
+
__metadata("design:type", Function),
|
|
61
|
+
__metadata("design:paramtypes", [String, dtos_1.UpdateProjectDto]),
|
|
62
|
+
__metadata("design:returntype", Promise)
|
|
63
|
+
], ProjectController.prototype, "updateProject", null);
|
|
64
|
+
__decorate([
|
|
65
|
+
(0, common_1.Get)(':id'),
|
|
66
|
+
(0, swagger_1.ApiOperation)({ summary: 'Get project by ID' }),
|
|
67
|
+
(0, swagger_1.ApiResponse)({ status: 200, description: 'Returns project' }),
|
|
68
|
+
__param(0, (0, common_1.Param)('id')),
|
|
69
|
+
__metadata("design:type", Function),
|
|
70
|
+
__metadata("design:paramtypes", [String]),
|
|
71
|
+
__metadata("design:returntype", Promise)
|
|
72
|
+
], ProjectController.prototype, "getProjectById", null);
|
|
73
|
+
__decorate([
|
|
74
|
+
(0, common_1.Patch)(':id/archive'),
|
|
75
|
+
(0, swagger_1.ApiOperation)({ summary: 'Archive a project' }),
|
|
76
|
+
(0, swagger_1.ApiResponse)({ status: 200, description: 'Project archived successfully' }),
|
|
77
|
+
__param(0, (0, common_1.Param)('id')),
|
|
78
|
+
__metadata("design:type", Function),
|
|
79
|
+
__metadata("design:paramtypes", [String]),
|
|
80
|
+
__metadata("design:returntype", Promise)
|
|
81
|
+
], ProjectController.prototype, "archiveProject", null);
|
|
82
|
+
__decorate([
|
|
83
|
+
(0, common_1.Delete)(':id'),
|
|
84
|
+
(0, swagger_1.ApiOperation)({ summary: 'Delete a project' }),
|
|
85
|
+
(0, swagger_1.ApiResponse)({ status: 200, description: 'Project deleted successfully' }),
|
|
86
|
+
__param(0, (0, common_1.Param)('id')),
|
|
87
|
+
__metadata("design:type", Function),
|
|
88
|
+
__metadata("design:paramtypes", [String]),
|
|
89
|
+
__metadata("design:returntype", Promise)
|
|
90
|
+
], ProjectController.prototype, "deleteProject", null);
|
|
91
|
+
exports.ProjectController = ProjectController = __decorate([
|
|
92
|
+
(0, crud_1.Crud)({
|
|
93
|
+
model: {
|
|
94
|
+
type: project_entity_1.Project,
|
|
95
|
+
},
|
|
96
|
+
dto: {
|
|
97
|
+
create: dtos_1.CreateProjectDto,
|
|
98
|
+
update: dtos_1.UpdateProjectDto,
|
|
99
|
+
},
|
|
100
|
+
query: {
|
|
101
|
+
sort: [
|
|
102
|
+
{
|
|
103
|
+
field: 'createdAt',
|
|
104
|
+
order: 'DESC',
|
|
105
|
+
},
|
|
106
|
+
],
|
|
107
|
+
},
|
|
108
|
+
routes: {
|
|
109
|
+
exclude: ['createManyBase'],
|
|
110
|
+
},
|
|
111
|
+
}),
|
|
112
|
+
(0, swagger_1.ApiTags)('Project'),
|
|
113
|
+
(0, common_1.Controller)('projects'),
|
|
114
|
+
__metadata("design:paramtypes", [project_service_1.ProjectService])
|
|
115
|
+
], ProjectController);
|
|
116
|
+
//# sourceMappingURL=project.controller.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project.controller.js","sourceRoot":"","sources":["../../src/controllers/project.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,uCAAoD;AACpD,2CAAmF;AACnF,6CAAqE;AACrE,kCAA6D;AAC7D,+DAAqD;AACrD,iEAA6D;AAwBtD,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;IACT;IAAnB,YAAmB,OAAuB;QAAvB,YAAO,GAAP,OAAO,CAAgB;IAAG,CAAC;IAKxC,AAAN,KAAK,CAAC,aAAa,CAAS,gBAAkC;QAC5D,OAAO,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,gBAAgB,CAAC,CAAC;IACtD,CAAC;IAKK,AAAN,KAAK,CAAC,aAAa,CAAc,EAAU,EAAU,gBAAkC;QACrF,OAAO,IAAI,CAAC,OAAO,CAA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|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UpdateProjectDto = exports.CreateProjectDto = void 0;
|
|
4
|
+
var project_dto_1 = require("./project.dto");
|
|
5
|
+
Object.defineProperty(exports, "CreateProjectDto", { enumerable: true, get: function () { return project_dto_1.CreateProjectDto; } });
|
|
6
|
+
Object.defineProperty(exports, "UpdateProjectDto", { enumerable: true, get: function () { return project_dto_1.UpdateProjectDto; } });
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/dtos/index.ts"],"names":[],"mappings":";;;AAAA,6CAAmE;AAA1D,+GAAA,gBAAgB,OAAA;AAAE,+GAAA,gBAAgB,OAAA"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export declare class CreateProjectDto {
|
|
2
|
+
name: string;
|
|
3
|
+
description?: string;
|
|
4
|
+
key?: string;
|
|
5
|
+
status?: string;
|
|
6
|
+
startDate?: string;
|
|
7
|
+
endDate?: string;
|
|
8
|
+
ownerId?: string;
|
|
9
|
+
tags?: string[];
|
|
10
|
+
isArchived?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare class UpdateProjectDto {
|
|
13
|
+
name?: string;
|
|
14
|
+
description?: string;
|
|
15
|
+
key?: string;
|
|
16
|
+
status?: string;
|
|
17
|
+
startDate?: string;
|
|
18
|
+
endDate?: string;
|
|
19
|
+
ownerId?: string;
|
|
20
|
+
tags?: string[];
|
|
21
|
+
isArchived?: boolean;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=project.dto.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project.dto.d.ts","sourceRoot":"","sources":["../../src/dtos/project.dto.ts"],"names":[],"mappings":"AAEA,qBAAa,gBAAgB;IAG3B,IAAI,EAAE,MAAM,CAAC;IAIb,WAAW,CAAC,EAAE,MAAM,CAAC;IAIrB,GAAG,CAAC,EAAE,MAAM,CAAC;IAIb,MAAM,CAAC,EAAE,MAAM,CAAC;IAIhB,SAAS,CAAC,EAAE,MAAM,CAAC;IAInB,OAAO,CAAC,EAAE,MAAM,CAAC;IAIjB,OAAO,CAAC,EAAE,MAAM,CAAC;IAKjB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAIhB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,qBAAa,gBAAgB;IAG3B,IAAI,CAAC,EAAE,MAAM,CAAC;IAId,WAAW,CAAC,EAAE,MAAM,CAAC;IAIrB,GAAG,CAAC,EAAE,MAAM,CAAC;IAIb,MAAM,CAAC,EAAE,MAAM,CAAC;IAIhB,SAAS,CAAC,EAAE,MAAM,CAAC;IAInB,OAAO,CAAC,EAAE,MAAM,CAAC;IAIjB,OAAO,CAAC,EAAE,MAAM,CAAC;IAKjB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAIhB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB"}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.UpdateProjectDto = exports.CreateProjectDto = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
class CreateProjectDto {
|
|
15
|
+
name;
|
|
16
|
+
description;
|
|
17
|
+
key;
|
|
18
|
+
status;
|
|
19
|
+
startDate;
|
|
20
|
+
endDate;
|
|
21
|
+
ownerId;
|
|
22
|
+
tags;
|
|
23
|
+
isArchived;
|
|
24
|
+
}
|
|
25
|
+
exports.CreateProjectDto = CreateProjectDto;
|
|
26
|
+
__decorate([
|
|
27
|
+
(0, class_validator_1.IsString)(),
|
|
28
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
29
|
+
__metadata("design:type", String)
|
|
30
|
+
], CreateProjectDto.prototype, "name", void 0);
|
|
31
|
+
__decorate([
|
|
32
|
+
(0, class_validator_1.IsString)(),
|
|
33
|
+
(0, class_validator_1.IsOptional)(),
|
|
34
|
+
__metadata("design:type", String)
|
|
35
|
+
], CreateProjectDto.prototype, "description", void 0);
|
|
36
|
+
__decorate([
|
|
37
|
+
(0, class_validator_1.IsString)(),
|
|
38
|
+
(0, class_validator_1.IsOptional)(),
|
|
39
|
+
__metadata("design:type", String)
|
|
40
|
+
], CreateProjectDto.prototype, "key", void 0);
|
|
41
|
+
__decorate([
|
|
42
|
+
(0, class_validator_1.IsString)(),
|
|
43
|
+
(0, class_validator_1.IsOptional)(),
|
|
44
|
+
__metadata("design:type", String)
|
|
45
|
+
], CreateProjectDto.prototype, "status", void 0);
|
|
46
|
+
__decorate([
|
|
47
|
+
(0, class_validator_1.IsDateString)(),
|
|
48
|
+
(0, class_validator_1.IsOptional)(),
|
|
49
|
+
__metadata("design:type", String)
|
|
50
|
+
], CreateProjectDto.prototype, "startDate", void 0);
|
|
51
|
+
__decorate([
|
|
52
|
+
(0, class_validator_1.IsDateString)(),
|
|
53
|
+
(0, class_validator_1.IsOptional)(),
|
|
54
|
+
__metadata("design:type", String)
|
|
55
|
+
], CreateProjectDto.prototype, "endDate", void 0);
|
|
56
|
+
__decorate([
|
|
57
|
+
(0, class_validator_1.IsUUID)(),
|
|
58
|
+
(0, class_validator_1.IsOptional)(),
|
|
59
|
+
__metadata("design:type", String)
|
|
60
|
+
], CreateProjectDto.prototype, "ownerId", void 0);
|
|
61
|
+
__decorate([
|
|
62
|
+
(0, class_validator_1.IsArray)(),
|
|
63
|
+
(0, class_validator_1.IsString)({ each: true }),
|
|
64
|
+
(0, class_validator_1.IsOptional)(),
|
|
65
|
+
__metadata("design:type", Array)
|
|
66
|
+
], CreateProjectDto.prototype, "tags", void 0);
|
|
67
|
+
__decorate([
|
|
68
|
+
(0, class_validator_1.IsBoolean)(),
|
|
69
|
+
(0, class_validator_1.IsOptional)(),
|
|
70
|
+
__metadata("design:type", Boolean)
|
|
71
|
+
], CreateProjectDto.prototype, "isArchived", void 0);
|
|
72
|
+
class UpdateProjectDto {
|
|
73
|
+
name;
|
|
74
|
+
description;
|
|
75
|
+
key;
|
|
76
|
+
status;
|
|
77
|
+
startDate;
|
|
78
|
+
endDate;
|
|
79
|
+
ownerId;
|
|
80
|
+
tags;
|
|
81
|
+
isArchived;
|
|
82
|
+
}
|
|
83
|
+
exports.UpdateProjectDto = UpdateProjectDto;
|
|
84
|
+
__decorate([
|
|
85
|
+
(0, class_validator_1.IsString)(),
|
|
86
|
+
(0, class_validator_1.IsOptional)(),
|
|
87
|
+
__metadata("design:type", String)
|
|
88
|
+
], UpdateProjectDto.prototype, "name", void 0);
|
|
89
|
+
__decorate([
|
|
90
|
+
(0, class_validator_1.IsString)(),
|
|
91
|
+
(0, class_validator_1.IsOptional)(),
|
|
92
|
+
__metadata("design:type", String)
|
|
93
|
+
], UpdateProjectDto.prototype, "description", void 0);
|
|
94
|
+
__decorate([
|
|
95
|
+
(0, class_validator_1.IsString)(),
|
|
96
|
+
(0, class_validator_1.IsOptional)(),
|
|
97
|
+
__metadata("design:type", String)
|
|
98
|
+
], UpdateProjectDto.prototype, "key", void 0);
|
|
99
|
+
__decorate([
|
|
100
|
+
(0, class_validator_1.IsString)(),
|
|
101
|
+
(0, class_validator_1.IsOptional)(),
|
|
102
|
+
__metadata("design:type", String)
|
|
103
|
+
], UpdateProjectDto.prototype, "status", void 0);
|
|
104
|
+
__decorate([
|
|
105
|
+
(0, class_validator_1.IsDateString)(),
|
|
106
|
+
(0, class_validator_1.IsOptional)(),
|
|
107
|
+
__metadata("design:type", String)
|
|
108
|
+
], UpdateProjectDto.prototype, "startDate", void 0);
|
|
109
|
+
__decorate([
|
|
110
|
+
(0, class_validator_1.IsDateString)(),
|
|
111
|
+
(0, class_validator_1.IsOptional)(),
|
|
112
|
+
__metadata("design:type", String)
|
|
113
|
+
], UpdateProjectDto.prototype, "endDate", void 0);
|
|
114
|
+
__decorate([
|
|
115
|
+
(0, class_validator_1.IsUUID)(),
|
|
116
|
+
(0, class_validator_1.IsOptional)(),
|
|
117
|
+
__metadata("design:type", String)
|
|
118
|
+
], UpdateProjectDto.prototype, "ownerId", void 0);
|
|
119
|
+
__decorate([
|
|
120
|
+
(0, class_validator_1.IsArray)(),
|
|
121
|
+
(0, class_validator_1.IsString)({ each: true }),
|
|
122
|
+
(0, class_validator_1.IsOptional)(),
|
|
123
|
+
__metadata("design:type", Array)
|
|
124
|
+
], UpdateProjectDto.prototype, "tags", void 0);
|
|
125
|
+
__decorate([
|
|
126
|
+
(0, class_validator_1.IsBoolean)(),
|
|
127
|
+
(0, class_validator_1.IsOptional)(),
|
|
128
|
+
__metadata("design:type", Boolean)
|
|
129
|
+
], UpdateProjectDto.prototype, "isArchived", void 0);
|
|
130
|
+
//# sourceMappingURL=project.dto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project.dto.js","sourceRoot":"","sources":["../../src/dtos/project.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAA6G;AAE7G,MAAa,gBAAgB;IAG3B,IAAI,CAAS;IAIb,WAAW,CAAU;IAIrB,GAAG,CAAU;IAIb,MAAM,CAAU;IAIhB,SA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,8BAAY,GAAE;IACd,IAAA,4BAAU,GAAE;;mDACM;AAInB;IAFC,IAAA,8BAAY,GAAE;IACd,IAAA,4BAAU,GAAE;;iDACI;AAIjB;IAFC,IAAA,wBAAM,GAAE;IACR,IAAA,4BAAU,GAAE;;iDACI;AAKjB;IAHC,IAAA,yBAAO,GAAE;IACT,IAAA,0BAAQ,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IACxB,IAAA,4BAAU,GAAE;;8CACG;AAIhB;IAFC,IAAA,2BAAS,GAAE;IACX,IAAA,4BAAU,GAAE;;oDACQ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/entities/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Project = void 0;
|
|
4
|
+
var project_entity_1 = require("./project.entity");
|
|
5
|
+
Object.defineProperty(exports, "Project", { enumerable: true, get: function () { return project_entity_1.Project; } });
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/entities/index.ts"],"names":[],"mappings":";;;AAAA,mDAA2C;AAAlC,yGAAA,OAAO,OAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare class OrganizationProject {
|
|
2
|
+
id: string;
|
|
3
|
+
organizationId: string;
|
|
4
|
+
name: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
key?: string;
|
|
7
|
+
status?: string;
|
|
8
|
+
startDate?: Date;
|
|
9
|
+
endDate?: Date;
|
|
10
|
+
ownerId?: string;
|
|
11
|
+
tags?: string[];
|
|
12
|
+
isArchived: boolean;
|
|
13
|
+
createdAt: Date;
|
|
14
|
+
updatedAt: Date;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=organization-project.entity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"organization-project.entity.d.ts","sourceRoot":"","sources":["../../src/entities/organization-project.entity.ts"],"names":[],"mappings":"AASA,qBACa,mBAAmB;IAE9B,EAAE,EAAE,MAAM,CAAC;IAKX,cAAc,EAAE,MAAM,CAAC;IAKvB,IAAI,EAAE,MAAM,CAAC;IAKb,WAAW,CAAC,EAAE,MAAM,CAAC;IAKrB,GAAG,CAAC,EAAE,MAAM,CAAC;IAKb,MAAM,CAAC,EAAE,MAAM,CAAC;IAGhB,SAAS,CAAC,EAAE,IAAI,CAAC;IAGjB,OAAO,CAAC,EAAE,IAAI,CAAC;IAKf,OAAO,CAAC,EAAE,MAAM,CAAC;IAGjB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAGhB,UAAU,EAAE,OAAO,CAAC;IAQpB,SAAS,EAAE,IAAI,CAAC;IAQhB,SAAS,EAAE,IAAI,CAAC;CACjB"}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.OrganizationProject = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
const typeorm_1 = require("typeorm");
|
|
15
|
+
let OrganizationProject = class OrganizationProject {
|
|
16
|
+
id;
|
|
17
|
+
organizationId;
|
|
18
|
+
name;
|
|
19
|
+
description;
|
|
20
|
+
key;
|
|
21
|
+
status;
|
|
22
|
+
startDate;
|
|
23
|
+
endDate;
|
|
24
|
+
ownerId;
|
|
25
|
+
tags;
|
|
26
|
+
isArchived;
|
|
27
|
+
createdAt;
|
|
28
|
+
updatedAt;
|
|
29
|
+
};
|
|
30
|
+
exports.OrganizationProject = OrganizationProject;
|
|
31
|
+
__decorate([
|
|
32
|
+
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
33
|
+
__metadata("design:type", String)
|
|
34
|
+
], OrganizationProject.prototype, "id", void 0);
|
|
35
|
+
__decorate([
|
|
36
|
+
(0, class_validator_1.IsUUID)(),
|
|
37
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
38
|
+
(0, typeorm_1.Column)(),
|
|
39
|
+
__metadata("design:type", String)
|
|
40
|
+
], OrganizationProject.prototype, "organizationId", void 0);
|
|
41
|
+
__decorate([
|
|
42
|
+
(0, class_validator_1.IsString)(),
|
|
43
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
44
|
+
(0, typeorm_1.Column)(),
|
|
45
|
+
__metadata("design:type", String)
|
|
46
|
+
], OrganizationProject.prototype, "name", void 0);
|
|
47
|
+
__decorate([
|
|
48
|
+
(0, class_validator_1.IsString)(),
|
|
49
|
+
(0, class_validator_1.IsOptional)(),
|
|
50
|
+
(0, typeorm_1.Column)({ type: 'text', nullable: true }),
|
|
51
|
+
__metadata("design:type", String)
|
|
52
|
+
], OrganizationProject.prototype, "description", void 0);
|
|
53
|
+
__decorate([
|
|
54
|
+
(0, class_validator_1.IsString)(),
|
|
55
|
+
(0, class_validator_1.IsOptional)(),
|
|
56
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
57
|
+
__metadata("design:type", String)
|
|
58
|
+
], OrganizationProject.prototype, "key", void 0);
|
|
59
|
+
__decorate([
|
|
60
|
+
(0, class_validator_1.IsString)(),
|
|
61
|
+
(0, class_validator_1.IsOptional)(),
|
|
62
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
63
|
+
__metadata("design:type", String)
|
|
64
|
+
], OrganizationProject.prototype, "status", void 0);
|
|
65
|
+
__decorate([
|
|
66
|
+
(0, typeorm_1.Column)({ type: 'date', nullable: true }),
|
|
67
|
+
__metadata("design:type", Date)
|
|
68
|
+
], OrganizationProject.prototype, "startDate", void 0);
|
|
69
|
+
__decorate([
|
|
70
|
+
(0, typeorm_1.Column)({ type: 'date', nullable: true }),
|
|
71
|
+
__metadata("design:type", Date)
|
|
72
|
+
], OrganizationProject.prototype, "endDate", void 0);
|
|
73
|
+
__decorate([
|
|
74
|
+
(0, class_validator_1.IsUUID)(),
|
|
75
|
+
(0, class_validator_1.IsOptional)(),
|
|
76
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
77
|
+
__metadata("design:type", String)
|
|
78
|
+
], OrganizationProject.prototype, "ownerId", void 0);
|
|
79
|
+
__decorate([
|
|
80
|
+
(0, typeorm_1.Column)({ type: 'simple-array', nullable: true }),
|
|
81
|
+
__metadata("design:type", Array)
|
|
82
|
+
], OrganizationProject.prototype, "tags", void 0);
|
|
83
|
+
__decorate([
|
|
84
|
+
(0, typeorm_1.Column)({ default: false }),
|
|
85
|
+
__metadata("design:type", Boolean)
|
|
86
|
+
], OrganizationProject.prototype, "isArchived", void 0);
|
|
87
|
+
__decorate([
|
|
88
|
+
(0, typeorm_1.CreateDateColumn)({
|
|
89
|
+
name: 'createdAt',
|
|
90
|
+
nullable: false,
|
|
91
|
+
type: 'timestamptz',
|
|
92
|
+
default: () => 'CURRENT_TIMESTAMP',
|
|
93
|
+
}),
|
|
94
|
+
__metadata("design:type", Date)
|
|
95
|
+
], OrganizationProject.prototype, "createdAt", void 0);
|
|
96
|
+
__decorate([
|
|
97
|
+
(0, typeorm_1.UpdateDateColumn)({
|
|
98
|
+
name: 'updatedAt',
|
|
99
|
+
nullable: false,
|
|
100
|
+
type: 'timestamptz',
|
|
101
|
+
default: () => 'CURRENT_TIMESTAMP',
|
|
102
|
+
}),
|
|
103
|
+
__metadata("design:type", Date)
|
|
104
|
+
], OrganizationProject.prototype, "updatedAt", void 0);
|
|
105
|
+
exports.OrganizationProject = OrganizationProject = __decorate([
|
|
106
|
+
(0, typeorm_1.Entity)('project')
|
|
107
|
+
], OrganizationProject);
|
|
108
|
+
//# sourceMappingURL=organization-project.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"organization-project.entity.js","sourceRoot":"","sources":["../../src/entities/organization-project.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAA2E;AAC3E,qCAMiB;AAGV,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;IAE9B,EAAE,CAAS;IAKX,cAAc,CAAS;IAKvB,IAAI,CAAS;IAKb,WAAW,CAAU;IAKrB,GAAG,CAAU;IAKb,MAAM,CAAU;IAGhB,SAAS,CAAQ;IAGjB,OAAO,CAAQ;IAKf,OAAO,CAAU;IAGjB,IAAI,CAAY;IAGhB,UAAU,CAAU;IAQpB,SAAS,CAAO;IAQhB,SAAS,CAAO;CACjB,CAAA;AA7DY,kDAAmB;AAE9B;IADC,IAAA,gCAAsB,EAAC,MAAM,CAAC;;+CACpB;AAKX;IAHC,IAAA,wBAAM,GAAE;IACR,IAAA,4BAAU,GAAE;IACZ,IAAA,gBAAM,GAAE;;2DACc;AAKvB;IAHC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;IACZ,IAAA,gBAAM,GAAE;;iDACI;AAKb;IAHC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;IACZ,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IA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AmB,CA6D/B"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare class Project {
|
|
2
|
+
id: string;
|
|
3
|
+
name: string;
|
|
4
|
+
description?: string;
|
|
5
|
+
key?: string;
|
|
6
|
+
status?: string;
|
|
7
|
+
startDate?: Date;
|
|
8
|
+
endDate?: Date;
|
|
9
|
+
ownerId?: string;
|
|
10
|
+
tags?: string[];
|
|
11
|
+
isArchived: boolean;
|
|
12
|
+
createdAt: Date;
|
|
13
|
+
updatedAt: Date;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=project.entity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project.entity.d.ts","sourceRoot":"","sources":["../../src/entities/project.entity.ts"],"names":[],"mappings":"AASA,qBACa,OAAO;IAElB,EAAE,EAAE,MAAM,CAAC;IAKX,IAAI,EAAE,MAAM,CAAC;IAKb,WAAW,CAAC,EAAE,MAAM,CAAC;IAKrB,GAAG,CAAC,EAAE,MAAM,CAAC;IAKb,MAAM,CAAC,EAAE,MAAM,CAAC;IAGhB,SAAS,CAAC,EAAE,IAAI,CAAC;IAGjB,OAAO,CAAC,EAAE,IAAI,CAAC;IAKf,OAAO,CAAC,EAAE,MAAM,CAAC;IAGjB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAGhB,UAAU,EAAE,OAAO,CAAC;IAQpB,SAAS,EAAE,IAAI,CAAC;IAQhB,SAAS,EAAE,IAAI,CAAC;CACjB"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.Project = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
const typeorm_1 = require("typeorm");
|
|
15
|
+
let Project = class Project {
|
|
16
|
+
id;
|
|
17
|
+
name;
|
|
18
|
+
description;
|
|
19
|
+
key;
|
|
20
|
+
status;
|
|
21
|
+
startDate;
|
|
22
|
+
endDate;
|
|
23
|
+
ownerId;
|
|
24
|
+
tags;
|
|
25
|
+
isArchived;
|
|
26
|
+
createdAt;
|
|
27
|
+
updatedAt;
|
|
28
|
+
};
|
|
29
|
+
exports.Project = Project;
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
32
|
+
__metadata("design:type", String)
|
|
33
|
+
], Project.prototype, "id", void 0);
|
|
34
|
+
__decorate([
|
|
35
|
+
(0, class_validator_1.IsString)(),
|
|
36
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
37
|
+
(0, typeorm_1.Column)(),
|
|
38
|
+
__metadata("design:type", String)
|
|
39
|
+
], Project.prototype, "name", void 0);
|
|
40
|
+
__decorate([
|
|
41
|
+
(0, class_validator_1.IsString)(),
|
|
42
|
+
(0, class_validator_1.IsOptional)(),
|
|
43
|
+
(0, typeorm_1.Column)({ type: 'text', nullable: true }),
|
|
44
|
+
__metadata("design:type", String)
|
|
45
|
+
], Project.prototype, "description", void 0);
|
|
46
|
+
__decorate([
|
|
47
|
+
(0, class_validator_1.IsString)(),
|
|
48
|
+
(0, class_validator_1.IsOptional)(),
|
|
49
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
50
|
+
__metadata("design:type", String)
|
|
51
|
+
], Project.prototype, "key", void 0);
|
|
52
|
+
__decorate([
|
|
53
|
+
(0, class_validator_1.IsString)(),
|
|
54
|
+
(0, class_validator_1.IsOptional)(),
|
|
55
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
56
|
+
__metadata("design:type", String)
|
|
57
|
+
], Project.prototype, "status", void 0);
|
|
58
|
+
__decorate([
|
|
59
|
+
(0, typeorm_1.Column)({ type: 'date', nullable: true }),
|
|
60
|
+
__metadata("design:type", Date)
|
|
61
|
+
], Project.prototype, "startDate", void 0);
|
|
62
|
+
__decorate([
|
|
63
|
+
(0, typeorm_1.Column)({ type: 'date', nullable: true }),
|
|
64
|
+
__metadata("design:type", Date)
|
|
65
|
+
], Project.prototype, "endDate", void 0);
|
|
66
|
+
__decorate([
|
|
67
|
+
(0, class_validator_1.IsUUID)(),
|
|
68
|
+
(0, class_validator_1.IsOptional)(),
|
|
69
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
70
|
+
__metadata("design:type", String)
|
|
71
|
+
], Project.prototype, "ownerId", void 0);
|
|
72
|
+
__decorate([
|
|
73
|
+
(0, typeorm_1.Column)({ type: 'simple-array', nullable: true }),
|
|
74
|
+
__metadata("design:type", Array)
|
|
75
|
+
], Project.prototype, "tags", void 0);
|
|
76
|
+
__decorate([
|
|
77
|
+
(0, typeorm_1.Column)({ default: false }),
|
|
78
|
+
__metadata("design:type", Boolean)
|
|
79
|
+
], Project.prototype, "isArchived", void 0);
|
|
80
|
+
__decorate([
|
|
81
|
+
(0, typeorm_1.CreateDateColumn)({
|
|
82
|
+
name: 'createdAt',
|
|
83
|
+
nullable: false,
|
|
84
|
+
type: 'timestamptz',
|
|
85
|
+
default: () => 'CURRENT_TIMESTAMP',
|
|
86
|
+
}),
|
|
87
|
+
__metadata("design:type", Date)
|
|
88
|
+
], Project.prototype, "createdAt", void 0);
|
|
89
|
+
__decorate([
|
|
90
|
+
(0, typeorm_1.UpdateDateColumn)({
|
|
91
|
+
name: 'updatedAt',
|
|
92
|
+
nullable: false,
|
|
93
|
+
type: 'timestamptz',
|
|
94
|
+
default: () => 'CURRENT_TIMESTAMP',
|
|
95
|
+
}),
|
|
96
|
+
__metadata("design:type", Date)
|
|
97
|
+
], Project.prototype, "updatedAt", void 0);
|
|
98
|
+
exports.Project = Project = __decorate([
|
|
99
|
+
(0, typeorm_1.Entity)('project')
|
|
100
|
+
], Project);
|
|
101
|
+
//# sourceMappingURL=project.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project.entity.js","sourceRoot":"","sources":["../../src/entities/project.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAA2E;AAC3E,qCAMiB;AAGV,IAAM,OAAO,GAAb,MAAM,OAAO;IAElB,EAAE,CAAS;IAKX,IAAI,CAAS;IAKb,WAAW,CAAU;IAKrB,GAAG,CAAU;IAKb,MAAM,CAAU;IAGhB,SAAS,CAAQ;IAGjB,OAAO,CAAQ;IAKf,OAAO,CAAU;IAGjB,IAAI,CAAY;IAGhB,UAAU,CAAU;IAQpB,SAAS,CAAO;IAQhB,SAAS,CAAO;CACjB,CAAA;AAxDY,0BAAO;AAElB;IADC,IAAA,gCAAsB,EAAC,MAAM,CAAC;;mCACpB;AAKX;IAHC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;IACZ,IAAA,gBAAM,GAAE;;qCACI;AAKb;IAHC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;IACZ,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;4CACpB;AAKrB;IAHC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;IACZ,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;oCACd;AAKb;IAHC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;IACZ,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;uCACX;AAGhB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;8BAC7B,IAAI;0CAAC;AAGjB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;8BAC/B,IAAI;wCAAC;AAKf;IAHC,IAAA,wBAAM,GAAE;IACR,IAAA,4BAAU,GAAE;IACZ,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;wCACV;AAGjB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,cAAc,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;qCACjC;AAGhB;IADC,IAAA,gBAAM,EAAC,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;;2CACP;AAQpB;IANC,IAAA,0BAAgB,EAAC;QAChB,IAAI,EAAE,WAAW;QACjB,QAAQ,EAAE,KAAK;QACf,IAAI,EAAE,aAAa;QACnB,OAAO,EAAE,GAAG,EAAE,CAAC,mBAAmB;KACnC,CAAC;8BACS,IAAI;0CAAC;AAQhB;IANC,IAAA,0BAAgB,EAAC;QAChB,IAAI,EAAE,WAAW;QACjB,QAAQ,EAAE,KAAK;QACf,IAAI,EAAE,aAAa;QACnB,OAAO,EAAE,GAAG,EAAE,CAAC,mBAAmB;KACnC,CAAC;8BACS,IAAI;0CAAC;kBAvDL,OAAO;IADnB,IAAA,gBAAM,EAAC,SAAS,CAAC;GACL,OAAO,CAwDnB"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { ProjectModule } from './project.module';
|
|
2
|
+
export { Project } from './entities';
|
|
3
|
+
export { ProjectService } from './services';
|
|
4
|
+
export { CreateProjectDto, UpdateProjectDto } from './dtos';
|
|
5
|
+
export { ProjectController } from './controllers';
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAGjD,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAGrC,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAG5C,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AAG5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ProjectController = exports.UpdateProjectDto = exports.CreateProjectDto = exports.ProjectService = exports.Project = exports.ProjectModule = void 0;
|
|
4
|
+
var project_module_1 = require("./project.module");
|
|
5
|
+
Object.defineProperty(exports, "ProjectModule", { enumerable: true, get: function () { return project_module_1.ProjectModule; } });
|
|
6
|
+
var entities_1 = require("./entities");
|
|
7
|
+
Object.defineProperty(exports, "Project", { enumerable: true, get: function () { return entities_1.Project; } });
|
|
8
|
+
var services_1 = require("./services");
|
|
9
|
+
Object.defineProperty(exports, "ProjectService", { enumerable: true, get: function () { return services_1.ProjectService; } });
|
|
10
|
+
var dtos_1 = require("./dtos");
|
|
11
|
+
Object.defineProperty(exports, "CreateProjectDto", { enumerable: true, get: function () { return dtos_1.CreateProjectDto; } });
|
|
12
|
+
Object.defineProperty(exports, "UpdateProjectDto", { enumerable: true, get: function () { return dtos_1.UpdateProjectDto; } });
|
|
13
|
+
var controllers_1 = require("./controllers");
|
|
14
|
+
Object.defineProperty(exports, "ProjectController", { enumerable: true, get: function () { return controllers_1.ProjectController; } });
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AACA,mDAAiD;AAAxC,+GAAA,aAAa,OAAA;AAGtB,uCAAqC;AAA5B,mGAAA,OAAO,OAAA;AAGhB,uCAA4C;AAAnC,0GAAA,cAAc,OAAA;AAGvB,+BAA4D;AAAnD,wGAAA,gBAAgB,OAAA;AAAE,wGAAA,gBAAgB,OAAA;AAG3C,6CAAkD;AAAzC,gHAAA,iBAAiB,OAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project.module.d.ts","sourceRoot":"","sources":["../src/project.module.ts"],"names":[],"mappings":"AAOA,qBAMa,aAAa;CAAG"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.ProjectModule = void 0;
|
|
10
|
+
const common_1 = require("@nestjs/common");
|
|
11
|
+
const typeorm_1 = require("@nestjs/typeorm");
|
|
12
|
+
const project_controller_1 = require("./controllers/project.controller");
|
|
13
|
+
const project_entity_1 = require("./entities/project.entity");
|
|
14
|
+
const project_service_1 = require("./services/project.service");
|
|
15
|
+
let ProjectModule = class ProjectModule {
|
|
16
|
+
};
|
|
17
|
+
exports.ProjectModule = ProjectModule;
|
|
18
|
+
exports.ProjectModule = ProjectModule = __decorate([
|
|
19
|
+
(0, common_1.Module)({
|
|
20
|
+
imports: [typeorm_1.TypeOrmModule.forFeature([project_entity_1.Project])],
|
|
21
|
+
controllers: [project_controller_1.ProjectController],
|
|
22
|
+
providers: [project_service_1.ProjectService],
|
|
23
|
+
exports: [project_service_1.ProjectService, typeorm_1.TypeOrmModule],
|
|
24
|
+
})
|
|
25
|
+
], ProjectModule);
|
|
26
|
+
//# sourceMappingURL=project.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project.module.js","sourceRoot":"","sources":["../src/project.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,6CAAgD;AAEhD,yEAAqE;AACrE,8DAAoD;AACpD,gEAA4D;AAQrD,IAAM,aAAa,GAAnB,MAAM,aAAa;CAAG,CAAA;AAAhB,sCAAa;wBAAb,aAAa;IANzB,IAAA,eAAM,EAAC;QACN,OAAO,EAAE,CAAC,uBAAa,CAAC,UAAU,CAAC,CAAC,wBAAO,CAAC,CAAC,CAAC;QAC9C,WAAW,EAAE,CAAC,sCAAiB,CAAC;QAChC,SAAS,EAAE,CAAC,gCAAc,CAAC;QAC3B,OAAO,EAAE,CAAC,gCAAc,EAAE,uBAAa,CAAC;KACzC,CAAC;GACW,aAAa,CAAG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/services/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ProjectService = void 0;
|
|
4
|
+
var project_service_1 = require("./project.service");
|
|
5
|
+
Object.defineProperty(exports, "ProjectService", { enumerable: true, get: function () { return project_service_1.ProjectService; } });
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/services/index.ts"],"names":[],"mappings":";;;AAAA,qDAAmD;AAA1C,iHAAA,cAAc,OAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { TypeOrmCrudService } from '@dataui/crud-typeorm';
|
|
2
|
+
import { Repository } from 'typeorm';
|
|
3
|
+
import { CreateProjectDto, UpdateProjectDto } from '../dtos';
|
|
4
|
+
import { OrganizationProject } from '../entities/organization-project.entity';
|
|
5
|
+
export declare class OrganizationProjectService extends TypeOrmCrudService<OrganizationProject> {
|
|
6
|
+
repo: Repository<OrganizationProject>;
|
|
7
|
+
constructor(repo: Repository<OrganizationProject>);
|
|
8
|
+
createProjectForOrganization(createProjectDto: CreateProjectDto): Promise<OrganizationProject>;
|
|
9
|
+
updateProject(id: string, updateProjectDto: UpdateProjectDto): Promise<OrganizationProject | null>;
|
|
10
|
+
getProjectsByOrganization(organizationId: string, includeArchived?: boolean): Promise<OrganizationProject[]>;
|
|
11
|
+
getProjectById(id: string): Promise<OrganizationProject | null>;
|
|
12
|
+
getActiveProjectsByOrganization(organizationId: string): Promise<OrganizationProject[]>;
|
|
13
|
+
archiveProject(id: string): Promise<OrganizationProject | null>;
|
|
14
|
+
deleteProject(id: string): Promise<void>;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=organization-project.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"organization-project.service.d.ts","sourceRoot":"","sources":["../../src/services/organization-project.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAG1D,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErC,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAC7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAC;AAE9E,qBACa,0BAA2B,SAAQ,kBAAkB,CAAC,mBAAmB,CAAC;IAG5E,IAAI,EAAE,UAAU,CAAC,mBAAmB,CAAC;gBAArC,IAAI,EAAE,UAAU,CAAC,mBAAmB,CAAC;IAKxC,4BAA4B,CAChC,gBAAgB,EAAE,gBAAgB,GACjC,OAAO,CAAC,mBAAmB,CAAC;IAKzB,aAAa,CACjB,EAAE,EAAE,MAAM,EACV,gBAAgB,EAAE,gBAAgB,GACjC,OAAO,CAAC,mBAAmB,GAAG,IAAI,CAAC;IAKhC,yBAAyB,CAC7B,cAAc,EAAE,MAAM,EACtB,eAAe,UAAQ,GACtB,OAAO,CAAC,mBAAmB,EAAE,CAAC;IAc3B,cAAc,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,GAAG,IAAI,CAAC;IAM/D,+BAA+B,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,EAAE,CAAC;IAavF,cAAc,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,GAAG,IAAI,CAAC;IAK/D,aAAa,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAG/C"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.OrganizationProjectService = void 0;
|
|
16
|
+
const crud_typeorm_1 = require("@dataui/crud-typeorm");
|
|
17
|
+
const common_1 = require("@nestjs/common");
|
|
18
|
+
const typeorm_1 = require("@nestjs/typeorm");
|
|
19
|
+
const typeorm_2 = require("typeorm");
|
|
20
|
+
const organization_project_entity_1 = require("../entities/organization-project.entity");
|
|
21
|
+
let OrganizationProjectService = class OrganizationProjectService extends crud_typeorm_1.TypeOrmCrudService {
|
|
22
|
+
repo;
|
|
23
|
+
constructor(repo) {
|
|
24
|
+
super(repo);
|
|
25
|
+
this.repo = repo;
|
|
26
|
+
}
|
|
27
|
+
async createProjectForOrganization(createProjectDto) {
|
|
28
|
+
const project = this.repo.create(createProjectDto);
|
|
29
|
+
return await this.repo.save(project);
|
|
30
|
+
}
|
|
31
|
+
async updateProject(id, updateProjectDto) {
|
|
32
|
+
await this.repo.update(id, updateProjectDto);
|
|
33
|
+
return await this.repo.findOne({ where: { id } });
|
|
34
|
+
}
|
|
35
|
+
async getProjectsByOrganization(organizationId, includeArchived = false) {
|
|
36
|
+
const query = this.repo
|
|
37
|
+
.createQueryBuilder('project')
|
|
38
|
+
.where('project.organizationId = :organizationId', { organizationId });
|
|
39
|
+
if (!includeArchived) {
|
|
40
|
+
query.andWhere('project.isArchived = :isArchived', { isArchived: false });
|
|
41
|
+
}
|
|
42
|
+
query.orderBy('project.createdAt', 'DESC');
|
|
43
|
+
return await query.getMany();
|
|
44
|
+
}
|
|
45
|
+
async getProjectById(id) {
|
|
46
|
+
return await this.repo.findOne({
|
|
47
|
+
where: { id },
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
async getActiveProjectsByOrganization(organizationId) {
|
|
51
|
+
return await this.repo.find({
|
|
52
|
+
where: {
|
|
53
|
+
organizationId,
|
|
54
|
+
status: 'active',
|
|
55
|
+
isArchived: false,
|
|
56
|
+
},
|
|
57
|
+
order: {
|
|
58
|
+
createdAt: 'DESC',
|
|
59
|
+
},
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
async archiveProject(id) {
|
|
63
|
+
await this.repo.update(id, { isArchived: true });
|
|
64
|
+
return await this.repo.findOne({ where: { id } });
|
|
65
|
+
}
|
|
66
|
+
async deleteProject(id) {
|
|
67
|
+
await this.repo.delete(id);
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
exports.OrganizationProjectService = OrganizationProjectService;
|
|
71
|
+
exports.OrganizationProjectService = OrganizationProjectService = __decorate([
|
|
72
|
+
(0, common_1.Injectable)(),
|
|
73
|
+
__param(0, (0, typeorm_1.InjectRepository)(organization_project_entity_1.OrganizationProject)),
|
|
74
|
+
__metadata("design:paramtypes", [typeorm_2.Repository])
|
|
75
|
+
], OrganizationProjectService);
|
|
76
|
+
//# sourceMappingURL=organization-project.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"organization-project.service.js","sourceRoot":"","sources":["../../src/services/organization-project.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,uDAA0D;AAC1D,2CAA4C;AAC5C,6CAAmD;AACnD,qCAAqC;AAGrC,yFAA8E;AAGvE,IAAM,0BAA0B,GAAhC,MAAM,0BAA2B,SAAQ,iCAAuC;IAG5E;IAFT,YAES,IAAqC;QAE5C,KAAK,CAAC,IAAI,CAAC,CAAC;QAFL,SAAI,GAAJ,IAAI,CAAiC;IAG9C,CAAC;IAED,KAAK,CAAC,4BAA4B,CAChC,gBAAkC;QAElC,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC;QACnD,OAAO,MAAM,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC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AAE,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC;QACjD,OAAO,MAAM,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;IACpD,CAAC;IAED,KAAK,CAAC,aAAa,CAAC,EAAU;QAC5B,MAAM,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IAC7B,CAAC;CACF,CAAA;AAnEY,gEAA0B;qCAA1B,0BAA0B;IADtC,IAAA,mBAAU,GAAE;IAGR,WAAA,IAAA,0BAAgB,EAAC,iDAAmB,CAAC,CAAA;qCACzB,oBAAU;GAHd,0BAA0B,CAmEtC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { TypeOrmCrudService } from '@dataui/crud-typeorm';
|
|
2
|
+
import { Repository } from 'typeorm';
|
|
3
|
+
import { CreateProjectDto, UpdateProjectDto } from '../dtos';
|
|
4
|
+
import { Project } from '../entities/project.entity';
|
|
5
|
+
export declare class ProjectService extends TypeOrmCrudService<Project> {
|
|
6
|
+
repo: Repository<Project>;
|
|
7
|
+
constructor(repo: Repository<Project>);
|
|
8
|
+
createProject(createProjectDto: CreateProjectDto): Promise<Project>;
|
|
9
|
+
updateProject(id: string, updateProjectDto: UpdateProjectDto): Promise<Project | null>;
|
|
10
|
+
getProjectById(id: string): Promise<Project | null>;
|
|
11
|
+
archiveProject(id: string): Promise<Project | null>;
|
|
12
|
+
deleteProject(id: string): Promise<void>;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=project.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project.service.d.ts","sourceRoot":"","sources":["../../src/services/project.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAG1D,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErC,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAC7D,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAErD,qBACa,cAAe,SAAQ,kBAAkB,CAAC,OAAO,CAAC;IAGpD,IAAI,EAAE,UAAU,CAAC,OAAO,CAAC;gBAAzB,IAAI,EAAE,UAAU,CAAC,OAAO,CAAC;IAK5B,aAAa,CACjB,gBAAgB,EAAE,gBAAgB,GACjC,OAAO,CAAC,OAAO,CAAC;IAKb,aAAa,CACjB,EAAE,EAAE,MAAM,EACV,gBAAgB,EAAE,gBAAgB,GACjC,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC;IAKpB,cAAc,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC;IAMnD,cAAc,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC;IAKnD,aAAa,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAG/C"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.ProjectService = void 0;
|
|
16
|
+
const crud_typeorm_1 = require("@dataui/crud-typeorm");
|
|
17
|
+
const common_1 = require("@nestjs/common");
|
|
18
|
+
const typeorm_1 = require("@nestjs/typeorm");
|
|
19
|
+
const typeorm_2 = require("typeorm");
|
|
20
|
+
const project_entity_1 = require("../entities/project.entity");
|
|
21
|
+
let ProjectService = class ProjectService extends crud_typeorm_1.TypeOrmCrudService {
|
|
22
|
+
repo;
|
|
23
|
+
constructor(repo) {
|
|
24
|
+
super(repo);
|
|
25
|
+
this.repo = repo;
|
|
26
|
+
}
|
|
27
|
+
async createProject(createProjectDto) {
|
|
28
|
+
const project = this.repo.create(createProjectDto);
|
|
29
|
+
return await this.repo.save(project);
|
|
30
|
+
}
|
|
31
|
+
async updateProject(id, updateProjectDto) {
|
|
32
|
+
await this.repo.update(id, updateProjectDto);
|
|
33
|
+
return await this.repo.findOne({ where: { id } });
|
|
34
|
+
}
|
|
35
|
+
async getProjectById(id) {
|
|
36
|
+
return await this.repo.findOne({
|
|
37
|
+
where: { id },
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
async archiveProject(id) {
|
|
41
|
+
await this.repo.update(id, { isArchived: true });
|
|
42
|
+
return await this.repo.findOne({ where: { id } });
|
|
43
|
+
}
|
|
44
|
+
async deleteProject(id) {
|
|
45
|
+
await this.repo.delete(id);
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
exports.ProjectService = ProjectService;
|
|
49
|
+
exports.ProjectService = ProjectService = __decorate([
|
|
50
|
+
(0, common_1.Injectable)(),
|
|
51
|
+
__param(0, (0, typeorm_1.InjectRepository)(project_entity_1.Project)),
|
|
52
|
+
__metadata("design:paramtypes", [typeorm_2.Repository])
|
|
53
|
+
], ProjectService);
|
|
54
|
+
//# sourceMappingURL=project.service.js.map
|
|
@@ -0,0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AAC,EAAU;QAC5B,MAAM,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IAC7B,CAAC;CACF,CAAA;AArCY,wCAAc;yBAAd,cAAc;IAD1B,IAAA,mBAAU,GAAE;IAGR,WAAA,IAAA,0BAAgB,EAAC,wBAAO,CAAC,CAAA;qCACb,oBAAU;GAHd,cAAc,CAqC1B"}
|
package/package.json
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@venturialstd/project",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "Project Management Module for Venturial - Project Entity Only",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"type": "commonjs",
|
|
8
|
+
"files": [
|
|
9
|
+
"dist"
|
|
10
|
+
],
|
|
11
|
+
"publishConfig": {
|
|
12
|
+
"access": "public"
|
|
13
|
+
},
|
|
14
|
+
"scripts": {
|
|
15
|
+
"build": "tsc -p tsconfig.json",
|
|
16
|
+
"prepublishOnly": "npm run build",
|
|
17
|
+
"release:patch": "npm run build && npm version patch --no-git-tag-version && npm publish"
|
|
18
|
+
},
|
|
19
|
+
"devDependencies": {
|
|
20
|
+
"@dataui/crud": "^5.3.4",
|
|
21
|
+
"@dataui/crud-typeorm": "^5.3.4",
|
|
22
|
+
"@nestjs/common": "^11.0.11",
|
|
23
|
+
"@nestjs/config": "^3.0.0",
|
|
24
|
+
"@nestjs/core": "^11.0.5",
|
|
25
|
+
"@nestjs/swagger": "^11.0.3",
|
|
26
|
+
"@nestjs/typeorm": "^10.0.0",
|
|
27
|
+
"@types/node": "^20.0.0",
|
|
28
|
+
"class-transformer": "^0.5.1",
|
|
29
|
+
"class-validator": "^0.14.1",
|
|
30
|
+
"ts-node": "^10.9.0",
|
|
31
|
+
"tsconfig-paths": "^4.2.0",
|
|
32
|
+
"typeorm": "^0.3.20",
|
|
33
|
+
"typescript": "^5.9.3"
|
|
34
|
+
},
|
|
35
|
+
"peerDependencies": {
|
|
36
|
+
"@dataui/crud": "^5.3.4",
|
|
37
|
+
"@dataui/crud-typeorm": "^5.3.4",
|
|
38
|
+
"@nestjs/common": "^11.0.11",
|
|
39
|
+
"@nestjs/core": "^11.0.5",
|
|
40
|
+
"@nestjs/swagger": "^11.0.3",
|
|
41
|
+
"@nestjs/typeorm": "^10.0.0",
|
|
42
|
+
"class-transformer": "^0.5.1",
|
|
43
|
+
"class-validator": "^0.14.1",
|
|
44
|
+
"typeorm": "^0.3.20"
|
|
45
|
+
}
|
|
46
|
+
}
|