đ§ SubscriptionController Documentation
QUICK DOCUMENTATIONâ
- File Path: /API/Controllers/SubscriptionController.cs
- Primary Purpose: Manages client subscription data, including features, limits, and expiration dates.
- Key Endpoints:
- đ GET /List - Retrieves list of subscriptions
- đ GET /Get - Gets a specific subscription by ID
- đ POST /Update - Updates subscription details
- Related Models: SubscriptionDto, SubscriptionSummaryDto
- Used By:
- Administrative interfaces
- Client management screens
- License management system
- Feature access control
DETAILED DOCUMENTATIONâ
đ Overviewâ
The SubscriptionController manages subscription information for clients in Asset Valuer Pro. Subscriptions define the features, limits, and validity periods for each client using the system. This controller provides functionality to list, retrieve, and update subscription information. Access to this controller is restricted to users with the Administrator role, as it deals with licensing and access control.
đī¸ Controller Dependenciesâ
- Namespace: AVP.API.Controllers
- Services Used:
- Mediator (CQRS pattern implementation)
- Other Dependencies:
- đ Authorization attribute requiring the Administrator role
đ Endpointsâ
đ List Subscriptionsâ
- HTTP Method: GET
- URL Pattern: /List
- Authentication: đ Required (Administrator role only)
- Description: Retrieves a list of subscriptions, optionally filtered by criteria
Request Parametersâ
| Parameter | Type | Required | Description |
|---|---|---|---|
| query | SubscriptionListQuery | Yes | Query parameters for filtering subscriptions |
Response Formatâ
[
{
"id": 123,
"clientId": 456,
"clientName": "City Council XYZ",
"planType": "Enterprise",
"status": "Active",
"startDate": "2024-01-01T00:00:00Z",
"expiryDate": "2026-01-01T00:00:00Z",
"maxUsers": 20,
"currentUsers": 8
},
{
"id": 124,
"clientId": 457,
"clientName": "ABC Corporation",
"planType": "Professional",
"status": "Active",
"startDate": "2024-03-15T00:00:00Z",
"expiryDate": "2025-03-15T00:00:00Z",
"maxUsers": 10,
"currentUsers": 4
}
]
đ Get Subscriptionâ
- HTTP Method: GET
- URL Pattern: /Get
- Authentication: đ Required (Administrator role only)
- Description: Retrieves detailed information about a specific subscription
Request Parametersâ
| Parameter | Type | Required | Description |
|---|---|---|---|
| query | GetSubscriptionQuery | Yes | Contains SubscriptionId to retrieve |
Response Formatâ
{
"id": 123,
"clientId": 456,
"clientName": "City Council XYZ",
"planType": "Enterprise",
"status": "Active",
"startDate": "2024-01-01T00:00:00Z",
"expiryDate": "2026-01-01T00:00:00Z",
"createdDate": "2023-12-15T00:00:00Z",
"lastModifiedDate": "2024-11-20T00:00:00Z",
"maxUsers": 20,
"currentUsers": 8,
"features": [
{
"name": "EasySAM",
"enabled": true
},
{
"name": "Multi-User",
"enabled": true
},
{
"name": "Custom Reports",
"enabled": true
},
{
"name": "API Access",
"enabled": false
}
],
"limits": {
"maxAssets": 10000,
"maxJobs": 50,
"maxStorage": 10240
},
"usage": {
"currentAssets": 5430,
"currentJobs": 12,
"currentStorage": 4765
},
"billingInfo": {
"plan": "Annual",
"nextBillingDate": "2025-01-01T00:00:00Z",
"amount": 10000,
"currency": "AUD"
}
}
đ Update Subscriptionâ
- HTTP Method: POST
- URL Pattern: /Update
- Authentication: đ Required (Administrator role only)
- Description: Updates subscription information or creates a new subscription
Request Parametersâ
| Parameter | Type | Required | Description |
|---|---|---|---|
| command | UpdateSubscriptionCommand | Yes | Contains subscription data to update |
Response Formatâ
{
"id": 123,
"clientId": 456,
"clientName": "City Council XYZ",
"planType": "Enterprise Plus",
"status": "Active",
"startDate": "2024-01-01T00:00:00Z",
"expiryDate": "2027-01-01T00:00:00Z",
"createdDate": "2023-12-15T00:00:00Z",
"lastModifiedDate": "2025-04-17T00:00:00Z",
"maxUsers": 30,
"currentUsers": 8,
"features": [
{
"name": "EasySAM",
"enabled": true
},
{
"name": "Multi-User",
"enabled": true
},
{
"name": "Custom Reports",
"enabled": true
},
{
"name": "API Access",
"enabled": true
}
],
"limits": {
"maxAssets": 20000,
"maxJobs": 100,
"maxStorage": 20480
},
"usage": {
"currentAssets": 5430,
"currentJobs": 12,
"currentStorage": 4765
},
"billingInfo": {
"plan": "Annual",
"nextBillingDate": "2026-01-01T00:00:00Z",
"amount": 15000,
"currency": "AUD"
}
}
đĄ Tips for Subscription Managementâ
- â ī¸ Changing subscription plans may affect client access to features
- âšī¸ The system automatically checks subscription validity before allowing access to restricted features
- đ Only system administrators can modify subscription details
- ⥠Subscription usage statistics are updated in real-time as clients use the system