-
Notifications
You must be signed in to change notification settings - Fork 2
Update deployment docs and refactor string formatting to strconv #7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -3,6 +3,7 @@ package repository | |||||
| import ( | ||||||
| "database/sql" | ||||||
| "fmt" | ||||||
| "strconv" | ||||||
| "strings" | ||||||
| "time" | ||||||
|
|
||||||
|
|
@@ -89,17 +90,17 @@ func (r *holidayRepository) GetAll(filter models.HolidayFilter) ([]models.Holida | |||||
|
|
||||||
| if filter.Year != nil { | ||||||
| whereConditions = append(whereConditions, "strftime('%Y', date) = ?") | ||||||
| args = append(args, fmt.Sprintf("%d", *filter.Year)) | ||||||
| args = append(args, strconv.Itoa(*filter.Year)) | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. CRITICAL: Lost leading zero padding - SQLite strftime('%m') returns "01"-"12" but strconv.Itoa(1) returns "1", causing month filter to fail silently.
Suggested change
|
||||||
| } | ||||||
|
|
||||||
| if filter.Month != nil { | ||||||
| whereConditions = append(whereConditions, "strftime('%m', date) = ?") | ||||||
| args = append(args, fmt.Sprintf("%02d", *filter.Month)) | ||||||
| args = append(args, strconv.Itoa(*filter.Month)) | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. CRITICAL: Lost leading zero padding - SQLite strftime('%m') returns "01"-"12" but strconv.Itoa(1) returns "1", causing month filter to fail silently.
Suggested change
|
||||||
| } | ||||||
|
Comment on lines
96
to
99
|
||||||
|
|
||||||
| if filter.Day != nil { | ||||||
| whereConditions = append(whereConditions, "strftime('%d', date) = ?") | ||||||
| args = append(args, fmt.Sprintf("%02d", *filter.Day)) | ||||||
| args = append(args, strconv.Itoa(*filter.Day)) | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. CRITICAL: Lost leading zero padding - SQLite strftime('%d') returns "01"-"31" but strconv.Itoa(1) returns "1", causing day filter to fail silently.
Suggested change
|
||||||
| } | ||||||
|
Comment on lines
101
to
104
|
||||||
|
|
||||||
| if filter.Type != nil { | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -6,6 +6,7 @@ import ( | |||||
| "encoding/json" | ||||||
| "fmt" | ||||||
| "net/http" | ||||||
| "strconv" | ||||||
| "time" | ||||||
| ) | ||||||
|
|
||||||
|
|
@@ -101,10 +102,10 @@ func (c *Client) GetHolidays(ctx context.Context, year, month *int, holidayType | |||||
|
|
||||||
| q := req.URL.Query() | ||||||
| if year != nil { | ||||||
| q.Add("year", fmt.Sprintf("%d", *year)) | ||||||
| q.Add("year", strconv.Itoa(*year)) | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. WARNING: Inconsistent with server expectation - the server's SQLite query expects zero-padded month ("01"-"12") but this sends unpadded ("1"-"12"). This may cause filtering to fail.
Suggested change
|
||||||
| } | ||||||
| if month != nil { | ||||||
| q.Add("month", fmt.Sprintf("%d", *month)) | ||||||
| q.Add("month", strconv.Itoa(*month)) | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. WARNING: Inconsistent with server expectation - the server's SQLite query expects zero-padded month ("01"-"12") but this sends unpadded ("1"-"12"). This may cause filtering to fail.
Suggested change
|
||||||
| } | ||||||
| if holidayType != "" { | ||||||
| q.Add("type", holidayType) | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The README is otherwise written in English in this section, but the newly added Railway deprecation note is in Indonesian. For consistency and readability for the broader audience, consider translating this note to English or providing bilingual text.