+ Entity Relationship Diagram

Scroll to zoom Drag to pan Double-click to fit 100%
erDiagram AstraEvent { string token PK string payload string type string user_id datetime processed } BitgoEvent { string token PK string payload string type datetime processed string wallet_id } BoxEvent { string token PK string payload string type datetime processed string file_id } DwollaEvent { string token PK string payload string topic string dwolla_customer_id datetime created } FortressEvent { string token PK string payload string action string type datetime processed } MarqetaEvent { string token PK string payload int type string user_token int transaction FK } MarqetaEvent }o--|| MarqetaEvent : preceding_event PrimeTrustEvent { string token PK string payload string account_id datetime created string type } SardineEvent { string token PK string payload string document_verification_result string type string customer_id } TaxbitEvent { string token PK string payload string type datetime processed string account_id }

AstraEvent

Table: fold_astra_event Extends: BaseModelMixin
Field Type Constraints
token UUIDField PK
payload JSONField
type TextField indexed
user_id TextField indexed
processed DateTimeField nullable indexed

Sample Queries (click to expand)

Get all records
AstraEvent.objects.all()
Get by ID
AstraEvent.objects.get(id=1)
Filter by processed (last 7 days)
AstraEvent.objects.filter(processed__gte=datetime.now()-timedelta(days=7))

BitgoEvent

Table: fold_card_bitgo_event Extends: BaseModelMixin
Field Type Constraints
token TextField PK
payload JSONField
type TextField indexed
processed DateTimeField nullable indexed
wallet_id TextField nullable indexed

Sample Queries (click to expand)

Get all records
BitgoEvent.objects.all()
Get by ID
BitgoEvent.objects.get(id=1)
Filter by processed (last 7 days)
BitgoEvent.objects.filter(processed__gte=datetime.now()-timedelta(days=7))

BoxEvent

Table: fold_card_box_event Extends: BaseModelMixin
Field Type Constraints
token TextField PK
payload JSONField
type TextField indexed
processed DateTimeField nullable indexed
file_id TextField nullable indexed
user_email TextField indexed nullable
document_front BooleanField default=False
document_back BooleanField default=False

Sample Queries (click to expand)

Get all records
BoxEvent.objects.all()
Get by ID
BoxEvent.objects.get(id=1)
Filter by processed (last 7 days)
BoxEvent.objects.filter(processed__gte=datetime.now()-timedelta(days=7))

DwollaEvent

Table: dwolla_event
Field Type Constraints
token UUIDField PK
payload JSONField
topic TextField
dwolla_customer_id UUIDField
created DateTimeField
processed DateTimeField nullable
ach_transfer FK → ACHTransfer nullable

Relationships

.ach_transfer N:1 ACHTransfer

Sample Queries (click to expand)

Get all records
DwollaEvent.objects.all()
Get by ID
DwollaEvent.objects.get(id=1)
With related ACHTransfer
DwollaEvent.objects.select_related("ach_transfer")
Filter by created (last 7 days)
DwollaEvent.objects.filter(created__gte=datetime.now()-timedelta(days=7))

FortressEvent

Table: fold_card_fortress_event Extends: BaseModelMixin
Field Type Constraints
token TextField PK
payload JSONField
action TextField indexed
type TextField indexed
processed DateTimeField nullable indexed

Sample Queries (click to expand)

Get all records
FortressEvent.objects.all()
Get by ID
FortressEvent.objects.get(id=1)
Filter by processed (last 7 days)
FortressEvent.objects.filter(processed__gte=datetime.now()-timedelta(days=7))

MarqetaEvent

Table: fold_card_marqeta_event
Field Type Constraints
token UUIDField PK
payload JSONField
type SmallIntegerField choices indexedShow 4 choices
DIRECT_DEPOSIT_BUFFERDirect Deposit Buffer
GIFTGift
CUSTOMER_SUPPORTCUSTOMER_SUPPORT
GIFT_CARD_REFUNDGift Card Refund
user_token TextField indexed
transaction FK → FoldCardTransaction nullable
preceding_event FK → MarqetaEvent nullable
created DateTimeField indexed
processed DateTimeField nullable indexed

Relationships

.transaction N:1 FoldCardTransaction
.preceding_event N:1 MarqetaEvent

Referenced By (2 tables)

FoldCardSummary N:1 .last_marqeta_event
MarqetaEvent N:1 .preceding_event

Sample Queries (click to expand)

Get all records
MarqetaEvent.objects.all()
Get by ID
MarqetaEvent.objects.get(id=1)
With related FoldCardTransaction
MarqetaEvent.objects.select_related("transaction")
Filter by created (last 7 days)
MarqetaEvent.objects.filter(created__gte=datetime.now()-timedelta(days=7))

PrimeTrustEvent

Table: fold_card_prime_trust_event
Field Type Constraints
token TextField PK
payload JSONField
account_id TextField indexed nullable
created DateTimeField indexed
type TextField indexed
processed DateTimeField nullable indexed

Sample Queries (click to expand)

Get all records
PrimeTrustEvent.objects.all()
Get by ID
PrimeTrustEvent.objects.get(id=1)
Filter by created (last 7 days)
PrimeTrustEvent.objects.filter(created__gte=datetime.now()-timedelta(days=7))

SardineEvent

Table: fold_card_sardine_event
Field Type Constraints
token TextField PK
payload JSONField default=dict()
document_verification_result JSONField default=dict() nullable
type TextField indexed nullable
customer_id TextField indexed nullable
created DateTimeField indexed
processed DateTimeField nullable indexed

Sample Queries (click to expand)

Get all records
SardineEvent.objects.all()
Get by ID
SardineEvent.objects.get(id=1)
Filter by created (last 7 days)
SardineEvent.objects.filter(created__gte=datetime.now()-timedelta(days=7))

TaxbitEvent

Table: fold_card_taxbit_event Extends: BaseModelMixin
Field Type Constraints
token TextField PK
payload JSONField
type TextField indexed
processed DateTimeField nullable indexed
account_id TextField nullable indexed

Sample Queries (click to expand)

Get all records
TaxbitEvent.objects.all()
Get by ID
TaxbitEvent.objects.get(id=1)
Filter by processed (last 7 days)
TaxbitEvent.objects.filter(processed__gte=datetime.now()-timedelta(days=7))