Trendsic Platform Service

<back to all web services

PayRuleSaveRequest

Requires Authentication
The following routes are available for this service:
POST/v1/workforce/payrules/{PayRulePolicyId}
import 'package:servicestack/servicestack.dart';
import 'dart:typed_data';

class PayRulePolicy implements IConvertible
{
    int? PayRulePolicyId;
    String? PayRulePolicyUID;
    String? Name;
    String? ScopeLevel;
    String? BranchId;
    String? JurisdictionKey;
    String? CbaKey;
    String? WorkTypeKey;
    int? CurrentVersion;
    bool? IsActive;
    String? BranchName;

    PayRulePolicy({this.PayRulePolicyId,this.PayRulePolicyUID,this.Name,this.ScopeLevel,this.BranchId,this.JurisdictionKey,this.CbaKey,this.WorkTypeKey,this.CurrentVersion,this.IsActive,this.BranchName});
    PayRulePolicy.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        PayRulePolicyId = json['PayRulePolicyId'];
        PayRulePolicyUID = json['PayRulePolicyUID'];
        Name = json['Name'];
        ScopeLevel = json['ScopeLevel'];
        BranchId = json['BranchId'];
        JurisdictionKey = json['JurisdictionKey'];
        CbaKey = json['CbaKey'];
        WorkTypeKey = json['WorkTypeKey'];
        CurrentVersion = json['CurrentVersion'];
        IsActive = json['IsActive'];
        BranchName = json['BranchName'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'PayRulePolicyId': PayRulePolicyId,
        'PayRulePolicyUID': PayRulePolicyUID,
        'Name': Name,
        'ScopeLevel': ScopeLevel,
        'BranchId': BranchId,
        'JurisdictionKey': JurisdictionKey,
        'CbaKey': CbaKey,
        'WorkTypeKey': WorkTypeKey,
        'CurrentVersion': CurrentVersion,
        'IsActive': IsActive,
        'BranchName': BranchName
    };

    getTypeName() => "PayRulePolicy";
    TypeContext? context = _ctx;
}

class PayRuleDocSection implements IConvertible
{
    String? H;
    String? T;

    PayRuleDocSection({this.H,this.T});
    PayRuleDocSection.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        H = json['H'];
        T = json['T'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'H': H,
        'T': T
    };

    getTypeName() => "PayRuleDocSection";
    TypeContext? context = _ctx;
}

class PayRuleTuneOption implements IConvertible
{
    String? Label;
    String? Sub;

    PayRuleTuneOption({this.Label,this.Sub});
    PayRuleTuneOption.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Label = json['Label'];
        Sub = json['Sub'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Label': Label,
        'Sub': Sub
    };

    getTypeName() => "PayRuleTuneOption";
    TypeContext? context = _ctx;
}

class PayRuleTune implements IConvertible
{
    String? Intro;
    List<PayRuleTuneOption>? Options = [];

    PayRuleTune({this.Intro,this.Options});
    PayRuleTune.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Intro = json['Intro'];
        Options = JsonConverters.fromJson(json['Options'],'List<PayRuleTuneOption>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Intro': Intro,
        'Options': JsonConverters.toJson(Options,'List<PayRuleTuneOption>',context!)
    };

    getTypeName() => "PayRuleTune";
    TypeContext? context = _ctx;
}

class PayRuleDef implements IConvertible
{
    String? RuleId;
    String? Name;
    String? Kind;
    String? Demand;
    String? SourcePolicyName;
    String? CascadeLevel;
    String? Why;
    String? Change;
    String? OverrideWho;
    String? OverrideConsequence;
    String? NoNote;
    String? LegalVerify;
    Map<String,String?>? Params = {};
    List<PayRuleDocSection>? Doc = [];
    PayRuleTune? Tune;

