# Financial Crime domain — Phase 1 instantiation.
# Thin wrapper over the metadata-driven driver (deploy/instantiate.py), which
# orchestrates the semprini-data-domain template against this repo's metadata.

PY ?= python3
DRIVER := $(PY) deploy/instantiate.py

.PHONY: help preflight instantiate verify teardown install-hooks \
        wire secrets scaffold build up ducklake register activate

help:
	@echo "Targets:"
	@echo "  make preflight      Validate MD-DDL metadata (blocks on findings)"
	@echo "  make instantiate    Full stand-up: scaffold -> build -> up -> register -> verify"
	@echo "  make verify         Health-check the running domain"
	@echo "  make teardown       Unregister + stop the domain (reversible)"
	@echo "  make install-hooks  Install the pre-commit metadata gate"
	@echo ""
	@echo "Individual steps: wire secrets scaffold build up ducklake register activate"

preflight:
	$(DRIVER) preflight

instantiate:
	$(DRIVER) all

verify:
	$(DRIVER) verify

teardown:
	$(DRIVER) teardown

# individual driver steps (handy for debugging a partial stand-up)
wire secrets scaffold build up ducklake register activate:
	$(DRIVER) $@

install-hooks:
	@ln -sf ../../deploy/hooks/pre-commit .git/hooks/pre-commit
	@chmod +x deploy/hooks/pre-commit
	@echo "Installed .git/hooks/pre-commit -> deploy/hooks/pre-commit"
