@m6d/cortex-server 1.6.0 → 1.8.0
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/index.d.ts +1 -1
- package/dist/src/{adapters → lib/adapters}/database.d.ts +16 -1
- package/dist/src/lib/ai/context/compressor.d.ts +18 -0
- package/dist/src/{ai → lib/ai}/context/index.d.ts +2 -1
- package/dist/src/lib/ai/context/intra-turn-compressor.d.ts +24 -0
- package/dist/src/{ai → lib/ai}/context/types.d.ts +2 -0
- package/dist/src/lib/config.d.ts +153 -0
- package/dist/src/{db → lib/db}/schema.d.ts +104 -1
- package/dist/src/{index.d.ts → lib/index.d.ts} +2 -2
- package/dist/src/{types.d.ts → lib/types.d.ts} +15 -14
- package/index.ts +1 -1
- package/package.json +8 -3
- package/src/{adapters → lib/adapters}/database.ts +20 -1
- package/src/{adapters → lib/adapters}/minio.ts +2 -1
- package/src/{adapters → lib/adapters}/mssql.ts +38 -2
- package/src/lib/ai/context/compressor.ts +259 -0
- package/src/{ai → lib/ai}/context/index.ts +6 -1
- package/src/lib/ai/context/intra-turn-compressor.ts +264 -0
- package/src/{ai → lib/ai}/context/types.ts +4 -1
- package/src/{ai → lib/ai}/index.ts +114 -13
- package/src/lib/ai/prompt.ts +354 -0
- package/src/{ai → lib/ai}/tools/execute-code.tool.ts +5 -2
- package/src/{auth → lib/auth}/middleware.ts +7 -0
- package/src/lib/config.ts +181 -0
- package/src/{db/migrations/20260309012148_cloudy_maria_hill → lib/db/migrations/20260326231647_nice_speedball}/migration.sql +12 -0
- package/src/{db/migrations/20260309012148_cloudy_maria_hill → lib/db/migrations/20260326231647_nice_speedball}/snapshot.json +106 -1
- package/src/{db → lib/db}/schema.ts +15 -2
- package/src/{factory.ts → lib/factory.ts} +1 -0
- package/src/{index.ts → lib/index.ts} +3 -1
- package/src/{routes → lib/routes}/files.ts +9 -2
- package/src/{routes → lib/routes}/threads.ts +8 -1
- package/src/{types.ts → lib/types.ts} +16 -15
- package/src/sample/db/client.ts +9 -0
- package/src/sample/db/migrations/20260411023125_rich_purple_man/migration.sql +5 -0
- package/src/sample/db/migrations/20260411023125_rich_purple_man/snapshot.json +50 -0
- package/src/sample/db/schema.ts +10 -0
- package/src/sample/domains/account/concepts/session.concept.ts +17 -0
- package/src/sample/domains/account/endpoints/listCurrentSessions.endpoint.ts +31 -0
- package/src/sample/domains/account/endpoints/revokeAllOtherSessions.endpoint.ts +22 -0
- package/src/sample/domains/account/endpoints/revokeCurrentSession.endpoint.ts +33 -0
- package/src/sample/domains/account/index.ts +18 -0
- package/src/sample/domains/appraisals/concepts/appraisalCycle.concept.ts +15 -0
- package/src/sample/domains/appraisals/concepts/appraisalRecord.concept.ts +20 -0
- package/src/sample/domains/appraisals/concepts/appraisalRecordCompetency.concept.ts +10 -0
- package/src/sample/domains/appraisals/concepts/appraisalRecordFunctionalRequirement.concept.ts +10 -0
- package/src/sample/domains/appraisals/concepts/appraisalRecordGoal.concept.ts +17 -0
- package/src/sample/domains/appraisals/endpoints/getAppraisalRecordById.endpoint.ts +321 -0
- package/src/sample/domains/appraisals/endpoints/getAppraisalRecordCompetencies.endpoint.ts +120 -0
- package/src/sample/domains/appraisals/endpoints/getAppraisalRecordFunctionalRequirements.endpoint.ts +126 -0
- package/src/sample/domains/appraisals/endpoints/getAppraisalRecordGoals.endpoint.ts +104 -0
- package/src/sample/domains/appraisals/endpoints/getAppraisalRecordScore.endpoint.ts +58 -0
- package/src/sample/domains/appraisals/endpoints/listAppraisalCyclesSimple.endpoint.ts +52 -0
- package/src/sample/domains/appraisals/endpoints/listAppraisalRecords.endpoint.ts +245 -0
- package/src/sample/domains/appraisals/endpoints/listAppraisalTemplatesSimple.endpoint.ts +52 -0
- package/src/sample/domains/appraisals/index.ts +40 -0
- package/src/sample/domains/appraisals/rules/appraisalRecordScoping.rule.ts +7 -0
- package/src/sample/domains/attendance/concepts/attendancePermission.concept.ts +17 -0
- package/src/sample/domains/attendance/concepts/attendanceTransaction.concept.ts +17 -0
- package/src/sample/domains/attendance/concepts/publicHoliday.concept.ts +10 -0
- package/src/sample/domains/attendance/concepts/punch.concept.ts +19 -0
- package/src/sample/domains/attendance/endpoints/getAttendanceTransactionById.endpoint.ts +444 -0
- package/src/sample/domains/attendance/endpoints/getCurrentAttendanceProfile.endpoint.ts +886 -0
- package/src/sample/domains/attendance/endpoints/getCurrentAttendanceStatistics.endpoint.ts +49 -0
- package/src/sample/domains/attendance/endpoints/listAttendancePermissions.endpoint.ts +176 -0
- package/src/sample/domains/attendance/endpoints/listAttendanceTransactionStates.endpoint.ts +26 -0
- package/src/sample/domains/attendance/endpoints/listAttendanceTransactions.endpoint.ts +373 -0
- package/src/sample/domains/attendance/endpoints/listPublicHolidaysSimple.endpoint.ts +52 -0
- package/src/sample/domains/attendance/endpoints/listPunchTypes.endpoint.ts +25 -0
- package/src/sample/domains/attendance/endpoints/listPunches.endpoint.ts +178 -0
- package/src/sample/domains/attendance/index.ts +41 -0
- package/src/sample/domains/attendance/services/attendancePermissions.service.ts +15 -0
- package/src/sample/domains/employees/concepts/employee.concept.ts +20 -0
- package/src/sample/domains/employees/concepts/employeeBankAccount.concept.ts +19 -0
- package/src/sample/domains/employees/concepts/employeeChild.concept.ts +19 -0
- package/src/sample/domains/employees/concepts/employeeDocument.concept.ts +21 -0
- package/src/sample/domains/employees/concepts/employeeEvent.concept.ts +21 -0
- package/src/sample/domains/employees/concepts/employeeExperience.concept.ts +18 -0
- package/src/sample/domains/employees/concepts/employeeJobLevelChange.concept.ts +21 -0
- package/src/sample/domains/employees/concepts/employeeMedal.concept.ts +20 -0
- package/src/sample/domains/employees/concepts/employeeQualification.concept.ts +20 -0
- package/src/sample/domains/employees/concepts/employeeSpouse.concept.ts +21 -0
- package/src/sample/domains/employees/concepts/employeeViolation.concept.ts +19 -0
- package/src/sample/domains/employees/endpoints/getCurrentEmployee.endpoint.ts +1651 -0
- package/src/sample/domains/employees/endpoints/getCurrentIdentity.endpoint.ts +197 -0
- package/src/sample/domains/employees/endpoints/getCurrentManagers.endpoint.ts +142 -0
- package/src/sample/domains/employees/endpoints/getEmployeeById.endpoint.ts +1659 -0
- package/src/sample/domains/employees/endpoints/getEmployeeStatistics.endpoint.ts +43 -0
- package/src/sample/domains/employees/endpoints/listBankAccounts.endpoint.ts +223 -0
- package/src/sample/domains/employees/endpoints/listChildren.endpoint.ts +211 -0
- package/src/sample/domains/employees/endpoints/listDocuments.endpoint.ts +222 -0
- package/src/sample/domains/employees/endpoints/listEmployeesSimple.endpoint.ts +156 -0
- package/src/sample/domains/employees/endpoints/listEvents.endpoint.ts +120 -0
- package/src/sample/domains/employees/endpoints/listExperiences.endpoint.ts +188 -0
- package/src/sample/domains/employees/endpoints/listJobLevelChanges.endpoint.ts +240 -0
- package/src/sample/domains/employees/endpoints/listMedals.endpoint.ts +266 -0
- package/src/sample/domains/employees/endpoints/listQualifications.endpoint.ts +265 -0
- package/src/sample/domains/employees/endpoints/listSpouses.endpoint.ts +278 -0
- package/src/sample/domains/employees/endpoints/listViolations.endpoint.ts +245 -0
- package/src/sample/domains/employees/index.ts +75 -0
- package/src/sample/domains/employees/services/employees.service.ts +181 -0
- package/src/sample/domains/index.ts +10 -0
- package/src/sample/domains/leaves/concepts/leave.concept.ts +21 -0
- package/src/sample/domains/leaves/concepts/leaveBalance.concept.ts +17 -0
- package/src/sample/domains/leaves/concepts/leaveBalanceTransaction.concept.ts +16 -0
- package/src/sample/domains/leaves/concepts/leaveType.concept.ts +13 -0
- package/src/sample/domains/leaves/concepts/leaveTypes.concept.ts +205 -0
- package/src/sample/domains/leaves/endpoints/getBalance.endpoint.ts +53 -0
- package/src/sample/domains/leaves/endpoints/getLeaveById.endpoint.ts +53 -0
- package/src/sample/domains/leaves/endpoints/listBalanceTransactions.endpoint.ts +196 -0
- package/src/sample/domains/leaves/endpoints/listBalanceTypes.endpoint.ts +26 -0
- package/src/sample/domains/leaves/endpoints/listBalances.endpoint.ts +201 -0
- package/src/sample/domains/leaves/endpoints/listLeaveTypes.endpoint.ts +28 -0
- package/src/sample/domains/leaves/endpoints/listLeaves.endpoint.ts +234 -0
- package/src/sample/domains/leaves/index.ts +38 -0
- package/src/sample/domains/leaves/services/leaveRequests.service.ts +232 -0
- package/src/sample/domains/notifications/concepts/notification.concept.ts +19 -0
- package/src/sample/domains/notifications/endpoints/countMyNotifications.endpoint.ts +21 -0
- package/src/sample/domains/notifications/endpoints/getMyNotification.endpoint.ts +57 -0
- package/src/sample/domains/notifications/endpoints/listMyNotifications.endpoint.ts +59 -0
- package/src/sample/domains/notifications/endpoints/markMyNotificationAsRead.endpoint.ts +32 -0
- package/src/sample/domains/notifications/index.ts +20 -0
- package/src/sample/domains/payroll/concepts/payslip.concept.ts +18 -0
- package/src/sample/domains/payroll/concepts/salaryCertificate.concept.ts +17 -0
- package/src/sample/domains/payroll/concepts/salaryCertificateRequestingEntity.concept.ts +8 -0
- package/src/sample/domains/payroll/endpoints/getPayslipById.endpoint.ts +238 -0
- package/src/sample/domains/payroll/endpoints/listPayslips.endpoint.ts +216 -0
- package/src/sample/domains/payroll/endpoints/listSalaryCertificateLanguages.endpoint.ts +25 -0
- package/src/sample/domains/payroll/endpoints/listSalaryCertificateRequestingEntities.endpoint.ts +62 -0
- package/src/sample/domains/payroll/endpoints/listSalaryCertificateTypes.endpoint.ts +24 -0
- package/src/sample/domains/payroll/endpoints/listSalaryCertificates.endpoint.ts +122 -0
- package/src/sample/domains/payroll/endpoints/previewSalaryCertificate.endpoint.ts +45 -0
- package/src/sample/domains/payroll/index.ts +32 -0
- package/src/sample/domains/payroll/rules/payrollEmployeeContext.rule.ts +7 -0
- package/src/sample/domains/payroll/services/salaryCertificates.service.ts +15 -0
- package/src/sample/domains/servicing/concepts/service.concept.ts +6 -0
- package/src/sample/domains/servicing/concepts/serviceRequest.concept.ts +12 -0
- package/src/sample/domains/servicing/concepts/serviceRequestApproval.concept.ts +9 -0
- package/src/sample/domains/servicing/endpoints/cancelServiceRequest.endpoint.ts +21 -0
- package/src/sample/domains/servicing/endpoints/createServiceRequest.endpoint.ts +511 -0
- package/src/sample/domains/servicing/endpoints/getServiceRequest.endpoint.ts +352 -0
- package/src/sample/domains/servicing/endpoints/getServiceRequestFormItems.endpoint.ts +219 -0
- package/src/sample/domains/servicing/endpoints/getServiceRequestTransactionFormItems.endpoint.ts +216 -0
- package/src/sample/domains/servicing/endpoints/getServiceStates.endpoint.ts +47 -0
- package/src/sample/domains/servicing/endpoints/invokeServiceRequestAction.endpoint.ts +139 -0
- package/src/sample/domains/servicing/endpoints/listServiceRequests.endpoint.ts +292 -0
- package/src/sample/domains/servicing/endpoints/listServices.endpoint.ts +108 -0
- package/src/sample/domains/servicing/endpoints/updateServiceRequest.endpoint.ts +355 -0
- package/src/sample/domains/servicing/index.ts +44 -0
- package/src/sample/domains/servicing/rules/checkValidActions.rule.ts +7 -0
- package/src/sample/domains/servicing/rules/createServiceRequest.rule.ts +7 -0
- package/src/sample/domains/servicing/rules/filterServiceRequestsByState.rule.ts +7 -0
- package/src/sample/domains/servicing/rules/passingOptionFields.rule.ts +7 -0
- package/src/sample/domains/shared/rules/pagination.rule.ts +7 -0
- package/src/sample/domains/suggestions/concepts/suggestion.concept.ts +19 -0
- package/src/sample/domains/suggestions/concepts/suggestionCategory.concept.ts +7 -0
- package/src/sample/domains/suggestions/concepts/suggestionImpactLevel.concept.ts +7 -0
- package/src/sample/domains/suggestions/endpoints/createSuggestion.endpoint.ts +705 -0
- package/src/sample/domains/suggestions/endpoints/deleteSuggestion.endpoint.ts +32 -0
- package/src/sample/domains/suggestions/endpoints/getSuggestionById.endpoint.ts +635 -0
- package/src/sample/domains/suggestions/endpoints/listSuggestionCategories.endpoint.ts +62 -0
- package/src/sample/domains/suggestions/endpoints/listSuggestionImpactLevels.endpoint.ts +62 -0
- package/src/sample/domains/suggestions/endpoints/listSuggestionStates.endpoint.ts +24 -0
- package/src/sample/domains/suggestions/endpoints/listSuggestions.endpoint.ts +132 -0
- package/src/sample/domains/suggestions/endpoints/updateSuggestion.endpoint.ts +690 -0
- package/src/sample/domains/suggestions/endpoints/updateSuggestionState.endpoint.ts +39 -0
- package/src/sample/domains/suggestions/index.ts +34 -0
- package/src/sample/domains/suggestions/rules/suggestionScope.rule.ts +7 -0
- package/src/sample/domains/surveys/concepts/survey.concept.ts +10 -0
- package/src/sample/domains/surveys/concepts/surveyResponse.concept.ts +14 -0
- package/src/sample/domains/surveys/endpoints/getSurveyResponseById.endpoint.ts +131 -0
- package/src/sample/domains/surveys/endpoints/getTargetedSurvey.endpoint.ts +129 -0
- package/src/sample/domains/surveys/endpoints/listTargetedSurveys.endpoint.ts +160 -0
- package/src/sample/domains/surveys/endpoints/respondToSurvey.endpoint.ts +144 -0
- package/src/sample/domains/surveys/index.ts +21 -0
- package/src/sample/drizzle.config.ts +11 -0
- package/src/sample/index.bak.ts +341 -0
- package/src/sample/index.ts +318 -0
- package/src/sample/official-statements/defaults.ts +57 -0
- package/src/sample/official-statements/routes.ts +137 -0
- package/src/sample/official-statements/service.ts +148 -0
- package/src/sample/official-statements/types.ts +23 -0
- package/dist/src/ai/context/compressor.d.ts +0 -7
- package/dist/src/ai/tools/call-endpoint.tool.d.ts +0 -7
- package/dist/src/config.d.ts +0 -159
- package/src/ai/context/compressor.ts +0 -47
- package/src/ai/prompt.ts +0 -126
- package/src/ai/tools/call-endpoint.tool.ts +0 -89
- package/src/config.ts +0 -164
- package/src/db/migrations/20260315000000_add_context_meta/migration.sql +0 -1
- package/dist/src/{adapters → lib/adapters}/minio.d.ts +0 -0
- package/dist/src/{adapters → lib/adapters}/mssql.d.ts +0 -0
- package/dist/src/{adapters → lib/adapters}/storage.d.ts +0 -0
- package/dist/src/{ai → lib/ai}/active-streams.d.ts +0 -0
- package/dist/src/{ai → lib/ai}/context/builder.d.ts +0 -0
- package/dist/src/{ai → lib/ai}/context/summarizer.d.ts +0 -0
- package/dist/src/{ai → lib/ai}/context/token-estimator.d.ts +0 -0
- package/dist/src/{ai → lib/ai}/fetch.d.ts +0 -0
- package/dist/src/{ai → lib/ai}/helpers.d.ts +0 -0
- package/dist/src/{ai → lib/ai}/index.d.ts +0 -0
- package/dist/src/{ai → lib/ai}/interceptors/request-interceptor.d.ts +0 -0
- package/dist/src/{ai → lib/ai}/prompt.d.ts +0 -0
- package/dist/src/{ai → lib/ai}/tools/capture-files.tool.d.ts +0 -0
- package/dist/src/{ai → lib/ai}/tools/execute-code.tool.d.ts +0 -0
- package/dist/src/{ai → lib/ai}/tools/query-graph.tool.d.ts +0 -0
- package/dist/src/{auth → lib/auth}/middleware.d.ts +0 -0
- package/dist/src/{cli → lib/cli}/extract-endpoints.d.ts +0 -0
- package/dist/src/{db → lib/db}/migrate.d.ts +0 -0
- package/dist/src/{factory.d.ts → lib/factory.d.ts} +0 -0
- package/dist/src/{graph → lib/graph}/expand-domains.d.ts +0 -0
- package/dist/src/{graph → lib/graph}/generate-cypher.d.ts +0 -0
- package/dist/src/{graph → lib/graph}/helpers.d.ts +2 -2
- /package/dist/src/{graph → lib/graph}/index.d.ts +0 -0
- /package/dist/src/{graph → lib/graph}/neo4j.d.ts +0 -0
- /package/dist/src/{graph → lib/graph}/resolver.d.ts +0 -0
- /package/dist/src/{graph → lib/graph}/seed.d.ts +0 -0
- /package/dist/src/{graph → lib/graph}/types.d.ts +0 -0
- /package/dist/src/{graph → lib/graph}/validate.d.ts +0 -0
- /package/dist/src/{routes → lib/routes}/chat.d.ts +0 -0
- /package/dist/src/{routes → lib/routes}/files.d.ts +0 -0
- /package/dist/src/{routes → lib/routes}/index.d.ts +0 -0
- /package/dist/src/{routes → lib/routes}/threads.d.ts +0 -0
- /package/dist/src/{routes → lib/routes}/ws.d.ts +0 -0
- /package/dist/src/{ws → lib/ws}/connections.d.ts +0 -0
- /package/dist/src/{ws → lib/ws}/events.d.ts +0 -0
- /package/dist/src/{ws → lib/ws}/index.d.ts +0 -0
- /package/dist/src/{ws → lib/ws}/notify.d.ts +0 -0
- /package/src/{adapters → lib/adapters}/storage.ts +0 -0
- /package/src/{ai → lib/ai}/active-streams.ts +0 -0
- /package/src/{ai → lib/ai}/context/builder.ts +0 -0
- /package/src/{ai → lib/ai}/context/summarizer.ts +0 -0
- /package/src/{ai → lib/ai}/context/token-estimator.ts +0 -0
- /package/src/{ai → lib/ai}/fetch.ts +0 -0
- /package/src/{ai → lib/ai}/helpers.ts +0 -0
- /package/src/{ai → lib/ai}/interceptors/request-interceptor.ts +0 -0
- /package/src/{ai → lib/ai}/tools/capture-files.tool.ts +0 -0
- /package/src/{ai → lib/ai}/tools/query-graph.tool.ts +0 -0
- /package/src/{cli → lib/cli}/extract-endpoints.ts +0 -0
- /package/src/{db → lib/db}/migrate.ts +0 -0
- /package/src/{graph → lib/graph}/expand-domains.ts +0 -0
- /package/src/{graph → lib/graph}/generate-cypher.ts +0 -0
- /package/src/{graph → lib/graph}/helpers.ts +0 -0
- /package/src/{graph → lib/graph}/index.ts +0 -0
- /package/src/{graph → lib/graph}/neo4j.ts +0 -0
- /package/src/{graph → lib/graph}/resolver.ts +0 -0
- /package/src/{graph → lib/graph}/seed.ts +0 -0
- /package/src/{graph → lib/graph}/types.ts +0 -0
- /package/src/{graph → lib/graph}/validate.ts +0 -0
- /package/src/{routes → lib/routes}/chat.ts +0 -0
- /package/src/{routes → lib/routes}/index.ts +0 -0
- /package/src/{routes → lib/routes}/ws.ts +0 -0
- /package/src/{ws → lib/ws}/connections.ts +0 -0
- /package/src/{ws → lib/ws}/events.ts +0 -0
- /package/src/{ws → lib/ws}/index.ts +0 -0
- /package/src/{ws → lib/ws}/notify.ts +0 -0
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import { defineService } from "@m6d/cortex-server";
|
|
2
|
+
import type { ConceptDef } from "@m6d/cortex-server";
|
|
3
|
+
import { employeeConcept } from "../concepts/employee.concept";
|
|
4
|
+
|
|
5
|
+
function employeeService(config: {
|
|
6
|
+
name: string;
|
|
7
|
+
builtInId: string;
|
|
8
|
+
belongsTo: ConceptDef;
|
|
9
|
+
description: string;
|
|
10
|
+
intakeMode: "conversational" | "form";
|
|
11
|
+
}) {
|
|
12
|
+
return defineService({
|
|
13
|
+
name: config.name,
|
|
14
|
+
builtInId: config.builtInId,
|
|
15
|
+
belongsTo: config.belongsTo,
|
|
16
|
+
description: config.description,
|
|
17
|
+
metadata: {
|
|
18
|
+
intakeMode: config.intakeMode,
|
|
19
|
+
},
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export const detailsUpdateService = employeeService({
|
|
24
|
+
name: "Details update request",
|
|
25
|
+
builtInId: "services:details_update",
|
|
26
|
+
belongsTo: employeeConcept,
|
|
27
|
+
description:
|
|
28
|
+
"Request to update personal details such as name change, ID renewal, passport renewal, acquiring qualification, spouse employment or resignation, phone number, or home address.",
|
|
29
|
+
intakeMode: "form",
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
export const changeJobTitleService = employeeService({
|
|
33
|
+
name: "Change job title request",
|
|
34
|
+
builtInId: "services:change_job_title",
|
|
35
|
+
belongsTo: employeeConcept,
|
|
36
|
+
description:
|
|
37
|
+
"Request to change job title. Requires selecting the new job title and providing a reason.",
|
|
38
|
+
intakeMode: "conversational",
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
export const changeNationalityService = employeeService({
|
|
42
|
+
name: "Change nationality request",
|
|
43
|
+
builtInId: "services:change_nationality",
|
|
44
|
+
belongsTo: employeeConcept,
|
|
45
|
+
description: "Request to change nationality on employee record.",
|
|
46
|
+
intakeMode: "form",
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
export const changeMaritalStatusService = employeeService({
|
|
50
|
+
name: "Change marital status request",
|
|
51
|
+
builtInId: "services:change_marital_status",
|
|
52
|
+
belongsTo: employeeConcept,
|
|
53
|
+
description: "Request to change marital status due to marriage, divorce, or death of spouse.",
|
|
54
|
+
intakeMode: "form",
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
export const medalService = employeeService({
|
|
58
|
+
name: "Decoration, medal, badge, or insignia request",
|
|
59
|
+
builtInId: "services:medal",
|
|
60
|
+
belongsTo: employeeConcept,
|
|
61
|
+
description: "Request for a decoration, medal, badge, or insignia award.",
|
|
62
|
+
intakeMode: "conversational",
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
export const grievanceService = employeeService({
|
|
66
|
+
name: "Grievance request",
|
|
67
|
+
builtInId: "services:grievance",
|
|
68
|
+
belongsTo: employeeConcept,
|
|
69
|
+
description: "Submit a grievance or complaint.",
|
|
70
|
+
intakeMode: "conversational",
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
export const serviceInclusionService = employeeService({
|
|
74
|
+
name: "Service inclusion request",
|
|
75
|
+
builtInId: "services:service_inclusion",
|
|
76
|
+
belongsTo: employeeConcept,
|
|
77
|
+
description:
|
|
78
|
+
"Request to include previous work service. Requires previous work entity name, employment title, and start date.",
|
|
79
|
+
intakeMode: "conversational",
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
export const socialAllowanceAdditionService = employeeService({
|
|
83
|
+
name: "Social allowance addition request",
|
|
84
|
+
builtInId: "services:social_allowance_addition",
|
|
85
|
+
belongsTo: employeeConcept,
|
|
86
|
+
description: "Request to add a social allowance.",
|
|
87
|
+
intakeMode: "conversational",
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
export const socialAllowanceWithholdingService = employeeService({
|
|
91
|
+
name: "Social allowance withholding request",
|
|
92
|
+
builtInId: "services:social_allowance_withholding",
|
|
93
|
+
belongsTo: employeeConcept,
|
|
94
|
+
description: "Request to withhold a social allowance.",
|
|
95
|
+
intakeMode: "conversational",
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
export const supervisorMeetingService = employeeService({
|
|
99
|
+
name: "Supervisor meeting request",
|
|
100
|
+
builtInId: "services:supervisor_meeting",
|
|
101
|
+
belongsTo: employeeConcept,
|
|
102
|
+
description: "Request a meeting with a supervisor.",
|
|
103
|
+
intakeMode: "conversational",
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
export const additionOrWithholdingAllowanceService = employeeService({
|
|
107
|
+
name: "Addition or withholding allowance request",
|
|
108
|
+
builtInId: "services:addition_or_withholding_allowance",
|
|
109
|
+
belongsTo: employeeConcept,
|
|
110
|
+
description: "Request to add or withhold an allowance.",
|
|
111
|
+
intakeMode: "conversational",
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
export const medicalExemptionService = employeeService({
|
|
115
|
+
name: "Medical exemption request",
|
|
116
|
+
builtInId: "services:medical_exemption",
|
|
117
|
+
belongsTo: employeeConcept,
|
|
118
|
+
description: "Request a medical exemption.",
|
|
119
|
+
intakeMode: "conversational",
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
export const pursueOfHigherEducationService = employeeService({
|
|
123
|
+
name: "Pursue of higher education request",
|
|
124
|
+
builtInId: "services:pursue_of_higher_education",
|
|
125
|
+
belongsTo: employeeConcept,
|
|
126
|
+
description: "Request to pursue higher education.",
|
|
127
|
+
intakeMode: "conversational",
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
export const renewOrReplaceMilitaryCardService = employeeService({
|
|
131
|
+
name: "Renew or replace military card request",
|
|
132
|
+
builtInId: "services:renew_or_replace_military_card",
|
|
133
|
+
belongsTo: employeeConcept,
|
|
134
|
+
description: "Request to renew or replace a military card.",
|
|
135
|
+
intakeMode: "conversational",
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
export const internalTransferService = employeeService({
|
|
139
|
+
name: "Internal transfer request",
|
|
140
|
+
builtInId: "services:internal_transfer",
|
|
141
|
+
belongsTo: employeeConcept,
|
|
142
|
+
description: "Request an internal transfer to a different department.",
|
|
143
|
+
intakeMode: "conversational",
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
export const externalEntityAffiliationService = employeeService({
|
|
147
|
+
name: "External entity affiliation request",
|
|
148
|
+
builtInId: "services:external_entity_affiliation",
|
|
149
|
+
belongsTo: employeeConcept,
|
|
150
|
+
description: "Request for affiliation with an external entity.",
|
|
151
|
+
intakeMode: "conversational",
|
|
152
|
+
});
|
|
153
|
+
|
|
154
|
+
export const employeeTerminationService = employeeService({
|
|
155
|
+
name: "End of service request",
|
|
156
|
+
builtInId: "services:employee_termination",
|
|
157
|
+
belongsTo: employeeConcept,
|
|
158
|
+
description:
|
|
159
|
+
"Request for end of service (termination). Covers various termination types including resignation, retirement, and other end-of-service scenarios.",
|
|
160
|
+
intakeMode: "form",
|
|
161
|
+
});
|
|
162
|
+
|
|
163
|
+
export const employeeServices = [
|
|
164
|
+
detailsUpdateService,
|
|
165
|
+
changeJobTitleService,
|
|
166
|
+
changeNationalityService,
|
|
167
|
+
changeMaritalStatusService,
|
|
168
|
+
medalService,
|
|
169
|
+
grievanceService,
|
|
170
|
+
serviceInclusionService,
|
|
171
|
+
socialAllowanceAdditionService,
|
|
172
|
+
socialAllowanceWithholdingService,
|
|
173
|
+
supervisorMeetingService,
|
|
174
|
+
additionOrWithholdingAllowanceService,
|
|
175
|
+
medicalExemptionService,
|
|
176
|
+
pursueOfHigherEducationService,
|
|
177
|
+
renewOrReplaceMilitaryCardService,
|
|
178
|
+
internalTransferService,
|
|
179
|
+
externalEntityAffiliationService,
|
|
180
|
+
employeeTerminationService,
|
|
181
|
+
];
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * from "./employees";
|
|
2
|
+
export * from "./leaves";
|
|
3
|
+
export * from "./servicing";
|
|
4
|
+
export * from "./attendance";
|
|
5
|
+
export * from "./appraisals";
|
|
6
|
+
export * from "./account";
|
|
7
|
+
export * from "./notifications";
|
|
8
|
+
export * from "./suggestions";
|
|
9
|
+
export * from "./surveys";
|
|
10
|
+
export * from "./payroll";
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { defineConcept } from "@m6d/cortex-server";
|
|
2
|
+
import { paginationRule } from "../../shared/rules/pagination.rule";
|
|
3
|
+
|
|
4
|
+
export const leaveConcept = defineConcept({
|
|
5
|
+
name: "Leave",
|
|
6
|
+
description:
|
|
7
|
+
"Applying for or submitting a new leave request. Used when an employee wants to take time off work. Includes start date, end date and leave type.",
|
|
8
|
+
aliases: [
|
|
9
|
+
"leave",
|
|
10
|
+
"leave application",
|
|
11
|
+
"time off request",
|
|
12
|
+
"leave",
|
|
13
|
+
"my leaves",
|
|
14
|
+
"طلب إجازة",
|
|
15
|
+
"إجازاتي",
|
|
16
|
+
"طلبات الإجازة",
|
|
17
|
+
"أريد إجازة",
|
|
18
|
+
"أبي أطلب إجازة",
|
|
19
|
+
],
|
|
20
|
+
governedBy: [paginationRule],
|
|
21
|
+
});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { defineConcept } from "@m6d/cortex-server";
|
|
2
|
+
|
|
3
|
+
export const leaveBalanceConcept = defineConcept({
|
|
4
|
+
name: "LeaveBalance",
|
|
5
|
+
description:
|
|
6
|
+
"Employee leave balance — the number of available/remaining leave days an employee has for each leave type. Tracks accrued, used, and remaining days. رصيد الإجازات",
|
|
7
|
+
aliases: [
|
|
8
|
+
"leave balance",
|
|
9
|
+
"remaining leaves",
|
|
10
|
+
"available leave days",
|
|
11
|
+
"رصيد الإجازات",
|
|
12
|
+
"رصيد إجازاتي",
|
|
13
|
+
"كم باقي لي إجازة",
|
|
14
|
+
"كم يوم إجازة عندي",
|
|
15
|
+
"أيام الإجازة المتبقية",
|
|
16
|
+
],
|
|
17
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { defineConcept } from "@m6d/cortex-server";
|
|
2
|
+
import { paginationRule } from "../../shared/rules/pagination.rule";
|
|
3
|
+
|
|
4
|
+
export const leaveBalanceTransactionConcept = defineConcept({
|
|
5
|
+
name: "LeaveBalanceTransaction",
|
|
6
|
+
description:
|
|
7
|
+
"A transaction record showing additions to or deductions from an employee's leave balance. Tracks the history of balance changes. حركات رصيد الإجازات",
|
|
8
|
+
aliases: [
|
|
9
|
+
"balance transaction",
|
|
10
|
+
"leave balance history",
|
|
11
|
+
"balance change",
|
|
12
|
+
"حركات الرصيد",
|
|
13
|
+
"سجل رصيد الإجازات",
|
|
14
|
+
],
|
|
15
|
+
governedBy: [paginationRule],
|
|
16
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { defineConcept } from "@m6d/cortex-server";
|
|
2
|
+
|
|
3
|
+
export const leaveTypeConcept = defineConcept({
|
|
4
|
+
name: "LeaveType",
|
|
5
|
+
description: "The category or type of leave being requested or referenced.",
|
|
6
|
+
aliases: [
|
|
7
|
+
"leave type",
|
|
8
|
+
"types of leave",
|
|
9
|
+
"أنواع الإجازات",
|
|
10
|
+
"ما هي أنواع الإجازات",
|
|
11
|
+
"leave categories",
|
|
12
|
+
],
|
|
13
|
+
});
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
import { defineConcept } from "@m6d/cortex-server";
|
|
2
|
+
import { leaveBalanceConcept } from "./leaveBalance.concept";
|
|
3
|
+
import { leaveConcept } from "./leave.concept";
|
|
4
|
+
|
|
5
|
+
export const annualLeaveConcept = defineConcept({
|
|
6
|
+
name: "AnnualLeave",
|
|
7
|
+
description:
|
|
8
|
+
"Annual leave — regular vacation days that accumulate yearly. The most commonly used leave type. Requires balance check. Cannot apply in the past.",
|
|
9
|
+
aliases: [
|
|
10
|
+
"annual leave",
|
|
11
|
+
"vacation",
|
|
12
|
+
"yearly leave",
|
|
13
|
+
"إجازة سنوية",
|
|
14
|
+
"إجازتي السنوية",
|
|
15
|
+
"أبي أطلب إجازة سنوية",
|
|
16
|
+
],
|
|
17
|
+
parentConcept: leaveConcept,
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
export const sickLeaveConcept = defineConcept({
|
|
21
|
+
name: "SickLeave",
|
|
22
|
+
description:
|
|
23
|
+
"Sick leave — leave taken due to illness or medical condition. Less than 5 days needs basic approval; 5+ days requires medical committee approval and medical certificate.",
|
|
24
|
+
aliases: [
|
|
25
|
+
"sick leave",
|
|
26
|
+
"medical leave",
|
|
27
|
+
"illness leave",
|
|
28
|
+
"إجازة مرضية",
|
|
29
|
+
"مريض",
|
|
30
|
+
"أبي إجازة مرضية",
|
|
31
|
+
],
|
|
32
|
+
parentConcept: leaveConcept,
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
export const casualLeaveConcept = defineConcept({
|
|
36
|
+
name: "CasualLeave",
|
|
37
|
+
description:
|
|
38
|
+
"Casual leave — short-notice leave for urgent personal matters. Must be taken today (not in past or future). Cannot have adjacent leaves. Requires balance. Not available for all job classifications.",
|
|
39
|
+
aliases: ["casual leave", "urgent personal leave", "إجازة اضطرارية", "إجازة طارئة"],
|
|
40
|
+
parentConcept: leaveConcept,
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
export const maternityLeaveConcept = defineConcept({
|
|
44
|
+
name: "MaternityLeave",
|
|
45
|
+
description:
|
|
46
|
+
"Maternity leave — 90 days fixed balance for female employees after childbirth. Requires date of birth and medical report. Only female employees.",
|
|
47
|
+
aliases: ["maternity leave", "إجازة أمومة", "إجازة وضع"],
|
|
48
|
+
parentConcept: leaveConcept,
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
export const pilgrimageLeaveConcept = defineConcept({
|
|
52
|
+
name: "PilgrimageLeave",
|
|
53
|
+
description: "Pilgrimage leave (Hajj leave) — 30 days fixed balance for Hajj pilgrimage.",
|
|
54
|
+
aliases: ["pilgrimage leave", "hajj leave", "إجازة حج"],
|
|
55
|
+
parentConcept: leaveConcept,
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
export const encashLeaveDaysConcept = defineConcept({
|
|
59
|
+
name: "EncashLeaveDays",
|
|
60
|
+
description:
|
|
61
|
+
"Leave encashment — converting unused leave days into cash payment. Requires specifying the number of days and leave type.",
|
|
62
|
+
aliases: [
|
|
63
|
+
"encash leave",
|
|
64
|
+
"leave encashment",
|
|
65
|
+
"cash out leave",
|
|
66
|
+
"بدل إجازة",
|
|
67
|
+
"صرف إجازة",
|
|
68
|
+
"تعويض إجازة",
|
|
69
|
+
],
|
|
70
|
+
parentConcept: leaveConcept,
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
export const returnFromLeaveConcept = defineConcept({
|
|
74
|
+
name: "ReturnFromLeave",
|
|
75
|
+
description:
|
|
76
|
+
"Return from leave — a service request to officially register returning from an ongoing leave, possibly earlier than the planned end date.",
|
|
77
|
+
aliases: [
|
|
78
|
+
"return from leave",
|
|
79
|
+
"early return",
|
|
80
|
+
"مباشرة بعد إجازة",
|
|
81
|
+
"عودة من إجازة",
|
|
82
|
+
"رجعت من الإجازة",
|
|
83
|
+
],
|
|
84
|
+
parentConcept: leaveConcept,
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
export const timeInLieuLeaveConcept = defineConcept({
|
|
88
|
+
name: "TimeInLieuLeave",
|
|
89
|
+
description:
|
|
90
|
+
"Time in lieu leave — leave taken in exchange for overtime hours worked. Uses time-in-lieu balance.",
|
|
91
|
+
aliases: ["time in lieu", "TOIL", "overtime leave", "comp time", "إجازة بديلة"],
|
|
92
|
+
parentConcept: leaveConcept,
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
export const paternalLeaveConcept = defineConcept({
|
|
96
|
+
name: "PaternalLeave",
|
|
97
|
+
description: "Paternal leave — leave for new fathers after childbirth.",
|
|
98
|
+
aliases: ["paternal leave", "paternity leave", "إجازة أبوة"],
|
|
99
|
+
parentConcept: leaveConcept,
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
export const examLeaveConcept = defineConcept({
|
|
103
|
+
name: "ExamLeave",
|
|
104
|
+
description: "Exam leave — leave to sit for academic examinations.",
|
|
105
|
+
aliases: ["exam leave", "study leave", "إجازة امتحانات"],
|
|
106
|
+
parentConcept: leaveConcept,
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
export const unpaidLeaveConcept = defineConcept({
|
|
110
|
+
name: "UnpaidLeave",
|
|
111
|
+
description: "Unpaid leave — leave without pay for personal reasons.",
|
|
112
|
+
aliases: ["unpaid leave", "leave without pay", "إجازة بدون راتب"],
|
|
113
|
+
parentConcept: leaveConcept,
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
export const guardianLeaveConcept = defineConcept({
|
|
117
|
+
name: "GuardianLeave",
|
|
118
|
+
description: "Guardian leave — leave to accompany a sick family member for treatment.",
|
|
119
|
+
aliases: ["guardian leave", "accompanying leave", "إجازة مرافقة", "إجازة مرافقة مريض"],
|
|
120
|
+
parentConcept: leaveConcept,
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
export const sabbaticalLeaveConcept = defineConcept({
|
|
124
|
+
name: "SabbaticalLeave",
|
|
125
|
+
description: "Sabbatical leave — extended leave for personal or professional development.",
|
|
126
|
+
aliases: ["sabbatical leave", "sabbatical", "إجازة تفرغ"],
|
|
127
|
+
parentConcept: leaveConcept,
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
export const mourningLeaveConcept = defineConcept({
|
|
131
|
+
name: "MourningLeave",
|
|
132
|
+
description: "Mourning leave (bereavement leave) — leave due to the death of a close relative.",
|
|
133
|
+
aliases: ["mourning leave", "bereavement leave", "إجازة عزاء", "إجازة وفاة"],
|
|
134
|
+
parentConcept: leaveConcept,
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
export const iddaLeaveConcept = defineConcept({
|
|
138
|
+
name: "IddaLeave",
|
|
139
|
+
description:
|
|
140
|
+
"Idda leave — leave for the Islamic waiting period (عدة) after death of spouse or divorce. Women only.",
|
|
141
|
+
aliases: ["idda leave", "إجازة عدة"],
|
|
142
|
+
parentConcept: leaveConcept,
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
export const officialDutyLeaveConcept = defineConcept({
|
|
146
|
+
name: "OfficialDutyLeave",
|
|
147
|
+
description:
|
|
148
|
+
"Official duty leave — leave for work-related travel, conferences, or official assignments.",
|
|
149
|
+
aliases: ["official duty leave", "duty leave", "إجازة مهمة رسمية"],
|
|
150
|
+
parentConcept: leaveConcept,
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
export const careLeaveConcept = defineConcept({
|
|
154
|
+
name: "CareLeave",
|
|
155
|
+
description: "Care leave — leave to care for a sick child or family member.",
|
|
156
|
+
aliases: ["care leave", "إجازة رعاية"],
|
|
157
|
+
parentConcept: leaveConcept,
|
|
158
|
+
});
|
|
159
|
+
|
|
160
|
+
export const contactWithInfectedPatientLeaveConcept = defineConcept({
|
|
161
|
+
name: "ContactWithInfectedPatientLeave",
|
|
162
|
+
description:
|
|
163
|
+
"Contact with infected patient leave — quarantine leave due to exposure to an infectious disease.",
|
|
164
|
+
aliases: ["quarantine leave", "infected patient leave", "إجازة مخالطة", "إجازة حجر صحي"],
|
|
165
|
+
parentConcept: leaveConcept,
|
|
166
|
+
});
|
|
167
|
+
|
|
168
|
+
export const urgentLeaveConcept = defineConcept({
|
|
169
|
+
name: "UrgentLeave",
|
|
170
|
+
description: "Urgent leave — leave for emergencies that cannot wait.",
|
|
171
|
+
aliases: ["urgent leave", "emergency leave", "إجازة طارئة", "إجازة اضطرارية"],
|
|
172
|
+
parentConcept: leaveConcept,
|
|
173
|
+
});
|
|
174
|
+
|
|
175
|
+
export const timeInLieuBalanceCreditGrantConcept = defineConcept({
|
|
176
|
+
name: "TimeInLieuBalanceCreditGrant",
|
|
177
|
+
description:
|
|
178
|
+
"Time in lieu balance credit grant — manager action to add overtime compensation days to an employee time-in-lieu balance.",
|
|
179
|
+
aliases: ["grant time in lieu", "time in lieu credit", "منح رصيد إجازة تعويضية"],
|
|
180
|
+
parentConcept: leaveBalanceConcept,
|
|
181
|
+
});
|
|
182
|
+
|
|
183
|
+
/** All specific leave type concepts as an array. */
|
|
184
|
+
export const leaveTypeConcepts = [
|
|
185
|
+
annualLeaveConcept,
|
|
186
|
+
sickLeaveConcept,
|
|
187
|
+
casualLeaveConcept,
|
|
188
|
+
maternityLeaveConcept,
|
|
189
|
+
pilgrimageLeaveConcept,
|
|
190
|
+
encashLeaveDaysConcept,
|
|
191
|
+
returnFromLeaveConcept,
|
|
192
|
+
timeInLieuLeaveConcept,
|
|
193
|
+
paternalLeaveConcept,
|
|
194
|
+
examLeaveConcept,
|
|
195
|
+
unpaidLeaveConcept,
|
|
196
|
+
guardianLeaveConcept,
|
|
197
|
+
sabbaticalLeaveConcept,
|
|
198
|
+
mourningLeaveConcept,
|
|
199
|
+
iddaLeaveConcept,
|
|
200
|
+
officialDutyLeaveConcept,
|
|
201
|
+
careLeaveConcept,
|
|
202
|
+
contactWithInfectedPatientLeaveConcept,
|
|
203
|
+
urgentLeaveConcept,
|
|
204
|
+
timeInLieuBalanceCreditGrantConcept,
|
|
205
|
+
];
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { defineEndpoint } from "@m6d/cortex-server";
|
|
2
|
+
import { leaveBalanceConcept } from "../concepts/leaveBalance.concept";
|
|
3
|
+
import { annualLeaveConcept } from "../concepts/leaveTypes.concept";
|
|
4
|
+
import { listLeaveTypesEndpoint } from "./listLeaveTypes.endpoint";
|
|
5
|
+
|
|
6
|
+
export const getBalanceEndpoint = defineEndpoint({
|
|
7
|
+
name: "Get employee leave balance",
|
|
8
|
+
path: "/leaves/balances/employees/{employeeId}/{type}",
|
|
9
|
+
method: "GET",
|
|
10
|
+
description: "Get a specific employee's leave balance for a given type",
|
|
11
|
+
queries: [leaveBalanceConcept, annualLeaveConcept],
|
|
12
|
+
returns: [{ concept: leaveBalanceConcept }],
|
|
13
|
+
dependsOn: [
|
|
14
|
+
{
|
|
15
|
+
endpoint: listLeaveTypesEndpoint,
|
|
16
|
+
paramName: "type",
|
|
17
|
+
fromField: "id",
|
|
18
|
+
},
|
|
19
|
+
],
|
|
20
|
+
|
|
21
|
+
// @auto-generated-start
|
|
22
|
+
autoGenerated: {
|
|
23
|
+
params: [
|
|
24
|
+
{ name: "employeeId", required: true, type: "uuid" },
|
|
25
|
+
{ name: "type", required: true, type: "string" },
|
|
26
|
+
] as const,
|
|
27
|
+
body: [] as const,
|
|
28
|
+
response: [
|
|
29
|
+
{
|
|
30
|
+
name: "employee",
|
|
31
|
+
required: false,
|
|
32
|
+
type: "object",
|
|
33
|
+
properties: [
|
|
34
|
+
{ name: "id", required: false, type: "uuid" },
|
|
35
|
+
{
|
|
36
|
+
name: "name",
|
|
37
|
+
required: false,
|
|
38
|
+
type: "object",
|
|
39
|
+
properties: [
|
|
40
|
+
{ name: "ar", required: false, type: "string" },
|
|
41
|
+
{ name: "en", required: false, type: "string" },
|
|
42
|
+
],
|
|
43
|
+
},
|
|
44
|
+
],
|
|
45
|
+
},
|
|
46
|
+
{ name: "balance", required: false, type: "number" },
|
|
47
|
+
] as const,
|
|
48
|
+
successStatus: 200,
|
|
49
|
+
errorStatuses: [404],
|
|
50
|
+
responseKind: "object",
|
|
51
|
+
} as const,
|
|
52
|
+
// @auto-generated-end
|
|
53
|
+
});
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { defineEndpoint } from "@m6d/cortex-server";
|
|
2
|
+
import { leaveConcept } from "../concepts/leave.concept";
|
|
3
|
+
|
|
4
|
+
export const getLeaveByIdEndpoint = defineEndpoint({
|
|
5
|
+
name: "Get leave by ID",
|
|
6
|
+
path: "/leaves/{id}",
|
|
7
|
+
method: "GET",
|
|
8
|
+
description: "Get a single leave record by its ID",
|
|
9
|
+
queries: [leaveConcept],
|
|
10
|
+
returns: [{ concept: leaveConcept }],
|
|
11
|
+
|
|
12
|
+
// @auto-generated-start
|
|
13
|
+
autoGenerated: {
|
|
14
|
+
params: [{ name: "id", required: true, type: "uuid" }] as const,
|
|
15
|
+
body: [] as const,
|
|
16
|
+
response: [
|
|
17
|
+
{ name: "id", required: false, type: "uuid" },
|
|
18
|
+
{
|
|
19
|
+
name: "employee",
|
|
20
|
+
required: false,
|
|
21
|
+
type: "object",
|
|
22
|
+
properties: [
|
|
23
|
+
{ name: "id", required: false, type: "uuid" },
|
|
24
|
+
{
|
|
25
|
+
name: "name",
|
|
26
|
+
required: false,
|
|
27
|
+
type: "object",
|
|
28
|
+
properties: [
|
|
29
|
+
{ name: "ar", required: false, type: "string" },
|
|
30
|
+
{ name: "en", required: false, type: "string" },
|
|
31
|
+
],
|
|
32
|
+
},
|
|
33
|
+
],
|
|
34
|
+
},
|
|
35
|
+
{ name: "type", required: false, type: "string" },
|
|
36
|
+
{ name: "from", required: false, type: "datetime" },
|
|
37
|
+
{ name: "to", required: false, type: "datetime" },
|
|
38
|
+
{ name: "dayCount", required: false, type: "number" },
|
|
39
|
+
{ name: "daysBalanceBeforeLeave", required: false, type: "number" },
|
|
40
|
+
{ name: "deductibleFromBalance", required: false, type: "boolean" },
|
|
41
|
+
{
|
|
42
|
+
name: "serviceRequest",
|
|
43
|
+
required: false,
|
|
44
|
+
type: "object",
|
|
45
|
+
properties: [{ name: "id", required: false, type: "uuid" }],
|
|
46
|
+
},
|
|
47
|
+
] as const,
|
|
48
|
+
successStatus: 200,
|
|
49
|
+
errorStatuses: [404],
|
|
50
|
+
responseKind: "object",
|
|
51
|
+
} as const,
|
|
52
|
+
// @auto-generated-end
|
|
53
|
+
});
|