@hed-hog/operations 0.0.332 → 0.0.338
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/controllers/operations-collaborators.controller.d.ts +0 -54
- package/dist/controllers/operations-collaborators.controller.d.ts.map +1 -1
- package/dist/controllers/operations-collaborators.controller.js +0 -100
- package/dist/controllers/operations-collaborators.controller.js.map +1 -1
- package/dist/controllers/operations-contracts.controller.d.ts +12 -12
- package/dist/operations.service.d.ts +0 -76
- package/dist/operations.service.d.ts.map +1 -1
- package/dist/operations.service.js +7 -230
- package/dist/operations.service.js.map +1 -1
- package/dist/operations.service.spec.js +6 -0
- package/dist/operations.service.spec.js.map +1 -1
- package/hedhog/data/menu.yaml +8 -27
- package/hedhog/data/route.yaml +0 -72
- package/hedhog/frontend/app/_components/collaborator-details-screen.tsx.ejs +476 -0
- package/hedhog/frontend/app/_components/collaborator-form-screen.tsx.ejs +3 -39
- package/hedhog/frontend/app/_components/collaborator-select-with-create.tsx.ejs +261 -0
- package/hedhog/frontend/app/_components/collaborator-tasks-tab.tsx.ejs +358 -358
- package/hedhog/frontend/app/_components/collaborator-timesheets-tab.tsx.ejs +6 -6
- package/hedhog/frontend/app/_components/contract-content-editor.tsx.ejs +258 -0
- package/hedhog/frontend/app/_components/my-project-summary-screen.tsx.ejs +5 -4
- package/hedhog/frontend/app/_components/person-select-with-create.tsx.ejs +1 -0
- package/hedhog/frontend/app/_components/project-assignments-tab.tsx.ejs +10 -218
- package/hedhog/frontend/app/_components/project-cost-report-screen.tsx.ejs +23 -23
- package/hedhog/frontend/app/_components/project-details-screen.tsx.ejs +24 -708
- package/hedhog/frontend/app/_components/project-form-screen.tsx.ejs +38 -158
- package/hedhog/frontend/app/_components/task-detail-sheet.tsx.ejs +1 -5
- package/hedhog/frontend/app/_components/task-form-sheet.tsx.ejs +629 -629
- package/hedhog/frontend/app/_lib/api.ts.ejs +0 -151
- package/hedhog/frontend/app/_lib/types.ts.ejs +0 -1
- package/hedhog/frontend/app/_lib/utils/task-ui.ts.ejs +0 -18
- package/hedhog/frontend/app/my-projects/page.tsx.ejs +2 -16
- package/hedhog/frontend/app/my-tasks/page.tsx.ejs +86 -24
- package/hedhog/frontend/app/projects/page.tsx.ejs +6 -42
- package/hedhog/frontend/messages/en.json +2 -96
- package/hedhog/frontend/messages/operations/operations/en.json +2100 -0
- package/hedhog/frontend/messages/operations/operations/pt.json +2111 -0
- package/hedhog/frontend/messages/pt.json +2 -96
- package/hedhog/frontend/widgets/capacity-distribution.tsx.ejs +16 -16
- package/hedhog/frontend/widgets/effort-by-project.tsx.ejs +16 -16
- package/hedhog/frontend/widgets/headcount-by-area.tsx.ejs +16 -16
- package/hedhog/frontend/widgets/index.ts.ejs +25 -25
- package/hedhog/frontend/widgets/managed-projects-status.tsx.ejs +16 -16
- package/hedhog/frontend/widgets/my-hours-period-kpi.tsx.ejs +16 -16
- package/hedhog/frontend/widgets/my-open-requests-kpi.tsx.ejs +16 -16
- package/hedhog/frontend/widgets/my-pending-requests-list.tsx.ejs +16 -16
- package/hedhog/frontend/widgets/my-project-allocations-kpi.tsx.ejs +16 -16
- package/hedhog/frontend/widgets/my-quick-actions.tsx.ejs +16 -16
- package/hedhog/frontend/widgets/my-relevant-deadlines.tsx.ejs +16 -16
- package/hedhog/frontend/widgets/my-timesheet-status-kpi.tsx.ejs +16 -16
- package/hedhog/frontend/widgets/my-weekly-journey.tsx.ejs +16 -16
- package/hedhog/frontend/widgets/portfolio-costs-kpi.tsx.ejs +16 -16
- package/hedhog/frontend/widgets/portfolio-effort-kpi.tsx.ejs +16 -16
- package/hedhog/frontend/widgets/portfolio-projects-kpi.tsx.ejs +16 -16
- package/hedhog/frontend/widgets/portfolio-risk-kpi.tsx.ejs +16 -16
- package/hedhog/frontend/widgets/project-status-overview.tsx.ejs +16 -16
- package/hedhog/frontend/widgets/shared-operations-widget.tsx.ejs +169 -169
- package/hedhog/frontend/widgets/strategic-deadlines.tsx.ejs +16 -16
- package/hedhog/frontend/widgets/team-approval-queue.tsx.ejs +16 -16
- package/hedhog/frontend/widgets/team-capacity-kpi.tsx.ejs +16 -16
- package/hedhog/frontend/widgets/team-headcount-kpi.tsx.ejs +16 -16
- package/hedhog/frontend/widgets/team-hours-kpi.tsx.ejs +16 -16
- package/hedhog/frontend/widgets/team-pending-approvals-kpi.tsx.ejs +16 -16
- package/hedhog/frontend/widgets/team-utilization-overview.tsx.ejs +16 -16
- package/hedhog/frontend/widgets/team-workload-alerts.tsx.ejs +16 -16
- package/hedhog/table/operations_collaborator.yaml +8 -8
- package/hedhog/table/operations_task.yaml +76 -76
- package/hedhog/table/operations_task_activity.yaml +51 -51
- package/package.json +6 -6
- package/src/controllers/operations-collaborators.controller.ts +8 -117
- package/src/controllers/operations-tasks.controller.ts +156 -156
- package/src/dashboard/widgets/MyQuickActions.tsx +22 -22
- package/src/dto/create-collaborator.dto.ts +4 -4
- package/src/operations.service.spec.ts +1006 -988
- package/src/operations.service.ts +7 -323
- package/dist/dto/create-collaborator-invoice.dto.d.ts +0 -11
- package/dist/dto/create-collaborator-invoice.dto.d.ts.map +0 -1
- package/dist/dto/create-collaborator-invoice.dto.js +0 -55
- package/dist/dto/create-collaborator-invoice.dto.js.map +0 -1
- package/dist/dto/create-collaborator-payment.dto.d.ts +0 -10
- package/dist/dto/create-collaborator-payment.dto.d.ts.map +0 -1
- package/dist/dto/create-collaborator-payment.dto.js +0 -50
- package/dist/dto/create-collaborator-payment.dto.js.map +0 -1
- package/dist/dto/list-collaborator-invoice.dto.d.ts +0 -4
- package/dist/dto/list-collaborator-invoice.dto.d.ts.map +0 -1
- package/dist/dto/list-collaborator-invoice.dto.js +0 -8
- package/dist/dto/list-collaborator-invoice.dto.js.map +0 -1
- package/dist/dto/list-collaborator-payment.dto.d.ts +0 -4
- package/dist/dto/list-collaborator-payment.dto.d.ts.map +0 -1
- package/dist/dto/list-collaborator-payment.dto.js +0 -8
- package/dist/dto/list-collaborator-payment.dto.js.map +0 -1
- package/dist/dto/update-collaborator-invoice.dto.d.ts +0 -6
- package/dist/dto/update-collaborator-invoice.dto.d.ts.map +0 -1
- package/dist/dto/update-collaborator-invoice.dto.js +0 -9
- package/dist/dto/update-collaborator-invoice.dto.js.map +0 -1
- package/dist/dto/update-collaborator-payment.dto.d.ts +0 -6
- package/dist/dto/update-collaborator-payment.dto.d.ts.map +0 -1
- package/dist/dto/update-collaborator-payment.dto.js +0 -9
- package/dist/dto/update-collaborator-payment.dto.js.map +0 -1
- package/hedhog/frontend/app/_components/collaborator-invoices-tab.tsx.ejs +0 -443
- package/hedhog/frontend/app/_components/collaborator-payment-history-tab.tsx.ejs +0 -429
- package/hedhog/frontend/app/tasks-gantt/page.tsx.ejs +0 -953
- package/hedhog/table/operations_collaborator_invoice.yaml +0 -35
- package/hedhog/table/operations_collaborator_payment.yaml +0 -32
- package/src/dto/create-collaborator-invoice.dto.ts +0 -39
- package/src/dto/create-collaborator-payment.dto.ts +0 -35
- package/src/dto/list-collaborator-invoice.dto.ts +0 -3
- package/src/dto/list-collaborator-payment.dto.ts +0 -3
- package/src/dto/update-collaborator-invoice.dto.ts +0 -6
- package/src/dto/update-collaborator-payment.dto.ts +0 -6
|
@@ -1462,172 +1462,6 @@ let OperationsService = OperationsService_1 = class OperationsService {
|
|
|
1462
1462
|
WHERE h.collaborator_id = $1
|
|
1463
1463
|
ORDER BY h.created_at DESC`, [collaboratorId]);
|
|
1464
1464
|
}
|
|
1465
|
-
async getCollaboratorPaymentHistory(userId, collaboratorId) {
|
|
1466
|
-
const actor = await this.getActorContext(userId);
|
|
1467
|
-
this.ensureDirector(actor);
|
|
1468
|
-
await this.getCollaboratorById(collaboratorId);
|
|
1469
|
-
const rows = await this.prisma.operations_collaborator_payment.findMany({
|
|
1470
|
-
where: { collaborator_id: collaboratorId },
|
|
1471
|
-
orderBy: { payment_date: 'desc' },
|
|
1472
|
-
});
|
|
1473
|
-
return rows.map((r) => ({
|
|
1474
|
-
id: r.id,
|
|
1475
|
-
collaboratorId: r.collaborator_id,
|
|
1476
|
-
amount: r.amount.toString(),
|
|
1477
|
-
paymentDate: r.payment_date,
|
|
1478
|
-
referenceMonth: r.reference_month,
|
|
1479
|
-
paymentMethod: r.payment_method,
|
|
1480
|
-
notes: r.notes,
|
|
1481
|
-
createdAt: r.created_at,
|
|
1482
|
-
}));
|
|
1483
|
-
}
|
|
1484
|
-
async getCollaboratorInvoices(userId, collaboratorId) {
|
|
1485
|
-
const actor = await this.getActorContext(userId);
|
|
1486
|
-
this.ensureDirector(actor);
|
|
1487
|
-
await this.getCollaboratorById(collaboratorId);
|
|
1488
|
-
const rows = await this.prisma.operations_collaborator_invoice.findMany({
|
|
1489
|
-
where: { collaborator_id: collaboratorId },
|
|
1490
|
-
orderBy: { issue_date: 'desc' },
|
|
1491
|
-
});
|
|
1492
|
-
return rows.map((r) => ({
|
|
1493
|
-
id: r.id,
|
|
1494
|
-
collaboratorId: r.collaborator_id,
|
|
1495
|
-
invoiceNumber: r.invoice_number,
|
|
1496
|
-
amount: r.amount.toString(),
|
|
1497
|
-
issueDate: r.issue_date,
|
|
1498
|
-
dueDate: r.due_date,
|
|
1499
|
-
status: r.status,
|
|
1500
|
-
description: r.description,
|
|
1501
|
-
createdAt: r.created_at,
|
|
1502
|
-
}));
|
|
1503
|
-
}
|
|
1504
|
-
async createCollaboratorPayment(userId, collaboratorId, data) {
|
|
1505
|
-
var _a, _b, _c;
|
|
1506
|
-
const actor = await this.getActorContext(userId);
|
|
1507
|
-
this.ensureDirector(actor);
|
|
1508
|
-
await this.getCollaboratorById(collaboratorId);
|
|
1509
|
-
const created = await this.prisma.operations_collaborator_payment.create({
|
|
1510
|
-
data: {
|
|
1511
|
-
collaborator_id: collaboratorId,
|
|
1512
|
-
amount: data.amount,
|
|
1513
|
-
payment_date: new Date(data.paymentDate),
|
|
1514
|
-
reference_month: (_a = data.referenceMonth) !== null && _a !== void 0 ? _a : null,
|
|
1515
|
-
payment_method: ((_b = data.paymentMethod) !== null && _b !== void 0 ? _b : 'pix'),
|
|
1516
|
-
notes: (_c = data.notes) !== null && _c !== void 0 ? _c : null,
|
|
1517
|
-
},
|
|
1518
|
-
});
|
|
1519
|
-
return {
|
|
1520
|
-
id: created.id,
|
|
1521
|
-
collaboratorId: created.collaborator_id,
|
|
1522
|
-
amount: created.amount.toString(),
|
|
1523
|
-
paymentDate: created.payment_date,
|
|
1524
|
-
referenceMonth: created.reference_month,
|
|
1525
|
-
paymentMethod: created.payment_method,
|
|
1526
|
-
notes: created.notes,
|
|
1527
|
-
createdAt: created.created_at,
|
|
1528
|
-
};
|
|
1529
|
-
}
|
|
1530
|
-
async updateCollaboratorPayment(userId, collaboratorId, paymentId, data) {
|
|
1531
|
-
const actor = await this.getActorContext(userId);
|
|
1532
|
-
this.ensureDirector(actor);
|
|
1533
|
-
const payment = await this.prisma.operations_collaborator_payment.findFirst({
|
|
1534
|
-
where: { id: paymentId, collaborator_id: collaboratorId },
|
|
1535
|
-
});
|
|
1536
|
-
if (!payment)
|
|
1537
|
-
throw new common_1.NotFoundException('Payment record not found.');
|
|
1538
|
-
const updated = await this.prisma.operations_collaborator_payment.update({
|
|
1539
|
-
where: { id: paymentId },
|
|
1540
|
-
data: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, (data.amount !== undefined && { amount: data.amount })), (data.paymentDate !== undefined && { payment_date: new Date(data.paymentDate) })), ('referenceMonth' in data && { reference_month: data.referenceMonth })), (data.paymentMethod !== undefined && { payment_method: data.paymentMethod })), ('notes' in data && { notes: data.notes })),
|
|
1541
|
-
});
|
|
1542
|
-
return {
|
|
1543
|
-
id: updated.id,
|
|
1544
|
-
collaboratorId: updated.collaborator_id,
|
|
1545
|
-
amount: updated.amount.toString(),
|
|
1546
|
-
paymentDate: updated.payment_date,
|
|
1547
|
-
referenceMonth: updated.reference_month,
|
|
1548
|
-
paymentMethod: updated.payment_method,
|
|
1549
|
-
notes: updated.notes,
|
|
1550
|
-
createdAt: updated.created_at,
|
|
1551
|
-
};
|
|
1552
|
-
}
|
|
1553
|
-
async deleteCollaboratorPayment(userId, collaboratorId, paymentId) {
|
|
1554
|
-
const actor = await this.getActorContext(userId);
|
|
1555
|
-
this.ensureDirector(actor);
|
|
1556
|
-
const payment = await this.prisma.operations_collaborator_payment.findFirst({
|
|
1557
|
-
where: { id: paymentId, collaborator_id: collaboratorId },
|
|
1558
|
-
});
|
|
1559
|
-
if (!payment)
|
|
1560
|
-
throw new common_1.NotFoundException('Payment record not found.');
|
|
1561
|
-
await this.prisma.operations_collaborator_payment.delete({
|
|
1562
|
-
where: { id: paymentId },
|
|
1563
|
-
});
|
|
1564
|
-
return { success: true };
|
|
1565
|
-
}
|
|
1566
|
-
async createCollaboratorInvoice(userId, collaboratorId, data) {
|
|
1567
|
-
var _a, _b, _c;
|
|
1568
|
-
const actor = await this.getActorContext(userId);
|
|
1569
|
-
this.ensureDirector(actor);
|
|
1570
|
-
await this.getCollaboratorById(collaboratorId);
|
|
1571
|
-
const created = await this.prisma.operations_collaborator_invoice.create({
|
|
1572
|
-
data: {
|
|
1573
|
-
collaborator_id: collaboratorId,
|
|
1574
|
-
invoice_number: (_a = data.invoiceNumber) !== null && _a !== void 0 ? _a : null,
|
|
1575
|
-
amount: data.amount,
|
|
1576
|
-
issue_date: new Date(data.issueDate),
|
|
1577
|
-
due_date: data.dueDate ? new Date(data.dueDate) : null,
|
|
1578
|
-
status: ((_b = data.status) !== null && _b !== void 0 ? _b : 'pending'),
|
|
1579
|
-
description: (_c = data.description) !== null && _c !== void 0 ? _c : null,
|
|
1580
|
-
},
|
|
1581
|
-
});
|
|
1582
|
-
return {
|
|
1583
|
-
id: created.id,
|
|
1584
|
-
collaboratorId: created.collaborator_id,
|
|
1585
|
-
invoiceNumber: created.invoice_number,
|
|
1586
|
-
amount: created.amount.toString(),
|
|
1587
|
-
issueDate: created.issue_date,
|
|
1588
|
-
dueDate: created.due_date,
|
|
1589
|
-
status: created.status,
|
|
1590
|
-
description: created.description,
|
|
1591
|
-
createdAt: created.created_at,
|
|
1592
|
-
};
|
|
1593
|
-
}
|
|
1594
|
-
async updateCollaboratorInvoice(userId, collaboratorId, invoiceId, data) {
|
|
1595
|
-
const actor = await this.getActorContext(userId);
|
|
1596
|
-
this.ensureDirector(actor);
|
|
1597
|
-
const invoice = await this.prisma.operations_collaborator_invoice.findFirst({
|
|
1598
|
-
where: { id: invoiceId, collaborator_id: collaboratorId },
|
|
1599
|
-
});
|
|
1600
|
-
if (!invoice)
|
|
1601
|
-
throw new common_1.NotFoundException('Invoice not found.');
|
|
1602
|
-
const updated = await this.prisma.operations_collaborator_invoice.update({
|
|
1603
|
-
where: { id: invoiceId },
|
|
1604
|
-
data: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, ('invoiceNumber' in data && { invoice_number: data.invoiceNumber })), (data.amount !== undefined && { amount: data.amount })), (data.issueDate !== undefined && { issue_date: new Date(data.issueDate) })), ('dueDate' in data && { due_date: data.dueDate ? new Date(data.dueDate) : null })), (data.status !== undefined && { status: data.status })), ('description' in data && { description: data.description })),
|
|
1605
|
-
});
|
|
1606
|
-
return {
|
|
1607
|
-
id: updated.id,
|
|
1608
|
-
collaboratorId: updated.collaborator_id,
|
|
1609
|
-
invoiceNumber: updated.invoice_number,
|
|
1610
|
-
amount: updated.amount.toString(),
|
|
1611
|
-
issueDate: updated.issue_date,
|
|
1612
|
-
dueDate: updated.due_date,
|
|
1613
|
-
status: updated.status,
|
|
1614
|
-
description: updated.description,
|
|
1615
|
-
createdAt: updated.created_at,
|
|
1616
|
-
};
|
|
1617
|
-
}
|
|
1618
|
-
async deleteCollaboratorInvoice(userId, collaboratorId, invoiceId) {
|
|
1619
|
-
const actor = await this.getActorContext(userId);
|
|
1620
|
-
this.ensureDirector(actor);
|
|
1621
|
-
const invoice = await this.prisma.operations_collaborator_invoice.findFirst({
|
|
1622
|
-
where: { id: invoiceId, collaborator_id: collaboratorId },
|
|
1623
|
-
});
|
|
1624
|
-
if (!invoice)
|
|
1625
|
-
throw new common_1.NotFoundException('Invoice not found.');
|
|
1626
|
-
await this.prisma.operations_collaborator_invoice.delete({
|
|
1627
|
-
where: { id: invoiceId },
|
|
1628
|
-
});
|
|
1629
|
-
return { success: true };
|
|
1630
|
-
}
|
|
1631
1465
|
async listDepartments(userId, filters = {}) {
|
|
1632
1466
|
var _a, _b;
|
|
1633
1467
|
const actor = await this.getActorContext(userId);
|
|
@@ -1912,17 +1746,6 @@ let OperationsService = OperationsService_1 = class OperationsService {
|
|
|
1912
1746
|
AND LOWER(TRIM(p2.name)) = LOWER(TRIM(p.client_name))
|
|
1913
1747
|
LIMIT 1)
|
|
1914
1748
|
) AS "clientAvatarId",
|
|
1915
|
-
COALESCE(
|
|
1916
|
-
client_user.photo_id,
|
|
1917
|
-
(SELECT u2.photo_id
|
|
1918
|
-
FROM person p2
|
|
1919
|
-
JOIN person_user pu2 ON pu2.person_id = p2.id
|
|
1920
|
-
JOIN "user" u2 ON u2.id = pu2.user_id
|
|
1921
|
-
WHERE p.client_person_id IS NULL
|
|
1922
|
-
AND LOWER(TRIM(p2.name)) = LOWER(TRIM(p.client_name))
|
|
1923
|
-
ORDER BY pu2.id ASC
|
|
1924
|
-
LIMIT 1)
|
|
1925
|
-
) AS "clientUserPhotoId",
|
|
1926
1749
|
p.summary,
|
|
1927
1750
|
p.status,
|
|
1928
1751
|
p.progress_percent AS "progressPercent",
|
|
@@ -1940,21 +1763,13 @@ let OperationsService = OperationsService_1 = class OperationsService {
|
|
|
1940
1763
|
LEFT JOIN operations_contract c ON c.id = p.contract_id
|
|
1941
1764
|
LEFT JOIN operations_collaborator m ON m.id = p.manager_collaborator_id
|
|
1942
1765
|
LEFT JOIN person cp ON cp.id = p.client_person_id
|
|
1943
|
-
LEFT JOIN LATERAL (
|
|
1944
|
-
SELECT u.photo_id
|
|
1945
|
-
FROM person_user pu
|
|
1946
|
-
JOIN "user" u ON u.id = pu.user_id
|
|
1947
|
-
WHERE pu.person_id = p.client_person_id
|
|
1948
|
-
ORDER BY pu.id ASC
|
|
1949
|
-
LIMIT 1
|
|
1950
|
-
) client_user ON TRUE
|
|
1951
1766
|
LEFT JOIN person mp ON mp.id = m.person_id
|
|
1952
1767
|
LEFT JOIN operations_project_assignment pa
|
|
1953
1768
|
ON pa.project_id = p.id
|
|
1954
1769
|
AND pa.deleted_at IS NULL
|
|
1955
1770
|
AND pa.status IN ('planned', 'active')
|
|
1956
1771
|
WHERE ${whereClause}
|
|
1957
|
-
GROUP BY p.id, c.id, m.id, cp.id, mp.id
|
|
1772
|
+
GROUP BY p.id, c.id, m.id, cp.id, mp.id`;
|
|
1958
1773
|
if (!pagination) {
|
|
1959
1774
|
return this.queryRows(`${baseQuery} ORDER BY p.name ASC`, params);
|
|
1960
1775
|
}
|
|
@@ -5380,17 +5195,6 @@ let OperationsService = OperationsService_1 = class OperationsService {
|
|
|
5380
5195
|
AND LOWER(TRIM(p2.name)) = LOWER(TRIM(p.client_name))
|
|
5381
5196
|
LIMIT 1)
|
|
5382
5197
|
) AS "clientAvatarId",
|
|
5383
|
-
COALESCE(
|
|
5384
|
-
client_user.photo_id,
|
|
5385
|
-
(SELECT u2.photo_id
|
|
5386
|
-
FROM person p2
|
|
5387
|
-
JOIN person_user pu2 ON pu2.person_id = p2.id
|
|
5388
|
-
JOIN "user" u2 ON u2.id = pu2.user_id
|
|
5389
|
-
WHERE p.client_person_id IS NULL
|
|
5390
|
-
AND LOWER(TRIM(p2.name)) = LOWER(TRIM(p.client_name))
|
|
5391
|
-
ORDER BY pu2.id ASC
|
|
5392
|
-
LIMIT 1)
|
|
5393
|
-
) AS "clientUserPhotoId",
|
|
5394
5198
|
p.code,
|
|
5395
5199
|
p.name,
|
|
5396
5200
|
p.client_name AS "clientName",
|
|
@@ -5412,14 +5216,6 @@ let OperationsService = OperationsService_1 = class OperationsService {
|
|
|
5412
5216
|
LEFT JOIN operations_contract c ON c.id = p.contract_id
|
|
5413
5217
|
LEFT JOIN operations_collaborator m ON m.id = p.manager_collaborator_id
|
|
5414
5218
|
LEFT JOIN person client_person ON client_person.id = p.client_person_id
|
|
5415
|
-
LEFT JOIN LATERAL (
|
|
5416
|
-
SELECT u.photo_id
|
|
5417
|
-
FROM person_user pu
|
|
5418
|
-
JOIN "user" u ON u.id = pu.user_id
|
|
5419
|
-
WHERE pu.person_id = p.client_person_id
|
|
5420
|
-
ORDER BY pu.id ASC
|
|
5421
|
-
LIMIT 1
|
|
5422
|
-
) client_user ON TRUE
|
|
5423
5219
|
LEFT JOIN operations_project_assignment pa
|
|
5424
5220
|
ON pa.project_id = p.id
|
|
5425
5221
|
AND pa.deleted_at IS NULL
|
|
@@ -5435,7 +5231,7 @@ let OperationsService = OperationsService_1 = class OperationsService {
|
|
|
5435
5231
|
) project_role_locale ON TRUE
|
|
5436
5232
|
WHERE p.id = $1
|
|
5437
5233
|
AND p.deleted_at IS NULL
|
|
5438
|
-
GROUP BY p.id, c.id, m.id, client_person.id
|
|
5234
|
+
GROUP BY p.id, c.id, m.id, client_person.id`, [projectId, actorCollaboratorId !== null && actorCollaboratorId !== void 0 ? actorCollaboratorId : null]);
|
|
5439
5235
|
if (!project) {
|
|
5440
5236
|
throw new common_1.NotFoundException("Project not found.");
|
|
5441
5237
|
}
|
|
@@ -5908,9 +5704,9 @@ let OperationsService = OperationsService_1 = class OperationsService {
|
|
|
5908
5704
|
) VALUES (
|
|
5909
5705
|
$1,
|
|
5910
5706
|
$2,
|
|
5911
|
-
$3::operations_task_activity_action_bd50457330_enum,
|
|
5912
|
-
$4::operations_task_activity_from_status_3a69262de6_enum,
|
|
5913
|
-
$5::operations_task_activity_to_status_1fd99321c8_enum,
|
|
5707
|
+
$3::"operations_task_activity_action_bd50457330_enum",
|
|
5708
|
+
$4::"operations_task_activity_from_status_3a69262de6_enum",
|
|
5709
|
+
$5::"operations_task_activity_to_status_1fd99321c8_enum",
|
|
5914
5710
|
NOW()
|
|
5915
5711
|
)`, params.taskId, params.actorCollaboratorId, params.action, (_a = params.fromStatus) !== null && _a !== void 0 ? _a : null, (_b = params.toStatus) !== null && _b !== void 0 ? _b : null);
|
|
5916
5712
|
}
|
|
@@ -6555,7 +6351,7 @@ let OperationsService = OperationsService_1 = class OperationsService {
|
|
|
6555
6351
|
created_at,
|
|
6556
6352
|
updated_at
|
|
6557
6353
|
) VALUES (
|
|
6558
|
-
$1, $2, $3, $4, $5
|
|
6354
|
+
$1, $2, $3, $4, $5, $6, $7::date, $8::date,
|
|
6559
6355
|
$9::operations_project_assignment_status_155b459bbf_enum,
|
|
6560
6356
|
NOW(), NOW()
|
|
6561
6357
|
)`, projectId, assignment.collaboratorId, (_a = projectRole === null || projectRole === void 0 ? void 0 : projectRole.id) !== null && _a !== void 0 ? _a : null, (_c = (_b = this.normalizeOptionalText(assignment.roleLabel)) !== null && _b !== void 0 ? _b : projectRole === null || projectRole === void 0 ? void 0 : projectRole.name) !== null && _c !== void 0 ? _c : "Team Member", (_d = assignment.allocationPercent) !== null && _d !== void 0 ? _d : null, (_e = assignment.weeklyHours) !== null && _e !== void 0 ? _e : null, (_f = assignment.startDate) !== null && _f !== void 0 ? _f : null, (_g = assignment.endDate) !== null && _g !== void 0 ? _g : null, (_h = assignment.status) !== null && _h !== void 0 ? _h : "active");
|
|
@@ -7987,17 +7783,6 @@ let OperationsService = OperationsService_1 = class OperationsService {
|
|
|
7987
7783
|
AND LOWER(TRIM(p2.name)) = LOWER(TRIM(p.client_name))
|
|
7988
7784
|
LIMIT 1)
|
|
7989
7785
|
) AS "clientAvatarId",
|
|
7990
|
-
COALESCE(
|
|
7991
|
-
client_user.photo_id,
|
|
7992
|
-
(SELECT u2.photo_id
|
|
7993
|
-
FROM person p2
|
|
7994
|
-
JOIN person_user pu2 ON pu2.person_id = p2.id
|
|
7995
|
-
JOIN "user" u2 ON u2.id = pu2.user_id
|
|
7996
|
-
WHERE p.client_person_id IS NULL
|
|
7997
|
-
AND LOWER(TRIM(p2.name)) = LOWER(TRIM(p.client_name))
|
|
7998
|
-
ORDER BY pu2.id ASC
|
|
7999
|
-
LIMIT 1)
|
|
8000
|
-
) AS "clientUserPhotoId",
|
|
8001
7786
|
p.summary,
|
|
8002
7787
|
p.status,
|
|
8003
7788
|
p.progress_percent AS "progressPercent",
|
|
@@ -8011,20 +7796,12 @@ let OperationsService = OperationsService_1 = class OperationsService {
|
|
|
8011
7796
|
LEFT JOIN operations_contract c ON c.id = p.contract_id
|
|
8012
7797
|
LEFT JOIN operations_collaborator m ON m.id = p.manager_collaborator_id
|
|
8013
7798
|
LEFT JOIN person cp ON cp.id = p.client_person_id
|
|
8014
|
-
LEFT JOIN LATERAL (
|
|
8015
|
-
SELECT u.photo_id
|
|
8016
|
-
FROM person_user pu
|
|
8017
|
-
JOIN "user" u ON u.id = pu.user_id
|
|
8018
|
-
WHERE pu.person_id = p.client_person_id
|
|
8019
|
-
ORDER BY pu.id ASC
|
|
8020
|
-
LIMIT 1
|
|
8021
|
-
) client_user ON TRUE
|
|
8022
7799
|
LEFT JOIN operations_project_assignment pa
|
|
8023
7800
|
ON pa.project_id = p.id
|
|
8024
7801
|
AND pa.deleted_at IS NULL
|
|
8025
7802
|
AND pa.status IN ('planned', 'active')
|
|
8026
7803
|
WHERE ${whereClause}
|
|
8027
|
-
GROUP BY p.id, c.id, m.id, cp.id
|
|
7804
|
+
GROUP BY p.id, c.id, m.id, cp.id`;
|
|
8028
7805
|
if (!pagination) {
|
|
8029
7806
|
return this.queryRows(`${baseQuery} ORDER BY p.name ASC`, params);
|
|
8030
7807
|
}
|