Skip to content

Commit 7339c02

Browse files
authored
Rename year_month to year_month_found in all affected files (#132)
1 parent 8c31d10 commit 7339c02

File tree

9 files changed

+25
-6
lines changed

9 files changed

+25
-6
lines changed

build.gradle.kts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ subprojects {
3737
}
3838
}
3939

40+
tasks.classes {
41+
dependsOn("spotlessApply")
42+
}
43+
4044
spotless {
4145
java {
4246
target("src/main/java/**")

jpa-repository/src/main/java/com/jongsoft/finance/jpa/insight/AnalyzeJobJpa.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.jongsoft.finance.jpa.insight;
22

3+
import jakarta.persistence.Column;
34
import jakarta.persistence.Entity;
45
import jakarta.persistence.Id;
56
import jakarta.persistence.Table;
@@ -13,6 +14,8 @@ public class AnalyzeJobJpa {
1314
@Id
1415
private String id;
1516

17+
@Column(name = "year_month_found")
1618
private String yearMonth;
19+
1720
private boolean completed;
1821
}

jpa-repository/src/main/java/com/jongsoft/finance/jpa/insight/SpendingInsightJpa.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public class SpendingInsightJpa extends EntityJpa {
3030
private String message;
3131
private Long transactionId;
3232

33-
@Column(name = "year_month")
33+
@Column(name = "year_month_found")
3434
private String yearMonth;
3535

3636
@ElementCollection

jpa-repository/src/main/java/com/jongsoft/finance/jpa/insight/SpendingPatternJpa.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public class SpendingPatternJpa extends EntityJpa {
2727
private double confidence;
2828
private LocalDate detectedDate;
2929

30-
@Column(name = "year_month")
30+
@Column(name = "year_month_found")
3131
private String yearMonth;
3232

3333
@ElementCollection
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
alter table spending_insights
2+
change `year_month` year_month_found char(7);
3+
alter table spending_patterns
4+
change `year_month` year_month_found char(7);
5+
alter table analyze_job
6+
change `year_month` year_month_found char(7);
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
alter table spending_insights
2+
rename year_month to year_month_found;
3+
alter table spending_patterns
4+
rename year_month to year_month_found;
5+
alter table analyze_job
6+
rename year_month to year_month_found;

jpa-repository/src/test/resources/sql/insight/analyze-job-provider-completed.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
-- Test data for AnalyzeJobProviderJpaIT (all jobs completed)
22

33
-- Add only completed analyze jobs for testing
4-
INSERT INTO analyze_job (id, year_month, completed)
4+
INSERT INTO analyze_job (id, year_month_found, completed)
55
VALUES
66
('job-1', '2023-01', true),
77
('job-2', '2023-02', true),

jpa-repository/src/test/resources/sql/insight/analyze-job-provider.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
-- Test data for AnalyzeJobProviderJpaIT
22

33
-- Add analyze jobs for testing
4-
INSERT INTO analyze_job (id, year_month, completed)
4+
INSERT INTO analyze_job (id, year_month_found, completed)
55
VALUES
66
('job-1', '2023-01', false),
77
('job-2', '2023-02', false),

jpa-repository/src/test/resources/sql/insight/spending-insight-provider.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
-- Test data for SpendingInsightProviderJpaIT
22

33
-- Add spending insights for demo-user
4-
INSERT INTO spending_insights (id, type, category, severity, score, detected_date, message, year_month, user_id)
4+
INSERT INTO spending_insights (id, type, category, severity, score, detected_date, message, year_month_found, user_id)
55
VALUES
66
(1, 'UNUSUAL_AMOUNT', 'Groceries', 'WARNING', 0.85, '2023-01-15', 'Unusual spending amount in Groceries', '2023-01', 1),
77
(2, 'BUDGET_EXCEEDED', 'Entertainment', 'ALERT', 0.95, '2023-01-20', 'Budget exceeded in Entertainment', '2023-01', 1),
@@ -21,6 +21,6 @@ VALUES
2121
(4, 'actual_count', '8');
2222

2323
-- Add spending insight for demo-user-not (to test user filtering)
24-
INSERT INTO spending_insights (id, type, category, severity, score, detected_date, message, year_month, user_id)
24+
INSERT INTO spending_insights (id, type, category, severity, score, detected_date, message, year_month_found, user_id)
2525
VALUES
2626
(5, 'UNUSUAL_AMOUNT', 'Groceries', 'WARNING', 0.85, '2023-01-15', 'Unusual spending amount in Groceries', '2023-01', 2);

0 commit comments

Comments
 (0)