@venturialstd/organization 0.0.12 → 0.0.13
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/dist/dtos/CreateOrganization.dto.d.ts +1 -1
- package/dist/dtos/CreateOrganization.dto.d.ts.map +1 -1
- package/dist/dtos/CreateOrganization.dto.js +8 -8
- package/dist/dtos/CreateOrganization.dto.js.map +1 -1
- package/dist/entities/organization-user.entity.d.ts +2 -2
- package/dist/entities/organization-user.entity.js +18 -18
- package/dist/entities/organization.entity.d.ts +1 -1
- package/dist/entities/organization.entity.d.ts.map +1 -1
- package/dist/entities/organization.entity.js +16 -16
- package/dist/entities/organization.entity.js.map +1 -1
- package/dist/index.d.ts +15 -15
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/organization.module.d.ts.map +1 -1
- package/dist/organization.module.js +0 -1
- package/dist/organization.module.js.map +1 -1
- package/dist/services/organization-user.service.d.ts +6 -6
- package/dist/services/organization-user.service.d.ts.map +1 -1
- package/dist/services/organization-user.service.js +15 -16
- package/dist/services/organization-user.service.js.map +1 -1
- package/dist/services/organization.service.d.ts +5 -5
- package/dist/services/organization.service.d.ts.map +1 -1
- package/dist/services/organization.service.js +2 -2
- package/dist/services/organization.service.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ORGANIZATION_EXPECTED_TEAM_SIZE, ORGANIZATION_INDUSTRY, ORGANIZATION_PRIMARY_USE_CASE, ORGANIZATION_SECURITY_REQUIREMENT, ORGANIZATION_TIMEZONE, ORGANIZATION_TYPE } from
|
|
1
|
+
import { ORGANIZATION_EXPECTED_TEAM_SIZE, ORGANIZATION_INDUSTRY, ORGANIZATION_PRIMARY_USE_CASE, ORGANIZATION_SECURITY_REQUIREMENT, ORGANIZATION_TIMEZONE, ORGANIZATION_TYPE } from '../constants/organization.constant';
|
|
2
2
|
export declare class CreateOrganizationDto {
|
|
3
3
|
name: string;
|
|
4
4
|
slug: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CreateOrganization.dto.d.ts","sourceRoot":"","sources":["../../src/dtos/CreateOrganization.dto.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CreateOrganization.dto.d.ts","sourceRoot":"","sources":["../../src/dtos/CreateOrganization.dto.ts"],"names":[],"mappings":"AAWA,OAAO,EACL,+BAA+B,EAC/B,qBAAqB,EACrB,6BAA6B,EAC7B,iCAAiC,EACjC,qBAAqB,EACrB,iBAAiB,EAClB,MAAM,oCAAoC,CAAC;AAE5C,qBAAa,qBAAqB;IAIhC,IAAI,EAAE,MAAM,CAAC;IAQb,IAAI,EAAE,MAAM,CAAC;IAIb,MAAM,CAAC,EAAE,MAAM,CAAC;IAIhB,WAAW,CAAC,EAAE,MAAM,CAAC;IAIrB,OAAO,CAAC,EAAE,MAAM,CAAC;IAIjB,OAAO,CAAC,EAAE,MAAM,CAAC;IAKjB,IAAI,EAAE,iBAAiB,CAAC;IAKxB,gBAAgB,EAAE,+BAA+B,CAAC;IAMlD,QAAQ,CAAC,EAAE,qBAAqB,CAAC;IAMjC,QAAQ,CAAC,EAAE,qBAAqB,CAAC;IAMjC,cAAc,CAAC,EAAE,6BAA6B,CAAC;IAM/C,oBAAoB,CAAC,EAAE,iCAAiC,EAAE,CAAC;CAC5D"}
|
|
@@ -30,15 +30,15 @@ exports.CreateOrganizationDto = CreateOrganizationDto;
|
|
|
30
30
|
__decorate([
|
|
31
31
|
(0, class_validator_1.IsString)(),
|
|
32
32
|
(0, class_validator_1.IsNotEmpty)(),
|
|
33
|
-
(0, class_validator_1.Length)(3, 50, { message:
|
|
33
|
+
(0, class_validator_1.Length)(3, 50, { message: 'Name must be between 3 and 50 characters' }),
|
|
34
34
|
__metadata("design:type", String)
|
|
35
35
|
], CreateOrganizationDto.prototype, "name", void 0);
|
|
36
36
|
__decorate([
|
|
37
37
|
(0, class_validator_1.IsString)(),
|
|
38
38
|
(0, class_validator_1.IsNotEmpty)(),
|
|
39
|
-
(0, class_validator_1.Length)(3, 50, { message:
|
|
39
|
+
(0, class_validator_1.Length)(3, 50, { message: 'Slug must be between 3 and 50 characters' }),
|
|
40
40
|
(0, class_validator_1.Matches)(/^[a-z0-9-]+$/, {
|
|
41
|
-
message:
|
|
41
|
+
message: 'Slug can only contain lowercase letters, numbers and dashes',
|
|
42
42
|
}),
|
|
43
43
|
__metadata("design:type", String)
|
|
44
44
|
], CreateOrganizationDto.prototype, "slug", void 0);
|
|
@@ -64,33 +64,33 @@ __decorate([
|
|
|
64
64
|
], CreateOrganizationDto.prototype, "logoUrl", void 0);
|
|
65
65
|
__decorate([
|
|
66
66
|
(0, class_validator_1.IsEnum)(organization_constant_1.ORGANIZATION_TYPE, {
|
|
67
|
-
message:
|
|
67
|
+
message: 'Invalid organization type',
|
|
68
68
|
}),
|
|
69
69
|
__metadata("design:type", String)
|
|
70
70
|
], CreateOrganizationDto.prototype, "type", void 0);
|
|
71
71
|
__decorate([
|
|
72
72
|
(0, class_validator_1.IsEnum)(organization_constant_1.ORGANIZATION_EXPECTED_TEAM_SIZE, {
|
|
73
|
-
message:
|
|
73
|
+
message: 'Invalid expected team size',
|
|
74
74
|
}),
|
|
75
75
|
__metadata("design:type", String)
|
|
76
76
|
], CreateOrganizationDto.prototype, "expectedTeamSize", void 0);
|
|
77
77
|
__decorate([
|
|
78
78
|
(0, class_validator_1.IsEnum)(organization_constant_1.ORGANIZATION_INDUSTRY, {
|
|
79
|
-
message:
|
|
79
|
+
message: 'Invalid industry',
|
|
80
80
|
}),
|
|
81
81
|
(0, class_validator_1.IsOptional)(),
|
|
82
82
|
__metadata("design:type", String)
|
|
83
83
|
], CreateOrganizationDto.prototype, "industry", void 0);
|
|
84
84
|
__decorate([
|
|
85
85
|
(0, class_validator_1.IsEnum)(organization_constant_1.ORGANIZATION_TIMEZONE, {
|
|
86
|
-
message:
|
|
86
|
+
message: 'Invalid timezone',
|
|
87
87
|
}),
|
|
88
88
|
(0, class_validator_1.IsOptional)(),
|
|
89
89
|
__metadata("design:type", String)
|
|
90
90
|
], CreateOrganizationDto.prototype, "timezone", void 0);
|
|
91
91
|
__decorate([
|
|
92
92
|
(0, class_validator_1.IsEnum)(organization_constant_1.ORGANIZATION_PRIMARY_USE_CASE, {
|
|
93
|
-
message:
|
|
93
|
+
message: 'Invalid primary use case',
|
|
94
94
|
}),
|
|
95
95
|
(0, class_validator_1.IsOptional)(),
|
|
96
96
|
__metadata("design:type", String)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CreateOrganization.dto.js","sourceRoot":"","sources":["../../src/dtos/CreateOrganization.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDASyB;
|
|
1
|
+
{"version":3,"file":"CreateOrganization.dto.js","sourceRoot":"","sources":["../../src/dtos/CreateOrganization.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDASyB;AAEzB,8EAO4C;AAE5C,MAAa,qBAAqB;IAIhC,IAAI,CAAS;IAQb,IAAI,CAAS;IAIb,MAAM,CAAU;IAIhB,WAAW,CAAU;IAIrB,OAAO,CAAU;IAIjB,OAAO,CAAU;IAKjB,IAAI,CAAoB;IAKxB,gBAAgB,CAAkC;IAMlD,QAAQ,CAAyB;IAMjC,QAAQ,CAAyB;IAMjC,cAAc,CAAiC;IAM/C,oBAAoB,CAAuC;CAC5D;AA/DD,sDA+DC;AA3DC;IAHC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;IACZ,IAAA,wBAAM,EAAC,CAAC,EAAE,EAAE,EAAE,EAAE,OAAO,EAAE,0CAA0C,EAAE,CAAC;;mDAC1D;AAQb;IANC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;IACZ,IAAA,wBAAM,EAAC,CAAC,EAAE,EAAE,EAAE,EAAE,OAAO,EAAE,0CAA0C,EAAE,CAAC;IACtE,IAAA,yBAAO,EAAC,cAAc,EAAE;QACvB,OAAO,EAAE,6DAA6D;KACvE,CAAC;;mDACW;AAIb;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;qDACG;AAIhB;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;0DACQ;AAIrB;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;sDACI;AAIjB;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;sDACI;AAKjB;IAHC,IAAA,wBAAM,EAAC,yCAAiB,EAAE;QACzB,OAAO,EAAE,2BAA2B;KACrC,CAAC;;mDACsB;AAKxB;IAHC,IAAA,wBAAM,EAAC,uDAA+B,EAAE;QACvC,OAAO,EAAE,4BAA4B;KACtC,CAAC;;+DACgD;AAMlD;IAJC,IAAA,wBAAM,EAAC,6CAAqB,EAAE;QAC7B,OAAO,EAAE,kBAAkB;KAC5B,CAAC;IACD,IAAA,4BAAU,GAAE;;uDACoB;AAMjC;IAJC,IAAA,wBAAM,EAAC,6CAAqB,EAAE;QAC7B,OAAO,EAAE,kBAAkB;KAC5B,CAAC;IACD,IAAA,4BAAU,GAAE;;uDACoB;AAMjC;IAJC,IAAA,wBAAM,EAAC,qDAA6B,EAAE;QACrC,OAAO,EAAE,0BAA0B;KACpC,CAAC;IACD,IAAA,4BAAU,GAAE;;6DACkC;AAM/C;IAJC,IAAA,yBAAO,GAAE;IACT,IAAA,6BAAW,GAAE;IACb,IAAA,wBAAM,EAAC,yDAAiC,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IACzD,IAAA,4BAAU,GAAE;;mEAC8C"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ORGANIZATION_USER_ROLE, ORGANIZATION_USER_STATUS } from
|
|
2
|
-
import { Organization } from
|
|
1
|
+
import { ORGANIZATION_USER_ROLE, ORGANIZATION_USER_STATUS } from '../constants/organization.constant';
|
|
2
|
+
import { Organization } from './organization.entity';
|
|
3
3
|
export declare class OrganizationUser {
|
|
4
4
|
id: string;
|
|
5
5
|
organizationId: string;
|
|
@@ -31,25 +31,25 @@ let OrganizationUser = class OrganizationUser {
|
|
|
31
31
|
};
|
|
32
32
|
exports.OrganizationUser = OrganizationUser;
|
|
33
33
|
__decorate([
|
|
34
|
-
(0, typeorm_1.PrimaryGeneratedColumn)(
|
|
34
|
+
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
35
35
|
__metadata("design:type", String)
|
|
36
36
|
], OrganizationUser.prototype, "id", void 0);
|
|
37
37
|
__decorate([
|
|
38
38
|
(0, class_validator_1.IsString)(),
|
|
39
39
|
(0, class_validator_1.IsNotEmpty)(),
|
|
40
|
-
(0, typeorm_1.Column)({ type:
|
|
40
|
+
(0, typeorm_1.Column)({ type: 'uuid' }),
|
|
41
41
|
(0, typeorm_1.Index)(),
|
|
42
42
|
__metadata("design:type", String)
|
|
43
43
|
], OrganizationUser.prototype, "organizationId", void 0);
|
|
44
44
|
__decorate([
|
|
45
|
-
(0, typeorm_1.ManyToOne)(() => organization_entity_1.Organization, { onDelete:
|
|
46
|
-
(0, typeorm_1.JoinColumn)({ name:
|
|
45
|
+
(0, typeorm_1.ManyToOne)(() => organization_entity_1.Organization, { onDelete: 'CASCADE' }),
|
|
46
|
+
(0, typeorm_1.JoinColumn)({ name: 'organizationId' }),
|
|
47
47
|
__metadata("design:type", organization_entity_1.Organization)
|
|
48
48
|
], OrganizationUser.prototype, "organization", void 0);
|
|
49
49
|
__decorate([
|
|
50
50
|
(0, class_validator_1.IsString)(),
|
|
51
51
|
(0, class_validator_1.IsNotEmpty)(),
|
|
52
|
-
(0, typeorm_1.Column)({ type:
|
|
52
|
+
(0, typeorm_1.Column)({ type: 'uuid' }),
|
|
53
53
|
(0, typeorm_1.Index)(),
|
|
54
54
|
__metadata("design:type", String)
|
|
55
55
|
], OrganizationUser.prototype, "userId", void 0);
|
|
@@ -57,7 +57,7 @@ __decorate([
|
|
|
57
57
|
(0, class_validator_1.IsString)(),
|
|
58
58
|
(0, class_validator_1.IsNotEmpty)(),
|
|
59
59
|
(0, typeorm_1.Column)({
|
|
60
|
-
type:
|
|
60
|
+
type: 'enum',
|
|
61
61
|
enum: organization_constant_1.ORGANIZATION_USER_ROLE,
|
|
62
62
|
default: organization_constant_1.ORGANIZATION_USER_ROLE.MEMBER,
|
|
63
63
|
}),
|
|
@@ -67,7 +67,7 @@ __decorate([
|
|
|
67
67
|
(0, class_validator_1.IsString)(),
|
|
68
68
|
(0, class_validator_1.IsNotEmpty)(),
|
|
69
69
|
(0, typeorm_1.Column)({
|
|
70
|
-
type:
|
|
70
|
+
type: 'enum',
|
|
71
71
|
enum: organization_constant_1.ORGANIZATION_USER_STATUS,
|
|
72
72
|
default: organization_constant_1.ORGANIZATION_USER_STATUS.ACTIVE,
|
|
73
73
|
}),
|
|
@@ -87,41 +87,41 @@ __decorate([
|
|
|
87
87
|
__decorate([
|
|
88
88
|
(0, class_validator_1.IsString)(),
|
|
89
89
|
(0, class_validator_1.IsOptional)(),
|
|
90
|
-
(0, typeorm_1.Column)({ type:
|
|
90
|
+
(0, typeorm_1.Column)({ type: 'timestamptz', nullable: true }),
|
|
91
91
|
__metadata("design:type", Date)
|
|
92
92
|
], OrganizationUser.prototype, "invitedAt", void 0);
|
|
93
93
|
__decorate([
|
|
94
94
|
(0, class_validator_1.IsString)(),
|
|
95
95
|
(0, class_validator_1.IsOptional)(),
|
|
96
|
-
(0, typeorm_1.Column)({ type:
|
|
96
|
+
(0, typeorm_1.Column)({ type: 'timestamptz', nullable: true }),
|
|
97
97
|
__metadata("design:type", Date)
|
|
98
98
|
], OrganizationUser.prototype, "joinedAt", void 0);
|
|
99
99
|
__decorate([
|
|
100
100
|
(0, class_validator_1.IsString)(),
|
|
101
101
|
(0, class_validator_1.IsOptional)(),
|
|
102
|
-
(0, typeorm_1.Column)({ type:
|
|
102
|
+
(0, typeorm_1.Column)({ type: 'jsonb', nullable: true }),
|
|
103
103
|
__metadata("design:type", Object)
|
|
104
104
|
], OrganizationUser.prototype, "permissions", void 0);
|
|
105
105
|
__decorate([
|
|
106
106
|
(0, typeorm_1.CreateDateColumn)({
|
|
107
|
-
name:
|
|
107
|
+
name: 'createdAt',
|
|
108
108
|
nullable: false,
|
|
109
|
-
type:
|
|
110
|
-
default: () =>
|
|
109
|
+
type: 'timestamptz',
|
|
110
|
+
default: () => 'CURRENT_TIMESTAMP',
|
|
111
111
|
}),
|
|
112
112
|
__metadata("design:type", Date)
|
|
113
113
|
], OrganizationUser.prototype, "createdAt", void 0);
|
|
114
114
|
__decorate([
|
|
115
115
|
(0, typeorm_1.UpdateDateColumn)({
|
|
116
|
-
name:
|
|
116
|
+
name: 'updatedAt',
|
|
117
117
|
nullable: false,
|
|
118
|
-
type:
|
|
119
|
-
default: () =>
|
|
118
|
+
type: 'timestamptz',
|
|
119
|
+
default: () => 'CURRENT_TIMESTAMP',
|
|
120
120
|
}),
|
|
121
121
|
__metadata("design:type", Date)
|
|
122
122
|
], OrganizationUser.prototype, "updatedAt", void 0);
|
|
123
123
|
exports.OrganizationUser = OrganizationUser = __decorate([
|
|
124
|
-
(0, typeorm_1.Entity)(
|
|
125
|
-
(0, typeorm_1.Index)([
|
|
124
|
+
(0, typeorm_1.Entity)('organization_user'),
|
|
125
|
+
(0, typeorm_1.Index)(['organizationId', 'userId'], { unique: true })
|
|
126
126
|
], OrganizationUser);
|
|
127
127
|
//# sourceMappingURL=organization-user.entity.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ORGANIZATION_EXPECTED_TEAM_SIZE, ORGANIZATION_INDUSTRY, ORGANIZATION_PRIMARY_USE_CASE, ORGANIZATION_SECURITY_REQUIREMENT, ORGANIZATION_TIMEZONE, ORGANIZATION_TYPE } from
|
|
1
|
+
import { ORGANIZATION_EXPECTED_TEAM_SIZE, ORGANIZATION_INDUSTRY, ORGANIZATION_PRIMARY_USE_CASE, ORGANIZATION_SECURITY_REQUIREMENT, ORGANIZATION_TIMEZONE, ORGANIZATION_TYPE } from '../constants/organization.constant';
|
|
2
2
|
export declare class Organization {
|
|
3
3
|
id: string;
|
|
4
4
|
name: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"organization.entity.d.ts","sourceRoot":"","sources":["../../src/entities/organization.entity.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"organization.entity.d.ts","sourceRoot":"","sources":["../../src/entities/organization.entity.ts"],"names":[],"mappings":"AAiBA,OAAO,EACL,+BAA+B,EAC/B,qBAAqB,EACrB,6BAA6B,EAC7B,iCAAiC,EACjC,qBAAqB,EACrB,iBAAiB,EAClB,MAAM,oCAAoC,CAAC;AAE5C,qBACa,YAAY;IAEvB,EAAE,EAAE,MAAM,CAAC;IAKX,IAAI,EAAE,MAAM,CAAC;IAKb,IAAI,EAAE,MAAM,CAAC;IAKb,MAAM,EAAE,MAAM,CAAC;IAKf,WAAW,EAAE,MAAM,CAAC;IASpB,QAAQ,EAAE,qBAAqB,CAAC;IAShC,QAAQ,EAAE,qBAAqB,CAAC;IAQhC,IAAI,EAAE,iBAAiB,CAAC;IAQxB,gBAAgB,EAAE,+BAA+B,CAAC;IASlD,cAAc,EAAE,6BAA6B,CAAC;IAY9C,oBAAoB,EAAE,iCAAiC,EAAE,CAAC;IAI1D,QAAQ,EAAE,OAAO,CAAC;IAKlB,OAAO,EAAE,MAAM,CAAC;IAKhB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAKlC,OAAO,EAAE,MAAM,CAAC;IAQhB,SAAS,EAAE,IAAI,CAAC;IAQhB,SAAS,EAAE,IAAI,CAAC;CACjB"}
|
|
@@ -34,7 +34,7 @@ let Organization = class Organization {
|
|
|
34
34
|
};
|
|
35
35
|
exports.Organization = Organization;
|
|
36
36
|
__decorate([
|
|
37
|
-
(0, typeorm_1.PrimaryGeneratedColumn)(
|
|
37
|
+
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
38
38
|
__metadata("design:type", String)
|
|
39
39
|
], Organization.prototype, "id", void 0);
|
|
40
40
|
__decorate([
|
|
@@ -65,7 +65,7 @@ __decorate([
|
|
|
65
65
|
(0, class_validator_1.IsString)(),
|
|
66
66
|
(0, class_validator_1.IsNotEmpty)(),
|
|
67
67
|
(0, typeorm_1.Column)({
|
|
68
|
-
type:
|
|
68
|
+
type: 'enum',
|
|
69
69
|
enum: organization_constant_1.ORGANIZATION_INDUSTRY,
|
|
70
70
|
default: organization_constant_1.ORGANIZATION_INDUSTRY.TECHNOLOGY,
|
|
71
71
|
}),
|
|
@@ -75,7 +75,7 @@ __decorate([
|
|
|
75
75
|
(0, class_validator_1.IsString)(),
|
|
76
76
|
(0, class_validator_1.IsNotEmpty)(),
|
|
77
77
|
(0, typeorm_1.Column)({
|
|
78
|
-
type:
|
|
78
|
+
type: 'enum',
|
|
79
79
|
enum: organization_constant_1.ORGANIZATION_TIMEZONE,
|
|
80
80
|
default: organization_constant_1.ORGANIZATION_TIMEZONE.UTC_MINUS_5,
|
|
81
81
|
}),
|
|
@@ -85,7 +85,7 @@ __decorate([
|
|
|
85
85
|
(0, class_validator_1.IsString)(),
|
|
86
86
|
(0, class_validator_1.IsNotEmpty)(),
|
|
87
87
|
(0, typeorm_1.Column)({
|
|
88
|
-
type:
|
|
88
|
+
type: 'enum',
|
|
89
89
|
enum: organization_constant_1.ORGANIZATION_TYPE,
|
|
90
90
|
}),
|
|
91
91
|
__metadata("design:type", String)
|
|
@@ -94,7 +94,7 @@ __decorate([
|
|
|
94
94
|
(0, class_validator_1.IsString)(),
|
|
95
95
|
(0, class_validator_1.IsNotEmpty)(),
|
|
96
96
|
(0, typeorm_1.Column)({
|
|
97
|
-
type:
|
|
97
|
+
type: 'enum',
|
|
98
98
|
enum: organization_constant_1.ORGANIZATION_EXPECTED_TEAM_SIZE,
|
|
99
99
|
}),
|
|
100
100
|
__metadata("design:type", String)
|
|
@@ -103,7 +103,7 @@ __decorate([
|
|
|
103
103
|
(0, class_validator_1.IsString)(),
|
|
104
104
|
(0, class_validator_1.IsOptional)(),
|
|
105
105
|
(0, typeorm_1.Column)({
|
|
106
|
-
type:
|
|
106
|
+
type: 'enum',
|
|
107
107
|
enum: organization_constant_1.ORGANIZATION_PRIMARY_USE_CASE,
|
|
108
108
|
nullable: true,
|
|
109
109
|
}),
|
|
@@ -115,7 +115,7 @@ __decorate([
|
|
|
115
115
|
(0, class_validator_1.ArrayUnique)(),
|
|
116
116
|
(0, class_validator_1.IsEnum)(organization_constant_1.ORGANIZATION_SECURITY_REQUIREMENT, { each: true }),
|
|
117
117
|
(0, typeorm_1.Column)({
|
|
118
|
-
type:
|
|
118
|
+
type: 'enum',
|
|
119
119
|
enum: organization_constant_1.ORGANIZATION_SECURITY_REQUIREMENT,
|
|
120
120
|
array: true,
|
|
121
121
|
nullable: true,
|
|
@@ -130,13 +130,13 @@ __decorate([
|
|
|
130
130
|
__decorate([
|
|
131
131
|
(0, class_validator_1.IsString)(),
|
|
132
132
|
(0, class_validator_1.IsOptional)(),
|
|
133
|
-
(0, typeorm_1.Column)({ type:
|
|
133
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 255, nullable: true }),
|
|
134
134
|
__metadata("design:type", String)
|
|
135
135
|
], Organization.prototype, "logoUrl", void 0);
|
|
136
136
|
__decorate([
|
|
137
137
|
(0, class_validator_1.IsString)(),
|
|
138
138
|
(0, class_validator_1.IsOptional)(),
|
|
139
|
-
(0, typeorm_1.Column)({ type:
|
|
139
|
+
(0, typeorm_1.Column)({ type: 'jsonb', nullable: true }),
|
|
140
140
|
__metadata("design:type", Object)
|
|
141
141
|
], Organization.prototype, "settings", void 0);
|
|
142
142
|
__decorate([
|
|
@@ -147,23 +147,23 @@ __decorate([
|
|
|
147
147
|
], Organization.prototype, "ownerId", void 0);
|
|
148
148
|
__decorate([
|
|
149
149
|
(0, typeorm_1.CreateDateColumn)({
|
|
150
|
-
name:
|
|
150
|
+
name: 'createdAt',
|
|
151
151
|
nullable: false,
|
|
152
|
-
type:
|
|
153
|
-
default: () =>
|
|
152
|
+
type: 'timestamptz',
|
|
153
|
+
default: () => 'CURRENT_TIMESTAMP',
|
|
154
154
|
}),
|
|
155
155
|
__metadata("design:type", Date)
|
|
156
156
|
], Organization.prototype, "createdAt", void 0);
|
|
157
157
|
__decorate([
|
|
158
158
|
(0, typeorm_1.UpdateDateColumn)({
|
|
159
|
-
name:
|
|
159
|
+
name: 'updatedAt',
|
|
160
160
|
nullable: false,
|
|
161
|
-
type:
|
|
162
|
-
default: () =>
|
|
161
|
+
type: 'timestamptz',
|
|
162
|
+
default: () => 'CURRENT_TIMESTAMP',
|
|
163
163
|
}),
|
|
164
164
|
__metadata("design:type", Date)
|
|
165
165
|
], Organization.prototype, "updatedAt", void 0);
|
|
166
166
|
exports.Organization = Organization = __decorate([
|
|
167
|
-
(0, typeorm_1.Entity)(
|
|
167
|
+
(0, typeorm_1.Entity)('organization')
|
|
168
168
|
], Organization);
|
|
169
169
|
//# sourceMappingURL=organization.entity.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"organization.entity.js","sourceRoot":"","sources":["../../src/entities/organization.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAQyB;AACzB,qCAMiB;
|
|
1
|
+
{"version":3,"file":"organization.entity.js","sourceRoot":"","sources":["../../src/entities/organization.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAQyB;AACzB,qCAMiB;AAEjB,8EAO4C;AAGrC,IAAM,YAAY,GAAlB,MAAM,YAAY;IAEvB,EAAE,CAAS;IAKX,IAAI,CAAS;IAKb,IAAI,CAAS;IAKb,MAAM,CAAS;IAKf,WAAW,CAAS;IASpB,QAAQ,CAAwB;IAShC,QAAQ,CAAwB;IAQhC,IAAI,CAAoB;IAQxB,gBAAgB,CAAkC;IASlD,cAAc,CAAgC;IAY9C,oBAAoB,CAAsC;IAI1D,QAAQ,CAAU;IAKlB,OAAO,CAAS;IA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K;QACf,IAAI,EAAE,aAAa;QACnB,OAAO,EAAE,GAAG,EAAE,CAAC,mBAAmB;KACnC,CAAC;8BACS,IAAI;+CAAC;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;+CAAC;uBAhHL,YAAY;IADxB,IAAA,gBAAM,EAAC,cAAc,CAAC;GACV,YAAY,CAiHxB"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
5
|
-
export * from
|
|
6
|
-
export * from
|
|
7
|
-
export * from
|
|
8
|
-
export * from
|
|
9
|
-
export * from
|
|
10
|
-
export * from
|
|
11
|
-
export * from
|
|
12
|
-
export * from
|
|
13
|
-
export * from
|
|
14
|
-
export * from
|
|
15
|
-
export * from
|
|
1
|
+
export * from './constants/organization.constant';
|
|
2
|
+
export * from './constants/organization.settings.constant';
|
|
3
|
+
export * from './constants/settings-type.constant';
|
|
4
|
+
export * from './decorators/organization.decorator';
|
|
5
|
+
export * from './decorators/roles.decorator';
|
|
6
|
+
export * from './dtos/CreateOrganization.dto';
|
|
7
|
+
export * from './entities/organization.entity';
|
|
8
|
+
export * from './entities/organization-settings.entity';
|
|
9
|
+
export * from './entities/organization-user.entity';
|
|
10
|
+
export * from './guards/organization.guard';
|
|
11
|
+
export * from './organization.module';
|
|
12
|
+
export * from './services/organization.service';
|
|
13
|
+
export * from './services/organization-settings.service';
|
|
14
|
+
export * from './services/organization-user.service';
|
|
15
|
+
export * from './settings/organization.settings';
|
|
16
16
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mCAAmC,CAAC;AAClD,cAAc,4CAA4C,CAAC;AAC3D,cAAc,oCAAoC,CAAC;AACnD,cAAc,qCAAqC,CAAC;AACpD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,yCAAyC,CAAC;AACxD,cAAc,qCAAqC,CAAC;AACpD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,uBAAuB,CAAC;AACtC,cAAc,iCAAiC,CAAC;AAChD,cAAc,0CAA0C,CAAC;AACzD,cAAc,sCAAsC,CAAC;AACrD,cAAc,kCAAkC,CAAC
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mCAAmC,CAAC;AAClD,cAAc,4CAA4C,CAAC;AAC3D,cAAc,oCAAoC,CAAC;AACnD,cAAc,qCAAqC,CAAC;AACpD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,yCAAyC,CAAC;AACxD,cAAc,qCAAqC,CAAC;AACpD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,uBAAuB,CAAC;AACtC,cAAc,iCAAiC,CAAC;AAChD,cAAc,0CAA0C,CAAC;AACzD,cAAc,sCAAsC,CAAC;AACrD,cAAc,kCAAkC,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -19,6 +19,7 @@ __exportStar(require("./constants/organization.settings.constant"), exports);
|
|
|
19
19
|
__exportStar(require("./constants/settings-type.constant"), exports);
|
|
20
20
|
__exportStar(require("./decorators/organization.decorator"), exports);
|
|
21
21
|
__exportStar(require("./decorators/roles.decorator"), exports);
|
|
22
|
+
__exportStar(require("./dtos/CreateOrganization.dto"), exports);
|
|
22
23
|
__exportStar(require("./entities/organization.entity"), exports);
|
|
23
24
|
__exportStar(require("./entities/organization-settings.entity"), exports);
|
|
24
25
|
__exportStar(require("./entities/organization-user.entity"), exports);
|
|
@@ -28,5 +29,4 @@ __exportStar(require("./services/organization.service"), exports);
|
|
|
28
29
|
__exportStar(require("./services/organization-settings.service"), exports);
|
|
29
30
|
__exportStar(require("./services/organization-user.service"), exports);
|
|
30
31
|
__exportStar(require("./settings/organization.settings"), exports);
|
|
31
|
-
__exportStar(require("./dtos/CreateOrganization.dto"), exports);
|
|
32
32
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oEAAkD;AAClD,6EAA2D;AAC3D,qEAAmD;AACnD,sEAAoD;AACpD,+DAA6C;AAC7C,iEAA+C;AAC/C,0EAAwD;AACxD,sEAAoD;AACpD,8DAA4C;AAC5C,wDAAsC;AACtC,kEAAgD;AAChD,2EAAyD;AACzD,uEAAqD;AACrD,mEAAiD
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oEAAkD;AAClD,6EAA2D;AAC3D,qEAAmD;AACnD,sEAAoD;AACpD,+DAA6C;AAC7C,gEAA8C;AAC9C,iEAA+C;AAC/C,0EAAwD;AACxD,sEAAoD;AACpD,8DAA4C;AAC5C,wDAAsC;AACtC,kEAAgD;AAChD,2EAAyD;AACzD,uEAAqD;AACrD,mEAAiD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"organization.module.d.ts","sourceRoot":"","sources":["../src/organization.module.ts"],"names":[],"mappings":"AAWA,
|
|
1
|
+
{"version":3,"file":"organization.module.d.ts","sourceRoot":"","sources":["../src/organization.module.ts"],"names":[],"mappings":"AAWA,qBAQa,kBAAkB;CAAG"}
|
|
@@ -26,7 +26,6 @@ exports.OrganizationModule = OrganizationModule = __decorate([
|
|
|
26
26
|
typeorm_1.TypeOrmModule.forFeature([organization_entity_1.Organization, organization_user_entity_1.OrganizationUser, organization_settings_entity_1.OrganizationSettings]),
|
|
27
27
|
],
|
|
28
28
|
providers: [organization_service_1.OrganizationService, organization_user_service_1.OrganizationUserService, organization_settings_service_1.OrganizationSettingsService],
|
|
29
|
-
controllers: [],
|
|
30
29
|
exports: [organization_service_1.OrganizationService, organization_user_service_1.OrganizationUserService, organization_settings_service_1.OrganizationSettingsService],
|
|
31
30
|
})
|
|
32
31
|
], OrganizationModule);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"organization.module.js","sourceRoot":"","sources":["../src/organization.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,6CAAgD;AAChD,6CAAkD;AAElD,wEAA8D;AAC9D,0FAA+E;AAC/E,kFAAuE;AACvE,0EAAsE;AACtE,4FAAuF;AACvF,oFAA+E;
|
|
1
|
+
{"version":3,"file":"organization.module.js","sourceRoot":"","sources":["../src/organization.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,6CAAgD;AAChD,6CAAkD;AAElD,wEAA8D;AAC9D,0FAA+E;AAC/E,kFAAuE;AACvE,0EAAsE;AACtE,4FAAuF;AACvF,oFAA+E;AAUxE,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;CAAG,CAAA;AAArB,gDAAkB;6BAAlB,kBAAkB;IAR9B,IAAA,eAAM,EAAC;QACN,OAAO,EAAE;YACP,mBAAY,CAAC,OAAO,CAAC,EAAE,CAAC;YACxB,uBAAa,CAAC,UAAU,CAAC,CAAC,kCAAY,EAAE,2CAAgB,EAAE,mDAAoB,CAAC,CAAC;SACjF;QACD,SAAS,EAAE,CAAC,0CAAmB,EAAE,mDAAuB,EAAE,2DAA2B,CAAC;QACtF,OAAO,EAAE,CAAC,0CAAmB,EAAE,mDAAuB,EAAE,2DAA2B,CAAC;KACrF,CAAC;GACW,kBAAkB,CAAG"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { TypeOrmCrudService } from
|
|
2
|
-
import { AppLogger } from
|
|
3
|
-
import { Repository } from
|
|
4
|
-
import { ORGANIZATION_USER_ROLE } from
|
|
5
|
-
import { Organization } from
|
|
6
|
-
import { OrganizationUser } from
|
|
1
|
+
import { TypeOrmCrudService } from '@dataui/crud-typeorm';
|
|
2
|
+
import { AppLogger } from '@venturialstd/core';
|
|
3
|
+
import { Repository } from 'typeorm';
|
|
4
|
+
import { ORGANIZATION_USER_ROLE } from '../constants/organization.constant';
|
|
5
|
+
import { Organization } from '../entities/organization.entity';
|
|
6
|
+
import { OrganizationUser } from '../entities/organization-user.entity';
|
|
7
7
|
export declare class OrganizationUserService extends TypeOrmCrudService<OrganizationUser> {
|
|
8
8
|
readonly repo: Repository<OrganizationUser>;
|
|
9
9
|
private readonly organizationRepo;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"organization-user.service.d.ts","sourceRoot":"","sources":["../../src/services/organization-user.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAQ1D,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErC,OAAO,EACL,sBAAsB,EAEvB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAExE,qBACa,uBAAwB,SAAQ,kBAAkB,CAAC,gBAAgB,CAAC;aAG7D,IAAI,EAAE,UAAU,CAAC,gBAAgB,CAAC;IAElD,OAAO,CAAC,QAAQ,CAAC,gBAAgB;IACjC,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAHP,IAAI,EAAE,UAAU,CAAC,gBAAgB,CAAC,EAEjC,gBAAgB,EAAE,UAAU,CAAC,YAAY,CAAC,EAC1C,MAAM,EAAE,SAAS;IAS9B,qBAAqB,CACzB,cAAc,EAAE,MAAM,EACtB,MAAM,EAAE,MAAM,EACd,IAAI,GAAE,sBAAsD,EAC5D,SAAS,CAAC,EAAE,MAAM,GACjB,OAAO,CAAC,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"organization-user.service.d.ts","sourceRoot":"","sources":["../../src/services/organization-user.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAQ1D,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErC,OAAO,EACL,sBAAsB,EAEvB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAExE,qBACa,uBAAwB,SAAQ,kBAAkB,CAAC,gBAAgB,CAAC;aAG7D,IAAI,EAAE,UAAU,CAAC,gBAAgB,CAAC;IAElD,OAAO,CAAC,QAAQ,CAAC,gBAAgB;IACjC,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAHP,IAAI,EAAE,UAAU,CAAC,gBAAgB,CAAC,EAEjC,gBAAgB,EAAE,UAAU,CAAC,YAAY,CAAC,EAC1C,MAAM,EAAE,SAAS;IAS9B,qBAAqB,CACzB,cAAc,EAAE,MAAM,EACtB,MAAM,EAAE,MAAM,EACd,IAAI,GAAE,sBAAsD,EAC5D,SAAS,CAAC,EAAE,MAAM,GACjB,OAAO,CAAC,gBAAgB,CAAC;IAyCtB,wBAAwB,CAC5B,cAAc,EAAE,MAAM,EACtB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,sBAAsB,EAC5B,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,gBAAgB,CAAC;IAqCtB,gBAAgB,CAAC,cAAc,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,gBAA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,gBAAgB,CAAC;IAuB9E,cAAc,CAAC,cAAc,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC;CAmBxF"}
|
|
@@ -41,13 +41,13 @@ let OrganizationUserService = OrganizationUserService_1 = class OrganizationUser
|
|
|
41
41
|
throw new common_1.NotFoundException(`Organization with id "${organizationId}" not found`);
|
|
42
42
|
}
|
|
43
43
|
if (!organization.isActive) {
|
|
44
|
-
throw new common_1.BadRequestException(
|
|
44
|
+
throw new common_1.BadRequestException('Cannot add users to an inactive organization');
|
|
45
45
|
}
|
|
46
46
|
const existing = await this.repo.findOne({
|
|
47
47
|
where: { organizationId, userId },
|
|
48
48
|
});
|
|
49
49
|
if (existing) {
|
|
50
|
-
throw new common_1.BadRequestException(
|
|
50
|
+
throw new common_1.BadRequestException('User is already a member of this organization');
|
|
51
51
|
}
|
|
52
52
|
const organizationUser = this.repo.create({
|
|
53
53
|
organizationId,
|
|
@@ -73,7 +73,7 @@ let OrganizationUserService = OrganizationUserService_1 = class OrganizationUser
|
|
|
73
73
|
where: { organizationId, userId },
|
|
74
74
|
});
|
|
75
75
|
if (existing) {
|
|
76
|
-
throw new common_1.BadRequestException(
|
|
76
|
+
throw new common_1.BadRequestException('User is already a member or has a pending invitation');
|
|
77
77
|
}
|
|
78
78
|
const organizationUser = this.repo.create({
|
|
79
79
|
organizationId,
|
|
@@ -97,7 +97,7 @@ let OrganizationUserService = OrganizationUserService_1 = class OrganizationUser
|
|
|
97
97
|
},
|
|
98
98
|
});
|
|
99
99
|
if (!organizationUser) {
|
|
100
|
-
throw new common_1.NotFoundException(
|
|
100
|
+
throw new common_1.NotFoundException('Invitation not found');
|
|
101
101
|
}
|
|
102
102
|
organizationUser.status = organization_constant_1.ORGANIZATION_USER_STATUS.ACTIVE;
|
|
103
103
|
organizationUser.joinedAt = new Date();
|
|
@@ -110,10 +110,10 @@ let OrganizationUserService = OrganizationUserService_1 = class OrganizationUser
|
|
|
110
110
|
where: { organizationId, userId },
|
|
111
111
|
});
|
|
112
112
|
if (!organizationUser) {
|
|
113
|
-
throw new common_1.NotFoundException(
|
|
113
|
+
throw new common_1.NotFoundException('User is not a member of this organization');
|
|
114
114
|
}
|
|
115
115
|
if (organizationUser.isPrimary) {
|
|
116
|
-
throw new common_1.BadRequestException(
|
|
116
|
+
throw new common_1.BadRequestException('Cannot remove the primary owner of an organization');
|
|
117
117
|
}
|
|
118
118
|
await this.repo.remove(organizationUser);
|
|
119
119
|
this.logger.log(`User ${userId} removed from organization ${organizationId}`);
|
|
@@ -123,11 +123,10 @@ let OrganizationUserService = OrganizationUserService_1 = class OrganizationUser
|
|
|
123
123
|
where: { organizationId, userId },
|
|
124
124
|
});
|
|
125
125
|
if (!organizationUser) {
|
|
126
|
-
throw new common_1.NotFoundException(
|
|
126
|
+
throw new common_1.NotFoundException('User is not a member of this organization');
|
|
127
127
|
}
|
|
128
|
-
if (organizationUser.isPrimary &&
|
|
129
|
-
|
|
130
|
-
throw new common_1.BadRequestException("Cannot change role of primary owner");
|
|
128
|
+
if (organizationUser.isPrimary && newRole !== organization_constant_1.ORGANIZATION_USER_ROLE.OWNER) {
|
|
129
|
+
throw new common_1.BadRequestException('Cannot change role of primary owner');
|
|
131
130
|
}
|
|
132
131
|
organizationUser.role = newRole;
|
|
133
132
|
const updated = await this.repo.save(organizationUser);
|
|
@@ -203,7 +202,7 @@ let OrganizationUserService = OrganizationUserService_1 = class OrganizationUser
|
|
|
203
202
|
where: { organizationId, userId },
|
|
204
203
|
});
|
|
205
204
|
if (!organizationUser) {
|
|
206
|
-
throw new common_1.NotFoundException(
|
|
205
|
+
throw new common_1.NotFoundException('User is not a member of this organization');
|
|
207
206
|
}
|
|
208
207
|
organizationUser.isPrimary = true;
|
|
209
208
|
organizationUser.role = organization_constant_1.ORGANIZATION_USER_ROLE.OWNER;
|
|
@@ -216,7 +215,7 @@ let OrganizationUserService = OrganizationUserService_1 = class OrganizationUser
|
|
|
216
215
|
where: { organizationId, userId: fromUserId, isPrimary: true },
|
|
217
216
|
});
|
|
218
217
|
if (!currentOwner) {
|
|
219
|
-
throw new common_1.ForbiddenException(
|
|
218
|
+
throw new common_1.ForbiddenException('Only the primary owner can transfer ownership');
|
|
220
219
|
}
|
|
221
220
|
const newOwner = await this.repo.findOne({
|
|
222
221
|
where: {
|
|
@@ -226,7 +225,7 @@ let OrganizationUserService = OrganizationUserService_1 = class OrganizationUser
|
|
|
226
225
|
},
|
|
227
226
|
});
|
|
228
227
|
if (!newOwner) {
|
|
229
|
-
throw new common_1.NotFoundException(
|
|
228
|
+
throw new common_1.NotFoundException('New owner must be an active member of the organization');
|
|
230
229
|
}
|
|
231
230
|
await this.setPrimaryOwner(organizationId, toUserId);
|
|
232
231
|
currentOwner.isPrimary = false;
|
|
@@ -244,10 +243,10 @@ let OrganizationUserService = OrganizationUserService_1 = class OrganizationUser
|
|
|
244
243
|
where: { organizationId, userId },
|
|
245
244
|
});
|
|
246
245
|
if (!organizationUser) {
|
|
247
|
-
throw new common_1.NotFoundException(
|
|
246
|
+
throw new common_1.NotFoundException('User is not a member of this organization');
|
|
248
247
|
}
|
|
249
248
|
if (organizationUser.isPrimary) {
|
|
250
|
-
throw new common_1.BadRequestException(
|
|
249
|
+
throw new common_1.BadRequestException('Cannot suspend the primary owner');
|
|
251
250
|
}
|
|
252
251
|
organizationUser.status = organization_constant_1.ORGANIZATION_USER_STATUS.SUSPENDED;
|
|
253
252
|
const updated = await this.repo.save(organizationUser);
|
|
@@ -263,7 +262,7 @@ let OrganizationUserService = OrganizationUserService_1 = class OrganizationUser
|
|
|
263
262
|
},
|
|
264
263
|
});
|
|
265
264
|
if (!organizationUser) {
|
|
266
|
-
throw new common_1.NotFoundException(
|
|
265
|
+
throw new common_1.NotFoundException('User is not suspended in this organization');
|
|
267
266
|
}
|
|
268
267
|
organizationUser.status = organization_constant_1.ORGANIZATION_USER_STATUS.ACTIVE;
|
|
269
268
|
const updated = await this.repo.save(organizationUser);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"organization-user.service.js","sourceRoot":"","sources":["../../src/services/organization-user.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uDAA0D;AAC1D,2CAKwB;AACxB,6CAAmD;AACnD,6CAA+C;AAC/C,qCAAqC;AAErC,8EAG4C;AAC5C,yEAA+D;AAC/D,mFAAwE;AAGjE,IAAM,uBAAuB,+BAA7B,MAAM,uBAAwB,SAAQ,iCAAoC;IAG7D;IAEC;IACA;IALnB,YAEkB,IAAkC,EAEjC,gBAA0C,EAC1C,MAAiB;QAElC,KAAK,CAAC,IAAI,CAAC,CAAC;QALI,SAAI,GAAJ,IAAI,CAA8B;QAEjC,qBAAgB,GAAhB,gBAAgB,CAA0B;QAC1C,WAAM,GAAN,MAAM,CAAW;QAGlC,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,yBAAuB,CAAC,IAAI,CAAC,CAAC;IACvD,CAAC;IAKD,KAAK,CAAC,qBAAqB,CACzB,cAAsB,EACtB,MAAc,EACd,OAA+B,8CAAsB,CAAC,MAAM,EAC5D,SAAkB;QAGlB,MAAM,YAAY,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC;YACvD,KAAK,EAAE,EAAE,EAAE,EAAE,cAAc,EAAE;SAC9B,CAAC,CAAC;QACH,IAAI,CAAC,YAAY,EAAE,CAAC;YAClB,MAAM,IAAI,0BAAiB,
|
|
1
|
+
{"version":3,"file":"organization-user.service.js","sourceRoot":"","sources":["../../src/services/organization-user.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uDAA0D;AAC1D,2CAKwB;AACxB,6CAAmD;AACnD,6CAA+C;AAC/C,qCAAqC;AAErC,8EAG4C;AAC5C,yEAA+D;AAC/D,mFAAwE;AAGjE,IAAM,uBAAuB,+BAA7B,MAAM,uBAAwB,SAAQ,iCAAoC;IAG7D;IAEC;IACA;IALnB,YAEkB,IAAkC,EAEjC,gBAA0C,EAC1C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AI,CAAC,gBAAgB,CAAC,CAAC;QACvD,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,QAAQ,MAAM,8BAA8B,cAAc,EAAE,CAAC,CAAC;QAE9E,OAAO,OAAO,CAAC;IACjB,CAAC;IAKD,KAAK,CAAC,cAAc,CAAC,cAAsB,EAAE,MAAc;QACzD,MAAM,gBAAgB,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC;YAC/C,KAAK,EAAE;gBACL,cAAc;gBACd,MAAM;gBACN,MAAM,EAAE,gDAAwB,CAAC,SAAS;aAC3C;SACF,CAAC,CAAC;QAEH,IAAI,CAAC,gBAAgB,EAAE,CAAC;YACtB,MAAM,IAAI,0BAAiB,CAAC,4CAA4C,CAAC,CAAC;QAC5E,CAAC;QAED,gBAAgB,CAAC,MAAM,GAAG,gDAAwB,CAAC,MAAM,CAAC;QAC1D,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;QACvD,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,QAAQ,MAAM,gCAAgC,cAAc,EAAE,CAAC,CAAC;QAEhF,OAAO,OAAO,CAAC;IACjB,CAAC;CACF,CAAA;AA/YY,0DAAuB;kCAAvB,uBAAuB;IADnC,IAAA,mBAAU,GAAE;IAGR,WAAA,IAAA,0BAAgB,EAAC,2CAAgB,CAAC,CAAA;IAElC,WAAA,IAAA,0BAAgB,EAAC,kCAAY,CAAC,CAAA;qCADT,oBAAU;QAEG,oBAAU;QACpB,gBAAS;GANzB,uBAAuB,CA+YnC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { TypeOrmCrudService } from
|
|
2
|
-
import { AppLogger, SettingsService } from
|
|
3
|
-
import { Repository } from
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { TypeOrmCrudService } from '@dataui/crud-typeorm';
|
|
2
|
+
import { AppLogger, SettingsService } from '@venturialstd/core';
|
|
3
|
+
import { Repository } from 'typeorm';
|
|
4
|
+
import { CreateOrganizationDto } from '../dtos/CreateOrganization.dto';
|
|
5
|
+
import { Organization } from '../entities/organization.entity';
|
|
6
6
|
export declare class OrganizationService extends TypeOrmCrudService<Organization> {
|
|
7
7
|
readonly repo: Repository<Organization>;
|
|
8
8
|
private readonly settingsService;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"organization.service.d.ts","sourceRoot":"","sources":["../../src/services/organization.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"organization.service.d.ts","sourceRoot":"","sources":["../../src/services/organization.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAG1D,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErC,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AACvE,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAE/D,qBACa,mBAAoB,SAAQ,kBAAkB,CAAC,YAAY,CAAC;aAGrD,IAAI,EAAE,UAAU,CAAC,YAAY,CAAC;IAC9C,OAAO,CAAC,QAAQ,CAAC,eAAe;IAChC,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAFP,IAAI,EAAE,UAAU,CAAC,YAAY,CAAC,EAC7B,eAAe,EAAE,eAAe,EAChC,MAAM,EAAE,SAAS;IAS9B,kBAAkB,CAAC,IAAI,EAAE,qBAAqB,GAAG,OAAO,CAAC,YAAY,CAAC;IAyEtE,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC;IAW1D,uBAAuB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC;IAW9D,0BAA0B,CAC9B,cAAc,EAAE,MAAM,EACtB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAChC,OAAO,CAAC,YAAY,CAAC;IAkBlB,qBAAqB,CAAC,cAAc,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,GAAG,OAAO,CAAC,YAAY,CAAC;IAkBvF,sBAAsB,IAAI,OAAO,CAAC,YAAY,EAAE,CAAC;IAOjD,uBAAuB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC;CAGxE"}
|
|
@@ -63,7 +63,7 @@ let OrganizationService = OrganizationService_1 = class OrganizationService exte
|
|
|
63
63
|
return savedOrganization;
|
|
64
64
|
}
|
|
65
65
|
catch (error) {
|
|
66
|
-
this.logger.error(
|
|
66
|
+
this.logger.error('Error creating organization:', error);
|
|
67
67
|
throw error;
|
|
68
68
|
}
|
|
69
69
|
}
|
|
@@ -102,7 +102,7 @@ let OrganizationService = OrganizationService_1 = class OrganizationService exte
|
|
|
102
102
|
}
|
|
103
103
|
organization.isActive = isActive;
|
|
104
104
|
const updatedOrganization = await this.repo.save(organization);
|
|
105
|
-
this.logger.log(`Organization ${isActive ?
|
|
105
|
+
this.logger.log(`Organization ${isActive ? 'activated' : 'deactivated'}: ${organizationId}`);
|
|
106
106
|
return updatedOrganization;
|
|
107
107
|
}
|
|
108
108
|
async getActiveOrganizations() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"organization.service.js","sourceRoot":"","sources":["../../src/services/organization.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uDAA0D;AAC1D,
|
|
1
|
+
{"version":3,"file":"organization.service.js","sourceRoot":"","sources":["../../src/services/organization.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uDAA0D;AAC1D,2CAAoF;AACpF,6CAAmD;AACnD,6CAAgE;AAChE,qCAAqC;AAGrC,yEAA+D;AAGxD,IAAM,mBAAmB,2BAAzB,MAAM,mBAAoB,SAAQ,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