forked from grandnode/grandnode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIWorkContext.cs
More file actions
87 lines (72 loc) · 2.46 KB
/
IWorkContext.cs
File metadata and controls
87 lines (72 loc) · 2.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
using Grand.Core.Domain.Customers;
using Grand.Core.Domain.Directory;
using Grand.Core.Domain.Localization;
using Grand.Core.Domain.Tax;
using Grand.Core.Domain.Vendors;
using System.Threading.Tasks;
namespace Grand.Core
{
/// <summary>
/// Work context
/// </summary>
public interface IWorkContext
{
/// <summary>
/// Gets or sets the current customer
/// </summary>
Customer CurrentCustomer { get; set; }
/// <summary>
/// Set the current customer by Middleware
/// </summary>
/// <returns></returns>
Task<Customer> SetCurrentCustomer();
/// <summary>
/// Gets or sets the original customer (in case the current one is impersonated)
/// </summary>
Customer OriginalCustomerIfImpersonated { get; }
/// <summary>
/// Gets the current vendor (logged-in manager)
/// </summary>
Vendor CurrentVendor { get; }
/// <summary>
/// Set the current vendor (logged-in manager)
/// </summary>
Task<Vendor> SetCurrentVendor(Customer customer);
/// <summary>
/// Get or set current user working language
/// </summary>
Language WorkingLanguage { get; }
/// <summary>
/// Set current user working language by Middleware
/// </summary>
Task<Language> SetWorkingLanguage(Customer customer);
/// <summary>
/// Set current user working language
/// </summary>
Task<Language> SetWorkingLanguage(Language language);
/// <summary>
/// Get or set current user working currency
/// </summary>
Currency WorkingCurrency { get; }
/// <summary>
/// Set current user working currency by Middleware
/// </summary>
Task<Currency> SetWorkingCurrency(Customer customer);
/// <summary>
/// Set user working currency
/// </summary>
Task<Currency> SetWorkingCurrency(Currency currency);
/// <summary>
/// Get current tax display type
/// </summary>
TaxDisplayType TaxDisplayType { get; }
/// <summary>
/// Set current tax display type by Middleware
/// </summary>
Task<TaxDisplayType> SetTaxDisplayType(Customer customer);
/// <summary>
/// Set tax display type
/// </summary>
Task<TaxDisplayType> SetTaxDisplayType(TaxDisplayType taxDisplayType);
}
}