@venturialstd/project 0.0.7 → 0.0.8

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 CHANGED
@@ -1,278 +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.
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.
@@ -18,7 +18,7 @@ let ProjectModule = class ProjectModule {
18
18
  exports.ProjectModule = ProjectModule;
19
19
  exports.ProjectModule = ProjectModule = __decorate([
20
20
  (0, common_1.Module)({
21
- imports: [core_1.SharedModule.forRoot({}), typeorm_1.TypeOrmModule.forFeature([project_entity_1.Project])],
21
+ imports: [core_1.SharedModule, typeorm_1.TypeOrmModule.forFeature([project_entity_1.Project])],
22
22
  controllers: [project_controller_1.ProjectController],
23
23
  providers: [project_service_1.ProjectService],
24
24
  exports: [project_service_1.ProjectService],
@@ -1 +1 @@
1
- {"version":3,"file":"project.module.js","sourceRoot":"","sources":["../src/project.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,6CAAgD;AAChD,6CAAkD;AAElD,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,mBAAY,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,uBAAa,CAAC,UAAU,CAAC,CAAC,wBAAO,CAAC,CAAC,CAAC;QACxE,WAAW,EAAE,CAAC,sCAAiB,CAAC;QAChC,SAAS,EAAE,CAAC,gCAAc,CAAC;QAC3B,OAAO,EAAE,CAAC,gCAAc,CAAC;KAC1B,CAAC;GACW,aAAa,CAAG"}
1
+ {"version":3,"file":"project.module.js","sourceRoot":"","sources":["../src/project.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,6CAAgD;AAChD,6CAAkD;AAElD,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,mBAAY,EAAE,uBAAa,CAAC,UAAU,CAAC,CAAC,wBAAO,CAAC,CAAC,CAAC;QAC5D,WAAW,EAAE,CAAC,sCAAiB,CAAC;QAChC,SAAS,EAAE,CAAC,gCAAc,CAAC;QAC3B,OAAO,EAAE,CAAC,gCAAc,CAAC;KAC1B,CAAC;GACW,aAAa,CAAG"}
package/package.json CHANGED
@@ -1,54 +1,54 @@
1
- {
2
- "name": "@venturialstd/project",
3
- "version": "0.0.7",
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/cache-manager": "^2.2.2",
23
- "@nestjs/common": "^11.0.11",
24
- "@nestjs/config": "^4.0.0",
25
- "@nestjs/core": "^11.0.5",
26
- "@nestjs/swagger": "^11.0.3",
27
- "@nestjs/typeorm": "^10.0.0",
28
- "@types/node": "^20.0.0",
29
- "@venturialstd/core": "^1.6.6",
30
- "cache-manager": "^5.7.6",
31
- "class-transformer": "^0.5.1",
32
- "class-validator": "^0.14.1",
33
- "rxjs": "^7.8.2",
34
- "ts-node": "^10.9.0",
35
- "tsconfig-paths": "^4.2.0",
36
- "typeorm": "^0.3.20",
37
- "typescript": "^5.9.3"
38
- },
39
- "peerDependencies": {
40
- "@dataui/crud": "^5.3.4",
41
- "@dataui/crud-typeorm": "^5.3.4",
42
- "@nestjs/cache-manager": "^2.2.2",
43
- "@nestjs/common": "^11.0.11",
44
- "@nestjs/core": "^11.0.5",
45
- "@nestjs/swagger": "^11.0.3",
46
- "@nestjs/typeorm": "^10.0.0",
47
- "@venturialstd/core": "^1.0.16",
48
- "cache-manager": "^5.7.6",
49
- "class-transformer": "^0.5.1",
50
- "class-validator": "^0.14.1",
51
- "rxjs": "^7.8.2",
52
- "typeorm": "^0.3.20"
53
- }
54
- }
1
+ {
2
+ "name": "@venturialstd/project",
3
+ "version": "0.0.8",
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/cache-manager": "^2.2.2",
23
+ "@nestjs/common": "^11.0.11",
24
+ "@nestjs/config": "^4.0.0",
25
+ "@nestjs/core": "^11.0.5",
26
+ "@nestjs/swagger": "^11.0.3",
27
+ "@nestjs/typeorm": "^10.0.0",
28
+ "@types/node": "^20.0.0",
29
+ "@venturialstd/core": "^1.6.6",
30
+ "cache-manager": "^5.7.6",
31
+ "class-transformer": "^0.5.1",
32
+ "class-validator": "^0.14.1",
33
+ "rxjs": "^7.8.2",
34
+ "ts-node": "^10.9.0",
35
+ "tsconfig-paths": "^4.2.0",
36
+ "typeorm": "^0.3.20",
37
+ "typescript": "^5.9.3"
38
+ },
39
+ "peerDependencies": {
40
+ "@dataui/crud": "^5.3.4",
41
+ "@dataui/crud-typeorm": "^5.3.4",
42
+ "@nestjs/cache-manager": "^2.2.2",
43
+ "@nestjs/common": "^11.0.11",
44
+ "@nestjs/core": "^11.0.5",
45
+ "@nestjs/swagger": "^11.0.3",
46
+ "@nestjs/typeorm": "^10.0.0",
47
+ "@venturialstd/core": "^1.0.16",
48
+ "cache-manager": "^5.7.6",
49
+ "class-transformer": "^0.5.1",
50
+ "class-validator": "^0.14.1",
51
+ "rxjs": "^7.8.2",
52
+ "typeorm": "^0.3.20"
53
+ }
54
+ }