Map UPRWebNew to Direct New
All checks were successful
Build and Push Docker Image / setup (push) Successful in 4s
Build and Push Docker Image / build_and_push (push) Successful in 33s

This commit is contained in:
Ankur Malik 2026-05-21 14:20:06 -04:00
parent 3d0f92e462
commit 744c55a615
2 changed files with 27 additions and 2 deletions

View File

@ -16,7 +16,10 @@ VALUES (
$application_bank_account_number,
$application_is_rejected,
$application_date_of_birth,
$application_customer_type
CASE
WHEN LOWER(TRIM($application_customer_type::text)) = 'uprwebnew' THEN 'Direct New'
ELSE $application_customer_type
END
)
ON CONFLICT (application_key)
DO UPDATE

22
test_block.py Normal file
View File

@ -0,0 +1,22 @@
import json
import unittest
from pathlib import Path
BLOCK_DIR = Path(__file__).resolve().parent
class TestDbPushV1SqlContract(unittest.TestCase):
def test_application_customer_type_direct_new_mapping(self):
schema = json.loads((BLOCK_DIR / "request_schema.json").read_text())
sql = (BLOCK_DIR / "main.sql").read_text().lower()
self.assertEqual(schema["properties"]["application_customer_type"]["type"], ["string", "null"])
self.assertNotIn("application_source_name", schema["properties"])
self.assertIn("$application_customer_type::text", sql)
self.assertIn("= 'uprwebnew' then 'direct new'", sql)
self.assertIn("else $application_customer_type", sql)
if __name__ == "__main__":
unittest.main()