https://project.mdnd-it.cc/work_packages/94
This commit is contained in:
2025-08-23 04:25:28 +02:00
parent 725516ad6c
commit 19cfa031d0
25823 changed files with 1095587 additions and 2801760 deletions
@@ -0,0 +1,9 @@
export interface CreateOrganizationCommand {
name: string;
contactfname: string;
contactlname: string;
contactphone: string;
contactemail: string;
url?: string;
}
//# sourceMappingURL=CreateOrganizationCommand.d.ts.map
@@ -0,0 +1 @@
{"version":3,"file":"CreateOrganizationCommand.d.ts","sourceRoot":"","sources":["../../../../src/Application/Organization/commands/CreateOrganizationCommand.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,yBAAyB;IACxC,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd"}
@@ -0,0 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=CreateOrganizationCommand.js.map
@@ -0,0 +1 @@
{"version":3,"file":"CreateOrganizationCommand.js","sourceRoot":"","sources":["../../../../src/Application/Organization/commands/CreateOrganizationCommand.ts"],"names":[],"mappings":""}
@@ -0,0 +1,9 @@
import { IOrganizationRepository } from '../../../Domain/IRepository/IOrganizationRepository';
import { CreateOrganizationCommand } from './CreateOrganizationCommand';
import { ShortOrganizationDto } from '../../DTOs/OrganizationDto';
export declare class CreateOrganizationCommandHandler {
private readonly orgRepo;
constructor(orgRepo: IOrganizationRepository);
execute(cmd: CreateOrganizationCommand): Promise<ShortOrganizationDto>;
}
//# sourceMappingURL=CreateOrganizationCommandHandler.d.ts.map
@@ -0,0 +1 @@
{"version":3,"file":"CreateOrganizationCommandHandler.d.ts","sourceRoot":"","sources":["../../../../src/Application/Organization/commands/CreateOrganizationCommandHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,qDAAqD,CAAC;AAC9F,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAIlE,qBAAa,gCAAgC;IAC/B,OAAO,CAAC,QAAQ,CAAC,OAAO;gBAAP,OAAO,EAAE,uBAAuB;IAEvD,OAAO,CAAC,GAAG,EAAE,yBAAyB,GAAG,OAAO,CAAC,oBAAoB,CAAC;CAsB7E"}
@@ -0,0 +1,34 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CreateOrganizationCommandHandler = void 0;
const OrganizationAggregate_1 = require("../../../Domain/Organization/OrganizationAggregate");
const OrganizationMapper_1 = require("../../DTOs/Mappers/OrganizationMapper");
class CreateOrganizationCommandHandler {
constructor(orgRepo) {
this.orgRepo = orgRepo;
}
async execute(cmd) {
try {
const org = new OrganizationAggregate_1.OrganizationAggregate();
org.name = cmd.name;
org.contactfname = cmd.contactfname;
org.contactlname = cmd.contactlname;
org.contactphone = cmd.contactphone;
org.contactemail = cmd.contactemail;
org.url = cmd.url || null;
org.state = OrganizationAggregate_1.OrganizationState.REGISTERED;
const created = await this.orgRepo.create(org);
return OrganizationMapper_1.OrganizationMapper.toShortDto(created);
}
catch (error) {
if (error instanceof Error) {
if (error.message.includes('duplicate key value violates unique constraint')) {
throw new Error('Organization with this name or contact email already exists');
}
}
throw new Error('Failed to create organization');
}
}
}
exports.CreateOrganizationCommandHandler = CreateOrganizationCommandHandler;
//# sourceMappingURL=CreateOrganizationCommandHandler.js.map
@@ -0,0 +1 @@
{"version":3,"file":"CreateOrganizationCommandHandler.js","sourceRoot":"","sources":["../../../../src/Application/Organization/commands/CreateOrganizationCommandHandler.ts"],"names":[],"mappings":";;;AAGA,8FAA8G;AAC9G,8EAA2E;AAE3E,MAAa,gCAAgC;IAC3C,YAA6B,OAAgC;QAAhC,YAAO,GAAP,OAAO,CAAyB;IAAG,CAAC;IAEjE,KAAK,CAAC,OAAO,CAAC,GAA8B;QAC1C,IAAI,CAAC;YACH,MAAM,GAAG,GAAG,IAAI,6CAAqB,EAAE,CAAC;YACxC,GAAG,CAAC,IAAI,GAAG,GAAG,CAAC,IAAI,CAAC;YACpB,GAAG,CAAC,YAAY,GAAG,GAAG,CAAC,YAAY,CAAC;YACpC,GAAG,CAAC,YAAY,GAAG,GAAG,CAAC,YAAY,CAAC;YACpC,GAAG,CAAC,YAAY,GAAG,GAAG,CAAC,YAAY,CAAC;YACpC,GAAG,CAAC,YAAY,GAAG,GAAG,CAAC,YAAY,CAAC;YACpC,GAAG,CAAC,GAAG,GAAG,GAAG,CAAC,GAAG,IAAI,IAAI,CAAC;YAC1B,GAAG,CAAC,KAAK,GAAG,yCAAiB,CAAC,UAAU,CAAC;YAEzC,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;YAC/C,OAAO,uCAAkB,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;QAChD,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,KAAK,YAAY,KAAK,EAAE,CAAC;gBAC3B,IAAI,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,gDAAgD,CAAC,EAAE,CAAC;oBAC7E,MAAM,IAAI,KAAK,CAAC,6DAA6D,CAAC,CAAC;gBACjF,CAAC;YACH,CAAC;YACD,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAC;QACnD,CAAC;IACH,CAAC;CACF;AAzBD,4EAyBC"}
@@ -0,0 +1,5 @@
export interface DeleteOrganizationCommand {
id: string;
soft?: boolean;
}
//# sourceMappingURL=DeleteOrganizationCommand.d.ts.map
@@ -0,0 +1 @@
{"version":3,"file":"DeleteOrganizationCommand.d.ts","sourceRoot":"","sources":["../../../../src/Application/Organization/commands/DeleteOrganizationCommand.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,yBAAyB;IACxC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB"}
@@ -0,0 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=DeleteOrganizationCommand.js.map
@@ -0,0 +1 @@
{"version":3,"file":"DeleteOrganizationCommand.js","sourceRoot":"","sources":["../../../../src/Application/Organization/commands/DeleteOrganizationCommand.ts"],"names":[],"mappings":""}
@@ -0,0 +1,8 @@
import { IOrganizationRepository } from '../../../Domain/IRepository/IOrganizationRepository';
import { DeleteOrganizationCommand } from './DeleteOrganizationCommand';
export declare class DeleteOrganizationCommandHandler {
private readonly orgRepo;
constructor(orgRepo: IOrganizationRepository);
execute(cmd: DeleteOrganizationCommand): Promise<boolean>;
}
//# sourceMappingURL=DeleteOrganizationCommandHandler.d.ts.map
@@ -0,0 +1 @@
{"version":3,"file":"DeleteOrganizationCommandHandler.d.ts","sourceRoot":"","sources":["../../../../src/Application/Organization/commands/DeleteOrganizationCommandHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,qDAAqD,CAAC;AAC9F,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AAGxE,qBAAa,gCAAgC;IAC/B,OAAO,CAAC,QAAQ,CAAC,OAAO;gBAAP,OAAO,EAAE,uBAAuB;IAEvD,OAAO,CAAC,GAAG,EAAE,yBAAyB,GAAG,OAAO,CAAC,OAAO,CAAC;CAQhE"}
@@ -0,0 +1,19 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.DeleteOrganizationCommandHandler = void 0;
class DeleteOrganizationCommandHandler {
constructor(orgRepo) {
this.orgRepo = orgRepo;
}
async execute(cmd) {
if (cmd.soft) {
await this.orgRepo.softDelete(cmd.id);
}
else {
await this.orgRepo.delete(cmd.id);
}
return true;
}
}
exports.DeleteOrganizationCommandHandler = DeleteOrganizationCommandHandler;
//# sourceMappingURL=DeleteOrganizationCommandHandler.js.map
@@ -0,0 +1 @@
{"version":3,"file":"DeleteOrganizationCommandHandler.js","sourceRoot":"","sources":["../../../../src/Application/Organization/commands/DeleteOrganizationCommandHandler.ts"],"names":[],"mappings":";;;AAIA,MAAa,gCAAgC;IAC3C,YAA6B,OAAgC;QAAhC,YAAO,GAAP,OAAO,CAAyB;IAAG,CAAC;IAEjE,KAAK,CAAC,OAAO,CAAC,GAA8B;QAC1C,IAAI,GAAG,CAAC,IAAI,EAAE,CAAC;YACb,MAAM,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QACxC,CAAC;aAAM,CAAC;YACN,MAAM,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QACpC,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AAXD,4EAWC"}
@@ -0,0 +1,7 @@
export interface ProcessOrgAuthCallbackCommand {
organizationId: string;
userId: string;
status: 'ok' | 'not_ok';
authToken?: string;
}
//# sourceMappingURL=ProcessOrgAuthCallbackCommand.d.ts.map
@@ -0,0 +1 @@
{"version":3,"file":"ProcessOrgAuthCallbackCommand.d.ts","sourceRoot":"","sources":["../../../../src/Application/Organization/commands/ProcessOrgAuthCallbackCommand.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,6BAA6B;IAC5C,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,IAAI,GAAG,QAAQ,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
@@ -0,0 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=ProcessOrgAuthCallbackCommand.js.map
@@ -0,0 +1 @@
{"version":3,"file":"ProcessOrgAuthCallbackCommand.js","sourceRoot":"","sources":["../../../../src/Application/Organization/commands/ProcessOrgAuthCallbackCommand.ts"],"names":[],"mappings":""}
@@ -0,0 +1,15 @@
import { IUserRepository } from '../../../Domain/IRepository/IUserRepository';
import { IOrganizationRepository } from '../../../Domain/IRepository/IOrganizationRepository';
import { ProcessOrgAuthCallbackCommand } from './ProcessOrgAuthCallbackCommand';
export interface ProcessOrgAuthCallbackResponse {
success: boolean;
message: string;
updatedFields?: string[];
}
export declare class ProcessOrgAuthCallbackCommandHandler {
private readonly userRepo;
private readonly orgRepo;
constructor(userRepo: IUserRepository, orgRepo: IOrganizationRepository);
execute(cmd: ProcessOrgAuthCallbackCommand): Promise<ProcessOrgAuthCallbackResponse>;
}
//# sourceMappingURL=ProcessOrgAuthCallbackCommandHandler.d.ts.map
@@ -0,0 +1 @@
{"version":3,"file":"ProcessOrgAuthCallbackCommandHandler.d.ts","sourceRoot":"","sources":["../../../../src/Application/Organization/commands/ProcessOrgAuthCallbackCommandHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,6CAA6C,CAAC;AAC9E,OAAO,EAAE,uBAAuB,EAAE,MAAM,qDAAqD,CAAC;AAC9F,OAAO,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAC;AAGhF,MAAM,WAAW,8BAA8B;IAC7C,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;CAC1B;AAED,qBAAa,oCAAoC;IAE7C,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,OAAO;gBADP,QAAQ,EAAE,eAAe,EACzB,OAAO,EAAE,uBAAuB;IAG7C,OAAO,CAAC,GAAG,EAAE,6BAA6B,GAAG,OAAO,CAAC,8BAA8B,CAAC;CAyG3F"}
@@ -0,0 +1,103 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ProcessOrgAuthCallbackCommandHandler = void 0;
const Logger_1 = require("../../Services/Logger");
class ProcessOrgAuthCallbackCommandHandler {
constructor(userRepo, orgRepo) {
this.userRepo = userRepo;
this.orgRepo = orgRepo;
}
async execute(cmd) {
const startTime = Date.now();
try {
(0, Logger_1.logAuth)('Processing organization authentication callback', cmd.userId, {
organizationId: cmd.organizationId,
status: cmd.status,
hasAuthToken: !!cmd.authToken
});
// Verify organization exists
const organization = await this.orgRepo.findById(cmd.organizationId);
if (!organization) {
(0, Logger_1.logWarning)('Organization not found for auth callback', {
organizationId: cmd.organizationId,
userId: cmd.userId
});
return {
success: false,
message: 'Organization not found'
};
}
// Verify user exists
const user = await this.userRepo.findById(cmd.userId);
if (!user) {
(0, Logger_1.logWarning)('User not found for auth callback', {
organizationId: cmd.organizationId,
userId: cmd.userId
});
return {
success: false,
message: 'User not found'
};
}
// Verify user belongs to the organization
if (user.orgid !== cmd.organizationId) {
(0, Logger_1.logWarning)('User does not belong to organization for auth callback', {
organizationId: cmd.organizationId,
userId: cmd.userId,
userOrgId: user.orgid
});
return {
success: false,
message: 'User does not belong to this organization'
};
}
if (cmd.status === 'not_ok') {
(0, Logger_1.logAuth)('Organization authentication failed', cmd.userId, {
organizationId: cmd.organizationId,
organizationName: organization.name
});
return {
success: false,
message: 'Organization authentication failed'
};
}
// Update user's organization login date
const now = new Date();
const updatedUser = await this.userRepo.update(cmd.userId, {
Orglogindate: now
});
if (!updatedUser) {
(0, Logger_1.logError)('Failed to update user organization login date', new Error('User update returned null'));
return {
success: false,
message: 'Failed to update user login information'
};
}
(0, Logger_1.logAuth)('Organization authentication successful', cmd.userId, {
organizationId: cmd.organizationId,
organizationName: organization.name,
orgLoginDate: now.toISOString(),
executionTime: Date.now() - startTime
});
(0, Logger_1.logDatabase)('User organization login date updated', `userId: ${cmd.userId}, orgId: ${cmd.organizationId}`, Date.now() - startTime, {
userId: cmd.userId,
organizationId: cmd.organizationId,
newOrgLoginDate: now.toISOString()
});
return {
success: true,
message: 'Organization authentication successful',
updatedFields: ['Orglogindate']
};
}
catch (error) {
(0, Logger_1.logError)('ProcessOrgAuthCallbackCommandHandler error', error);
return {
success: false,
message: 'Internal error processing authentication callback'
};
}
}
}
exports.ProcessOrgAuthCallbackCommandHandler = ProcessOrgAuthCallbackCommandHandler;
//# sourceMappingURL=ProcessOrgAuthCallbackCommandHandler.js.map
@@ -0,0 +1 @@
{"version":3,"file":"ProcessOrgAuthCallbackCommandHandler.js","sourceRoot":"","sources":["../../../../src/Application/Organization/commands/ProcessOrgAuthCallbackCommandHandler.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,14 @@
import { OrganizationStateType } from '../../../Domain/Organization/OrganizationAggregate';
export interface UpdateOrganizationCommand {
id: string;
name?: string;
contactfname?: string;
contactlname?: string;
contactphone?: string;
contactemail?: string;
url?: string;
state?: OrganizationStateType;
userinorg?: number;
maxOrganizationalDecks?: number | null;
}
//# sourceMappingURL=UpdateOrganizationCommand.d.ts.map
@@ -0,0 +1 @@
{"version":3,"file":"UpdateOrganizationCommand.d.ts","sourceRoot":"","sources":["../../../../src/Application/Organization/commands/UpdateOrganizationCommand.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,oDAAoD,CAAC;AAE3F,MAAM,WAAW,yBAAyB;IACxC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,qBAAqB,CAAC;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sBAAsB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACxC"}
@@ -0,0 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=UpdateOrganizationCommand.js.map
@@ -0,0 +1 @@
{"version":3,"file":"UpdateOrganizationCommand.js","sourceRoot":"","sources":["../../../../src/Application/Organization/commands/UpdateOrganizationCommand.ts"],"names":[],"mappings":""}
@@ -0,0 +1,9 @@
import { IOrganizationRepository } from '../../../Domain/IRepository/IOrganizationRepository';
import { UpdateOrganizationCommand } from './UpdateOrganizationCommand';
import { ShortOrganizationDto } from '../../DTOs/OrganizationDto';
export declare class UpdateOrganizationCommandHandler {
private readonly orgRepo;
constructor(orgRepo: IOrganizationRepository);
execute(cmd: UpdateOrganizationCommand): Promise<ShortOrganizationDto | null>;
}
//# sourceMappingURL=UpdateOrganizationCommandHandler.d.ts.map
@@ -0,0 +1 @@
{"version":3,"file":"UpdateOrganizationCommandHandler.d.ts","sourceRoot":"","sources":["../../../../src/Application/Organization/commands/UpdateOrganizationCommandHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,qDAAqD,CAAC;AAC9F,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AAExE,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAGlE,qBAAa,gCAAgC;IAC/B,OAAO,CAAC,QAAQ,CAAC,OAAO;gBAAP,OAAO,EAAE,uBAAuB;IAEvD,OAAO,CAAC,GAAG,EAAE,yBAAyB,GAAG,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC;CAKpF"}
@@ -0,0 +1,17 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.UpdateOrganizationCommandHandler = void 0;
const OrganizationMapper_1 = require("../../DTOs/Mappers/OrganizationMapper");
class UpdateOrganizationCommandHandler {
constructor(orgRepo) {
this.orgRepo = orgRepo;
}
async execute(cmd) {
const updated = await this.orgRepo.update(cmd.id, { ...cmd });
if (!updated)
return null;
return OrganizationMapper_1.OrganizationMapper.toShortDto(updated);
}
}
exports.UpdateOrganizationCommandHandler = UpdateOrganizationCommandHandler;
//# sourceMappingURL=UpdateOrganizationCommandHandler.js.map
@@ -0,0 +1 @@
{"version":3,"file":"UpdateOrganizationCommandHandler.js","sourceRoot":"","sources":["../../../../src/Application/Organization/commands/UpdateOrganizationCommandHandler.ts"],"names":[],"mappings":";;;AAIA,8EAA2E;AAE3E,MAAa,gCAAgC;IAC3C,YAA6B,OAAgC;QAAhC,YAAO,GAAP,OAAO,CAAyB;IAAG,CAAC;IAEjE,KAAK,CAAC,OAAO,CAAC,GAA8B;QAC1C,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,EAAE,EAAE,GAAG,GAAG,EAAE,CAAC,CAAC;QAC9D,IAAI,CAAC,OAAO;YAAE,OAAO,IAAI,CAAC;QAC1B,OAAO,uCAAkB,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;IAChD,CAAC;CACF;AARD,4EAQC"}