    PayRuleDef({this.RuleId,this.Name,this.Kind,this.Demand,this.SourcePolicyName,this.CascadeLevel,this.Why,this.Change,this.OverrideWho,this.OverrideConsequence,this.NoNote,this.LegalVerify,this.Params,this.Doc,this.Tune});
    PayRuleDef.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        RuleId = json['RuleId'];
        Name = json['Name'];
        Kind = json['Kind'];
        Demand = json['Demand'];
        SourcePolicyName = json['SourcePolicyName'];
        CascadeLevel = json['CascadeLevel'];
        Why = json['Why'];
        Change = json['Change'];
        OverrideWho = json['OverrideWho'];
        OverrideConsequence = json['OverrideConsequence'];
        NoNote = json['NoNote'];
        LegalVerify = json['LegalVerify'];
        Params = JsonConverters.toStringMap(json['Params']);
        Doc = JsonConverters.fromJson(json['Doc'],'List<PayRuleDocSection>',context!);
        Tune = JsonConverters.fromJson(json['Tune'],'PayRuleTune',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'RuleId': RuleId,
        'Name': Name,
        'Kind': Kind,
        'Demand': Demand,
        'SourcePolicyName': SourcePolicyName,
        'CascadeLevel': CascadeLevel,
        'Why': Why,
        'Change': Change,
        'OverrideWho': OverrideWho,
        'OverrideConsequence': OverrideConsequence,
        'NoNote': NoNote,
        'LegalVerify': LegalVerify,
        'Params': Params,
        'Doc': JsonConverters.toJson(Doc,'List<PayRuleDocSection>',context!),
        'Tune': JsonConverters.toJson(Tune,'PayRuleTune',context!)
    };

    getTypeName() => "PayRuleDef";
    TypeContext? context = _ctx;
}

class PayRulePolicyDoc implements IConvertible
{
    String? Intro;
    String? LockLine;
    String? TemplateName;
    List<PayRuleDef>? Rules = [];

    PayRulePolicyDoc({this.Intro,this.LockLine,this.TemplateName,this.Rules});
    PayRulePolicyDoc.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Intro = json['Intro'];
        LockLine = json['LockLine'];
        TemplateName = json['TemplateName'];
        Rules = JsonConverters.fromJson(json['Rules'],'List<PayRuleDef>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Intro': Intro,
        'LockLine': LockLine,
        'TemplateName': TemplateName,
        'Rules': JsonConverters.toJson(Rules,'List<PayRuleDef>',context!)
    };

    getTypeName() => "PayRulePolicyDoc";
    TypeContext? context = _ctx;
}

class PayRulePolicyVersionInfo implements IConvertible
{
    int? PayRulePolicyVersionId;
    int? VersionNumber;
    String? ChangeNote;
    String? ChangedByName;
    DateTime? CreatedAtUtc;

    PayRulePolicyVersionInfo({this.PayRulePolicyVersionId,this.VersionNumber,this.ChangeNote,this.ChangedByName,this.CreatedAtUtc});
    PayRulePolicyVersionInfo.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        PayRulePolicyVersionId = json['PayRulePolicyVersionId'];
        VersionNumber = json['VersionNumber'];
        ChangeNote = json['ChangeNote'];
        ChangedByName = json['ChangedByName'];
        CreatedAtUtc = JsonConverters.fromJson(json['CreatedAtUtc'],'DateTime',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'PayRulePolicyVersionId': PayRulePolicyVersionId,
        'VersionNumber': VersionNumber,
        'ChangeNote': ChangeNote,
        'ChangedByName': ChangedByName,
        'CreatedAtUtc': JsonConverters.toJson(CreatedAtUtc,'DateTime',context!)
    };

    getTypeName() => "PayRulePolicyVersionInfo";
    TypeContext? context = _ctx;
}

class PayRulesCascadeResponse implements IConvertible
{
    PayRulePolicy? Policy;
    PayRulePolicyDoc? Doc;
    int? VersionNumber;
    List<PayRulePolicyVersionInfo>? Versions = [];
    bool? CanEditRules;
    ResponseStatus? ResponseStatus;

    PayRulesCascadeResponse({this.Policy,this.Doc,this.VersionNumber,this.Versions,this.CanEditRules,this.ResponseStatus});
    PayRulesCascadeResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Policy = JsonConverters.fromJson(json['Policy'],'PayRulePolicy',context!);
        Doc = JsonConverters.fromJson(json['Doc'],'PayRulePolicyDoc',context!);
        VersionNumber = json['VersionNumber'];
        Versions = JsonConverters.fromJson(json['Versions'],'List<PayRulePolicyVersionInfo>',context!);
        CanEditRules = json['CanEditRules'];
        ResponseStatus = JsonConverters.fromJson(json['ResponseStatus'],'ResponseStatus',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Policy': JsonConverters.toJson(Policy,'PayRulePolicy',context!),
        'Doc': JsonConverters.toJson(Doc,'PayRulePolicyDoc',context!),
        'VersionNumber': VersionNumber,
        'Versions': JsonConverters.toJson(Versions,'List<PayRulePolicyVersionInfo>',context!),
        'CanEditRules': CanEditRules,
        'ResponseStatus': JsonConverters.toJson(ResponseStatus,'ResponseStatus',context!)
    };

    getTypeName() => "PayRulesCascadeResponse";
    TypeContext? context = _ctx;
}

