Trendsic Platform Service

<back to all web services

PayRuleSaveRequest

Requires Authentication
The following routes are available for this service:
POST/v1/workforce/payrules/{PayRulePolicyId}
"use strict";
export class PayRulePolicy {
    /** @param {{PayRulePolicyId?:number,PayRulePolicyUID?:string,Name?:string,ScopeLevel?:string,BranchId?:string,JurisdictionKey?:string,CbaKey?:string,WorkTypeKey?:string,CurrentVersion?:number,IsActive?:boolean,BranchName?:string}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {number} */
    PayRulePolicyId;
    /** @type {string} */
    PayRulePolicyUID;
    /** @type {string} */
    Name;
    /** @type {string} */
    ScopeLevel;
    /** @type {?string} */
    BranchId;
    /** @type {string} */
    JurisdictionKey;
    /** @type {string} */
    CbaKey;
    /** @type {string} */
    WorkTypeKey;
    /** @type {number} */
    CurrentVersion;
    /** @type {boolean} */
    IsActive;
    /** @type {string} */
    BranchName;
}
export class PayRuleDocSection {
    /** @param {{H?:string,T?:string}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {string} */
    H;
    /** @type {string} */
    T;
}
export class PayRuleTuneOption {
    /** @param {{Label?:string,Sub?:string}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {string} */
    Label;
    /** @type {string} */
    Sub;
}
export class PayRuleTune {
    /** @param {{Intro?:string,Options?:PayRuleTuneOption[]}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {string} */
    Intro;
    /** @type {PayRuleTuneOption[]} */
    Options = [];
}
export class PayRuleDef {
    /** @param {{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?:{ [index:string]: string; },Doc?:PayRuleDocSection[],Tune?:PayRuleTune}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {string} */
    RuleId;
    /** @type {string} */
    Name;
    /** @type {string} */
    Kind;
    /** @type {string} */
    Demand;
    /** @type {string} */
    SourcePolicyName;
    /** @type {string} */
    CascadeLevel;
    /** @type {string} */
    Why;
    /** @type {string} */
    Change;
    /** @type {string} */
    OverrideWho;
    /** @type {string} */
    OverrideConsequence;
    /** @type {string} */
    NoNote;
    /** @type {string} */
    LegalVerify;
    /** @type {{ [index:string]: string; }} */
    Params = {};
    /** @type {PayRuleDocSection[]} */
    Doc = [];
    /** @type {PayRuleTune} */
    Tune;
}
export class PayRulePolicyDoc {
    /** @param {{Intro?:string,LockLine?:string,TemplateName?:string,Rules?:PayRuleDef[]}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {string} */
    Intro;
    /** @type {string} */
    LockLine;
    /** @type {string} */
    TemplateName;
    /** @type {PayRuleDef[]} */
    Rules = [];
}
export class PayRulePolicyVersionInfo {
    /** @param {{PayRulePolicyVersionId?:number,VersionNumber?:number,ChangeNote?:string,ChangedByName?:string,CreatedAtUtc?:string}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {number} */
    PayRulePolicyVersionId;
    /** @type {number} */
    VersionNumber;
    /** @type {string} */
    ChangeNote;
    /** @type {string} */
    ChangedByName;
    /** @type {string} */
    CreatedAtUtc;
}
export class PayRulesCascadeResponse {
    /** @param {{Policy?:PayRulePolicy,Doc?:PayRulePolicyDoc,VersionNumber?:number,Versions?:PayRulePolicyVersionInfo[],CanEditRules?:boolean,ResponseStatus?:ResponseStatus}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {PayRulePolicy} */
    Policy;
    /** @type {PayRulePolicyDoc} */
    Doc;
    /** @type {number} */
    VersionNumber;
    /** @type {PayRulePolicyVersionInfo[]} */
    Versions = [];
    /** @type {boolean} */
    CanEditRules;
    /** @type {ResponseStatus} */
    ResponseStatus;
}
export class PayRuleSaveRequest {
    /** @param {{PayRulePolicyId?:number,Doc?:PayRulePolicyDoc,ChangeNote?:string}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {number} */
    PayRulePolicyId;
    /** @type {PayRulePolicyDoc} */
    Doc;
    /** @type {string} */
    ChangeNote;
}

JavaScript PayRuleSaveRequest DTOs

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

HTTP + JSV

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: text/jsv
Content-Type: text/jsv
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: text/jsv
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-01
		}
	],
	CanEditRules: False,
	ResponseStatus: 
	{
		ErrorCode: String,
		Message: String,
		StackTrace: String,
		Errors: 
		[
			{
				ErrorCode: String,
				FieldName: String,
				Message: String,
				Meta: 
				{
					String: String
				}
			}
		],
		Meta: 
		{
			String: String
		}
	}
}