Add PayU webhook capture per property
Some checks failed
build-and-deploy / build-deploy (push) Failing after 29s

This commit is contained in:
androidlover5842
2026-01-30 05:48:09 +05:30
parent e5c2abc317
commit 4168835d47
5 changed files with 130 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
package com.android.trisolarisserver.config
import org.springframework.jdbc.core.JdbcTemplate
import org.springframework.stereotype.Component
@Component
class PayuWebhookLogSchemaFix(
private val jdbcTemplate: JdbcTemplate
) : PostgresSchemaFix(jdbcTemplate) {
override fun runPostgres(jdbcTemplate: JdbcTemplate) {
val hasTable = jdbcTemplate.queryForObject(
"""
select count(*)
from information_schema.tables
where table_name = 'payu_webhook_log'
""".trimIndent(),
Int::class.java
) ?: 0
if (hasTable == 0) {
logger.info("Creating payu_webhook_log table")
jdbcTemplate.execute(
"""
create table payu_webhook_log (
id uuid primary key,
property_id uuid not null references property(id) on delete cascade,
headers text,
payload text,
content_type varchar,
received_at timestamptz not null
)
""".trimIndent()
)
}
}
}