Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
113 commits
Select commit Hold shift + click to select a range
1ece396
chore: update dependencies and add compliance router (#45)
rodrigopavezi Mar 27, 2025
612232f
feat: implement bank account management and payment details integration
rodrigopavezi Apr 3, 2025
efd8f2d
fix: add optional chaining to prevent errors in bank accounts section
rodrigopavezi Apr 7, 2025
a8b5bec
feat: enhance webhook handling and payment details integration
rodrigopavezi Apr 24, 2025
01163a4
refactor: remove unused AccountPage and BankAccountsSection components
rodrigopavezi Apr 24, 2025
1c33faf
Merge branch 'main' into feat/crypto-to-fiat
MantisClone Apr 29, 2025
a0cb1b7
fix as per coderabbitai review
rodrigopavezi Apr 30, 2025
2e14f0c
Merge branch 'feat/crypto-to-fiat' of https://github.com/RequestNetwo…
rodrigopavezi Apr 30, 2025
88d9def
fix: update kyc and agreement statuses to 'pending' in compliance rou…
rodrigopavezi Apr 30, 2025
c7e31da
feat: enhance compliance form with agreement update handling
rodrigopavezi Apr 30, 2025
1b1721b
feat: add timeout effect for bank account modal in invoice form
rodrigopavezi Apr 30, 2025
50cf77b
Update src/components/invoice-form.tsx
rodrigopavezi Apr 30, 2025
4b11ce1
fix: change accountNumber field type from encryptedText to text in pa…
rodrigopavezi Apr 30, 2025
ccbfeda
feat: implement payment details management in invoice form
rodrigopavezi Apr 30, 2025
3d7a020
refactor: rename cryptoToFiatAvailable to isCryptoToFiatAvailable acr…
rodrigopavezi Apr 30, 2025
92ec029
fix: improve payment details status display and handle unknown status
rodrigopavezi Apr 30, 2025
062c257
feat: add payment reference fields to request schema
rodrigopavezi Apr 30, 2025
c037f5b
feat: update request schema to include payment reference fields
rodrigopavezi Apr 30, 2025
2ebeca9
feat: enhance compliance form and status handling
rodrigopavezi May 5, 2025
5c4cb40
fix: update date format in bank account and compliance schemas
rodrigopavezi May 6, 2025
5df34e7
fix: update date format in bank account and compliance schemas to YYY…
rodrigopavezi May 6, 2025
4dcbfa7
feat: enhance webhook processing and error handling
rodrigopavezi May 7, 2025
85bfd61
feat: update compliance and bank account forms with enhanced error ha…
rodrigopavezi May 7, 2025
c5d669e
feat: refactor bank account form to use constants for currencies, cou…
rodrigopavezi May 9, 2025
82eead8
fix: update date input type in bank account form for improved user ex…
rodrigopavezi May 9, 2025
21da0cb
feat: enhance compliance form with country and nationality selection
rodrigopavezi May 9, 2025
25b59d3
fix: update phone input in compliance form and schema validation
rodrigopavezi May 9, 2025
f1f298d
feat: update bank account schema to use enum for currency validation
rodrigopavezi May 9, 2025
64b02ce
feat: add country codes to bank account schema for enhanced validation
rodrigopavezi May 9, 2025
506b4ad
feat: enhance compliance form date validation with coercion
rodrigopavezi May 9, 2025
4a6921e
feat: enhance bank account schema with regex validation for account d…
rodrigopavezi May 9, 2025
75c874f
feat: refactor bank account schema validations for improved readabili…
rodrigopavezi May 9, 2025
5305e78
feat: refine bank account schema validation logic for SWIFT and local…
rodrigopavezi May 9, 2025
5d7d511
feat: add country code validation to compliance form schema
rodrigopavezi May 9, 2025
917d61e
feat: improve phone number validation in compliance form schema
rodrigopavezi May 9, 2025
70d3f9f
feat: update SSN validation logic in compliance form schema
rodrigopavezi May 9, 2025
72cbabc
feat: enhance compliance form schema with postal code validation
rodrigopavezi May 9, 2025
0b44e61
fix: improve error handling in compliance router
rodrigopavezi May 9, 2025
a25204d
feat: enhance compliance router with type safety and error handling i…
rodrigopavezi May 9, 2025
ac1219d
feat: improve date formatting and error handling in date-utils
rodrigopavezi May 9, 2025
aa1ed06
fix: handle optional user data in payment details processing
rodrigopavezi May 9, 2025
aa3ce24
feat: make date of birth field optional in bank account schema
rodrigopavezi May 9, 2025
ca9afc1
feat: enhance compliance form schema with business beneficiary valida…
rodrigopavezi May 9, 2025
365a414
fix: enforce user authentication for payment details access
rodrigopavezi May 9, 2025
588c7be
refactor: streamline payment details processing in compliance router
rodrigopavezi May 9, 2025
e564d98
fix: encode payer email in payment details API request
rodrigopavezi May 9, 2025
3626126
refactor: update user retrieval process in compliance router
rodrigopavezi May 9, 2025
31f46dc
fix: update date formatting in date-utils
rodrigopavezi May 9, 2025
38597cc
fix: allow null payment details in bank account form
rodrigopavezi May 9, 2025
2a84b26
feat: add payment details status enumeration and update table schema
rodrigopavezi May 9, 2025
1361235
fix: enforce status type for agreement and KYC in compliance form
rodrigopavezi May 9, 2025
a4e6026
fix: update invoice form to handle nullable payment details and user …
rodrigopavezi May 9, 2025
bccff3f
feat: update environment and improve compliance form UI
rodrigopavezi May 9, 2025
83f0e58
feat: enhance invoice form submission handling and navigation
rodrigopavezi May 9, 2025
b3d1104
fix: update compliance API endpoints for consistency
rodrigopavezi May 12, 2025
85a1169
fix: update error code for non-compliant payer user in compliance router
rodrigopavezi May 12, 2025
eac9711
fix: change compliance info submission to protected procedure
rodrigopavezi May 19, 2025
2f6a2df
refactor: simplify date formatting by removing recurring date function
rodrigopavezi May 19, 2025
532cd8c
fix: improve error handling in compliance router
rodrigopavezi May 19, 2025
7966911
feat: enhance invoice and payment status handling
rodrigopavezi May 19, 2025
943a8c9
fix: enhance error logging in webhook route
rodrigopavezi May 19, 2025
efd44e3
fix: update error response status in webhook route
rodrigopavezi May 19, 2025
0f30a77
fix: correct payment details retrieval in invoice page
rodrigopavezi May 19, 2025
cb9eb0d
fix: improve payment details display logic in invoice page
rodrigopavezi May 19, 2025
342ac95
fix: improve error message for payment details creation failure
rodrigopavezi May 19, 2025
2c30d27
fix: add loading state for compliance iframe
rodrigopavezi May 19, 2025
eb77251
fix: enhance error message for compliance information submission
rodrigopavezi May 19, 2025
4ab6fc0
fix: enhance error message clarity in compliance form submission
rodrigopavezi May 19, 2025
12d5288
refactor: streamline compliance status handling
rodrigopavezi May 19, 2025
b0a2392
refactor: simplify CryptoToFiat component structure
rodrigopavezi May 19, 2025
34c09ab
fix: clarify wording in CryptoToFiat component compliance message
rodrigopavezi May 19, 2025
bf90114
refactor: simplify invoice submission handling
rodrigopavezi May 19, 2025
5156ebe
refactor: remove unnecessary state manipulation in invoice submission
rodrigopavezi May 19, 2025
9289987
feat: enhance payment details access control in compliance router
rodrigopavezi May 19, 2025
369ee27
chore: update package versions and enhance date formatting utility
rodrigopavezi May 19, 2025
7fb4f54
refactor: rename payment details reference for consistency
rodrigopavezi May 19, 2025
837c9cb
refactor: update payment details reference deletion behavior
rodrigopavezi May 19, 2025
7a87098
refactor: update invoice status handling for improved type safety
rodrigopavezi May 19, 2025
0ed8894
refactor: improve type safety and error logging in compliance router
rodrigopavezi May 19, 2025
26050ef
refactor: enhance error handling in compliance router
rodrigopavezi May 19, 2025
1e82f3e
refactor: encode payer email in payment details request URL
rodrigopavezi May 19, 2025
5dbe9f9
refactor: introduce utility function to filter undefined and null values
rodrigopavezi May 19, 2025
244822d
refactor: encode client user ID in API request URL
rodrigopavezi May 19, 2025
29f3bbf
refactor: improve type assertions for compliance data handling
rodrigopavezi May 19, 2025
0b356bc
refactor: encode client user ID in compliance API request
rodrigopavezi May 19, 2025
f70bf8f
refactor: enhance type safety for payment status handling
rodrigopavezi May 19, 2025
1238149
refactor: enhance user data handling in components
rodrigopavezi May 19, 2025
7c3db67
refactor: streamline invoice creation logic and user data handling
rodrigopavezi May 19, 2025
111e9d6
refactor: update environment variables for crypto to fiat integration
rodrigopavezi May 20, 2025
7baca2d
fix: add temporary logic for payee address in invoice creation
rodrigopavezi May 20, 2025
c3869aa
fix: improve error handling in invoice creation and update user data …
rodrigopavezi May 20, 2025
0cf4754
refactor: implement payment details status enum for improved clarity
rodrigopavezi May 20, 2025
301b556
refactor: update compliance form and schemas for country and gender h…
rodrigopavezi May 20, 2025
7832ae0
refactor: standardize naming for crypto-to-fiat across components
rodrigopavezi May 20, 2025
5ebcd37
refactor: standardize "crypto-to-fiat" terminology across components
rodrigopavezi May 20, 2025
fe3739b
fix: update payee address description for clarity
rodrigopavezi May 20, 2025
b8e8dc9
refactor: standardize "crypto-to-fiat" terminology in InvoiceForm
rodrigopavezi May 20, 2025
ace5514
chore: bump version to 0.5.0 in package.json and package-lock.json
rodrigopavezi May 20, 2025
8eda7d2
refactor: improve handling of submission state in InvoiceForm
rodrigopavezi May 20, 2025
5ba5daa
refactor: enhance access control for payment details in complianceRouter
rodrigopavezi May 20, 2025
423eb3f
Update src/server/routers/invoice.ts
rodrigopavezi May 21, 2025
6641b0a
Update src/server/routers/invoice.ts
rodrigopavezi May 21, 2025
88a2576
refactor: migrate enums to constants for better organization
rodrigopavezi May 21, 2025
d8051f7
Merge branch 'feat/crypto-to-fiat' of https://github.com/RequestNetwo…
rodrigopavezi May 21, 2025
d812b7d
refactor: reorganize currency and chain constants
rodrigopavezi May 21, 2025
031a7ad
refactor: enhance authorization checks in complianceRouter
rodrigopavezi May 21, 2025
6e3e96b
refactor: streamline form submission logic in InvoiceForm
rodrigopavezi May 21, 2025
41ff5cc
refactor: update compliance form polling behavior
rodrigopavezi May 21, 2025
069607f
refactor: simplify payment details filtering and enhance invoice hand…
rodrigopavezi May 21, 2025
df3dd96
feat: add payment details schema and update request handling
rodrigopavezi May 21, 2025
f35364d
refactor: improve payment details handling and error management
rodrigopavezi May 21, 2025
209e21b
fix: enhance error handling for crypto-to-fiat payment configuration
rodrigopavezi May 21, 2025
44d8dd4
refactor: improve variable naming for payment details handling
rodrigopavezi May 21, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ REQUEST_API_URL=""
REQUEST_API_KEY=""
NEXT_PUBLIC_REOWN_PROJECT_ID=""
WEBHOOK_SECRET=""
CRYPTO_TO_FIAT_PAYEE_ADDRESS=""

# Optional
# NEXT_PUBLIC_GTM_ID=""
# NEXT_PUBLIC_CRYPTO_TO_FIAT_TRUSTED_ORIGINS=""

84 changes: 84 additions & 0 deletions drizzle/0005_fine_joystick.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
CREATE TYPE "public"."account_type" AS ENUM('checking', 'savings');--> statement-breakpoint
CREATE TYPE "public"."agreement_status" AS ENUM('not_started', 'pending', 'completed');--> statement-breakpoint
CREATE TYPE "public"."beneficiary_type" AS ENUM('individual', 'business');--> statement-breakpoint
CREATE TYPE "public"."gender" AS ENUM('male', 'female', 'other', 'prefer_not_to_say');--> statement-breakpoint
CREATE TYPE "public"."kyc_status" AS ENUM('not_started', 'initiated', 'pending', 'approved');--> statement-breakpoint
CREATE TYPE "public"."payment_details_status" AS ENUM('pending', 'approved', 'rejected');--> statement-breakpoint
CREATE TYPE "public"."rails_type" AS ENUM('local', 'swift', 'wire');--> statement-breakpoint
CREATE TYPE "public"."request_status" AS ENUM('pending', 'paid', 'crypto_paid', 'offramp_initiated', 'offramp_failed', 'offramp_pending', 'processing', 'overdue');--> statement-breakpoint
CREATE TABLE IF NOT EXISTS "easyinvoice_payment_details_payers" (
"id" text PRIMARY KEY NOT NULL,
"paymentDetailsId" text NOT NULL,
"payerId" text NOT NULL,
"payment_details_status" "payment_details_status" DEFAULT 'pending',
"externalPaymentDetailId" text NOT NULL,
"created_at" timestamp DEFAULT now()
);
--> statement-breakpoint
CREATE TABLE IF NOT EXISTS "easyinvoice_payment_details" (
"id" text PRIMARY KEY NOT NULL,
"userId" text NOT NULL,
"bankName" text NOT NULL,
"accountName" text NOT NULL,
"accountNumber" text,
"routingNumber" text,
"account_type" "account_type" DEFAULT 'checking',
"sortCode" text,
"iban" text,
"swiftBic" text,
"documentNumber" text,
"documentType" text,
"ribNumber" text,
"bsbNumber" text,
"ncc" text,
"branchCode" text,
"bankCode" text,
"ifsc" text,
"beneficiary_type" "beneficiary_type" NOT NULL,
"dateOfBirth" text,
"addressLine1" text NOT NULL,
"addressLine2" text,
"city" text NOT NULL,
"state" text,
"postalCode" text NOT NULL,
"country" text NOT NULL,
"rails_type" "rails_type" DEFAULT 'local',
"currency" text NOT NULL,
"phone" text,
"businessActivity" text,
"nationality" text,
"gender" "gender",
"created_at" timestamp DEFAULT now(),
"updated_at" timestamp DEFAULT now()
);
--> statement-breakpoint
ALTER TABLE "easyinvoice_request" RENAME COLUMN "status" TO "request_status";--> statement-breakpoint
ALTER TABLE "easyinvoice_request" ADD COLUMN "originalRequestId" text;--> statement-breakpoint
ALTER TABLE "easyinvoice_request" ADD COLUMN "isCryptoToFiatAvailable" boolean DEFAULT false;--> statement-breakpoint
ALTER TABLE "easyinvoice_request" ADD COLUMN "paymentDetailsId" text;--> statement-breakpoint
ALTER TABLE "easyinvoice_user" ADD COLUMN "agreement_status" "agreement_status" DEFAULT 'pending';--> statement-breakpoint
ALTER TABLE "easyinvoice_user" ADD COLUMN "kyc_status" "kyc_status" DEFAULT 'pending';--> statement-breakpoint
ALTER TABLE "easyinvoice_user" ADD COLUMN "isCompliant" boolean DEFAULT false;--> statement-breakpoint
DO $$ BEGIN
ALTER TABLE "easyinvoice_payment_details_payers" ADD CONSTRAINT "easyinvoice_payment_details_payers_paymentDetailsId_easyinvoice_payment_details_id_fk" FOREIGN KEY ("paymentDetailsId") REFERENCES "public"."easyinvoice_payment_details"("id") ON DELETE cascade ON UPDATE no action;
EXCEPTION
WHEN duplicate_object THEN null;
END $$;
--> statement-breakpoint
DO $$ BEGIN
ALTER TABLE "easyinvoice_payment_details_payers" ADD CONSTRAINT "easyinvoice_payment_details_payers_payerId_easyinvoice_user_id_fk" FOREIGN KEY ("payerId") REFERENCES "public"."easyinvoice_user"("id") ON DELETE cascade ON UPDATE no action;
EXCEPTION
WHEN duplicate_object THEN null;
END $$;
--> statement-breakpoint
DO $$ BEGIN
ALTER TABLE "easyinvoice_payment_details" ADD CONSTRAINT "easyinvoice_payment_details_userId_easyinvoice_user_id_fk" FOREIGN KEY ("userId") REFERENCES "public"."easyinvoice_user"("id") ON DELETE restrict ON UPDATE no action;
EXCEPTION
WHEN duplicate_object THEN null;
END $$;
--> statement-breakpoint
DO $$ BEGIN
ALTER TABLE "easyinvoice_request" ADD CONSTRAINT "easyinvoice_request_paymentDetailsId_easyinvoice_payment_details_id_fk" FOREIGN KEY ("paymentDetailsId") REFERENCES "public"."easyinvoice_payment_details"("id") ON DELETE set null ON UPDATE no action;
EXCEPTION
WHEN duplicate_object THEN null;
END $$;
Loading