POST | /superadmin/company/inactive | Evaluates inactive companies and performs deletion or notification based on predefined criteria. |
---|
import Foundation
import ServiceStack
public class DeleteInactiveCompaniesRequest : Codable
{
/**
* Number of companies to process for deletion or notification in each run.
*/
// @ApiMember(Description="Number of companies to process for deletion or notification in each run.", IsRequired=true)
public var batchLimit:Int?
required public init(){}
}
public class InactiveCompaniesResponse : Codable
{
public var processedCompanies:[InactiveCompanyResult] = []
required public init(){}
}
public class InactiveCompanyResult : Codable
{
public var companyId:String
public var lastActivityDate:Date
public var lastActivityNotificationDate:Date
public var deletionTime:Date
public var action:InactivityAction
required public init(){}
}
public enum InactivityAction : String, Codable
{
case ActivityReminder
case FinalWarning
case Delete
}
Swift DeleteInactiveCompaniesRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /superadmin/company/inactive HTTP/1.1
Host: testapi.bokamera.se
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<DeleteInactiveCompaniesRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Dtos">
<BatchLimit>0</BatchLimit>
</DeleteInactiveCompaniesRequest>
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <InactiveCompaniesResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Dtos"> <ProcessedCompanies> <InactiveCompanyResult> <Action>ActivityReminder</Action> <CompanyId>00000000-0000-0000-0000-000000000000</CompanyId> <DeletionTime>0001-01-01T00:00:00</DeletionTime> <LastActivityDate>0001-01-01T00:00:00</LastActivityDate> <LastActivityNotificationDate>0001-01-01T00:00:00</LastActivityNotificationDate> </InactiveCompanyResult> </ProcessedCompanies> </InactiveCompaniesResponse>