class PayRuleSaveRequest implements IConvertible
{
    int? PayRulePolicyId;
    PayRulePolicyDoc? Doc;
    String? ChangeNote;

    PayRuleSaveRequest({this.PayRulePolicyId,this.Doc,this.ChangeNote});
    PayRuleSaveRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        PayRulePolicyId = json['PayRulePolicyId'];
        Doc = JsonConverters.fromJson(json['Doc'],'PayRulePolicyDoc',context!);
        ChangeNote = json['ChangeNote'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'PayRulePolicyId': PayRulePolicyId,
        'Doc': JsonConverters.toJson(Doc,'PayRulePolicyDoc',context!),
        'ChangeNote': ChangeNote
    };

    getTypeName() => "PayRuleSaveRequest";
    TypeContext? context = _ctx;
}

TypeContext _ctx = TypeContext(library: 'api.dev.dynamics.trendsic.com', types: <String, TypeInfo> {
    'PayRulePolicy': TypeInfo(TypeOf.Class, create:() => PayRulePolicy()),
    'PayRuleDocSection': TypeInfo(TypeOf.Class, create:() => PayRuleDocSection()),
    'PayRuleTuneOption': TypeInfo(TypeOf.Class, create:() => PayRuleTuneOption()),
    'PayRuleTune': TypeInfo(TypeOf.Class, create:() => PayRuleTune()),
    'List<PayRuleTuneOption>': TypeInfo(TypeOf.Class, create:() => <PayRuleTuneOption>[]),
    'PayRuleDef': TypeInfo(TypeOf.Class, create:() => PayRuleDef()),
    'List<PayRuleDocSection>': TypeInfo(TypeOf.Class, create:() => <PayRuleDocSection>[]),
    'PayRulePolicyDoc': TypeInfo(TypeOf.Class, create:() => PayRulePolicyDoc()),
    'List<PayRuleDef>': TypeInfo(TypeOf.Class, create:() => <PayRuleDef>[]),
    'PayRulePolicyVersionInfo': TypeInfo(TypeOf.Class, create:() => PayRulePolicyVersionInfo()),
    'PayRulesCascadeResponse': TypeInfo(TypeOf.Class, create:() => PayRulesCascadeResponse()),
    'List<PayRulePolicyVersionInfo>': TypeInfo(TypeOf.Class, create:() => <PayRulePolicyVersionInfo>[]),
    'PayRuleSaveRequest': TypeInfo(TypeOf.Class, create:() => PayRuleSaveRequest()),
});

Dart PayRuleSaveRequest DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json

To embed the response in a jsonp callback, append ?callback=myCallback

HTTP + JSON

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /v1/workforce/payrules/{PayRulePolicyId} HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: application/json
Content-Type: application/json
Content-Length: length

{"PayRulePolicyId":0,"Doc":{"Intro":"String","LockLine":"String","TemplateName":"String","Rules":[{"RuleId":"String","Name":"String","Kind":"String","Demand":"String","SourcePolicyName":"String","CascadeLevel":"String","Why":"String","Change":"String","OverrideWho":"String","OverrideConsequence":"String","NoNote":"String","LegalVerify":"String","Params":{"String":"String"},"Doc":[{"H":"String","T":"String"}],"Tune":{"Intro":"String","Options":[{"Label":"String","Sub":"String"}]}}]},"ChangeNote":"String"}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"Policy":{"PayRulePolicyId":0,"PayRulePolicyUID":"00000000000000000000000000000000","Name":"String","ScopeLevel":"String","BranchId":"00000000000000000000000000000000","JurisdictionKey":"String","CbaKey":"String","WorkTypeKey":"String","CurrentVersion":0,"IsActive":false,"BranchName":"String"},"Doc":{"Intro":"String","LockLine":"String","TemplateName":"String","Rules":[{"RuleId":"String","Name":"String","Kind":"String","Demand":"String","SourcePolicyName":"String","CascadeLevel":"String","Why":"String","Change":"String","OverrideWho":"String","OverrideConsequence":"String","NoNote":"String","LegalVerify":"String","Params":{"String":"String"},"Doc":[{"H":"String","T":"String"}],"Tune":{"Intro":"String","Options":[{"Label":"String","Sub":"String"}]}}]},"VersionNumber":0,"Versions":[{"PayRulePolicyVersionId":0,"VersionNumber":0,"ChangeNote":"String","ChangedByName":"String","CreatedAtUtc":"0001-01-01T00:00:00.0000000"}],"CanEditRules":false,"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}}}