Creator tax compliance (#4254)

* Initial implementation

* Remove test code

* Query cache

* Appease clippy

* Precise TIN/SSN

* Make tax threshold customizable via env variable

* Address review comments
This commit is contained in:
François-Xavier Talbot
2025-08-25 12:34:58 -04:00
committed by GitHub
parent ca36d11570
commit 006b19e3c9
16 changed files with 773 additions and 37 deletions

View File

@@ -0,0 +1,17 @@
CREATE TABLE users_compliance (
id BIGSERIAL PRIMARY KEY,
user_id BIGINT NOT NULL REFERENCES users(id),
requested TIMESTAMP WITH TIME ZONE NOT NULL,
signed TIMESTAMP WITH TIME ZONE,
e_delivery_consented BOOLEAN NOT NULL,
tin_matched BOOLEAN NOT NULL,
last_checked TIMESTAMP WITH TIME ZONE NOT NULL,
external_request_id VARCHAR NOT NULL,
reference_id VARCHAR NOT NULL,
form_type VARCHAR NOT NULL,
UNIQUE (user_id)
);