Ana içeriğe geç
Versiyon: 1.0.1

Enterprise Features

Milvaion includes a comprehensive set of enterprise features for managing access control, tracking user activities, auditing changes, and generating automated performance reports. This document covers the built-in identity and compliance infrastructure alongside the metric reporting system.


User Management

Milvaion provides a full user management system with role-based access control. Users are managed through the UsersController API and the Dashboard UI.

User Types

TypeValueDescription
Manager1Access to management screens (Dashboard, Jobs, Workers, Settings)
AppUser2Access to user profile and view-only screens

User Properties

PropertyTypeDescription
UserNamestringUnique login identifier
EmailstringUser email address
NamestringFirst name
SurnamestringLast name
UserTypeenumManager or AppUser
RoleIdListint[]Roles assigned to the user
AllowedNotificationsAlertType[]Which alert types the user receives as internal notifications

API Endpoints

All user endpoints require Manager user type and the corresponding UserManagement.* permission.

MethodEndpointPermissionDescription
PATCH/api/v1.0/usersUserManagement.ListPaginated user list with filtering and sorting
GET/api/v1.0/users/user?UserId={id}UserManagement.DetailGet user detail with roles and audit info
POST/api/v1.0/users/userUserManagement.CreateCreate a new user
PUT/api/v1.0/users/userUserManagement.UpdatePartial update (only fields marked as updated)
DELETE/api/v1.0/users/user?UserId={id}UserManagement.DeleteDelete a user

Create User Example

curl -X POST https://your-domain/api/v1.0/users/user \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"userName": "johndoe",
"email": "[email protected]",
"name": "John",
"surname": "Doe",
"password": "SecurePass123!",
"userType": 1,
"roleIdList": [1, 2],
"allowedNotifications": [3, 4, 6]
}'

User Detail Response

{
"isSuccess": true,
"data": {
"id": 5,
"userName": "johndoe",
"email": "[email protected]",
"name": "John",
"surname": "Doe",
"roles": [
{ "id": 1, "name": "Admin" },
{ "id": 2, "name": "Editor" }
],
"allowedNotifications": [3, 4, 6],
"auditInfo": {
"creationDate": "2026-06-01T10:00:00Z",
"creatorUserName": "rootuser",
"lastModificationDate": "2026-06-10T14:30:00Z",
"lastModifierUserName": "rootuser"
}
}
}

Role Management

Roles group permissions together and are assigned to users. Each role can have multiple permissions and multiple users.

Role Properties

PropertyTypeDescription
NamestringRole display name (e.g., Admin, Viewer, Editor)
PermissionslistPermissions assigned to this role
UserslistUsers belonging to this role

API Endpoints

All role endpoints require Manager user type and the corresponding RoleManagement.* permission.

MethodEndpointPermissionDescription
PATCH/api/v1.0/rolesRoleManagement.ListPaginated role list
GET/api/v1.0/roles/role?RoleId={id}RoleManagement.DetailGet role detail with users and permissions
POST/api/v1.0/roles/roleRoleManagement.CreateCreate a new role with permissions
PUT/api/v1.0/roles/roleRoleManagement.UpdatePartial update
DELETE/api/v1.0/roles/role?RoleId={id}RoleManagement.DeleteDelete a role

Role Detail Response

{
"isSuccess": true,
"data": {
"id": 2,
"name": "Editor",
"permissions": [
{ "id": 3, "name": "List" },
{ "id": 4, "name": "Detail" },
{ "id": 5, "name": "Create" },
{ "id": 6, "name": "Update" }
],
"users": [
{ "id": 5, "name": "johndoe" },
{ "id": 8, "name": "janesmith" }
],
"auditInfo": {
"creationDate": "2026-01-15T08:00:00Z",
"creatorUserName": "rootuser"
}
}
}

Permission Management

Milvaion uses a code-first permission system. Permissions are defined in PermissionCatalog as static constants organized into groups. They are migrated to the database via the /permissions/migrate endpoint and assigned to roles.

Permission Groups

