//
//  CDVIndigitallLAParse.m
//  Indigitall
//
//  Created by Guillermo Claros on 5/8/25.
//

#import "CDVIndigitallLAParse.h"


@implementation CDVIndigitallLAParse
+ (NSDictionary *)jsonFromDevice: (INLADevice *)device{
    NSMutableDictionary *obj = [[NSMutableDictionary alloc]init];
    if (device != nil) {
        
        obj = [@{
            @"enable" : device.enabled,
            @"deviceId": device.deviceID ?: @"",
            @"platform": device.platform ?: @"",
            @"version": device.sdkVersion  ?: @"",
            @"productName" : device.productName  ?: @"",
            @"productVersion" : device.productVersion  ?: @"",
            @"osName": device.osName  ?: @"",
            @"osVersion": device.osVersion  ?: @"",
            @"deviceBrand": device.deviceBrand ?: @"",
            @"deviceModel": device.deviceModel ?: @"",
            @"operator": device.carrier ?: @"",
            @"deviceType": device.deviceType ?: @"",
            @"appVersion": device.appVersion ?: @"",
            @"locale": device.locale ?: @"",
            @"timeZone": device.timeZone ?: @"",
            @"timeOffset": @(device.timeOffset) ?: 0L,
            @"externalCode": device.externalCode ?: @""
        } mutableCopy];
    }
    return [obj mutableCopy];
}

+ (NSDictionary *) jsonFromINLiveActivity: (INLiveActivity *)la {
    NSMutableDictionary *obj = [[NSMutableDictionary alloc]init];
    if (la != nil) {
        obj = [@{
            @"id" : la.liveActivityId,
            @"createdAt": la.createdAt ?: @"",
            @"updatedAt": la.updatedAt ?: @"",
            @"applicationId": @(la.applicationId),
            @"status" : la.status  ?: @"",
            @"liveActivityExternalId": la.liveActivityExternalId  ?: @"",
            @"iosChannelId" : la.iOSChannelId  ?: @"",
            
        } mutableCopy];
    }
    return ([obj copy]);
}
@end
