Skip to content

Commit 33e8c23

Browse files
authored
160 recurring expense (#420)
* Fix Dockerfile build args * Fix docker manifest tags * Try fixing the latest boolean * Add pg_cron config commands * Unify action and submit button * Add UI for setting recurrence rules in a expense * Create recurrence migration * Stub schedule service * Migrate expense id to uuid for db side generation * Fix radix ui import of new components * Add the recurrence procedure * Use the duplicate procedure with pg_cron * Add the notified field for web push notification polling * Create a polling task for recurrent transaction notification * Format prisma schema * Add pg_cron schema * Set cron tables as externally managed * Move the extension activation to migration * Remove the problematic relation from expenseRecurrence * Recurring page stub * Fix instrumentation import * Post rebase schema fix * Integrate with partial changes from banktransction PR * Add the cron builder component * Localize calendar component * Replace obsolete timestamp of gocardless migration * Improve schema and migration with recurrence job relation * HIde bank transaction icon when no account is connected * Fix import issues due to incorrect base path * Restyle cron builder and localize it * Add last day cron key and fix drawer height * Remove redundant createdById from recurrence * Basic recurrent expense submission * One more migration update, change relation to 1-N for expenseRecurrence * Localize and display recurrence in details * Display recurring expenses in activity subpage * Use UTC hours/minutes in cron time input * Update scheduling to work around sql injection prevention * Use UTC for pg_cron * Editing and deleting support * Remove no longer used shadcn components * Lock the selections to single values as pg_cron does not support commas * Remove unnecessary eslint comment
1 parent db04a78 commit 33e8c23

File tree

40 files changed

+1694
-238
lines changed

40 files changed

+1694
-238
lines changed

.github/workflows/postgres.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,11 +156,11 @@ jobs:
156156
--amend ghcr.io/oss-apps/postgres-amd64:$GIT_SHA \
157157
--amend ghcr.io/oss-apps/postgres-arm64:$GIT_SHA \
158158
159-
docker manifest push ghcr.io/oss-apps/postgres:$CHANNEL
159+
docker manifest push ghcr.io/oss-apps/postgres:$DB_VERSION
160160
docker manifest push ghcr.io/oss-apps/postgres:$GIT_SHA
161161
162162
- name: Create and push "latest" tag if applicable
163-
if: ${{ github.event.inputs.is_latest == true }}
163+
if: github.event.inputs.is_latest == 'true'
164164
run: |
165165
docker manifest create \
166166
ossapps/postgres:latest \

.lintstagedrc.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ const config = {
55
// Run oxlint on JavaScript/TypeScript files
66
'*.{js,jsx,ts,tsx}': ['oxlint --type-aware --fix'],
77

8+
// Format prisma.schema files
9+
'*.prisma': ['pnpm prisma format'],
10+
811
// Type check TypeScript files (optional - can be slow)
912
// '*.{ts,tsx}': () => 'tsc --noEmit',
1013
};

components.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"$schema": "https://ui.shadcn.com/schema.json",
3-
"style": "default",
3+
"style": "new-york",
44
"rsc": false,
55
"tsx": true,
66
"tailwind": {
7-
"config": "tailwind.config.ts",
7+
"config": "",
88
"css": "src/styles/globals.css",
99
"baseColor": "gray",
1010
"cssVariables": true,

docker/dev/compose.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ services:
1212
- POSTGRES_PORT=${POSTGRES_PORT:-5432}
1313
volumes:
1414
- database:/var/lib/postgresql/data
15-
ports:
16-
- '${POSTGRES_PORT:-5432}:${POSTGRES_PORT:-5432}'
1715
command: >
1816
postgres
1917
-c shared_preload_libraries=pg_cron
2018
-c cron.database_name=${POSTGRES_DB:-splitpro}
21-
-c cron.timezone=${TZ:-UTC}
19+
-c cron.timezone=UTC
20+
ports:
21+
- '${POSTGRES_PORT:-5432}:${POSTGRES_PORT:-5432}'
2222

2323
minio:
2424
image: minio/minio:RELEASE.2025-04-22T22-12-26Z

docker/postgres/Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
ARG POSTGRES_MAJOR=16
2-
ARG POSTGRES_MINOR=16.10
2+
ARG POSTGRES_MINOR=10
33
ARG POSTGRES_BASE=trixie
44

55
FROM postgres:${POSTGRES_MAJOR}.${POSTGRES_MINOR}-${POSTGRES_BASE}
66

7+
ARG POSTGRES_MAJOR
8+
79
# Install pg_cron (from PGDG packages)
810
RUN apt-get update && apt-get install -y \
911
postgresql-${POSTGRES_MAJOR}-cron \

docker/prod/compose.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,16 @@ services:
1515
interval: 10s
1616
timeout: 5s
1717
retries: 5
18+
command: >
19+
postgres
20+
-c shared_preload_libraries=pg_cron
21+
-c cron.database_name=${POSTGRES_DB:-splitpro}
22+
-c cron.timezone=UTC
1823
# ports:
1924
# - "5432:5432"
2025
env_file: .env
2126
volumes:
2227
- database:/var/lib/postgresql/data
23-
command: >
24-
postgres
25-
-c shared_preload_libraries=pg_cron
26-
-c cron.database_name=${POSTGRES_DB:-splitpro}
27-
-c cron.timezone=${TZ:-UTC}
2828

2929
splitpro:
3030
image: ossapps/splitpro:latest

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@
4444
"class-variance-authority": "^0.7.0",
4545
"clsx": "^2.1.0",
4646
"cmdk": "^1.1.1",
47+
"cron-parser": "^4.9.0",
48+
"cronstrue": "^3.3.0",
4749
"date-fns": "^3.3.1",
4850
"i18next": "^25.2.1",
4951
"i18next-browser-languagedetector": "^8.2.0",

pnpm-lock.yaml

Lines changed: 26 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

prisma.config.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,10 @@ export default {
88
path: path.join('prisma', 'migrations'),
99
seed: 'tsx prisma/seed.ts',
1010
},
11+
experimental: {
12+
externalTables: true,
13+
},
14+
tables: {
15+
external: ['cron.job', 'cron.job_run_details'],
16+
},
1117
} satisfies PrismaConfig;

0 commit comments

Comments
 (0)