GroupPermissionsDescription
AppSuperAdminFull system access
UserManagementList, Detail, Create, Update, DeleteUser CRUD operations
RoleManagementList, Detail, Create, Update, DeleteRole CRUD operations
PermissionManagementListView system permissions
ActivityLogManagementListView activity logs
ScheduledJobManagementList, Detail, Create, Update, Delete, Cancel, TriggerJob scheduling operations
WorkerManagementList, Detail, DeleteWorker instance management
FailedOccurrenceManagementList, Detail, Create, Update, DeleteFailed job (DLQ) management
WorkflowManagementList, Detail, Create, Update, Delete, TriggerWorkflow operations
SystemAdministrationList, Detail, Update, DeleteSystem-level settings
ContentManagementList, Detail, Create, Update, DeleteCMS content operations
NamespaceManagementList, Detail, Create, Update, DeleteContent namespace operations
ResourceGroupManagementList, Detail, Create, Update, DeleteContent resource group operations
LanguageManagementList, UpdateLanguage/localization management
InternalNotificationManagementList, Detail, Create, Update, DeleteIn-app notification management

API Endpoints

MethodEndpointPermissionDescription
PATCH/api/v1.0/permissionsPermissionManagement.ListList all permissions with group info
PUT/api/v1.0/permissions/migrateApp.SuperAdminSync code-defined permissions to database

How It Works

