Commit 1e103a3
authored
Rename TimeZoneTimeProvider to RequestTimeProvider for better clarity and consistency (#32)
This PR renames the `TimeZoneTimeProvider` class to
`RequestTimeProvider` to improve code readability and better reflect its
purpose. The class is primarily used to provide timezone-aware time
information based on HTTP request context, making "RequestTimeProvider"
a more descriptive and intuitive name.
## Changes Made
- **Renamed class**: `TimeZoneTimeProvider` → `RequestTimeProvider`
- **Renamed file**: `TimeZoneTimeProvider.cs` → `RequestTimeProvider.cs`
- **Updated dependency injection**: Modified `Program.cs` to register
the renamed class
- **Updated constructor parameters**: Updated all template engines
(`HandlebarsTemplateEngine`, `ScribanTemplateEngine`,
`RazorTemplateEngine`) to use the new class name
- **Updated variable names**: Changed all instances of
`timeZoneTimeProvider` to `requestTimeProvider` throughout the codebase
for consistency
- **Updated Razor template injection**: Modified the `@inject` directive
in `RazorTemplateEngine` to reference the new class and variable names
## Benefits
- **Improved clarity**: The new name better describes the class's role
in providing request-scoped time information
- **Better consistency**: Variable names now follow camelCase convention
with the new class name
- **Enhanced maintainability**: More descriptive naming makes the
codebase easier to understand for new developers
All existing functionality remains unchanged - this is purely a
refactoring change to improve code quality and readability.
<!-- START COPILOT CODING AGENT SUFFIX -->
<details>
<summary>Original prompt</summary>
>
> ----
>
> *This section details on the original issue you should resolve*
>
> <issue_title>Rename TimeZoneTimeProvider class to RequestTimeProvider
and update related variables</issue_title>
> <issue_description>The `TimeZoneTimeProvider` class should be renamed
to `RequestTimeProvider` for better clarity and consistency.
Additionally, any variables of this type (e.g., `timeZoneTimeProvider`,
`tztm`, or similar) should be updated to reflect the new class name
throughout the codebase.
>
> **Tasks:**
> - Rename the `TimeZoneTimeProvider` class to `RequestTimeProvider`.
> - Update all variable names that reference this type to follow the new
naming (e.g., `requestTimeProvider`).
> - Ensure all references in documentation and comments are also
updated.
> - Run all tests to confirm there are no regressions after the rename.
>
> This refactor will help improve code readability and
maintainability.</issue_description>
>
> ## Comments on the Issue (you are @copilot in this section)
>
> <comments>
> </comments>
>
</details>
Fixes #31
<!-- START COPILOT CODING AGENT TIPS -->
---
💡 You can make Copilot smarter by setting up custom instructions,
customizing its development environment and configuring Model Context
Protocol (MCP) servers. Learn more [Copilot coding agent
tips](https://gh.io/copilot-coding-agent-tips) in the docs.File tree
5 files changed
+12
-12
lines changed- src
- PdfSmith.BusinessLayer
- Services
- Templating
- PdfSmith
5 files changed
+12
-12
lines changedLines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
Lines changed: 5 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
| 35 | + | |
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| |||
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
95 | | - | |
| 95 | + | |
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
| |||
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
104 | | - | |
| 104 | + | |
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
| |||
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
17 | | - | |
| 16 | + | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
| 40 | + | |
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| |||
0 commit comments