Interface ICalendarService
Payroll calendar service
Inherited Members
Namespace: PayrollEngine.Client.Service
Assembly: PayrollEngine.Client.Core.dll
Syntax
public interface ICalendarService : ICrudService<ICalendar, TenantServiceContext, Query>, ICreateService<ICalendar, TenantServiceContext, Query>, IReadService<ICalendar, TenantServiceContext, Query>
Methods
CalculateValueAsync(int, decimal, string, string, DateTime?, DateTime?)
Calculate calendar value
Declaration
Task<decimal?> CalculateValueAsync(int tenantId, decimal value, string cultureName = null, string calendarName = null, DateTime? evaluationDate = null, DateTime? evaluationPeriodDate = null)
Parameters
| Type | Name | Description |
|---|---|---|
| int | tenantId | The tenant id |
| decimal | value | The value to calculate |
| string | cultureName | The culture to use (default: tenant culture) |
| string | calendarName | The calendar name |
| DateTime? | evaluationDate | The period evaluation date (default: now) |
| DateTime? | evaluationPeriodDate | The date within the evaluation period (default: evaluation date) |
Returns
| Type | Description |
|---|---|
| Task<decimal?> | The calendar value |
GetAsync<T>(TenantServiceContext, string)
Get calendar by name
Declaration
Task<T> GetAsync<T>(TenantServiceContext context, string name) where T : class, ICalendar
Parameters
| Type | Name | Description |
|---|---|---|
| TenantServiceContext | context | The service context |
| string | name | The calendar name |
Returns
| Type | Description |
|---|---|
| Task<T> | The calendar, null if missing |
Type Parameters
| Name | Description |
|---|---|
| T |
GetCycleAsync(int, string, string, DateTime?, int?)
Get tenant calendar cycle
Declaration
Task<DatePeriod> GetCycleAsync(int tenantId, string cultureName = null, string calendarName = null, DateTime? cycleMoment = null, int? offset = null)
Parameters
| Type | Name | Description |
|---|---|---|
| int | tenantId | The tenant id |
| string | cultureName | The culture to use (default: tenant culture) |
| string | calendarName | The calendar name |
| DateTime? | cycleMoment | The moment within the payrun cycle (default: now) |
| int? | offset | The offset: |
Returns
| Type | Description |
|---|---|
| Task<DatePeriod> | The calendar cycle |
GetPeriodAsync(int, string, string, DateTime?, int?)
Get tenant calendar period
Declaration
Task<DatePeriod> GetPeriodAsync(int tenantId, string cultureName = null, string calendarName = null, DateTime? periodMoment = null, int? offset = null)
Parameters
| Type | Name | Description |
|---|---|---|
| int | tenantId | The tenant id |
| string | cultureName | The culture to use (default: tenant culture) |
| string | calendarName | The calendar name |
| DateTime? | periodMoment | The moment within the payrun period (default: now) |
| int? | offset | The offset: |
Returns
| Type | Description |
|---|---|
| Task<DatePeriod> | The calendar period |