PermissionCatalog (C# code)

├─ UserManagement
│ ├─ List = "UserManagement.List"
│ ├─ Detail = "UserManagement.Detail"
│ ├─ Create = "UserManagement.Create"
│ ├─ Update = "UserManagement.Update"
│ └─ Delete = "UserManagement.Delete"

├─ RoleManagement
│ ├─ ...

└─ (other groups)

│ PUT /permissions/migrate

┌──────────────┐
│ Permissions │ (database table)
│ table │
└──────┬───────┘
│ assigned to
┌──────▼───────┐
│ Roles │ (via RolePermissionRelations)
└──────┬───────┘
│ assigned to
┌──────▼───────┐
│ Users │ (via UserRoleRelations)
└──────────────┘

Authorization Flow

  1. User logs in → receives JWT token with UserType claim
  2. On each request, the [Auth("Permission.Name")] attribute checks if the user's roles include the required permission
  3. [UserTypeAuth(UserType.Manager)] restricts entire controllers to specific user types
  4. SuperAdmin permission bypasses all permission checks

Activity Tracking

Milvaion automatically tracks user activities for compliance and auditing purposes. When a user performs a create, update, or delete operation, an ActivityLog record is created in the database.

Activity Log Schema

ColumnTypeDescription
IdintAuto-increment primary key
UserNamevarchar(100)Username of the user who performed the action
Activityenum (byte)Activity type from UserActivity enum
ActivityDatedatetimeoffsetTimestamp of the activity (UTC)

API Endpoint

MethodEndpointPermissionDescription
PATCH/api/v1.0/activitylogsActivityLogManagement.ListPaginated list with filtering by user, activity type, and date

Activity Log Response

{
"isSuccess": true,
"totalDataCount": 156,
"data": [
{
"id": 42,
"userName": "johndoe",
"activity": 0,
"activityDescription": "CreateUser",
"activityDate": "2026-06-15T14:30:00Z"
},
{
"id": 41,
"userName": "rootuser",
"activity": 16,
"activityDescription": "CreateScheduledJob",
"activityDate": "2026-06-15T12:00:00Z"
}
]
}

Data Retention

Activity logs are automatically cleaned up by the ActivityLogCleanerJob in the Maintenance Worker:

  • Schedule: Every 30 days at 02:00 AM UTC
  • Default retention: 60 days

Auditing

Beyond activity tracking, Milvaion provides entity-level audit fields on all core entities. These are populated automatically by the Milvasoft framework's auditing infrastructure.

Audit Fields

All auditable entities include:

FieldTypeDescription
CreationDatedatetimeWhen the record was created
CreatorUserNamestringWho created the record
LastModificationDatedatetimeWhen the record was last modified
LastModifierUserNamestringWho last modified the record

These fields are automatically populated by Milvasoft's CreationAuditableEntity and FullAuditableEntity base classes when SaveChanges is called.

Audited Entities

EntityAudit LevelDescription
UserFullCreated, modified, and soft-deletable with audit trail
RoleFullCreated with permission assignments tracked
ScheduledJobFullJob configuration changes tracked
JobOccurrenceCreationExecution records with creation timestamp
FailedOccurrenceCreationFailed job entries with creation audit
MetricReportCreationGenerated reports with creator info
WorkflowFullWorkflow definitions with change tracking
WorkflowRunCreationWorkflow execution records
ContentFullCMS content with full audit trail
InternalNotificationFullNotifications with audit info

Viewing Audit Information

Audit information is included in detail endpoints. For example, user detail response includes:

{
"auditInfo": {
"creationDate": "2026-06-01T10:00:00Z",
"creatorUserName": "rootuser",
"lastModificationDate": "2026-06-10T14:30:00Z",
"lastModifierUserName": "admin"
}
}

Account Management

Users can manage their own accounts through the AccountController. These endpoints don't require admin permissions — authenticated users can access their own data.

API Endpoints

MethodEndpointAuthDescription
POST/api/v1.0/account/loginAnonymousLogin with username/password, returns JWT
POST/api/v1.0/account/login/refreshAnonymousRefresh an expired access token
POST/api/v1.0/account/logoutAuthenticatedInvalidate current session
PUT/api/v1.0/account/password/changeAuthenticatedChange own password
GET/api/v1.0/account/detailAuthenticatedGet own account information
PATCH/api/v1.0/account/notificationsAuthenticatedList own notifications
PUT/api/v1.0/account/notifications/seenAuthenticatedMark notifications as seen
DELETE/api/v1.0/account/notificationsAuthenticatedDelete notifications

Login Response

{
"isSuccess": true,
"data": {
"token": {
"accessToken": "eyJhbGciOiJIUzI1NiIs...",
"tokenType": "Bearer",
"expiresIn": 3600
}
}
}

Metric Reports

Milvaion includes an automated reporting system that generates metric reports about your job scheduling infrastructure. Reports are produced periodically by the ReporterWorker and stored in the database. You can view, filter, and manage them through the API and the Dashboard UI.

Overview

FeatureDescription
Automated GenerationReporterWorker produces reports on a configurable schedule
10 Metric TypesJob performance, worker throughput, workflow health, and more
Dashboard UIVisual report cards with charts and drill-down detail pages
Data RetentionBuilt-in cleanup endpoint for removing old reports

Architecture

┌──────────────┐         ┌────────────┐         ┌───────────────┐
│ PostgreSQL │──────▶│ Reporter │──────▶ │ PostgreSQL │
│ (Occurrences) │ read │ Worker │ write │(MetricReports)│
└──────────────┘ └────────────┘ └──────┬────────┘

┌────────▼────────┐
│ Milvaion API │
│ MetricReports │
│ Controller │
└────────┬────────┘

┌────────▼────────┐
│ Dashboard UI │
│ Report Pages │
└─────────────────┘
  1. ReporterWorker queries JobOccurrences, ScheduledJobs, and WorkflowRuns
  2. Computes aggregated metrics and writes a MetricReport record with a JSON Data payload
  3. Milvaion API exposes CRUD endpoints through MetricReportsController
  4. Dashboard UI fetches the latest report per type and renders interactive charts

Metric Types

Milvaion provides 10 built-in metric report types, grouped into three categories:

Job Metrics

Metric TypeDisplay NameDescription
FailureRateTrendFailure Rate TrendHourly failure rate percentage over the lookback period
PercentileDurationsP50 / P95 / P99 DurationsPercentile-based execution duration distribution per job
TopSlowJobsTop Slow JobsJobs with the highest average execution duration
JobHealthScoreJob Health ScoreSuccess rate and occurrence counts for each job
CronScheduleVsActualCron Schedule vs ActualDeviation between scheduled and actual execution times

Worker Metrics

Metric TypeDisplay NameDescription
WorkerThroughputWorker ThroughputJob count, success/failure breakdown, and average duration per worker
WorkerUtilizationTrendWorker Utilization TrendCapacity vs actual utilization rate over time

Workflow Metrics

Metric TypeDisplay NameDescription
WorkflowSuccessRateWorkflow Success RateSuccess, failure, partial, and cancelled rates per workflow
WorkflowStepBottleneckWorkflow Step BottleneckStep-level performance analysis (avg/max duration, failure count)
WorkflowDurationTrendWorkflow Duration TrendAverage workflow execution duration over time

Report API Reference

All endpoints are served under api/v1.0/metricreports and require Manager user type authentication with the corresponding permissions.

MethodEndpointPermissionDescription
PATCH/api/v1.0/metricreportsScheduledJobManagement.ListPaginated list with optional MetricType filter
GET/api/v1.0/metricreports?Id={id}ScheduledJobManagement.DetailGet report detail by ID
GET/api/v1.0/metricreports/latest?MetricType={type}ScheduledJobManagement.DetailGet latest report for a metric type
DELETE/api/v1.0/metricreports?Id={id}ScheduledJobManagement.DeleteDelete a single report
DELETE/api/v1.0/metricreports/cleanup?OlderThanDays={days}ScheduledJobManagement.DeleteBulk-delete old reports (1–365 days)

Report Data Schemas

Each metric type stores its data as a JSON payload in the Data field. Below are the schemas for each type.

FailureRateTrend

{
"thresholdPercentage": 5.0,
"dataPoints": [
{ "timestamp": "2026-06-01T10:00:00Z", "value": 2.5 },
{ "timestamp": "2026-06-01T11:00:00Z", "value": 3.1 }
]
}

PercentileDurations

{
"jobs": {
"EmailSenderJob": { "p50": 120.5, "p95": 450.2, "p99": 890.7 },
"DataSyncJob": { "p50": 80.3, "p95": 310.1, "p99": 620.4 }
}
}

TopSlowJobs

{
"jobs": [
{ "jobName": "HeavyReportJob", "averageDurationMs": 45200.5, "occurrenceCount": 12 },
{ "jobName": "DataMigrationJob", "averageDurationMs": 32100.3, "occurrenceCount": 8 }
]
}

WorkerThroughput

{
"workers": [
{
"workerId": "worker-1",
"jobCount": 150,
"successCount": 145,
"failureCount": 5,
"averageDurationMs": 1200.5
}
]
}

WorkerUtilizationTrend

{
"dataPoints": [
{
"timestamp": "2026-06-01T10:00:00Z",
"workerUtilization": { "worker-1": 75.5, "worker-2": 42.3 }
}
]
}

CronScheduleVsActual

{
"jobs": [
{
"occurrenceId": "01968a3b-...",
"jobId": "01968a2a-...",
"jobName": "HourlySync",
"scheduledTime": "2026-06-01T10:00:00Z",
"actualTime": "2026-06-01T10:00:12Z",
"deviationSeconds": 12.0
}
]
}

JobHealthScore

{
"jobs": [
{
"jobName": "EmailSenderJob",
"successRate": 98.5,
"totalOccurrences": 200,
"successCount": 197,
"failureCount": 3
}
]
}

WorkflowSuccessRate

{
"workflows": [
{
"workflowId": "01968a3b-...",
"workflowName": "OrderProcessing",
"successRate": 95.0,
"totalRuns": 100,
"completedCount": 95,
"failedCount": 3,
"partialCount": 1,
"cancelledCount": 1,
"avgDurationMs": 5400.0
}
]
}

WorkflowStepBottleneck

{
"workflows": [
{
"workflowId": "01968a3b-...",
"workflowName": "OrderProcessing",
"steps": [
{
"stepName": "ValidateOrder",
"avgDurationMs": 200.5,
"maxDurationMs": 1500.0,
"executionCount": 100,
"failureCount": 2,
"skippedCount": 0,
"retryCount": 1
}
]
}
]
}

WorkflowDurationTrend

{
"dataPoints": [
{
"timestamp": "2026-06-01T10:00:00Z",
"workflowAvgDurationMs": {
"OrderProcessing": 5200.0,
"DataPipeline": 12400.0
}
}
]
}

Dashboard UI

The Milvaion Dashboard includes a dedicated Reports section with two main views.

Report Dashboard

Reports Overview

The report dashboard displays a card for each metric type showing:

  • Metric name and icon with color-coded category
  • Latest report timestamp (or "No data" if no report exists)
  • Quick navigation — click a card to view the detailed report with charts

Report Detail Pages

Reports Detail

Each metric type has a dedicated detail page with:

  • Interactive charts — line charts for time-series data, bar charts for rankings, grouped bars for comparisons
  • Data tables — tabular representation of report data with sorting
  • Report metadata — generation time, period start/end, tags
  • History navigation — browse previous reports of the same type

Cleanup Dialog

The dashboard includes a cleanup dialog accessible from the toolbar:

  1. Set the retention days threshold (default: 30)
  2. Click Delete to bulk-remove old reports
  3. Confirmation shows the number of deleted reports

Report Data Retention

Metric reports accumulate over time. Implement a retention strategy to manage storage:

Recommended retention periods:

EnvironmentRetentionRationale
Development7 daysMinimal storage
Staging14 daysEnough for testing cycles
Production30–90 daysBalance between history and storage

For ReporterWorker configuration and report generation details, see Reporter Worker.