diff --git a/drizzle/0015_bumpy_green_goblin.sql b/drizzle/0015_bumpy_green_goblin.sql new file mode 100644 index 0000000..721be0d --- /dev/null +++ b/drizzle/0015_bumpy_green_goblin.sql @@ -0,0 +1,31 @@ +CREATE TYPE "public"."quarter_balance_boundary" AS ENUM('opening', 'closing');--> statement-breakpoint +ALTER TYPE "public"."quarter_sync_step" ADD VALUE 'balances' BEFORE 'finalize';--> statement-breakpoint +CREATE TABLE "quarter_balance_snapshots" ( + "id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL, + "quarter_id" uuid NOT NULL, + "treasury_account_id" uuid, + "boundary" "quarter_balance_boundary" NOT NULL, + "account_address" text NOT NULL, + "chain_id" integer NOT NULL, + "block_number" integer NOT NULL, + "block_timestamp" timestamp with time zone NOT NULL, + "symbol" text NOT NULL, + "name" text NOT NULL, + "decimals" integer NOT NULL, + "raw_amount" numeric(78, 0) NOT NULL, + "balance" numeric(36, 18) NOT NULL, + "usd_price" numeric(18, 8) NOT NULL, + "usd_value" numeric(18, 2) NOT NULL, + "price_source" text NOT NULL, + "created_at" timestamp with time zone DEFAULT now() NOT NULL, + "updated_at" timestamp with time zone DEFAULT now() NOT NULL +); +--> statement-breakpoint +ALTER TABLE "quarter_sync_statuses" ADD COLUMN "balances_status" "quarter_sync_step_status" DEFAULT 'pending' NOT NULL;--> statement-breakpoint +ALTER TABLE "quarter_sync_statuses" ADD COLUMN "balances_started_at" timestamp with time zone;--> statement-breakpoint +ALTER TABLE "quarter_sync_statuses" ADD COLUMN "balances_completed_at" timestamp with time zone;--> statement-breakpoint +ALTER TABLE "quarter_sync_statuses" ADD COLUMN "balances_error" text;--> statement-breakpoint +ALTER TABLE "quarter_balance_snapshots" ADD CONSTRAINT "quarter_balance_snapshots_quarter_id_quarters_id_fk" FOREIGN KEY ("quarter_id") REFERENCES "public"."quarters"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint +ALTER TABLE "quarter_balance_snapshots" ADD CONSTRAINT "quarter_balance_snapshots_treasury_account_id_treasury_accounts_id_fk" FOREIGN KEY ("treasury_account_id") REFERENCES "public"."treasury_accounts"("id") ON DELETE set null ON UPDATE no action;--> statement-breakpoint +CREATE INDEX "quarter_balance_snapshots_quarter_boundary_idx" ON "quarter_balance_snapshots" USING btree ("quarter_id","boundary");--> statement-breakpoint +CREATE UNIQUE INDEX "quarter_balance_snapshots_unique" ON "quarter_balance_snapshots" USING btree ("quarter_id","boundary","chain_id",lower("account_address"),"symbol"); diff --git a/drizzle/0016_rapid_loa.sql b/drizzle/0016_rapid_loa.sql new file mode 100644 index 0000000..850ac04 --- /dev/null +++ b/drizzle/0016_rapid_loa.sql @@ -0,0 +1 @@ +ALTER TYPE "public"."treasury_account_type" ADD VALUE 'bank'; \ No newline at end of file diff --git a/drizzle/meta/0015_snapshot.json b/drizzle/meta/0015_snapshot.json new file mode 100644 index 0000000..e72de68 --- /dev/null +++ b/drizzle/meta/0015_snapshot.json @@ -0,0 +1,3260 @@ +{ + "id": "9faab200-7edd-4c4d-a322-fe382da1d693", + "prevId": "7c76a67b-73a5-4718-9c45-5ea5f2741143", + "version": "7", + "dialect": "postgresql", + "tables": { + "public.app_users": { + "name": "app_users", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "wallet_address": { + "name": "wallet_address", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "display_name_encrypted": { + "name": "display_name_encrypted", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "last_seen_at": { + "name": "last_seen_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "app_users_wallet_address_unique": { + "name": "app_users_wallet_address_unique", + "columns": [ + { + "expression": "lower(\"wallet_address\")", + "asc": true, + "isExpression": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.audit_events": { + "name": "audit_events", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "actor_user_id": { + "name": "actor_user_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "actor_wallet_address": { + "name": "actor_wallet_address", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "action": { + "name": "action", + "type": "audit_action", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "subject_table": { + "name": "subject_table", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "subject_id": { + "name": "subject_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "quarter_id": { + "name": "quarter_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "summary": { + "name": "summary", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "metadata": { + "name": "metadata", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "audit_events_subject_idx": { + "name": "audit_events_subject_idx", + "columns": [ + { + "expression": "subject_table", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "subject_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "audit_events_actor_user_id_idx": { + "name": "audit_events_actor_user_id_idx", + "columns": [ + { + "expression": "actor_user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "audit_events_quarter_id_idx": { + "name": "audit_events_quarter_id_idx", + "columns": [ + { + "expression": "quarter_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "audit_events_created_at_idx": { + "name": "audit_events_created_at_idx", + "columns": [ + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "audit_events_actor_user_id_app_users_id_fk": { + "name": "audit_events_actor_user_id_app_users_id_fk", + "tableFrom": "audit_events", + "tableTo": "app_users", + "columnsFrom": [ + "actor_user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "audit_events_quarter_id_quarters_id_fk": { + "name": "audit_events_quarter_id_quarters_id_fk", + "tableFrom": "audit_events", + "tableTo": "quarters", + "columnsFrom": [ + "quarter_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.cleric_roles": { + "name": "cleric_roles", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "wallet_address": { + "name": "wallet_address", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "granted_by_user_id": { + "name": "granted_by_user_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "revoked_at": { + "name": "revoked_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "revoked_by_user_id": { + "name": "revoked_by_user_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "cleric_roles_wallet_address_idx": { + "name": "cleric_roles_wallet_address_idx", + "columns": [ + { + "expression": "lower(\"wallet_address\")", + "asc": true, + "isExpression": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "cleric_roles_active_idx": { + "name": "cleric_roles_active_idx", + "columns": [ + { + "expression": "lower(\"wallet_address\")", + "asc": true, + "isExpression": true, + "nulls": "last" + }, + { + "expression": "revoked_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "cleric_roles_granted_by_user_id_app_users_id_fk": { + "name": "cleric_roles_granted_by_user_id_app_users_id_fk", + "tableFrom": "cleric_roles", + "tableTo": "app_users", + "columnsFrom": [ + "granted_by_user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "cleric_roles_revoked_by_user_id_app_users_id_fk": { + "name": "cleric_roles_revoked_by_user_id_app_users_id_fk", + "tableFrom": "cleric_roles", + "tableTo": "app_users", + "columnsFrom": [ + "revoked_by_user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.dao_proposals": { + "name": "dao_proposals", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "dao_address": { + "name": "dao_address", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "chain_id": { + "name": "chain_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "proposal_id": { + "name": "proposal_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "proposal_number": { + "name": "proposal_number", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "title": { + "name": "title", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "status": { + "name": "status", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "execution_tx_hash": { + "name": "execution_tx_hash", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "executed_at": { + "name": "executed_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "daohaus_url": { + "name": "daohaus_url", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "raw_metadata": { + "name": "raw_metadata", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "dao_proposals_chain_dao_proposal_unique": { + "name": "dao_proposals_chain_dao_proposal_unique", + "columns": [ + { + "expression": "chain_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "lower(\"dao_address\")", + "asc": true, + "isExpression": true, + "nulls": "last" + }, + { + "expression": "proposal_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + }, + "dao_proposals_chain_execution_tx_unique": { + "name": "dao_proposals_chain_execution_tx_unique", + "columns": [ + { + "expression": "chain_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "lower(\"execution_tx_hash\")", + "asc": true, + "isExpression": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + }, + "dao_proposals_executed_at_idx": { + "name": "dao_proposals_executed_at_idx", + "columns": [ + { + "expression": "executed_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "dao_proposals_status_idx": { + "name": "dao_proposals_status_idx", + "columns": [ + { + "expression": "status", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.entities": { + "name": "entities", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "type": { + "name": "type", + "type": "entity_type", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "name_encrypted": { + "name": "name_encrypted", + "type": "jsonb", + "primaryKey": false, + "notNull": true + }, + "website_encrypted": { + "name": "website_encrypted", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "notes_encrypted": { + "name": "notes_encrypted", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "is_member": { + "name": "is_member", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "archived_at": { + "name": "archived_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "entities_type_idx": { + "name": "entities_type_idx", + "columns": [ + { + "expression": "type", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "entities_archived_at_idx": { + "name": "entities_archived_at_idx", + "columns": [ + { + "expression": "archived_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.entity_addresses": { + "name": "entity_addresses", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "entity_id": { + "name": "entity_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "address": { + "name": "address", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "chain_id": { + "name": "chain_id", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "label_encrypted": { + "name": "label_encrypted", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "entity_addresses_entity_id_idx": { + "name": "entity_addresses_entity_id_idx", + "columns": [ + { + "expression": "entity_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "entity_addresses_address_idx": { + "name": "entity_addresses_address_idx", + "columns": [ + { + "expression": "address", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "entity_addresses_chain_address_unique": { + "name": "entity_addresses_chain_address_unique", + "columns": [ + { + "expression": "coalesce(\"chain_id\", -1)", + "asc": true, + "isExpression": true, + "nulls": "last" + }, + { + "expression": "lower(\"address\")", + "asc": true, + "isExpression": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "entity_addresses_entity_id_entities_id_fk": { + "name": "entity_addresses_entity_id_entities_id_fk", + "tableFrom": "entity_addresses", + "tableTo": "entities", + "columnsFrom": [ + "entity_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.ledger_entries": { + "name": "ledger_entries", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "quarter_id": { + "name": "quarter_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "source": { + "name": "source", + "type": "ledger_source", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "source_external_id": { + "name": "source_external_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "category": { + "name": "category", + "type": "ledger_category", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'uncategorized'" + }, + "verification_status": { + "name": "verification_status", + "type": "verification_status", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'verified'" + }, + "occurred_at": { + "name": "occurred_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "chain_id": { + "name": "chain_id", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "tx_hash": { + "name": "tx_hash", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "treasury_account_id": { + "name": "treasury_account_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "treasury_transaction_transfer_id": { + "name": "treasury_transaction_transfer_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "asset_symbol": { + "name": "asset_symbol", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "asset_amount": { + "name": "asset_amount", + "type": "numeric(36, 18)", + "primaryKey": false, + "notNull": true + }, + "usd_amount": { + "name": "usd_amount", + "type": "numeric(18, 2)", + "primaryKey": false, + "notNull": true + }, + "counterparty_entity_id": { + "name": "counterparty_entity_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "raid_id": { + "name": "raid_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "rip_id": { + "name": "rip_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "notes_encrypted": { + "name": "notes_encrypted", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "source_metadata": { + "name": "source_metadata", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "ledger_entries_quarter_id_idx": { + "name": "ledger_entries_quarter_id_idx", + "columns": [ + { + "expression": "quarter_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "ledger_entries_category_idx": { + "name": "ledger_entries_category_idx", + "columns": [ + { + "expression": "category", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "ledger_entries_source_external_id_unique": { + "name": "ledger_entries_source_external_id_unique", + "columns": [ + { + "expression": "source_external_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + }, + "ledger_entries_tx_hash_idx": { + "name": "ledger_entries_tx_hash_idx", + "columns": [ + { + "expression": "tx_hash", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "ledger_entries_treasury_transfer_unique": { + "name": "ledger_entries_treasury_transfer_unique", + "columns": [ + { + "expression": "treasury_transaction_transfer_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + }, + "ledger_entries_raid_id_idx": { + "name": "ledger_entries_raid_id_idx", + "columns": [ + { + "expression": "raid_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "ledger_entries_rip_id_idx": { + "name": "ledger_entries_rip_id_idx", + "columns": [ + { + "expression": "rip_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "ledger_entries_occurred_at_idx": { + "name": "ledger_entries_occurred_at_idx", + "columns": [ + { + "expression": "occurred_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "ledger_entries_quarter_id_quarters_id_fk": { + "name": "ledger_entries_quarter_id_quarters_id_fk", + "tableFrom": "ledger_entries", + "tableTo": "quarters", + "columnsFrom": [ + "quarter_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "ledger_entries_treasury_account_id_treasury_accounts_id_fk": { + "name": "ledger_entries_treasury_account_id_treasury_accounts_id_fk", + "tableFrom": "ledger_entries", + "tableTo": "treasury_accounts", + "columnsFrom": [ + "treasury_account_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "ledger_entries_treasury_transaction_transfer_id_treasury_transaction_transfers_id_fk": { + "name": "ledger_entries_treasury_transaction_transfer_id_treasury_transaction_transfers_id_fk", + "tableFrom": "ledger_entries", + "tableTo": "treasury_transaction_transfers", + "columnsFrom": [ + "treasury_transaction_transfer_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "ledger_entries_counterparty_entity_id_entities_id_fk": { + "name": "ledger_entries_counterparty_entity_id_entities_id_fk", + "tableFrom": "ledger_entries", + "tableTo": "entities", + "columnsFrom": [ + "counterparty_entity_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "ledger_entries_raid_id_raids_id_fk": { + "name": "ledger_entries_raid_id_raids_id_fk", + "tableFrom": "ledger_entries", + "tableTo": "raids", + "columnsFrom": [ + "raid_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "ledger_entries_rip_id_rips_id_fk": { + "name": "ledger_entries_rip_id_rips_id_fk", + "tableFrom": "ledger_entries", + "tableTo": "rips", + "columnsFrom": [ + "rip_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.membership_activities": { + "name": "membership_activities", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "quarter_id": { + "name": "quarter_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "dao_proposal_id": { + "name": "dao_proposal_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "type": { + "name": "type", + "type": "membership_activity_type", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "dao_address": { + "name": "dao_address", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "chain_id": { + "name": "chain_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "member_address": { + "name": "member_address", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "recipient_address": { + "name": "recipient_address", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "tx_hash": { + "name": "tx_hash", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "executed_at": { + "name": "executed_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "proposal_id": { + "name": "proposal_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "proposal_title": { + "name": "proposal_title", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "asset_address": { + "name": "asset_address", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "asset_symbol": { + "name": "asset_symbol", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "asset_amount": { + "name": "asset_amount", + "type": "numeric(36, 18)", + "primaryKey": false, + "notNull": false + }, + "usd_amount": { + "name": "usd_amount", + "type": "numeric(18, 2)", + "primaryKey": false, + "notNull": false + }, + "shares": { + "name": "shares", + "type": "numeric(36, 18)", + "primaryKey": false, + "notNull": false + }, + "loot": { + "name": "loot", + "type": "numeric(36, 18)", + "primaryKey": false, + "notNull": false + }, + "raw_metadata": { + "name": "raw_metadata", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "membership_activities_chain_tx_type_member_unique": { + "name": "membership_activities_chain_tx_type_member_unique", + "columns": [ + { + "expression": "chain_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "lower(\"tx_hash\")", + "asc": true, + "isExpression": true, + "nulls": "last" + }, + { + "expression": "type", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "lower(\"member_address\")", + "asc": true, + "isExpression": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + }, + "membership_activities_quarter_id_idx": { + "name": "membership_activities_quarter_id_idx", + "columns": [ + { + "expression": "quarter_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "membership_activities_dao_proposal_id_idx": { + "name": "membership_activities_dao_proposal_id_idx", + "columns": [ + { + "expression": "dao_proposal_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "membership_activities_executed_at_idx": { + "name": "membership_activities_executed_at_idx", + "columns": [ + { + "expression": "executed_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "membership_activities_type_idx": { + "name": "membership_activities_type_idx", + "columns": [ + { + "expression": "type", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "membership_activities_member_address_idx": { + "name": "membership_activities_member_address_idx", + "columns": [ + { + "expression": "member_address", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "membership_activities_quarter_id_quarters_id_fk": { + "name": "membership_activities_quarter_id_quarters_id_fk", + "tableFrom": "membership_activities", + "tableTo": "quarters", + "columnsFrom": [ + "quarter_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "membership_activities_dao_proposal_id_dao_proposals_id_fk": { + "name": "membership_activities_dao_proposal_id_dao_proposals_id_fk", + "tableFrom": "membership_activities", + "tableTo": "dao_proposals", + "columnsFrom": [ + "dao_proposal_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.quarter_balance_snapshots": { + "name": "quarter_balance_snapshots", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "quarter_id": { + "name": "quarter_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "treasury_account_id": { + "name": "treasury_account_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "boundary": { + "name": "boundary", + "type": "quarter_balance_boundary", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "account_address": { + "name": "account_address", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "chain_id": { + "name": "chain_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "block_number": { + "name": "block_number", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "block_timestamp": { + "name": "block_timestamp", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "symbol": { + "name": "symbol", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "decimals": { + "name": "decimals", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "raw_amount": { + "name": "raw_amount", + "type": "numeric(78, 0)", + "primaryKey": false, + "notNull": true + }, + "balance": { + "name": "balance", + "type": "numeric(36, 18)", + "primaryKey": false, + "notNull": true + }, + "usd_price": { + "name": "usd_price", + "type": "numeric(18, 8)", + "primaryKey": false, + "notNull": true + }, + "usd_value": { + "name": "usd_value", + "type": "numeric(18, 2)", + "primaryKey": false, + "notNull": true + }, + "price_source": { + "name": "price_source", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "quarter_balance_snapshots_quarter_boundary_idx": { + "name": "quarter_balance_snapshots_quarter_boundary_idx", + "columns": [ + { + "expression": "quarter_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "boundary", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "quarter_balance_snapshots_unique": { + "name": "quarter_balance_snapshots_unique", + "columns": [ + { + "expression": "quarter_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "boundary", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "chain_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "lower(\"account_address\")", + "isExpression": true, + "asc": true, + "nulls": "last" + }, + { + "expression": "symbol", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "quarter_balance_snapshots_quarter_id_quarters_id_fk": { + "name": "quarter_balance_snapshots_quarter_id_quarters_id_fk", + "tableFrom": "quarter_balance_snapshots", + "tableTo": "quarters", + "columnsFrom": [ + "quarter_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "quarter_balance_snapshots_treasury_account_id_treasury_accounts_id_fk": { + "name": "quarter_balance_snapshots_treasury_account_id_treasury_accounts_id_fk", + "tableFrom": "quarter_balance_snapshots", + "tableTo": "treasury_accounts", + "columnsFrom": [ + "treasury_account_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.quarter_sync_statuses": { + "name": "quarter_sync_statuses", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "quarter_id": { + "name": "quarter_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "run_id": { + "name": "run_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "overall_status": { + "name": "overall_status", + "type": "quarter_sync_overall_status", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'idle'" + }, + "current_step": { + "name": "current_step", + "type": "quarter_sync_step", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "transactions_status": { + "name": "transactions_status", + "type": "quarter_sync_step_status", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'pending'" + }, + "proposals_status": { + "name": "proposals_status", + "type": "quarter_sync_step_status", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'pending'" + }, + "membership_status": { + "name": "membership_status", + "type": "quarter_sync_step_status", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'pending'" + }, + "balances_status": { + "name": "balances_status", + "type": "quarter_sync_step_status", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'pending'" + }, + "finalize_status": { + "name": "finalize_status", + "type": "quarter_sync_step_status", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'pending'" + }, + "transactions_started_at": { + "name": "transactions_started_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "transactions_completed_at": { + "name": "transactions_completed_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "proposals_started_at": { + "name": "proposals_started_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "proposals_completed_at": { + "name": "proposals_completed_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "membership_started_at": { + "name": "membership_started_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "membership_completed_at": { + "name": "membership_completed_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "balances_started_at": { + "name": "balances_started_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "balances_completed_at": { + "name": "balances_completed_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "finalize_started_at": { + "name": "finalize_started_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "finalize_completed_at": { + "name": "finalize_completed_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "transactions_error": { + "name": "transactions_error", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "proposals_error": { + "name": "proposals_error", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "membership_error": { + "name": "membership_error", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "balances_error": { + "name": "balances_error", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "finalize_error": { + "name": "finalize_error", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "imported_transactions": { + "name": "imported_transactions", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "imported_transfers": { + "name": "imported_transfers", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "scanned_transfers": { + "name": "scanned_transfers", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "sync_error_count": { + "name": "sync_error_count", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "proposal_linked_transactions": { + "name": "proposal_linked_transactions", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "proposal_matches": { + "name": "proposal_matches", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "membership_activities": { + "name": "membership_activities", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "last_synced_at": { + "name": "last_synced_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "quarter_sync_statuses_quarter_id_unique": { + "name": "quarter_sync_statuses_quarter_id_unique", + "columns": [ + { + "expression": "quarter_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + }, + "quarter_sync_statuses_overall_status_idx": { + "name": "quarter_sync_statuses_overall_status_idx", + "columns": [ + { + "expression": "overall_status", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "quarter_sync_statuses_last_synced_at_idx": { + "name": "quarter_sync_statuses_last_synced_at_idx", + "columns": [ + { + "expression": "last_synced_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "quarter_sync_statuses_quarter_id_quarters_id_fk": { + "name": "quarter_sync_statuses_quarter_id_quarters_id_fk", + "tableFrom": "quarter_sync_statuses", + "tableTo": "quarters", + "columnsFrom": [ + "quarter_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.quarters": { + "name": "quarters", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "label": { + "name": "label", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "year": { + "name": "year", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "quarter": { + "name": "quarter", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "starts_on": { + "name": "starts_on", + "type": "date", + "primaryKey": false, + "notNull": true + }, + "ends_on": { + "name": "ends_on", + "type": "date", + "primaryKey": false, + "notNull": true + }, + "status": { + "name": "status", + "type": "quarter_status", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'draft'" + }, + "published_at": { + "name": "published_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "reopened_at": { + "name": "reopened_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "quarters_year_quarter_unique": { + "name": "quarters_year_quarter_unique", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + }, + "quarters_status_idx": { + "name": "quarters_status_idx", + "columns": [ + { + "expression": "status", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.raids": { + "name": "raids", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "client_entity_id": { + "name": "client_entity_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "name_encrypted": { + "name": "name_encrypted", + "type": "jsonb", + "primaryKey": false, + "notNull": true + }, + "notes_encrypted": { + "name": "notes_encrypted", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "archived_at": { + "name": "archived_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "raids_client_entity_id_idx": { + "name": "raids_client_entity_id_idx", + "columns": [ + { + "expression": "client_entity_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "raids_archived_at_idx": { + "name": "raids_archived_at_idx", + "columns": [ + { + "expression": "archived_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "raids_client_entity_id_entities_id_fk": { + "name": "raids_client_entity_id_entities_id_fk", + "tableFrom": "raids", + "tableTo": "entities", + "columnsFrom": [ + "client_entity_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "restrict", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.rips": { + "name": "rips", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "title_encrypted": { + "name": "title_encrypted", + "type": "jsonb", + "primaryKey": false, + "notNull": true + }, + "url_encrypted": { + "name": "url_encrypted", + "type": "jsonb", + "primaryKey": false, + "notNull": true + }, + "created_by_wallet_address": { + "name": "created_by_wallet_address", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "rips_created_at_idx": { + "name": "rips_created_at_idx", + "columns": [ + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "rips_created_by_wallet_address_idx": { + "name": "rips_created_by_wallet_address_idx", + "columns": [ + { + "expression": "lower(\"created_by_wallet_address\")", + "asc": true, + "isExpression": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.treasury_accounts": { + "name": "treasury_accounts", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "name_encrypted": { + "name": "name_encrypted", + "type": "jsonb", + "primaryKey": false, + "notNull": true + }, + "address": { + "name": "address", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "chain_id": { + "name": "chain_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "type": { + "name": "type", + "type": "treasury_account_type", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "is_dao_controlled": { + "name": "is_dao_controlled", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": true + }, + "notes_encrypted": { + "name": "notes_encrypted", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "archived_at": { + "name": "archived_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "treasury_accounts_chain_address_unique": { + "name": "treasury_accounts_chain_address_unique", + "columns": [ + { + "expression": "chain_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "address", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + }, + "treasury_accounts_type_idx": { + "name": "treasury_accounts_type_idx", + "columns": [ + { + "expression": "type", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "treasury_accounts_archived_at_idx": { + "name": "treasury_accounts_archived_at_idx", + "columns": [ + { + "expression": "archived_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.treasury_balance_assets": { + "name": "treasury_balance_assets", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "snapshot_id": { + "name": "snapshot_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "symbol": { + "name": "symbol", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "decimals": { + "name": "decimals", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "raw_amount": { + "name": "raw_amount", + "type": "numeric(78, 0)", + "primaryKey": false, + "notNull": true + }, + "balance": { + "name": "balance", + "type": "numeric(36, 18)", + "primaryKey": false, + "notNull": true + }, + "usd_price": { + "name": "usd_price", + "type": "numeric(18, 8)", + "primaryKey": false, + "notNull": true + }, + "usd_value": { + "name": "usd_value", + "type": "numeric(18, 2)", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "treasury_balance_assets_snapshot_id_idx": { + "name": "treasury_balance_assets_snapshot_id_idx", + "columns": [ + { + "expression": "snapshot_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "treasury_balance_assets_snapshot_symbol_unique": { + "name": "treasury_balance_assets_snapshot_symbol_unique", + "columns": [ + { + "expression": "snapshot_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "symbol", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "treasury_balance_assets_snapshot_id_treasury_balance_snapshots_id_fk": { + "name": "treasury_balance_assets_snapshot_id_treasury_balance_snapshots_id_fk", + "tableFrom": "treasury_balance_assets", + "tableTo": "treasury_balance_snapshots", + "columnsFrom": [ + "snapshot_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.treasury_balance_snapshots": { + "name": "treasury_balance_snapshots", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "account_address": { + "name": "account_address", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "chain_id": { + "name": "chain_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "status": { + "name": "status", + "type": "treasury_snapshot_status", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "total_usd": { + "name": "total_usd", + "type": "numeric(18, 2)", + "primaryKey": false, + "notNull": true + }, + "synced_at": { + "name": "synced_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "error_message": { + "name": "error_message", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "treasury_balance_snapshots_chain_account_synced_idx": { + "name": "treasury_balance_snapshots_chain_account_synced_idx", + "columns": [ + { + "expression": "chain_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "account_address", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "synced_at", + "isExpression": false, + "asc": false, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "treasury_balance_snapshots_synced_at_idx": { + "name": "treasury_balance_snapshots_synced_at_idx", + "columns": [ + { + "expression": "synced_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.treasury_transaction_transfers": { + "name": "treasury_transaction_transfers", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "treasury_transaction_id": { + "name": "treasury_transaction_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "treasury_account_id": { + "name": "treasury_account_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "transfer_id": { + "name": "transfer_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "direction": { + "name": "direction", + "type": "treasury_transfer_direction", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "transfer_type": { + "name": "transfer_type", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "account_address": { + "name": "account_address", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "chain_id": { + "name": "chain_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "tx_hash": { + "name": "tx_hash", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "executed_at": { + "name": "executed_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "from_address": { + "name": "from_address", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "to_address": { + "name": "to_address", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "token_address": { + "name": "token_address", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "asset_symbol": { + "name": "asset_symbol", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "asset_name": { + "name": "asset_name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "decimals": { + "name": "decimals", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "raw_amount": { + "name": "raw_amount", + "type": "numeric(78, 0)", + "primaryKey": false, + "notNull": true + }, + "amount": { + "name": "amount", + "type": "numeric(36, 18)", + "primaryKey": false, + "notNull": true + }, + "usd_price": { + "name": "usd_price", + "type": "numeric(18, 8)", + "primaryKey": false, + "notNull": false + }, + "usd_amount": { + "name": "usd_amount", + "type": "numeric(18, 2)", + "primaryKey": false, + "notNull": false + }, + "raw_metadata": { + "name": "raw_metadata", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "treasury_transaction_transfers_chain_transfer_unique": { + "name": "treasury_transaction_transfers_chain_transfer_unique", + "columns": [ + { + "expression": "chain_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "lower(\"account_address\")", + "asc": true, + "isExpression": true, + "nulls": "last" + }, + { + "expression": "transfer_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + }, + "treasury_transaction_transfers_transaction_id_idx": { + "name": "treasury_transaction_transfers_transaction_id_idx", + "columns": [ + { + "expression": "treasury_transaction_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "treasury_transaction_transfers_treasury_account_id_idx": { + "name": "treasury_transaction_transfers_treasury_account_id_idx", + "columns": [ + { + "expression": "treasury_account_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "treasury_transaction_transfers_tx_hash_idx": { + "name": "treasury_transaction_transfers_tx_hash_idx", + "columns": [ + { + "expression": "tx_hash", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "treasury_transaction_transfers_executed_at_idx": { + "name": "treasury_transaction_transfers_executed_at_idx", + "columns": [ + { + "expression": "executed_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "treasury_transaction_transfers_treasury_transaction_id_treasury_transactions_id_fk": { + "name": "treasury_transaction_transfers_treasury_transaction_id_treasury_transactions_id_fk", + "tableFrom": "treasury_transaction_transfers", + "tableTo": "treasury_transactions", + "columnsFrom": [ + "treasury_transaction_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "treasury_transaction_transfers_treasury_account_id_treasury_accounts_id_fk": { + "name": "treasury_transaction_transfers_treasury_account_id_treasury_accounts_id_fk", + "tableFrom": "treasury_transaction_transfers", + "tableTo": "treasury_accounts", + "columnsFrom": [ + "treasury_account_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.treasury_transactions": { + "name": "treasury_transactions", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "dao_proposal_id": { + "name": "dao_proposal_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "treasury_account_id": { + "name": "treasury_account_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "source": { + "name": "source", + "type": "ledger_source", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "account_address": { + "name": "account_address", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "chain_id": { + "name": "chain_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "tx_hash": { + "name": "tx_hash", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "safe_transaction_hash": { + "name": "safe_transaction_hash", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "transaction_type": { + "name": "transaction_type", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "executed_at": { + "name": "executed_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "block_number": { + "name": "block_number", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "raw_metadata": { + "name": "raw_metadata", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "imported_at": { + "name": "imported_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "treasury_transactions_chain_account_tx_unique": { + "name": "treasury_transactions_chain_account_tx_unique", + "columns": [ + { + "expression": "chain_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "lower(\"account_address\")", + "asc": true, + "isExpression": true, + "nulls": "last" + }, + { + "expression": "lower(\"tx_hash\")", + "asc": true, + "isExpression": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + }, + "treasury_transactions_tx_hash_idx": { + "name": "treasury_transactions_tx_hash_idx", + "columns": [ + { + "expression": "tx_hash", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "treasury_transactions_account_executed_idx": { + "name": "treasury_transactions_account_executed_idx", + "columns": [ + { + "expression": "chain_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "account_address", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "executed_at", + "isExpression": false, + "asc": false, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "treasury_transactions_treasury_account_id_idx": { + "name": "treasury_transactions_treasury_account_id_idx", + "columns": [ + { + "expression": "treasury_account_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "treasury_transactions_dao_proposal_id_idx": { + "name": "treasury_transactions_dao_proposal_id_idx", + "columns": [ + { + "expression": "dao_proposal_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "treasury_transactions_dao_proposal_id_dao_proposals_id_fk": { + "name": "treasury_transactions_dao_proposal_id_dao_proposals_id_fk", + "tableFrom": "treasury_transactions", + "tableTo": "dao_proposals", + "columnsFrom": [ + "dao_proposal_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "treasury_transactions_treasury_account_id_treasury_accounts_id_fk": { + "name": "treasury_transactions_treasury_account_id_treasury_accounts_id_fk", + "tableFrom": "treasury_transactions", + "tableTo": "treasury_accounts", + "columnsFrom": [ + "treasury_account_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + } + }, + "enums": { + "public.audit_action": { + "name": "audit_action", + "schema": "public", + "values": [ + "create", + "update", + "delete", + "import", + "classify", + "publish", + "reopen", + "grant_role", + "revoke_role" + ] + }, + "public.entity_type": { + "name": "entity_type", + "schema": "public", + "values": [ + "client", + "provider", + "subcontractor" + ] + }, + "public.ledger_category": { + "name": "ledger_category", + "schema": "public", + "values": [ + "raid_revenue", + "raid_spoils", + "subcontractor_payout", + "rip_expense", + "provider_expense", + "member_dues", + "ragequit", + "treasury_transfer", + "uncategorized" + ] + }, + "public.ledger_source": { + "name": "ledger_source", + "schema": "public", + "values": [ + "main_safe", + "side_vault", + "operator", + "manual", + "bank_csv", + "dao_proposal" + ] + }, + "public.membership_activity_type": { + "name": "membership_activity_type", + "schema": "public", + "values": [ + "join", + "ragequit" + ] + }, + "public.quarter_balance_boundary": { + "name": "quarter_balance_boundary", + "schema": "public", + "values": [ + "opening", + "closing" + ] + }, + "public.quarter_status": { + "name": "quarter_status", + "schema": "public", + "values": [ + "draft", + "ready_for_review", + "published", + "reopened" + ] + }, + "public.quarter_sync_overall_status": { + "name": "quarter_sync_overall_status", + "schema": "public", + "values": [ + "idle", + "running", + "success", + "partial", + "failed" + ] + }, + "public.quarter_sync_step": { + "name": "quarter_sync_step", + "schema": "public", + "values": [ + "transactions", + "proposals", + "membership", + "balances", + "finalize" + ] + }, + "public.quarter_sync_step_status": { + "name": "quarter_sync_step_status", + "schema": "public", + "values": [ + "pending", + "running", + "success", + "failed" + ] + }, + "public.treasury_account_type": { + "name": "treasury_account_type", + "schema": "public", + "values": [ + "main_safe", + "side_vault", + "operator" + ] + }, + "public.treasury_snapshot_status": { + "name": "treasury_snapshot_status", + "schema": "public", + "values": [ + "pending_live_sync", + "synced", + "stale_syncing", + "partial", + "failed" + ] + }, + "public.treasury_transfer_direction": { + "name": "treasury_transfer_direction", + "schema": "public", + "values": [ + "inflow", + "outflow", + "internal" + ] + }, + "public.verification_status": { + "name": "verification_status", + "schema": "public", + "values": [ + "verified", + "unverified" + ] + } + }, + "schemas": {}, + "sequences": {}, + "roles": {}, + "policies": {}, + "views": {}, + "_meta": { + "columns": {}, + "schemas": {}, + "tables": {} + } +} diff --git a/drizzle/meta/0016_snapshot.json b/drizzle/meta/0016_snapshot.json new file mode 100644 index 0000000..54fd3a3 --- /dev/null +++ b/drizzle/meta/0016_snapshot.json @@ -0,0 +1,3261 @@ +{ + "id": "fb72f035-f07f-44d1-b3a6-a50b692ac32c", + "prevId": "9faab200-7edd-4c4d-a322-fe382da1d693", + "version": "7", + "dialect": "postgresql", + "tables": { + "public.app_users": { + "name": "app_users", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "wallet_address": { + "name": "wallet_address", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "display_name_encrypted": { + "name": "display_name_encrypted", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "last_seen_at": { + "name": "last_seen_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "app_users_wallet_address_unique": { + "name": "app_users_wallet_address_unique", + "columns": [ + { + "expression": "lower(\"wallet_address\")", + "asc": true, + "isExpression": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.audit_events": { + "name": "audit_events", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "actor_user_id": { + "name": "actor_user_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "actor_wallet_address": { + "name": "actor_wallet_address", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "action": { + "name": "action", + "type": "audit_action", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "subject_table": { + "name": "subject_table", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "subject_id": { + "name": "subject_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "quarter_id": { + "name": "quarter_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "summary": { + "name": "summary", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "metadata": { + "name": "metadata", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "audit_events_subject_idx": { + "name": "audit_events_subject_idx", + "columns": [ + { + "expression": "subject_table", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "subject_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "audit_events_actor_user_id_idx": { + "name": "audit_events_actor_user_id_idx", + "columns": [ + { + "expression": "actor_user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "audit_events_quarter_id_idx": { + "name": "audit_events_quarter_id_idx", + "columns": [ + { + "expression": "quarter_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "audit_events_created_at_idx": { + "name": "audit_events_created_at_idx", + "columns": [ + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "audit_events_actor_user_id_app_users_id_fk": { + "name": "audit_events_actor_user_id_app_users_id_fk", + "tableFrom": "audit_events", + "tableTo": "app_users", + "columnsFrom": [ + "actor_user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "audit_events_quarter_id_quarters_id_fk": { + "name": "audit_events_quarter_id_quarters_id_fk", + "tableFrom": "audit_events", + "tableTo": "quarters", + "columnsFrom": [ + "quarter_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.cleric_roles": { + "name": "cleric_roles", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "wallet_address": { + "name": "wallet_address", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "granted_by_user_id": { + "name": "granted_by_user_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "revoked_at": { + "name": "revoked_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "revoked_by_user_id": { + "name": "revoked_by_user_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "cleric_roles_wallet_address_idx": { + "name": "cleric_roles_wallet_address_idx", + "columns": [ + { + "expression": "lower(\"wallet_address\")", + "asc": true, + "isExpression": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "cleric_roles_active_idx": { + "name": "cleric_roles_active_idx", + "columns": [ + { + "expression": "lower(\"wallet_address\")", + "asc": true, + "isExpression": true, + "nulls": "last" + }, + { + "expression": "revoked_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "cleric_roles_granted_by_user_id_app_users_id_fk": { + "name": "cleric_roles_granted_by_user_id_app_users_id_fk", + "tableFrom": "cleric_roles", + "tableTo": "app_users", + "columnsFrom": [ + "granted_by_user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "cleric_roles_revoked_by_user_id_app_users_id_fk": { + "name": "cleric_roles_revoked_by_user_id_app_users_id_fk", + "tableFrom": "cleric_roles", + "tableTo": "app_users", + "columnsFrom": [ + "revoked_by_user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.dao_proposals": { + "name": "dao_proposals", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "dao_address": { + "name": "dao_address", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "chain_id": { + "name": "chain_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "proposal_id": { + "name": "proposal_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "proposal_number": { + "name": "proposal_number", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "title": { + "name": "title", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "status": { + "name": "status", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "execution_tx_hash": { + "name": "execution_tx_hash", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "executed_at": { + "name": "executed_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "daohaus_url": { + "name": "daohaus_url", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "raw_metadata": { + "name": "raw_metadata", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "dao_proposals_chain_dao_proposal_unique": { + "name": "dao_proposals_chain_dao_proposal_unique", + "columns": [ + { + "expression": "chain_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "lower(\"dao_address\")", + "asc": true, + "isExpression": true, + "nulls": "last" + }, + { + "expression": "proposal_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + }, + "dao_proposals_chain_execution_tx_unique": { + "name": "dao_proposals_chain_execution_tx_unique", + "columns": [ + { + "expression": "chain_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "lower(\"execution_tx_hash\")", + "asc": true, + "isExpression": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + }, + "dao_proposals_executed_at_idx": { + "name": "dao_proposals_executed_at_idx", + "columns": [ + { + "expression": "executed_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "dao_proposals_status_idx": { + "name": "dao_proposals_status_idx", + "columns": [ + { + "expression": "status", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.entities": { + "name": "entities", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "type": { + "name": "type", + "type": "entity_type", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "name_encrypted": { + "name": "name_encrypted", + "type": "jsonb", + "primaryKey": false, + "notNull": true + }, + "website_encrypted": { + "name": "website_encrypted", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "notes_encrypted": { + "name": "notes_encrypted", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "is_member": { + "name": "is_member", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "archived_at": { + "name": "archived_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "entities_type_idx": { + "name": "entities_type_idx", + "columns": [ + { + "expression": "type", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "entities_archived_at_idx": { + "name": "entities_archived_at_idx", + "columns": [ + { + "expression": "archived_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.entity_addresses": { + "name": "entity_addresses", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "entity_id": { + "name": "entity_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "address": { + "name": "address", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "chain_id": { + "name": "chain_id", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "label_encrypted": { + "name": "label_encrypted", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "entity_addresses_entity_id_idx": { + "name": "entity_addresses_entity_id_idx", + "columns": [ + { + "expression": "entity_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "entity_addresses_address_idx": { + "name": "entity_addresses_address_idx", + "columns": [ + { + "expression": "address", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "entity_addresses_chain_address_unique": { + "name": "entity_addresses_chain_address_unique", + "columns": [ + { + "expression": "coalesce(\"chain_id\", -1)", + "asc": true, + "isExpression": true, + "nulls": "last" + }, + { + "expression": "lower(\"address\")", + "asc": true, + "isExpression": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "entity_addresses_entity_id_entities_id_fk": { + "name": "entity_addresses_entity_id_entities_id_fk", + "tableFrom": "entity_addresses", + "tableTo": "entities", + "columnsFrom": [ + "entity_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.ledger_entries": { + "name": "ledger_entries", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "quarter_id": { + "name": "quarter_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "source": { + "name": "source", + "type": "ledger_source", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "source_external_id": { + "name": "source_external_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "category": { + "name": "category", + "type": "ledger_category", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'uncategorized'" + }, + "verification_status": { + "name": "verification_status", + "type": "verification_status", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'verified'" + }, + "occurred_at": { + "name": "occurred_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "chain_id": { + "name": "chain_id", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "tx_hash": { + "name": "tx_hash", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "treasury_account_id": { + "name": "treasury_account_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "treasury_transaction_transfer_id": { + "name": "treasury_transaction_transfer_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "asset_symbol": { + "name": "asset_symbol", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "asset_amount": { + "name": "asset_amount", + "type": "numeric(36, 18)", + "primaryKey": false, + "notNull": true + }, + "usd_amount": { + "name": "usd_amount", + "type": "numeric(18, 2)", + "primaryKey": false, + "notNull": true + }, + "counterparty_entity_id": { + "name": "counterparty_entity_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "raid_id": { + "name": "raid_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "rip_id": { + "name": "rip_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "notes_encrypted": { + "name": "notes_encrypted", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "source_metadata": { + "name": "source_metadata", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "ledger_entries_quarter_id_idx": { + "name": "ledger_entries_quarter_id_idx", + "columns": [ + { + "expression": "quarter_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "ledger_entries_category_idx": { + "name": "ledger_entries_category_idx", + "columns": [ + { + "expression": "category", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "ledger_entries_source_external_id_unique": { + "name": "ledger_entries_source_external_id_unique", + "columns": [ + { + "expression": "source_external_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + }, + "ledger_entries_tx_hash_idx": { + "name": "ledger_entries_tx_hash_idx", + "columns": [ + { + "expression": "tx_hash", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "ledger_entries_treasury_transfer_unique": { + "name": "ledger_entries_treasury_transfer_unique", + "columns": [ + { + "expression": "treasury_transaction_transfer_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + }, + "ledger_entries_raid_id_idx": { + "name": "ledger_entries_raid_id_idx", + "columns": [ + { + "expression": "raid_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "ledger_entries_rip_id_idx": { + "name": "ledger_entries_rip_id_idx", + "columns": [ + { + "expression": "rip_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "ledger_entries_occurred_at_idx": { + "name": "ledger_entries_occurred_at_idx", + "columns": [ + { + "expression": "occurred_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "ledger_entries_quarter_id_quarters_id_fk": { + "name": "ledger_entries_quarter_id_quarters_id_fk", + "tableFrom": "ledger_entries", + "tableTo": "quarters", + "columnsFrom": [ + "quarter_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "ledger_entries_treasury_account_id_treasury_accounts_id_fk": { + "name": "ledger_entries_treasury_account_id_treasury_accounts_id_fk", + "tableFrom": "ledger_entries", + "tableTo": "treasury_accounts", + "columnsFrom": [ + "treasury_account_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "ledger_entries_treasury_transaction_transfer_id_treasury_transaction_transfers_id_fk": { + "name": "ledger_entries_treasury_transaction_transfer_id_treasury_transaction_transfers_id_fk", + "tableFrom": "ledger_entries", + "tableTo": "treasury_transaction_transfers", + "columnsFrom": [ + "treasury_transaction_transfer_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "ledger_entries_counterparty_entity_id_entities_id_fk": { + "name": "ledger_entries_counterparty_entity_id_entities_id_fk", + "tableFrom": "ledger_entries", + "tableTo": "entities", + "columnsFrom": [ + "counterparty_entity_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "ledger_entries_raid_id_raids_id_fk": { + "name": "ledger_entries_raid_id_raids_id_fk", + "tableFrom": "ledger_entries", + "tableTo": "raids", + "columnsFrom": [ + "raid_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "ledger_entries_rip_id_rips_id_fk": { + "name": "ledger_entries_rip_id_rips_id_fk", + "tableFrom": "ledger_entries", + "tableTo": "rips", + "columnsFrom": [ + "rip_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.membership_activities": { + "name": "membership_activities", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "quarter_id": { + "name": "quarter_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "dao_proposal_id": { + "name": "dao_proposal_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "type": { + "name": "type", + "type": "membership_activity_type", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "dao_address": { + "name": "dao_address", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "chain_id": { + "name": "chain_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "member_address": { + "name": "member_address", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "recipient_address": { + "name": "recipient_address", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "tx_hash": { + "name": "tx_hash", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "executed_at": { + "name": "executed_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "proposal_id": { + "name": "proposal_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "proposal_title": { + "name": "proposal_title", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "asset_address": { + "name": "asset_address", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "asset_symbol": { + "name": "asset_symbol", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "asset_amount": { + "name": "asset_amount", + "type": "numeric(36, 18)", + "primaryKey": false, + "notNull": false + }, + "usd_amount": { + "name": "usd_amount", + "type": "numeric(18, 2)", + "primaryKey": false, + "notNull": false + }, + "shares": { + "name": "shares", + "type": "numeric(36, 18)", + "primaryKey": false, + "notNull": false + }, + "loot": { + "name": "loot", + "type": "numeric(36, 18)", + "primaryKey": false, + "notNull": false + }, + "raw_metadata": { + "name": "raw_metadata", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "membership_activities_chain_tx_type_member_unique": { + "name": "membership_activities_chain_tx_type_member_unique", + "columns": [ + { + "expression": "chain_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "lower(\"tx_hash\")", + "asc": true, + "isExpression": true, + "nulls": "last" + }, + { + "expression": "type", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "lower(\"member_address\")", + "asc": true, + "isExpression": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + }, + "membership_activities_quarter_id_idx": { + "name": "membership_activities_quarter_id_idx", + "columns": [ + { + "expression": "quarter_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "membership_activities_dao_proposal_id_idx": { + "name": "membership_activities_dao_proposal_id_idx", + "columns": [ + { + "expression": "dao_proposal_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "membership_activities_executed_at_idx": { + "name": "membership_activities_executed_at_idx", + "columns": [ + { + "expression": "executed_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "membership_activities_type_idx": { + "name": "membership_activities_type_idx", + "columns": [ + { + "expression": "type", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "membership_activities_member_address_idx": { + "name": "membership_activities_member_address_idx", + "columns": [ + { + "expression": "member_address", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "membership_activities_quarter_id_quarters_id_fk": { + "name": "membership_activities_quarter_id_quarters_id_fk", + "tableFrom": "membership_activities", + "tableTo": "quarters", + "columnsFrom": [ + "quarter_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "membership_activities_dao_proposal_id_dao_proposals_id_fk": { + "name": "membership_activities_dao_proposal_id_dao_proposals_id_fk", + "tableFrom": "membership_activities", + "tableTo": "dao_proposals", + "columnsFrom": [ + "dao_proposal_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.quarter_balance_snapshots": { + "name": "quarter_balance_snapshots", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "quarter_id": { + "name": "quarter_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "treasury_account_id": { + "name": "treasury_account_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "boundary": { + "name": "boundary", + "type": "quarter_balance_boundary", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "account_address": { + "name": "account_address", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "chain_id": { + "name": "chain_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "block_number": { + "name": "block_number", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "block_timestamp": { + "name": "block_timestamp", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "symbol": { + "name": "symbol", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "decimals": { + "name": "decimals", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "raw_amount": { + "name": "raw_amount", + "type": "numeric(78, 0)", + "primaryKey": false, + "notNull": true + }, + "balance": { + "name": "balance", + "type": "numeric(36, 18)", + "primaryKey": false, + "notNull": true + }, + "usd_price": { + "name": "usd_price", + "type": "numeric(18, 8)", + "primaryKey": false, + "notNull": true + }, + "usd_value": { + "name": "usd_value", + "type": "numeric(18, 2)", + "primaryKey": false, + "notNull": true + }, + "price_source": { + "name": "price_source", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "quarter_balance_snapshots_quarter_boundary_idx": { + "name": "quarter_balance_snapshots_quarter_boundary_idx", + "columns": [ + { + "expression": "quarter_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "boundary", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "quarter_balance_snapshots_unique": { + "name": "quarter_balance_snapshots_unique", + "columns": [ + { + "expression": "quarter_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "boundary", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "chain_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "lower(\"account_address\")", + "isExpression": true, + "asc": true, + "nulls": "last" + }, + { + "expression": "symbol", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "quarter_balance_snapshots_quarter_id_quarters_id_fk": { + "name": "quarter_balance_snapshots_quarter_id_quarters_id_fk", + "tableFrom": "quarter_balance_snapshots", + "tableTo": "quarters", + "columnsFrom": [ + "quarter_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "quarter_balance_snapshots_treasury_account_id_treasury_accounts_id_fk": { + "name": "quarter_balance_snapshots_treasury_account_id_treasury_accounts_id_fk", + "tableFrom": "quarter_balance_snapshots", + "tableTo": "treasury_accounts", + "columnsFrom": [ + "treasury_account_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.quarter_sync_statuses": { + "name": "quarter_sync_statuses", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "quarter_id": { + "name": "quarter_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "run_id": { + "name": "run_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "overall_status": { + "name": "overall_status", + "type": "quarter_sync_overall_status", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'idle'" + }, + "current_step": { + "name": "current_step", + "type": "quarter_sync_step", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "transactions_status": { + "name": "transactions_status", + "type": "quarter_sync_step_status", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'pending'" + }, + "proposals_status": { + "name": "proposals_status", + "type": "quarter_sync_step_status", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'pending'" + }, + "membership_status": { + "name": "membership_status", + "type": "quarter_sync_step_status", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'pending'" + }, + "balances_status": { + "name": "balances_status", + "type": "quarter_sync_step_status", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'pending'" + }, + "finalize_status": { + "name": "finalize_status", + "type": "quarter_sync_step_status", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'pending'" + }, + "transactions_started_at": { + "name": "transactions_started_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "transactions_completed_at": { + "name": "transactions_completed_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "proposals_started_at": { + "name": "proposals_started_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "proposals_completed_at": { + "name": "proposals_completed_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "membership_started_at": { + "name": "membership_started_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "membership_completed_at": { + "name": "membership_completed_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "balances_started_at": { + "name": "balances_started_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "balances_completed_at": { + "name": "balances_completed_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "finalize_started_at": { + "name": "finalize_started_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "finalize_completed_at": { + "name": "finalize_completed_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "transactions_error": { + "name": "transactions_error", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "proposals_error": { + "name": "proposals_error", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "membership_error": { + "name": "membership_error", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "balances_error": { + "name": "balances_error", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "finalize_error": { + "name": "finalize_error", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "imported_transactions": { + "name": "imported_transactions", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "imported_transfers": { + "name": "imported_transfers", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "scanned_transfers": { + "name": "scanned_transfers", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "sync_error_count": { + "name": "sync_error_count", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "proposal_linked_transactions": { + "name": "proposal_linked_transactions", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "proposal_matches": { + "name": "proposal_matches", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "membership_activities": { + "name": "membership_activities", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "last_synced_at": { + "name": "last_synced_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "quarter_sync_statuses_quarter_id_unique": { + "name": "quarter_sync_statuses_quarter_id_unique", + "columns": [ + { + "expression": "quarter_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + }, + "quarter_sync_statuses_overall_status_idx": { + "name": "quarter_sync_statuses_overall_status_idx", + "columns": [ + { + "expression": "overall_status", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "quarter_sync_statuses_last_synced_at_idx": { + "name": "quarter_sync_statuses_last_synced_at_idx", + "columns": [ + { + "expression": "last_synced_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "quarter_sync_statuses_quarter_id_quarters_id_fk": { + "name": "quarter_sync_statuses_quarter_id_quarters_id_fk", + "tableFrom": "quarter_sync_statuses", + "tableTo": "quarters", + "columnsFrom": [ + "quarter_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.quarters": { + "name": "quarters", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "label": { + "name": "label", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "year": { + "name": "year", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "quarter": { + "name": "quarter", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "starts_on": { + "name": "starts_on", + "type": "date", + "primaryKey": false, + "notNull": true + }, + "ends_on": { + "name": "ends_on", + "type": "date", + "primaryKey": false, + "notNull": true + }, + "status": { + "name": "status", + "type": "quarter_status", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'draft'" + }, + "published_at": { + "name": "published_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "reopened_at": { + "name": "reopened_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "quarters_year_quarter_unique": { + "name": "quarters_year_quarter_unique", + "columns": [ + { + "expression": "year", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "quarter", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + }, + "quarters_status_idx": { + "name": "quarters_status_idx", + "columns": [ + { + "expression": "status", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.raids": { + "name": "raids", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "client_entity_id": { + "name": "client_entity_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "name_encrypted": { + "name": "name_encrypted", + "type": "jsonb", + "primaryKey": false, + "notNull": true + }, + "notes_encrypted": { + "name": "notes_encrypted", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "archived_at": { + "name": "archived_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "raids_client_entity_id_idx": { + "name": "raids_client_entity_id_idx", + "columns": [ + { + "expression": "client_entity_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "raids_archived_at_idx": { + "name": "raids_archived_at_idx", + "columns": [ + { + "expression": "archived_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "raids_client_entity_id_entities_id_fk": { + "name": "raids_client_entity_id_entities_id_fk", + "tableFrom": "raids", + "tableTo": "entities", + "columnsFrom": [ + "client_entity_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "restrict", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.rips": { + "name": "rips", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "title_encrypted": { + "name": "title_encrypted", + "type": "jsonb", + "primaryKey": false, + "notNull": true + }, + "url_encrypted": { + "name": "url_encrypted", + "type": "jsonb", + "primaryKey": false, + "notNull": true + }, + "created_by_wallet_address": { + "name": "created_by_wallet_address", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "rips_created_at_idx": { + "name": "rips_created_at_idx", + "columns": [ + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "rips_created_by_wallet_address_idx": { + "name": "rips_created_by_wallet_address_idx", + "columns": [ + { + "expression": "lower(\"created_by_wallet_address\")", + "asc": true, + "isExpression": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.treasury_accounts": { + "name": "treasury_accounts", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "name_encrypted": { + "name": "name_encrypted", + "type": "jsonb", + "primaryKey": false, + "notNull": true + }, + "address": { + "name": "address", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "chain_id": { + "name": "chain_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "type": { + "name": "type", + "type": "treasury_account_type", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "is_dao_controlled": { + "name": "is_dao_controlled", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": true + }, + "notes_encrypted": { + "name": "notes_encrypted", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "archived_at": { + "name": "archived_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "treasury_accounts_chain_address_unique": { + "name": "treasury_accounts_chain_address_unique", + "columns": [ + { + "expression": "chain_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "address", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + }, + "treasury_accounts_type_idx": { + "name": "treasury_accounts_type_idx", + "columns": [ + { + "expression": "type", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "treasury_accounts_archived_at_idx": { + "name": "treasury_accounts_archived_at_idx", + "columns": [ + { + "expression": "archived_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.treasury_balance_assets": { + "name": "treasury_balance_assets", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "snapshot_id": { + "name": "snapshot_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "symbol": { + "name": "symbol", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "decimals": { + "name": "decimals", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "raw_amount": { + "name": "raw_amount", + "type": "numeric(78, 0)", + "primaryKey": false, + "notNull": true + }, + "balance": { + "name": "balance", + "type": "numeric(36, 18)", + "primaryKey": false, + "notNull": true + }, + "usd_price": { + "name": "usd_price", + "type": "numeric(18, 8)", + "primaryKey": false, + "notNull": true + }, + "usd_value": { + "name": "usd_value", + "type": "numeric(18, 2)", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "treasury_balance_assets_snapshot_id_idx": { + "name": "treasury_balance_assets_snapshot_id_idx", + "columns": [ + { + "expression": "snapshot_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "treasury_balance_assets_snapshot_symbol_unique": { + "name": "treasury_balance_assets_snapshot_symbol_unique", + "columns": [ + { + "expression": "snapshot_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "symbol", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "treasury_balance_assets_snapshot_id_treasury_balance_snapshots_id_fk": { + "name": "treasury_balance_assets_snapshot_id_treasury_balance_snapshots_id_fk", + "tableFrom": "treasury_balance_assets", + "tableTo": "treasury_balance_snapshots", + "columnsFrom": [ + "snapshot_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.treasury_balance_snapshots": { + "name": "treasury_balance_snapshots", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "account_address": { + "name": "account_address", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "chain_id": { + "name": "chain_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "status": { + "name": "status", + "type": "treasury_snapshot_status", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "total_usd": { + "name": "total_usd", + "type": "numeric(18, 2)", + "primaryKey": false, + "notNull": true + }, + "synced_at": { + "name": "synced_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "error_message": { + "name": "error_message", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "treasury_balance_snapshots_chain_account_synced_idx": { + "name": "treasury_balance_snapshots_chain_account_synced_idx", + "columns": [ + { + "expression": "chain_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "account_address", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "synced_at", + "isExpression": false, + "asc": false, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "treasury_balance_snapshots_synced_at_idx": { + "name": "treasury_balance_snapshots_synced_at_idx", + "columns": [ + { + "expression": "synced_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.treasury_transaction_transfers": { + "name": "treasury_transaction_transfers", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "treasury_transaction_id": { + "name": "treasury_transaction_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "treasury_account_id": { + "name": "treasury_account_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "transfer_id": { + "name": "transfer_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "direction": { + "name": "direction", + "type": "treasury_transfer_direction", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "transfer_type": { + "name": "transfer_type", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "account_address": { + "name": "account_address", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "chain_id": { + "name": "chain_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "tx_hash": { + "name": "tx_hash", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "executed_at": { + "name": "executed_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "from_address": { + "name": "from_address", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "to_address": { + "name": "to_address", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "token_address": { + "name": "token_address", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "asset_symbol": { + "name": "asset_symbol", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "asset_name": { + "name": "asset_name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "decimals": { + "name": "decimals", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "raw_amount": { + "name": "raw_amount", + "type": "numeric(78, 0)", + "primaryKey": false, + "notNull": true + }, + "amount": { + "name": "amount", + "type": "numeric(36, 18)", + "primaryKey": false, + "notNull": true + }, + "usd_price": { + "name": "usd_price", + "type": "numeric(18, 8)", + "primaryKey": false, + "notNull": false + }, + "usd_amount": { + "name": "usd_amount", + "type": "numeric(18, 2)", + "primaryKey": false, + "notNull": false + }, + "raw_metadata": { + "name": "raw_metadata", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "treasury_transaction_transfers_chain_transfer_unique": { + "name": "treasury_transaction_transfers_chain_transfer_unique", + "columns": [ + { + "expression": "chain_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "lower(\"account_address\")", + "asc": true, + "isExpression": true, + "nulls": "last" + }, + { + "expression": "transfer_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + }, + "treasury_transaction_transfers_transaction_id_idx": { + "name": "treasury_transaction_transfers_transaction_id_idx", + "columns": [ + { + "expression": "treasury_transaction_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "treasury_transaction_transfers_treasury_account_id_idx": { + "name": "treasury_transaction_transfers_treasury_account_id_idx", + "columns": [ + { + "expression": "treasury_account_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "treasury_transaction_transfers_tx_hash_idx": { + "name": "treasury_transaction_transfers_tx_hash_idx", + "columns": [ + { + "expression": "tx_hash", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "treasury_transaction_transfers_executed_at_idx": { + "name": "treasury_transaction_transfers_executed_at_idx", + "columns": [ + { + "expression": "executed_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "treasury_transaction_transfers_treasury_transaction_id_treasury_transactions_id_fk": { + "name": "treasury_transaction_transfers_treasury_transaction_id_treasury_transactions_id_fk", + "tableFrom": "treasury_transaction_transfers", + "tableTo": "treasury_transactions", + "columnsFrom": [ + "treasury_transaction_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "treasury_transaction_transfers_treasury_account_id_treasury_accounts_id_fk": { + "name": "treasury_transaction_transfers_treasury_account_id_treasury_accounts_id_fk", + "tableFrom": "treasury_transaction_transfers", + "tableTo": "treasury_accounts", + "columnsFrom": [ + "treasury_account_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.treasury_transactions": { + "name": "treasury_transactions", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "dao_proposal_id": { + "name": "dao_proposal_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "treasury_account_id": { + "name": "treasury_account_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "source": { + "name": "source", + "type": "ledger_source", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "account_address": { + "name": "account_address", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "chain_id": { + "name": "chain_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "tx_hash": { + "name": "tx_hash", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "safe_transaction_hash": { + "name": "safe_transaction_hash", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "transaction_type": { + "name": "transaction_type", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "executed_at": { + "name": "executed_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "block_number": { + "name": "block_number", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "raw_metadata": { + "name": "raw_metadata", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "imported_at": { + "name": "imported_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "treasury_transactions_chain_account_tx_unique": { + "name": "treasury_transactions_chain_account_tx_unique", + "columns": [ + { + "expression": "chain_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "lower(\"account_address\")", + "asc": true, + "isExpression": true, + "nulls": "last" + }, + { + "expression": "lower(\"tx_hash\")", + "asc": true, + "isExpression": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + }, + "treasury_transactions_tx_hash_idx": { + "name": "treasury_transactions_tx_hash_idx", + "columns": [ + { + "expression": "tx_hash", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "treasury_transactions_account_executed_idx": { + "name": "treasury_transactions_account_executed_idx", + "columns": [ + { + "expression": "chain_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "account_address", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "executed_at", + "isExpression": false, + "asc": false, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "treasury_transactions_treasury_account_id_idx": { + "name": "treasury_transactions_treasury_account_id_idx", + "columns": [ + { + "expression": "treasury_account_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "treasury_transactions_dao_proposal_id_idx": { + "name": "treasury_transactions_dao_proposal_id_idx", + "columns": [ + { + "expression": "dao_proposal_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "treasury_transactions_dao_proposal_id_dao_proposals_id_fk": { + "name": "treasury_transactions_dao_proposal_id_dao_proposals_id_fk", + "tableFrom": "treasury_transactions", + "tableTo": "dao_proposals", + "columnsFrom": [ + "dao_proposal_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "treasury_transactions_treasury_account_id_treasury_accounts_id_fk": { + "name": "treasury_transactions_treasury_account_id_treasury_accounts_id_fk", + "tableFrom": "treasury_transactions", + "tableTo": "treasury_accounts", + "columnsFrom": [ + "treasury_account_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + } + }, + "enums": { + "public.audit_action": { + "name": "audit_action", + "schema": "public", + "values": [ + "create", + "update", + "delete", + "import", + "classify", + "publish", + "reopen", + "grant_role", + "revoke_role" + ] + }, + "public.entity_type": { + "name": "entity_type", + "schema": "public", + "values": [ + "client", + "provider", + "subcontractor" + ] + }, + "public.ledger_category": { + "name": "ledger_category", + "schema": "public", + "values": [ + "raid_revenue", + "raid_spoils", + "subcontractor_payout", + "rip_expense", + "provider_expense", + "member_dues", + "ragequit", + "treasury_transfer", + "uncategorized" + ] + }, + "public.ledger_source": { + "name": "ledger_source", + "schema": "public", + "values": [ + "main_safe", + "side_vault", + "operator", + "manual", + "bank_csv", + "dao_proposal" + ] + }, + "public.membership_activity_type": { + "name": "membership_activity_type", + "schema": "public", + "values": [ + "join", + "ragequit" + ] + }, + "public.quarter_balance_boundary": { + "name": "quarter_balance_boundary", + "schema": "public", + "values": [ + "opening", + "closing" + ] + }, + "public.quarter_status": { + "name": "quarter_status", + "schema": "public", + "values": [ + "draft", + "ready_for_review", + "published", + "reopened" + ] + }, + "public.quarter_sync_overall_status": { + "name": "quarter_sync_overall_status", + "schema": "public", + "values": [ + "idle", + "running", + "success", + "partial", + "failed" + ] + }, + "public.quarter_sync_step": { + "name": "quarter_sync_step", + "schema": "public", + "values": [ + "transactions", + "proposals", + "membership", + "balances", + "finalize" + ] + }, + "public.quarter_sync_step_status": { + "name": "quarter_sync_step_status", + "schema": "public", + "values": [ + "pending", + "running", + "success", + "failed" + ] + }, + "public.treasury_account_type": { + "name": "treasury_account_type", + "schema": "public", + "values": [ + "main_safe", + "side_vault", + "operator", + "bank" + ] + }, + "public.treasury_snapshot_status": { + "name": "treasury_snapshot_status", + "schema": "public", + "values": [ + "pending_live_sync", + "synced", + "stale_syncing", + "partial", + "failed" + ] + }, + "public.treasury_transfer_direction": { + "name": "treasury_transfer_direction", + "schema": "public", + "values": [ + "inflow", + "outflow", + "internal" + ] + }, + "public.verification_status": { + "name": "verification_status", + "schema": "public", + "values": [ + "verified", + "unverified" + ] + } + }, + "schemas": {}, + "sequences": {}, + "roles": {}, + "policies": {}, + "views": {}, + "_meta": { + "columns": {}, + "schemas": {}, + "tables": {} + } +} diff --git a/drizzle/meta/_journal.json b/drizzle/meta/_journal.json index b903fd2..533ac45 100644 --- a/drizzle/meta/_journal.json +++ b/drizzle/meta/_journal.json @@ -106,6 +106,20 @@ "when": 1781459469441, "tag": "0014_freezing_peter_quill", "breakpoints": true + }, + { + "idx": 15, + "version": "7", + "when": 1781736665354, + "tag": "0015_bumpy_green_goblin", + "breakpoints": true + }, + { + "idx": 16, + "version": "7", + "when": 1781746972671, + "tag": "0016_rapid_loa", + "breakpoints": true } ] } \ No newline at end of file diff --git a/package.json b/package.json index 62da915..7f3776e 100644 --- a/package.json +++ b/package.json @@ -24,6 +24,7 @@ "class-variance-authority": "^0.7.1", "clsx": "^2.1.1", "drizzle-orm": "^0.45.2", + "exceljs": "^4.4.0", "iron-session": "^8.0.4", "lucide-react": "^1.17.0", "next": "16.2.6", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e16b77b..dda8a47 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -29,6 +29,9 @@ importers: drizzle-orm: specifier: ^0.45.2 version: 0.45.2(@neondatabase/serverless@1.1.0)(@types/pg@8.18.0)(pg@8.18.0) + exceljs: + specifier: ^4.4.0 + version: 4.4.0 iron-session: specifier: ^8.0.4 version: 8.0.4 @@ -712,6 +715,12 @@ packages: resolution: {integrity: sha512-43/qtrDUokr7LJqoF2c3+RInu/t4zfrpYdoSDfYyhg52rwLV6TnOvdG4fXm7IkSB3wErkcmJS9iEhjVtOSEjjA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@fast-csv/format@4.3.5': + resolution: {integrity: sha512-8iRn6QF3I8Ak78lNAa+Gdl5MJJBM5vRHivFtMRUWINdevNo00K7OXxS2PshawLKTejVwieIlPmK5YlLu6w4u8A==} + + '@fast-csv/parse@4.3.6': + resolution: {integrity: sha512-uRsLYksqpbDmWaSmzvJcuApSEe38+6NQZBUsuAyMZKqHxH0g1wcJgsKUvN3WC8tewaqFjBMMGrkHmC+T7k8LvA==} + '@floating-ui/core@1.7.5': resolution: {integrity: sha512-1Ih4WTWyw0+lKyFMcBHGbb5U5FtuHJuujoyyr5zTaWS5EYMeT6Jb2AuDeftsCsEuchO+mM2ij5+q9crhydzLhQ==} @@ -777,89 +786,105 @@ packages: resolution: {integrity: sha512-excjX8DfsIcJ10x1Kzr4RcWe1edC9PquDRRPx3YVCvQv+U5p7Yin2s32ftzikXojb1PIFc/9Mt28/y+iRklkrw==} cpu: [arm64] os: [linux] + libc: [glibc] '@img/sharp-libvips-linux-arm@1.2.4': resolution: {integrity: sha512-bFI7xcKFELdiNCVov8e44Ia4u2byA+l3XtsAj+Q8tfCwO6BQ8iDojYdvoPMqsKDkuoOo+X6HZA0s0q11ANMQ8A==} cpu: [arm] os: [linux] + libc: [glibc] '@img/sharp-libvips-linux-ppc64@1.2.4': resolution: {integrity: sha512-FMuvGijLDYG6lW+b/UvyilUWu5Ayu+3r2d1S8notiGCIyYU/76eig1UfMmkZ7vwgOrzKzlQbFSuQfgm7GYUPpA==} cpu: [ppc64] os: [linux] + libc: [glibc] '@img/sharp-libvips-linux-riscv64@1.2.4': resolution: {integrity: sha512-oVDbcR4zUC0ce82teubSm+x6ETixtKZBh/qbREIOcI3cULzDyb18Sr/Wcyx7NRQeQzOiHTNbZFF1UwPS2scyGA==} cpu: [riscv64] os: [linux] + libc: [glibc] '@img/sharp-libvips-linux-s390x@1.2.4': resolution: {integrity: sha512-qmp9VrzgPgMoGZyPvrQHqk02uyjA0/QrTO26Tqk6l4ZV0MPWIW6LTkqOIov+J1yEu7MbFQaDpwdwJKhbJvuRxQ==} cpu: [s390x] os: [linux] + libc: [glibc] '@img/sharp-libvips-linux-x64@1.2.4': resolution: {integrity: sha512-tJxiiLsmHc9Ax1bz3oaOYBURTXGIRDODBqhveVHonrHJ9/+k89qbLl0bcJns+e4t4rvaNBxaEZsFtSfAdquPrw==} cpu: [x64] os: [linux] + libc: [glibc] '@img/sharp-libvips-linuxmusl-arm64@1.2.4': resolution: {integrity: sha512-FVQHuwx1IIuNow9QAbYUzJ+En8KcVm9Lk5+uGUQJHaZmMECZmOlix9HnH7n1TRkXMS0pGxIJokIVB9SuqZGGXw==} cpu: [arm64] os: [linux] + libc: [musl] '@img/sharp-libvips-linuxmusl-x64@1.2.4': resolution: {integrity: sha512-+LpyBk7L44ZIXwz/VYfglaX/okxezESc6UxDSoyo2Ks6Jxc4Y7sGjpgU9s4PMgqgjj1gZCylTieNamqA1MF7Dg==} cpu: [x64] os: [linux] + libc: [musl] '@img/sharp-linux-arm64@0.34.5': resolution: {integrity: sha512-bKQzaJRY/bkPOXyKx5EVup7qkaojECG6NLYswgktOZjaXecSAeCWiZwwiFf3/Y+O1HrauiE3FVsGxFg8c24rZg==} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} cpu: [arm64] os: [linux] + libc: [glibc] '@img/sharp-linux-arm@0.34.5': resolution: {integrity: sha512-9dLqsvwtg1uuXBGZKsxem9595+ujv0sJ6Vi8wcTANSFpwV/GONat5eCkzQo/1O6zRIkh0m/8+5BjrRr7jDUSZw==} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} cpu: [arm] os: [linux] + libc: [glibc] '@img/sharp-linux-ppc64@0.34.5': resolution: {integrity: sha512-7zznwNaqW6YtsfrGGDA6BRkISKAAE1Jo0QdpNYXNMHu2+0dTrPflTLNkpc8l7MUP5M16ZJcUvysVWWrMefZquA==} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} cpu: [ppc64] os: [linux] + libc: [glibc] '@img/sharp-linux-riscv64@0.34.5': resolution: {integrity: sha512-51gJuLPTKa7piYPaVs8GmByo7/U7/7TZOq+cnXJIHZKavIRHAP77e3N2HEl3dgiqdD/w0yUfiJnII77PuDDFdw==} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} cpu: [riscv64] os: [linux] + libc: [glibc] '@img/sharp-linux-s390x@0.34.5': resolution: {integrity: sha512-nQtCk0PdKfho3eC5MrbQoigJ2gd1CgddUMkabUj+rBevs8tZ2cULOx46E7oyX+04WGfABgIwmMC0VqieTiR4jg==} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} cpu: [s390x] os: [linux] + libc: [glibc] '@img/sharp-linux-x64@0.34.5': resolution: {integrity: sha512-MEzd8HPKxVxVenwAa+JRPwEC7QFjoPWuS5NZnBt6B3pu7EG2Ge0id1oLHZpPJdn3OQK+BQDiw9zStiHBTJQQQQ==} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} cpu: [x64] os: [linux] + libc: [glibc] '@img/sharp-linuxmusl-arm64@0.34.5': resolution: {integrity: sha512-fprJR6GtRsMt6Kyfq44IsChVZeGN97gTD331weR1ex1c1rypDEABN6Tm2xa1wE6lYb5DdEnk03NZPqA7Id21yg==} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} cpu: [arm64] os: [linux] + libc: [musl] '@img/sharp-linuxmusl-x64@0.34.5': resolution: {integrity: sha512-Jg8wNT1MUzIvhBFxViqrEhWDGzqymo3sV7z7ZsaWbZNDLXRJZoRGrjulp60YYtV4wfY8VIKcWidjojlLcWrd8Q==} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} cpu: [x64] os: [linux] + libc: [musl] '@img/sharp-wasm32@0.34.5': resolution: {integrity: sha512-OdWTEiVkY2PHwqkbBI8frFxQQFekHaSSkUIJkwzclWZe64O1X4UlUjqqqLaPbUpMOQk6FBu/HtlGXNblIs0huw==} @@ -933,24 +958,28 @@ packages: engines: {node: '>= 10'} cpu: [arm64] os: [linux] + libc: [glibc] '@next/swc-linux-arm64-musl@16.2.6': resolution: {integrity: sha512-URUTu1+dMkxJsPFgm+OeEvq9wf5sujw0EvgYy80TDGHTSLTnIHeqb0Eu8A3sC95IRgjejQL+kC4mw+4yPxiAXA==} engines: {node: '>= 10'} cpu: [arm64] os: [linux] + libc: [musl] '@next/swc-linux-x64-gnu@16.2.6': resolution: {integrity: sha512-DOj182mPV8G3UkrayLoREM5YEYI+Dk5wv7Ox9xl1fFibAELEsFD0lDPfHIeILlutMMfdyhlzYPELG3peuKaurw==} engines: {node: '>= 10'} cpu: [x64] os: [linux] + libc: [glibc] '@next/swc-linux-x64-musl@16.2.6': resolution: {integrity: sha512-HKQ5SP/V/ub73UvF7n/zeJlxk2kLmtL7Wzrg4WfmkjmNos5onJ2tKu7yZOPdL18A6Svfn3max29ym+ry7NkK4g==} engines: {node: '>= 10'} cpu: [x64] os: [linux] + libc: [musl] '@next/swc-win32-arm64-msvc@16.2.6': resolution: {integrity: sha512-LZXpTlPyS5v7HhSmnvsLGP3iIYgYOBnc8r8ArlT55sGHV89bR2HlDdBjWQ+PY6SJMmk8TuVGFuxalnP3k/0Dwg==} @@ -1067,24 +1096,28 @@ packages: engines: {node: '>= 20'} cpu: [arm64] os: [linux] + libc: [glibc] '@tailwindcss/oxide-linux-arm64-musl@4.3.0': resolution: {integrity: sha512-Z6sukiQsngnWO+l39X4pPbiWT81IC+PLKF+PHxIlyZbGNb9MODfYlXEVlFvej5BOZInWX01kVyzeLvHsXhfczQ==} engines: {node: '>= 20'} cpu: [arm64] os: [linux] + libc: [musl] '@tailwindcss/oxide-linux-x64-gnu@4.3.0': resolution: {integrity: sha512-DRNdQRpSGzRGfARVuVkxvM8Q12nh19l4BF/G7zGA1oe+9wcC6saFBHTISrpIcKzhiXtSrlSrluCfvMuledoCTQ==} engines: {node: '>= 20'} cpu: [x64] os: [linux] + libc: [glibc] '@tailwindcss/oxide-linux-x64-musl@4.3.0': resolution: {integrity: sha512-Z0IADbDo8bh6I7h2IQMx601AdXBLfFpEdUotft86evd/8ZPflZe9COPO8Q1vw+pfLWIUo9zN/JGZvwuAJqduqg==} engines: {node: '>= 20'} cpu: [x64] os: [linux] + libc: [musl] '@tailwindcss/oxide-wasm32-wasi@4.3.0': resolution: {integrity: sha512-HNZGOUxEmElksYR7S6sC5jTeNGpobAsy9u7Gu0AskJ8/20FR9GqebUyB+HBcU/ax6BHuiuJi+Oda4B+YX6H1yA==} @@ -1137,6 +1170,9 @@ packages: '@types/json5@0.0.29': resolution: {integrity: sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==} + '@types/node@14.18.63': + resolution: {integrity: sha512-fAtCfv4jJg+ExtXhvCkCqUKZ+4ok/JQk01qDKhL5BDDoS3AxKXhV5/MAVUZyQnSEd2GT92fkgZl0pz0Q0AzcIQ==} + '@types/node@20.19.41': resolution: {integrity: sha512-ECymXOukMnOoVkC2bb1Vc/w/836DXncOg5m8Xj1RH7xSHZJWNYY6Zh7EH477vcnD5egKNNfy2RpNOmuChhFPgQ==} @@ -1252,51 +1288,61 @@ packages: resolution: {integrity: sha512-zJc0H99FEPoFfSrNpa91HYfxzfAJCr502oxNK1cfdC9hlaFI43RT+JFCann9JUgZmLzzntChHyn13Sgn9ljHNg==} cpu: [arm64] os: [linux] + libc: [glibc] '@unrs/resolver-binding-linux-arm64-musl@1.12.2': resolution: {integrity: sha512-KQ3Lki6l+Pz1k/eBipN41ES+YUK30beLGb9YqcB1O542cyLCNE6GaxrfcY3T6EezmGGk84wb5XyO9loTM9tkcA==} cpu: [arm64] os: [linux] + libc: [musl] '@unrs/resolver-binding-linux-loong64-gnu@1.12.2': resolution: {integrity: sha512-3SJGEh1DborhG6pyxvhPzCT4bbSIVihsvgJc13P1bHG7KLdNDaF9T3gsTwFc7Jw/5Y5/iWOjkEx7Zy0NvCGX3Q==} cpu: [loong64] os: [linux] + libc: [glibc] '@unrs/resolver-binding-linux-loong64-musl@1.12.2': resolution: {integrity: sha512-jiuG/Obbel7uw1PwHNFfrkiKhLAF6mnyZ6aWlOAVN9WqKm8v0OFGnciJIHu8+CMvXLQ8AD51LPzAoUfT21D5Ew==} cpu: [loong64] os: [linux] + libc: [musl] '@unrs/resolver-binding-linux-ppc64-gnu@1.12.2': resolution: {integrity: sha512-q7xRvVpmcfeL+LlZg8Pbbo6QaTZwDU5BaGZbwfhkEsXJn3Was8xYfE0RBH266xZt0rM6B7i8xAYIvjthuUIWHg==} cpu: [ppc64] os: [linux] + libc: [glibc] '@unrs/resolver-binding-linux-riscv64-gnu@1.12.2': resolution: {integrity: sha512-0CVdx6lcnT3Q9inOH8tsMIOJ6ImndllMjqJHg8RLVdB7Vq4SfkEXl9mCSsVNuNA4MCYycRicCUxPCabVHJRr6A==} cpu: [riscv64] os: [linux] + libc: [glibc] '@unrs/resolver-binding-linux-riscv64-musl@1.12.2': resolution: {integrity: sha512-iOwlRo9vnp6R6ohHQS11n0NnfdXx/omhkocmIfaPRpQhKZ+3BDMkkdRVh53qjkFkpPddf+FETA28NwGN7l5l+w==} cpu: [riscv64] os: [linux] + libc: [musl] '@unrs/resolver-binding-linux-s390x-gnu@1.12.2': resolution: {integrity: sha512-HYJtLfXq94q8iZNFT1lknx258wlkkWhZeUXJRqzKBBUJ00CvZ+N33zgbCqimLjsyw5Va6uUxhVa12mI+kaveEw==} cpu: [s390x] os: [linux] + libc: [glibc] '@unrs/resolver-binding-linux-x64-gnu@1.12.2': resolution: {integrity: sha512-mPsUhunKKDih5O96Y6enDQyHc1SqBPlY1E/SfMWDM3EdJ95Z9CArPeCVwCCqbP45ljvivdEk8Fxn+SIb1rDAJQ==} cpu: [x64] os: [linux] + libc: [glibc] '@unrs/resolver-binding-linux-x64-musl@1.12.2': resolution: {integrity: sha512-azrt6+5ydLd8Vt210AAFis/lZevSfPw93EJRIJG+xPu4WCJ8K0kppCTpMyLPcKT7H15M4Jnt2tMp5bOvCkRC6A==} cpu: [x64] os: [linux] + libc: [musl] '@unrs/resolver-binding-openharmony-arm64@1.12.2': resolution: {integrity: sha512-YZ9hP4O0X9PQb8eO980qmLNGH4zT3I9+SZTdt0Pr0YyuGQhYKoOZkV02VzrzyOZJ5xIJ3UFIenKkUkGg8GjgWQ==} @@ -1435,6 +1481,18 @@ packages: apg-js@4.4.0: resolution: {integrity: sha512-fefmXFknJmtgtNEXfPwZKYkMFX4Fyeyz+fNF6JWp87biGOPslJbCBVU158zvKRZfHBKnJDy8CMM40oLFGkXT8Q==} + archiver-utils@2.1.0: + resolution: {integrity: sha512-bEL/yUb/fNNiNTuUz979Z0Yg5L+LzLxGJz8x79lYmR54fmTIb6ob/hNQgkQnIUDWIFjZVQwl9Xs356I6BAMHfw==} + engines: {node: '>= 6'} + + archiver-utils@3.0.4: + resolution: {integrity: sha512-KVgf4XQVrTjhyWmx6cte4RxonPLR9onExufI1jhvw/MQ4BB6IsZD5gT8Lq+u/+pRkWna/6JoHpiQioaqFP5Rzw==} + engines: {node: '>= 10'} + + archiver@5.3.2: + resolution: {integrity: sha512-+25nxyyznAXF7Nef3y0EbBeqmGZgeN/BxHX29Rs39djAfaFalmQ89SE6CWyDCHzGL0yt/ycBtNOmGTW0FyGWNw==} + engines: {node: '>= 10'} + argparse@2.0.1: resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} @@ -1481,6 +1539,9 @@ packages: resolution: {integrity: sha512-hsU18Ae8CDTR6Kgu9DYf0EbCr/a5iGL0rytQDobUcdpYOKokk8LEjVphnXkDkgpi0wYVsqrXuP0bZxJaTqdgoA==} engines: {node: '>= 0.4'} + async@3.2.6: + resolution: {integrity: sha512-htCUDlxyyCLMgaM3xXg0C0LW2xqfuQ6p05pCEIsXuyQ+a1koYKTuBMzRNwmybfLgvJDMd0r1LTn4+E0Ti6C2AA==} + available-typed-arrays@1.0.7: resolution: {integrity: sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==} engines: {node: '>= 0.4'} @@ -1500,14 +1561,33 @@ packages: resolution: {integrity: sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==} engines: {node: 18 || 20 || >=22} + base64-js@1.5.1: + resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==} + baseline-browser-mapping@2.10.32: resolution: {integrity: sha512-wbPvpyjJPC0zdfdKXxqEL3Ea+bOMD/87X4lftiJkkaBiuG6ALQy1SLmEd7BSmVCuwCQsBrCamgBoLyfFDD1EPg==} engines: {node: '>=6.0.0'} hasBin: true + big-integer@1.6.52: + resolution: {integrity: sha512-QxD8cf2eVqJOOz63z6JIN9BzvVs/dlySa5HGSBH5xtR8dPteIRQnBxxKqkNTiT6jbDTF6jAfrd4oMcND9RGbQg==} + engines: {node: '>=0.6'} + + binary@0.3.0: + resolution: {integrity: sha512-D4H1y5KYwpJgK8wk1Cue5LLPgmwHKYSChkbspQg5JtVuR5ulGckxfR62H3AE9UDkdMC8yyXlqYihuz3Aqg2XZg==} + + bl@4.1.0: + resolution: {integrity: sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==} + + bluebird@3.4.7: + resolution: {integrity: sha512-iD3898SR7sWVRHbiQv+sHUtHnMvC1o3nW5rAcqnq3uOn07DSAppZYUkIGslDz6gXC7HfunPe7YVBgoEJASPcHA==} + brace-expansion@1.1.15: resolution: {integrity: sha512-EwOCDEex4quD37XhqM3omwtMoJjr//isUZz1JopUNWms+4Z2ViyM/k1YIRePpoVNnQhENnxtFjLaxNHrT7xIUg==} + brace-expansion@2.1.1: + resolution: {integrity: sha512-WR1cURNjuvBLMZBMbqM0UoE+WAfdUcEV1ccD8PVBVOI+Z3ND4+SZbN8RsfT2bMuG1qwz5RFvPukSZm5fF2D5eA==} + brace-expansion@5.0.6: resolution: {integrity: sha512-kLpxurY4Z4r9sgMsyG0Z9uzsBlgiU/EFKhj/h91/8yHu0edo7XuixOIH3VcJ8kkxs6/jPzoI6U9Vj3WqbMQ94g==} engines: {node: 18 || 20 || >=22} @@ -1521,9 +1601,23 @@ packages: engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} hasBin: true + buffer-crc32@0.2.13: + resolution: {integrity: sha512-VO9Ht/+p3SN7SKWqcrgEzjGbRSJYTx+Q1pTQC0wrWqHx0vpJraQ6GtHx8tvcg1rlK1byhU5gccxgOgj7B0TDkQ==} + buffer-from@1.1.2: resolution: {integrity: sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==} + buffer-indexof-polyfill@1.0.2: + resolution: {integrity: sha512-I7wzHwA3t1/lwXQh+A5PbNvJxgfo5r3xulgpYDB5zckTu/Z9oUK9biouBKQUjEqzaz3HnAT6TYoovmE+GqSf7A==} + engines: {node: '>=0.10'} + + buffer@5.7.1: + resolution: {integrity: sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==} + + buffers@0.1.1: + resolution: {integrity: sha512-9q/rDEGSb/Qsvv2qvzIzdluL5k7AaJOTrw23z9reQthrbF7is4CtlT0DXyO1oei2DCp4uojjzQ7igaSHp1kAEQ==} + engines: {node: '>=0.2.0'} + call-bind-apply-helpers@1.0.2: resolution: {integrity: sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==} engines: {node: '>= 0.4'} @@ -1543,6 +1637,9 @@ packages: caniuse-lite@1.0.30001793: resolution: {integrity: sha512-iwSsYWaCOoh26cV8NwNRViHlrfUvYsHDfRVcbtmw0Kg6PJIZZXwMkj1442FYLBGkeUf1juAsU3DTfxW579mrPA==} + chainsaw@0.1.0: + resolution: {integrity: sha512-75kWfWt6MEKNC8xYXIdRpDehRYY/tNSgwKaJq+dbbDcxORuVrrQ+SEHoWsniVn9XPYfP4gmdWIeDk/4YNp1rNQ==} + chalk@4.1.2: resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} engines: {node: '>=10'} @@ -1564,6 +1661,10 @@ packages: color-name@1.1.4: resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} + compress-commons@4.1.2: + resolution: {integrity: sha512-D3uMHtGc/fcO1Gt1/L7i1e33VOvD4A9hfQLP+6ewd+BvG/gQ84Yh4oftEhAdjSMgBgwGL+jsppT7JYNpo6MHHg==} + engines: {node: '>= 10'} + concat-map@0.0.1: resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} @@ -1574,6 +1675,18 @@ packages: resolution: {integrity: sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==} engines: {node: '>= 0.6'} + core-util-is@1.0.3: + resolution: {integrity: sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==} + + crc-32@1.2.2: + resolution: {integrity: sha512-ROmzCKrTnOwybPcJApAA6WBWij23HVfGVNKqqrZpuyZOHqK2CwHSvpGuyt/UNNvaIjEd8X5IFGp4Mh+Ie1IHJQ==} + engines: {node: '>=0.8'} + hasBin: true + + crc32-stream@4.0.3: + resolution: {integrity: sha512-NT7w2JVU7DFroFdYkeq8cywxrgjPHWkdX1wjpRQXPX5Asews3tA+Ght6lddQO5Mkumffp3X7GEqku3epj2toIw==} + engines: {node: '>= 10'} + cross-spawn@7.0.6: resolution: {integrity: sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==} engines: {node: '>= 8'} @@ -1596,6 +1709,9 @@ packages: resolution: {integrity: sha512-BS8PfmtDGnrgYdOonGZQdLZslWIeCGFP9tpan0hi1Co2Zr2NKADsvGYA8XxuG/4UWgJ6Cjtv+YJnB6MM69QGlQ==} engines: {node: '>= 0.4'} + dayjs@1.11.21: + resolution: {integrity: sha512-98IT+HOahAisibz/yjKbzuOBwYcjJ7BCLPzARyHiyEBmRz4fatF+KPJszEHXsGYjUG234aH/cOjW1wwTbKUZlA==} + debug@3.2.7: resolution: {integrity: sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==} peerDependencies: @@ -1736,12 +1852,18 @@ packages: resolution: {integrity: sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==} engines: {node: '>= 0.4'} + duplexer2@0.1.4: + resolution: {integrity: sha512-asLFVfWWtJ90ZyOUHMqk7/S2w2guQKxUI2itj3d92ADHhxUSbCMGi1f1cBcJ7xM1To+pE/Khbwo1yuNbMEPKeA==} + electron-to-chromium@1.5.364: resolution: {integrity: sha512-G/dYE3+AYhyHwzTwg8UbnXf7zqMERYh7l2jJ3QujhFsH8agSYwtnGAR2aZ7f0AakIKJXd5En/Hre4igIUrdlYw==} emoji-regex@9.2.2: resolution: {integrity: sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==} + end-of-stream@1.4.5: + resolution: {integrity: sha512-ooEGc6HP26xXq/N+GCGOT0JKCLDGrq2bQUZrQ7gyrJiZANJ/8YDTxTpQBXGMn+WbIQXNVpyWymm7KYVICQnyOg==} + enhanced-resolve@5.22.1: resolution: {integrity: sha512-6QEuw3zoX1SJQc7b87aBXke/no+mG2bTBgw29gWMQonLmpEkWoCAVkl+M49e48AZlWzxiDzDZzYdp6kobcyLww==} engines: {node: '>=10.13.0'} @@ -1928,6 +2050,14 @@ packages: eventemitter3@5.0.1: resolution: {integrity: sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==} + exceljs@4.4.0: + resolution: {integrity: sha512-XctvKaEMaj1Ii9oDOqbW/6e1gXknSY4g/aLCDicOXqBE4M0nRWkUu0PTp++UPNzoFY12BNHMfs/VadKIS6llvg==} + engines: {node: '>=8.3.0'} + + fast-csv@4.3.6: + resolution: {integrity: sha512-2RNSpuwwsJGP0frGsOmTb9oUF+VkFSM4SyLTDgwf2ciHWTarN0lQTC+F2f/t5J9QjW+c65VFIAAu85GsvMIusw==} + engines: {node: '>=10.0.0'} + fast-deep-equal@3.1.3: resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} @@ -1976,11 +2106,22 @@ packages: resolution: {integrity: sha512-dKx12eRCVIzqCxFGplyFKJMPvLEWgmNtUrpTiJIR5u97zEhRG8ySrtboPHZXx7daLxQVrl643cTzbab2tkQjxg==} engines: {node: '>= 0.4'} + fs-constants@1.0.0: + resolution: {integrity: sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==} + + fs.realpath@1.0.0: + resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} + fsevents@2.3.3: resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==} engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} os: [darwin] + fstream@1.0.12: + resolution: {integrity: sha512-WvJ193OHa0GHPEL+AycEJgxvBEwyfRkN1vhjca23OaPVMCaLCXTd5qAu82AjTcgP1UJmytkOKb63Ypde7raDIg==} + engines: {node: '>=0.6'} + deprecated: This package is no longer supported. + function-bind@1.1.2: resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==} @@ -2022,6 +2163,10 @@ packages: resolution: {integrity: sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==} engines: {node: '>=10.13.0'} + glob@7.2.3: + resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} + deprecated: Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me + globals@14.0.0: resolution: {integrity: sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==} engines: {node: '>=18'} @@ -2074,6 +2219,9 @@ packages: hermes-parser@0.25.1: resolution: {integrity: sha512-6pEjquH3rqaI6cYAXYPcz9MS4rY6R4ngRgrgfDshRptUZIc3lw0MCIJIGDj9++mfySOuPTHB4nrSW99BCvOPIA==} + ieee754@1.2.1: + resolution: {integrity: sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==} + ignore@5.3.2: resolution: {integrity: sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==} engines: {node: '>= 4'} @@ -2082,6 +2230,9 @@ packages: resolution: {integrity: sha512-Hs59xBNfUIunMFgWAbGX5cq6893IbWg4KnrjbYwX3tx0ztorVgTDA6B2sxf8ejHJ4wz8BqGUMYlnzNBer5NvGg==} engines: {node: '>= 4'} + immediate@3.0.6: + resolution: {integrity: sha512-XXOFtyqDjNDAQxVfYxuF7g9Il/IbWmmlQg2MYKOH8ExIT1qg6xc4zyS3HaEEATgs1btfzxq15ciUiY7gjSXRGQ==} + import-fresh@3.3.1: resolution: {integrity: sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ==} engines: {node: '>=6'} @@ -2090,6 +2241,13 @@ packages: resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} engines: {node: '>=0.8.19'} + inflight@1.0.6: + resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==} + deprecated: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful. + + inherits@2.0.4: + resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} + internal-slot@1.1.0: resolution: {integrity: sha512-4gd7VpWNQNB4UKKCFFVcp1AVv+FMOgs9NKzjHKusc8jTMhd5eL1NqQqOpE0KzMds804/yHlglp3uxgluOqAPLw==} engines: {node: '>= 0.4'} @@ -2203,6 +2361,9 @@ packages: resolution: {integrity: sha512-mfcwb6IzQyOKTs84CQMrOwW4gQcaTOAWJ0zzJCl2WSPDrWk/OzDaImWFH3djXhb24g4eudZfLRozAvPGw4d9hQ==} engines: {node: '>= 0.4'} + isarray@1.0.0: + resolution: {integrity: sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==} + isarray@2.0.5: resolution: {integrity: sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==} @@ -2256,6 +2417,9 @@ packages: resolution: {integrity: sha512-ZZow9HBI5O6EPgSJLUb8n2NKgmVWTwCvHGwFuJlMjvLFqlGG6pjirPhtdsseaLZjSibD8eegzmYpUZwoIlj2cQ==} engines: {node: '>=4.0'} + jszip@3.10.1: + resolution: {integrity: sha512-xXDvecyTpGLrqFrvkrUSoxxfJI5AH7U8zxxtVclpsUtMCq4JQ290LY8AW5c7Ggnr/Y/oK+bQMbqK2qmtk3pN4g==} + keyv@4.5.4: resolution: {integrity: sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==} @@ -2266,10 +2430,17 @@ packages: resolution: {integrity: sha512-MbjN408fEndfiQXbFQ1vnd+1NoLDsnQW41410oQBXiyXDMYH5z505juWa4KUE1LqxRC7DgOgZDbKLxHIwm27hA==} engines: {node: '>=0.10'} + lazystream@1.0.1: + resolution: {integrity: sha512-b94GiNHQNy6JNTrt5w6zNyffMrNkXZb3KTkCZJb2V1xaEGCk093vkZ2jk3tpaeP33/OiXC+WvK9AxUebnf5nbw==} + engines: {node: '>= 0.6.3'} + levn@0.4.1: resolution: {integrity: sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==} engines: {node: '>= 0.8.0'} + lie@3.3.0: + resolution: {integrity: sha512-UaiMJzeWRlEujzAuw5LokY1L5ecNQYZKfmyZ9L7wDHb/p5etKaxXhohBcrw0EYby+G/NA52vRSN4N39dxHAIwQ==} + lightningcss-android-arm64@1.32.0: resolution: {integrity: sha512-YK7/ClTt4kAK0vo6w3X+Pnm0D2cf2vPHbhOXdoNti1Ga0al1P4TBZhwjATvjNwLEBCnKvjJc2jQgHXH0NEwlAg==} engines: {node: '>= 12.0.0'} @@ -2305,24 +2476,28 @@ packages: engines: {node: '>= 12.0.0'} cpu: [arm64] os: [linux] + libc: [glibc] lightningcss-linux-arm64-musl@1.32.0: resolution: {integrity: sha512-UpQkoenr4UJEzgVIYpI80lDFvRmPVg6oqboNHfoH4CQIfNA+HOrZ7Mo7KZP02dC6LjghPQJeBsvXhJod/wnIBg==} engines: {node: '>= 12.0.0'} cpu: [arm64] os: [linux] + libc: [musl] lightningcss-linux-x64-gnu@1.32.0: resolution: {integrity: sha512-V7Qr52IhZmdKPVr+Vtw8o+WLsQJYCTd8loIfpDaMRWGUZfBOYEJeyJIkqGIDMZPwPx24pUMfwSxxI8phr/MbOA==} engines: {node: '>= 12.0.0'} cpu: [x64] os: [linux] + libc: [glibc] lightningcss-linux-x64-musl@1.32.0: resolution: {integrity: sha512-bYcLp+Vb0awsiXg/80uCRezCYHNg1/l3mt0gzHnWV9XP1W5sKa5/TCdGWaR/zBM2PeF/HbsQv/j2URNOiVuxWg==} engines: {node: '>= 12.0.0'} cpu: [x64] os: [linux] + libc: [musl] lightningcss-win32-arm64-msvc@1.32.0: resolution: {integrity: sha512-8SbC8BR40pS6baCM8sbtYDSwEVQd4JlFTOlaD3gWGHfThTcABnNDBda6eTZeqbofalIJhFx0qKzgHJmcPTnGdw==} @@ -2340,13 +2515,56 @@ packages: resolution: {integrity: sha512-NXYBzinNrblfraPGyrbPoD19C1h9lfI/1mzgWYvXUTe414Gz/X1FD2XBZSZM7rRTrMA8JL3OtAaGifrIKhQ5yQ==} engines: {node: '>= 12.0.0'} + listenercount@1.0.1: + resolution: {integrity: sha512-3mk/Zag0+IJxeDrxSgaDPy4zZ3w05PRZeJNnlWhzFz5OkX49J4krc+A8X2d2M69vGMBEX0uyl8M+W+8gH+kBqQ==} + locate-path@6.0.0: resolution: {integrity: sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==} engines: {node: '>=10'} + lodash.defaults@4.2.0: + resolution: {integrity: sha512-qjxPLHd3r5DnsdGacqOMU6pb/avJzdh9tFX2ymgoZE27BmjXrNy/y4LoaiTeAb+O3gL8AfpJGtqfX/ae2leYYQ==} + + lodash.difference@4.5.0: + resolution: {integrity: sha512-dS2j+W26TQ7taQBGN8Lbbq04ssV3emRw4NY58WErlTO29pIqS0HmoT5aJ9+TUQ1N3G+JOZSji4eugsWwGp9yPA==} + + lodash.escaperegexp@4.1.2: + resolution: {integrity: sha512-TM9YBvyC84ZxE3rgfefxUWiQKLilstD6k7PTGt6wfbtXF8ixIJLOL3VYyV/z+ZiPLsVxAsKAFVwWlWeb2Y8Yyw==} + + lodash.flatten@4.4.0: + resolution: {integrity: sha512-C5N2Z3DgnnKr0LOpv/hKCgKdb7ZZwafIrsesve6lmzvZIRZRGaZ/l6Q8+2W7NaT+ZwO3fFlSCzCzrDCFdJfZ4g==} + + lodash.groupby@4.6.0: + resolution: {integrity: sha512-5dcWxm23+VAoz+awKmBaiBvzox8+RqMgFhi7UvX9DHZr2HdxHXM/Wrf8cfKpsW37RNrvtPn6hSwNqurSILbmJw==} + + lodash.isboolean@3.0.3: + resolution: {integrity: sha512-Bz5mupy2SVbPHURB98VAcw+aHh4vRV5IPNhILUCsOzRmsTmSQ17jIuqopAentWoehktxGd9e/hbIXq980/1QJg==} + + lodash.isequal@4.5.0: + resolution: {integrity: sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ==} + deprecated: This package is deprecated. Use require('node:util').isDeepStrictEqual instead. + + lodash.isfunction@3.0.9: + resolution: {integrity: sha512-AirXNj15uRIMMPihnkInB4i3NHeb4iBtNg9WRWuK2o31S+ePwwNmDPaTL3o7dTJ+VXNZim7rFs4rxN4YU1oUJw==} + + lodash.isnil@4.0.0: + resolution: {integrity: sha512-up2Mzq3545mwVnMhTDMdfoG1OurpA/s5t88JmQX809eH3C8491iu2sfKhTfhQtKY78oPNhiaHJUpT/dUDAAtng==} + + lodash.isplainobject@4.0.6: + resolution: {integrity: sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==} + + lodash.isundefined@3.0.1: + resolution: {integrity: sha512-MXB1is3s899/cD8jheYYE2V9qTHwKvt+npCwpD+1Sxm3Q3cECXCiYHjeHWXNwr6Q0SOBPrYUDxendrO6goVTEA==} + lodash.merge@4.6.2: resolution: {integrity: sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==} + lodash.union@4.6.0: + resolution: {integrity: sha512-c4pB2CdGrGdjMKYLA+XiRDO7Y0PRQbm/Gzg8qMj+QH+pFVAoTp5sBpO0odL3FjoPCGjK96p6qsP+yQoiLoOBcw==} + + lodash.uniq@4.5.0: + resolution: {integrity: sha512-xfBaXQd9ryd9dlSDvnvI0lvxfLJlYAZzXomUYzLKtUeOQvOP5piqAWuGtrhWeqaXK9hhoM/iyJc5AV+XfsX3HQ==} + loose-envify@1.4.0: resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==} hasBin: true @@ -2381,6 +2599,10 @@ packages: minimatch@3.1.5: resolution: {integrity: sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==} + minimatch@5.1.9: + resolution: {integrity: sha512-7o1wEA2RyMP7Iu7GNba9vc0RWWGACJOCZBJX2GJWip0ikV+wcOsgVuY9uE8CPiyQhkGFSlhuSkZPavN7u1c2Fw==} + engines: {node: '>=10'} + minimist@1.2.8: resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==} @@ -2392,6 +2614,10 @@ packages: typescript: optional: true + mkdirp@0.5.6: + resolution: {integrity: sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==} + hasBin: true + ms@2.1.3: resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} @@ -2437,6 +2663,10 @@ packages: resolution: {integrity: sha512-GYVXHE2KnrzAfsAjl4uP++evGFCrAU1jta4ubEjIG7YWt/64Gqv66a30yKwWczVjA6j3bM4nBwH7Pk1JmDHaxQ==} engines: {node: '>=18'} + normalize-path@3.0.0: + resolution: {integrity: sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==} + engines: {node: '>=0.10.0'} + object-assign@4.1.1: resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} engines: {node: '>=0.10.0'} @@ -2469,6 +2699,9 @@ packages: resolution: {integrity: sha512-gXah6aZrcUxjWg2zR2MwouP2eHlCBzdV4pygudehaKXSGW4v2AsRQUK+lwwXhii6KFZcunEnmSUoYp5CXibxtA==} engines: {node: '>= 0.4'} + once@1.4.0: + resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} + optionator@0.9.4: resolution: {integrity: sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==} engines: {node: '>= 0.8.0'} @@ -2493,6 +2726,9 @@ packages: resolution: {integrity: sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==} engines: {node: '>=10'} + pako@1.0.11: + resolution: {integrity: sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==} + parent-module@1.0.1: resolution: {integrity: sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==} engines: {node: '>=6'} @@ -2501,6 +2737,10 @@ packages: resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==} engines: {node: '>=8'} + path-is-absolute@1.0.1: + resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==} + engines: {node: '>=0.10.0'} + path-key@3.1.1: resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==} engines: {node: '>=8'} @@ -2585,6 +2825,9 @@ packages: resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==} engines: {node: '>= 0.8.0'} + process-nextick-args@2.0.1: + resolution: {integrity: sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==} + prop-types@15.8.1: resolution: {integrity: sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==} @@ -2607,6 +2850,16 @@ packages: resolution: {integrity: sha512-9nfp2hYpCwOjAN+8TZFGhtWEwgvWHXqESH8qT89AT/lWklpLON22Lc8pEtnpsZz7VmawabSU0gCjnj8aC0euHQ==} engines: {node: '>=0.10.0'} + readable-stream@2.3.8: + resolution: {integrity: sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==} + + readable-stream@3.6.2: + resolution: {integrity: sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==} + engines: {node: '>= 6'} + + readdir-glob@1.1.3: + resolution: {integrity: sha512-v05I2k7xN8zXvPD9N+z/uhXPaj0sUFCe2rcWZIpBsqxfP7xXFQ0tipAd/wjj1YxWyWtUS5IDJpOG82JKt2EAVA==} + reflect.getprototypeof@1.0.10: resolution: {integrity: sha512-00o4I+DVrefhv+nX0ulyi3biSHCPDe+yLv5o/p6d/UVlirijB8E16FtfwSAi4g3tcqrQ4lRAqQSoFEZJehYEcw==} engines: {node: '>= 0.4'} @@ -2634,6 +2887,11 @@ packages: resolution: {integrity: sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==} engines: {iojs: '>=1.0.0', node: '>=0.10.0'} + rimraf@2.7.1: + resolution: {integrity: sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==} + deprecated: Rimraf versions prior to v4 are no longer supported + hasBin: true + run-parallel@1.2.0: resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} @@ -2641,6 +2899,12 @@ packages: resolution: {integrity: sha512-wtZlHyOje6OZTGqAoaDKxFkgRtkF9CnHAVnCHKfuj200wAgL+bSJhdsCD2l0Qx/2ekEXjPWcyKkfGb5CPboslg==} engines: {node: '>=0.4'} + safe-buffer@5.1.2: + resolution: {integrity: sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==} + + safe-buffer@5.2.1: + resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} + safe-push-apply@1.0.0: resolution: {integrity: sha512-iKE9w/Z7xCzUMIZqdBsp6pEQvwuEebH4vdpjcDWnyzaI6yl6O9FHvVpmGelvEHNsoY6wGblkxR6Zty/h00WiSA==} engines: {node: '>= 0.4'} @@ -2649,6 +2913,10 @@ packages: resolution: {integrity: sha512-x/+Cz4YrimQxQccJf5mKEbIa1NzeCRNI5Ecl/ekmlYaampdNLPalVyIcCZNNH3MvmqBugV5TMYZXv0ljslUlaw==} engines: {node: '>= 0.4'} + saxes@5.0.1: + resolution: {integrity: sha512-5LBh1Tls8c9xgGjw3QrMwETmTMVk0oFgvrFSvWx62llR2hcEInrKNZ2GZCCuuy2lvWrdl5jhbpeqc5hRYKFOcw==} + engines: {node: '>=10'} + scheduler@0.27.0: resolution: {integrity: sha512-eNv+WrVbKu1f3vbYJT/xtiF5syA5HPIMtf9IgY/nKg0sWqzAUEvqY/xm7OcZc/qafLx/iO9FgOmeSAp4v5ti/Q==} @@ -2676,6 +2944,9 @@ packages: resolution: {integrity: sha512-RJRdvCo6IAnPdsvP/7m6bsQqNnn1FCBX5ZNtFL98MmFF/4xAIJTIg1YbHW5DC2W5SKZanrC6i4HsJqlajw/dZw==} engines: {node: '>= 0.4'} + setimmediate@1.0.5: + resolution: {integrity: sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA==} + sharp@0.34.5: resolution: {integrity: sha512-Ou9I5Ft9WNcCbXrU9cMgPBcCK8LiwLqcbywW3t4oDV37n1pzpuNLsYiAV8eODnjbtQlSDwZ2cUEeQz4E54Hltg==} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} @@ -2754,6 +3025,12 @@ packages: resolution: {integrity: sha512-UXSH262CSZY1tfu3G3Secr6uGLCFVPMhIqHjlgCUtCCcgihYc/xKs9djMTMUOb2j1mVSeU8EU6NWc/iQKU6Gfg==} engines: {node: '>= 0.4'} + string_decoder@1.1.1: + resolution: {integrity: sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==} + + string_decoder@1.3.0: + resolution: {integrity: sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==} + strip-bom@3.0.0: resolution: {integrity: sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==} engines: {node: '>=4'} @@ -2793,14 +3070,25 @@ packages: resolution: {integrity: sha512-uxc/zpqFg6x7C8vOE7lh6Lbda8eEL9zmVm/PLeTPBRhh1xCgdWaQ+J1CUieGpIfm2HdtsUpRv+HshiasBMcc6A==} engines: {node: '>=6'} + tar-stream@2.2.0: + resolution: {integrity: sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==} + engines: {node: '>=6'} + tinyglobby@0.2.16: resolution: {integrity: sha512-pn99VhoACYR8nFHhxqix+uvsbXineAasWm5ojXoN8xEwK5Kd3/TrhNn1wByuD52UxWRLy8pu+kRMniEi6Eq9Zg==} engines: {node: '>=12.0.0'} + tmp@0.2.7: + resolution: {integrity: sha512-e0votIpp4Uo2AJYSzVHV6xCcawuiez3DzqDAbrTc3YxBkplN6e+dM13ZeIcZnDg/QpSuU2zfZ3rzwY8ukEnaXw==} + engines: {node: '>=14.14'} + to-regex-range@5.0.1: resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} engines: {node: '>=8.0'} + traverse@0.3.9: + resolution: {integrity: sha512-iawgk0hLP3SxGKDfnDJf8wTz4p2qImnyihM5Hh/sGvQ3K37dPi/w8sRhdNIxYA1TwFwc5mDhIJq+O0RsvXBKdQ==} + ts-api-utils@2.5.0: resolution: {integrity: sha512-OJ/ibxhPlqrMM0UiNHJ/0CKQkoKF243/AEmplt3qpRgkW8VG7IfOS41h7V8TjITqdByHzrjcS/2si+y4lIh8NA==} engines: {node: '>=18.12'} @@ -2872,6 +3160,9 @@ packages: unrs-resolver@1.12.2: resolution: {integrity: sha512-dmlRxBJJayXjqTwC+JtF1HhJmgf3ftQ3YejFcZrf4+KKtJv0qDsK1pjqaaVjG7wJ5NJ6UVP1OqRMQ71Z4C3rxQ==} + unzipper@0.10.14: + resolution: {integrity: sha512-ti4wZj+0bQTiX2KmKWuwj7lhV+2n//uXEotUmGuQqrbVZSEGFMbI68+c6JCQ8aAmUWYvtHEz2A8K6wXvueR/6g==} + update-browserslist-db@1.2.3: resolution: {integrity: sha512-Js0m9cx+qOgDxo0eMiFGEueWztz+d4+M3rGlmKPT+T4IS/jP4ylw3Nwpu6cpTTP8R1MAC1kF4VbdLt3ARf209w==} hasBin: true @@ -2891,6 +3182,14 @@ packages: peerDependencies: react: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 + util-deprecate@1.0.2: + resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} + + uuid@8.3.2: + resolution: {integrity: sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==} + deprecated: uuid@10 and below is no longer supported. For ESM codebases, update to uuid@latest. For CommonJS codebases, use uuid@11 (but be aware this version will likely be deprecated in 2028). + hasBin: true + viem@2.51.3: resolution: {integrity: sha512-DA4EbrsvatzzLo6MwcWWiv6kI6dIr3I9HH9B6qsJaClN/s0AjIDUz5RIxl+VmGrovIUCcIvG8744yuGH7d37zw==} peerDependencies: @@ -2935,6 +3234,9 @@ packages: resolution: {integrity: sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==} engines: {node: '>=0.10.0'} + wrappy@1.0.2: + resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} + ws@8.17.1: resolution: {integrity: sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==} engines: {node: '>=10.0.0'} @@ -2959,6 +3261,9 @@ packages: utf-8-validate: optional: true + xmlchars@2.2.0: + resolution: {integrity: sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==} + xtend@4.0.2: resolution: {integrity: sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==} engines: {node: '>=0.4'} @@ -2970,6 +3275,10 @@ packages: resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} engines: {node: '>=10'} + zip-stream@4.1.1: + resolution: {integrity: sha512-9qv4rlDiopXg4E69k+vMHjNN63YFMe9sZMrdlvKnCjlCRWeCBswPPMPUfx+ipsAWq1LXHe70RcbaHdJJpS6hyQ==} + engines: {node: '>= 10'} + zod-validation-error@4.0.2: resolution: {integrity: sha512-Q6/nZLe6jxuU80qb/4uJ4t5v2VEZ44lzQjPDhYJNztRQ4wyWc6VF3D3Kb/fAuPetZQnhS3hnajCf9CsWesghLQ==} engines: {node: '>=18.0.0'} @@ -3426,6 +3735,25 @@ snapshots: '@eslint/core': 0.17.0 levn: 0.4.1 + '@fast-csv/format@4.3.5': + dependencies: + '@types/node': 14.18.63 + lodash.escaperegexp: 4.1.2 + lodash.isboolean: 3.0.3 + lodash.isequal: 4.5.0 + lodash.isfunction: 3.0.9 + lodash.isnil: 4.0.0 + + '@fast-csv/parse@4.3.6': + dependencies: + '@types/node': 14.18.63 + lodash.escaperegexp: 4.1.2 + lodash.groupby: 4.6.0 + lodash.isfunction: 3.0.9 + lodash.isnil: 4.0.0 + lodash.isundefined: 3.0.1 + lodash.uniq: 4.5.0 + '@floating-ui/core@1.7.5': dependencies: '@floating-ui/utils': 0.2.11 @@ -3766,6 +4094,8 @@ snapshots: '@types/json5@0.0.29': {} + '@types/node@14.18.63': {} + '@types/node@20.19.41': dependencies: undici-types: 6.21.0 @@ -4002,6 +4332,42 @@ snapshots: apg-js@4.4.0: {} + archiver-utils@2.1.0: + dependencies: + glob: 7.2.3 + graceful-fs: 4.2.11 + lazystream: 1.0.1 + lodash.defaults: 4.2.0 + lodash.difference: 4.5.0 + lodash.flatten: 4.4.0 + lodash.isplainobject: 4.0.6 + lodash.union: 4.6.0 + normalize-path: 3.0.0 + readable-stream: 2.3.8 + + archiver-utils@3.0.4: + dependencies: + glob: 7.2.3 + graceful-fs: 4.2.11 + lazystream: 1.0.1 + lodash.defaults: 4.2.0 + lodash.difference: 4.5.0 + lodash.flatten: 4.4.0 + lodash.isplainobject: 4.0.6 + lodash.union: 4.6.0 + normalize-path: 3.0.0 + readable-stream: 3.6.2 + + archiver@5.3.2: + dependencies: + archiver-utils: 2.1.0 + async: 3.2.6 + buffer-crc32: 0.2.13 + readable-stream: 3.6.2 + readdir-glob: 1.1.3 + tar-stream: 2.2.0 + zip-stream: 4.1.1 + argparse@2.0.1: {} aria-query@5.3.2: {} @@ -4077,6 +4443,8 @@ snapshots: async-function@1.0.0: {} + async@3.2.6: {} + available-typed-arrays@1.0.7: dependencies: possible-typed-array-names: 1.1.0 @@ -4089,13 +4457,34 @@ snapshots: balanced-match@4.0.4: {} + base64-js@1.5.1: {} + baseline-browser-mapping@2.10.32: {} + big-integer@1.6.52: {} + + binary@0.3.0: + dependencies: + buffers: 0.1.1 + chainsaw: 0.1.0 + + bl@4.1.0: + dependencies: + buffer: 5.7.1 + inherits: 2.0.4 + readable-stream: 3.6.2 + + bluebird@3.4.7: {} + brace-expansion@1.1.15: dependencies: balanced-match: 1.0.2 concat-map: 0.0.1 + brace-expansion@2.1.1: + dependencies: + balanced-match: 1.0.2 + brace-expansion@5.0.6: dependencies: balanced-match: 4.0.4 @@ -4112,8 +4501,19 @@ snapshots: node-releases: 2.0.46 update-browserslist-db: 1.2.3(browserslist@4.28.2) + buffer-crc32@0.2.13: {} + buffer-from@1.1.2: {} + buffer-indexof-polyfill@1.0.2: {} + + buffer@5.7.1: + dependencies: + base64-js: 1.5.1 + ieee754: 1.2.1 + + buffers@0.1.1: {} + call-bind-apply-helpers@1.0.2: dependencies: es-errors: 1.3.0 @@ -4135,6 +4535,10 @@ snapshots: caniuse-lite@1.0.30001793: {} + chainsaw@0.1.0: + dependencies: + traverse: 0.3.9 + chalk@4.1.2: dependencies: ansi-styles: 4.3.0 @@ -4154,12 +4558,28 @@ snapshots: color-name@1.1.4: {} + compress-commons@4.1.2: + dependencies: + buffer-crc32: 0.2.13 + crc32-stream: 4.0.3 + normalize-path: 3.0.0 + readable-stream: 3.6.2 + concat-map@0.0.1: {} convert-source-map@2.0.0: {} cookie@0.7.2: {} + core-util-is@1.0.3: {} + + crc-32@1.2.2: {} + + crc32-stream@4.0.3: + dependencies: + crc-32: 1.2.2 + readable-stream: 3.6.2 + cross-spawn@7.0.6: dependencies: path-key: 3.1.1 @@ -4188,6 +4608,8 @@ snapshots: es-errors: 1.3.0 is-data-view: 1.0.2 + dayjs@1.11.21: {} + debug@3.2.7: dependencies: ms: 2.1.3 @@ -4237,10 +4659,18 @@ snapshots: es-errors: 1.3.0 gopd: 1.2.0 + duplexer2@0.1.4: + dependencies: + readable-stream: 2.3.8 + electron-to-chromium@1.5.364: {} emoji-regex@9.2.2: {} + end-of-stream@1.4.5: + dependencies: + once: 1.4.0 + enhanced-resolve@5.22.1: dependencies: graceful-fs: 4.2.11 @@ -4654,6 +5084,23 @@ snapshots: eventemitter3@5.0.1: {} + exceljs@4.4.0: + dependencies: + archiver: 5.3.2 + dayjs: 1.11.21 + fast-csv: 4.3.6 + jszip: 3.10.1 + readable-stream: 3.6.2 + saxes: 5.0.1 + tmp: 0.2.7 + unzipper: 0.10.14 + uuid: 8.3.2 + + fast-csv@4.3.6: + dependencies: + '@fast-csv/format': 4.3.5 + '@fast-csv/parse': 4.3.6 + fast-deep-equal@3.1.3: {} fast-glob@3.3.1: @@ -4700,9 +5147,20 @@ snapshots: dependencies: is-callable: 1.2.7 + fs-constants@1.0.0: {} + + fs.realpath@1.0.0: {} + fsevents@2.3.3: optional: true + fstream@1.0.12: + dependencies: + graceful-fs: 4.2.11 + inherits: 2.0.4 + mkdirp: 0.5.6 + rimraf: 2.7.1 + function-bind@1.1.2: {} function.prototype.name@1.1.8: @@ -4756,6 +5214,15 @@ snapshots: dependencies: is-glob: 4.0.3 + glob@7.2.3: + dependencies: + fs.realpath: 1.0.0 + inflight: 1.0.6 + inherits: 2.0.4 + minimatch: 3.1.5 + once: 1.4.0 + path-is-absolute: 1.0.1 + globals@14.0.0: {} globals@16.4.0: {} @@ -4797,10 +5264,14 @@ snapshots: dependencies: hermes-estree: 0.25.1 + ieee754@1.2.1: {} + ignore@5.3.2: {} ignore@7.0.5: {} + immediate@3.0.6: {} + import-fresh@3.3.1: dependencies: parent-module: 1.0.1 @@ -4808,6 +5279,13 @@ snapshots: imurmurhash@0.1.4: {} + inflight@1.0.6: + dependencies: + once: 1.4.0 + wrappy: 1.0.2 + + inherits@2.0.4: {} + internal-slot@1.1.0: dependencies: es-errors: 1.3.0 @@ -4934,6 +5412,8 @@ snapshots: call-bound: 1.0.4 get-intrinsic: 1.3.0 + isarray@1.0.0: {} + isarray@2.0.5: {} isexe@2.0.0: {} @@ -4980,6 +5460,13 @@ snapshots: object.assign: 4.1.7 object.values: 1.2.1 + jszip@3.10.1: + dependencies: + lie: 3.3.0 + pako: 1.0.11 + readable-stream: 2.3.8 + setimmediate: 1.0.5 + keyv@4.5.4: dependencies: json-buffer: 3.0.1 @@ -4990,11 +5477,19 @@ snapshots: dependencies: language-subtag-registry: 0.3.23 + lazystream@1.0.1: + dependencies: + readable-stream: 2.3.8 + levn@0.4.1: dependencies: prelude-ls: 1.2.1 type-check: 0.4.0 + lie@3.3.0: + dependencies: + immediate: 3.0.6 + lightningcss-android-arm64@1.32.0: optional: true @@ -5044,12 +5539,40 @@ snapshots: lightningcss-win32-arm64-msvc: 1.32.0 lightningcss-win32-x64-msvc: 1.32.0 + listenercount@1.0.1: {} + locate-path@6.0.0: dependencies: p-locate: 5.0.0 + lodash.defaults@4.2.0: {} + + lodash.difference@4.5.0: {} + + lodash.escaperegexp@4.1.2: {} + + lodash.flatten@4.4.0: {} + + lodash.groupby@4.6.0: {} + + lodash.isboolean@3.0.3: {} + + lodash.isequal@4.5.0: {} + + lodash.isfunction@3.0.9: {} + + lodash.isnil@4.0.0: {} + + lodash.isplainobject@4.0.6: {} + + lodash.isundefined@3.0.1: {} + lodash.merge@4.6.2: {} + lodash.union@4.6.0: {} + + lodash.uniq@4.5.0: {} + loose-envify@1.4.0: dependencies: js-tokens: 4.0.0 @@ -5083,12 +5606,20 @@ snapshots: dependencies: brace-expansion: 1.1.15 + minimatch@5.1.9: + dependencies: + brace-expansion: 2.1.1 + minimist@1.2.8: {} mipd@0.0.7(typescript@5.9.3): optionalDependencies: typescript: 5.9.3 + mkdirp@0.5.6: + dependencies: + minimist: 1.2.8 + ms@2.1.3: {} nanoid@3.3.12: {} @@ -5130,6 +5661,8 @@ snapshots: node-releases@2.0.46: {} + normalize-path@3.0.0: {} + object-assign@4.1.1: {} object-inspect@1.13.4: {} @@ -5172,6 +5705,10 @@ snapshots: define-properties: 1.2.1 es-object-atoms: 1.1.2 + once@1.4.0: + dependencies: + wrappy: 1.0.2 + optionator@0.9.4: dependencies: deep-is: 0.1.4 @@ -5210,12 +5747,16 @@ snapshots: dependencies: p-limit: 3.1.0 + pako@1.0.11: {} + parent-module@1.0.1: dependencies: callsites: 3.1.0 path-exists@4.0.0: {} + path-is-absolute@1.0.1: {} + path-key@3.1.1: {} path-parse@1.0.7: {} @@ -5287,6 +5828,8 @@ snapshots: prelude-ls@1.2.1: {} + process-nextick-args@2.0.1: {} + prop-types@15.8.1: dependencies: loose-envify: 1.4.0 @@ -5306,6 +5849,26 @@ snapshots: react@19.2.4: {} + readable-stream@2.3.8: + dependencies: + core-util-is: 1.0.3 + inherits: 2.0.4 + isarray: 1.0.0 + process-nextick-args: 2.0.1 + safe-buffer: 5.1.2 + string_decoder: 1.1.1 + util-deprecate: 1.0.2 + + readable-stream@3.6.2: + dependencies: + inherits: 2.0.4 + string_decoder: 1.3.0 + util-deprecate: 1.0.2 + + readdir-glob@1.1.3: + dependencies: + minimatch: 5.1.9 + reflect.getprototypeof@1.0.10: dependencies: call-bind: 1.0.9 @@ -5343,6 +5906,10 @@ snapshots: reusify@1.1.0: {} + rimraf@2.7.1: + dependencies: + glob: 7.2.3 + run-parallel@1.2.0: dependencies: queue-microtask: 1.2.3 @@ -5355,6 +5922,10 @@ snapshots: has-symbols: 1.1.0 isarray: 2.0.5 + safe-buffer@5.1.2: {} + + safe-buffer@5.2.1: {} + safe-push-apply@1.0.0: dependencies: es-errors: 1.3.0 @@ -5366,6 +5937,10 @@ snapshots: es-errors: 1.3.0 is-regex: 1.2.1 + saxes@5.0.1: + dependencies: + xmlchars: 2.2.0 + scheduler@0.27.0: {} semver@6.3.1: {} @@ -5396,6 +5971,8 @@ snapshots: es-errors: 1.3.0 es-object-atoms: 1.1.2 + setimmediate@1.0.5: {} + sharp@0.34.5: dependencies: '@img/colour': 1.1.0 @@ -5536,6 +6113,14 @@ snapshots: define-properties: 1.2.1 es-object-atoms: 1.1.2 + string_decoder@1.1.1: + dependencies: + safe-buffer: 5.1.2 + + string_decoder@1.3.0: + dependencies: + safe-buffer: 5.2.1 + strip-bom@3.0.0: {} strip-json-comments@3.1.1: {} @@ -5559,15 +6144,27 @@ snapshots: tapable@2.3.3: {} + tar-stream@2.2.0: + dependencies: + bl: 4.1.0 + end-of-stream: 1.4.5 + fs-constants: 1.0.0 + inherits: 2.0.4 + readable-stream: 3.6.2 + tinyglobby@0.2.16: dependencies: fdir: 6.5.0(picomatch@4.0.4) picomatch: 4.0.4 + tmp@0.2.7: {} + to-regex-range@5.0.1: dependencies: is-number: 7.0.0 + traverse@0.3.9: {} + ts-api-utils@2.5.0(typescript@5.9.3): dependencies: typescript: 5.9.3 @@ -5681,6 +6278,19 @@ snapshots: '@unrs/resolver-binding-win32-ia32-msvc': 1.12.2 '@unrs/resolver-binding-win32-x64-msvc': 1.12.2 + unzipper@0.10.14: + dependencies: + big-integer: 1.6.52 + binary: 0.3.0 + bluebird: 3.4.7 + buffer-indexof-polyfill: 1.0.2 + duplexer2: 0.1.4 + fstream: 1.0.12 + graceful-fs: 4.2.11 + listenercount: 1.0.1 + readable-stream: 2.3.8 + setimmediate: 1.0.5 + update-browserslist-db@1.2.3(browserslist@4.28.2): dependencies: browserslist: 4.28.2 @@ -5699,6 +6309,10 @@ snapshots: dependencies: react: 19.2.4 + util-deprecate@1.0.2: {} + + uuid@8.3.2: {} + viem@2.51.3(typescript@5.9.3)(zod@4.4.3): dependencies: '@noble/curves': 1.9.1 @@ -5786,16 +6400,26 @@ snapshots: word-wrap@1.2.5: {} + wrappy@1.0.2: {} + ws@8.17.1: {} ws@8.20.1: {} + xmlchars@2.2.0: {} + xtend@4.0.2: {} yallist@3.1.1: {} yocto-queue@0.1.0: {} + zip-stream@4.1.1: + dependencies: + archiver-utils: 3.0.4 + compress-commons: 4.1.2 + readable-stream: 3.6.2 + zod-validation-error@4.0.2(zod@4.4.3): dependencies: zod: 4.4.3 diff --git a/src/app/admin/quarters/[id]/export.xlsx/route.ts b/src/app/admin/quarters/[id]/export.xlsx/route.ts new file mode 100644 index 0000000..79dad87 --- /dev/null +++ b/src/app/admin/quarters/[id]/export.xlsx/route.ts @@ -0,0 +1,64 @@ +import { getAuthSession, serializeSession } from "@/lib/auth/session"; +import { listQuarterReportingPeriods } from "@/lib/quarters"; +import { + buildQuarterXlsxExport, + getQuarterExportFilename, +} from "@/lib/quarter-xlsx-export"; +import { isQuarterExportReady } from "@/lib/quarter-export-readiness"; + +export const runtime = "nodejs"; + +type RouteParams = { + params: Promise<{ + id: string; + }>; +}; + +function responseText(message: string, status: number) { + return new Response(message, { + headers: { + "Content-Type": "text/plain; charset=utf-8", + }, + status, + }); +} + +export async function GET(_request: Request, { params }: RouteParams) { + const session = serializeSession(await getAuthSession()); + + if (!session.authenticated || !session.permissions?.canAccess) { + return responseText("Unauthorized", 401); + } + + const { id } = await params; + const quarter = (await listQuarterReportingPeriods()).find( + (item) => item.id === id, + ); + + if (!quarter) { + return responseText("Quarter not found", 404); + } + + if (!session.permissions.canAdmin && quarter.status !== "published") { + return responseText("Quarter is not published", 403); + } + + if (!isQuarterExportReady(quarter)) { + return responseText( + "Quarter export is not ready. Sync activity and classify every transaction first.", + 409, + ); + } + + const buffer = await buildQuarterXlsxExport(quarter); + const filename = getQuarterExportFilename(quarter); + + return new Response(buffer, { + headers: { + "Cache-Control": "no-store", + "Content-Disposition": `attachment; filename="${filename}"`, + "Content-Type": + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", + }, + }); +} diff --git a/src/app/admin/quarters/[id]/transactions/actions.ts b/src/app/admin/quarters/[id]/transactions/actions.ts index 78364e1..e0743be 100644 --- a/src/app/admin/quarters/[id]/transactions/actions.ts +++ b/src/app/admin/quarters/[id]/transactions/actions.ts @@ -15,7 +15,7 @@ import { treasuryTransactionTransfers, } from "@/db/schema"; import { writeAuditEvent } from "@/lib/audit"; -import { getAuthSession } from "@/lib/auth/session"; +import { canUseAdminAccess, getAuthSession } from "@/lib/auth/session"; import { buildBankCsvNote, parseBankCsvConfirmRows, @@ -31,6 +31,7 @@ import { createRaidForAccess, } from "@/lib/core-entity-mutations"; import { syncMembershipActivitiesForPeriod } from "@/lib/membership-activity"; +import { syncQuarterBalances } from "@/lib/quarter-balances"; import { assertClassificationEntityMatchesCategory, assertRaidIsAvailable, @@ -130,7 +131,7 @@ async function getExistingSourceExternalIds(sourceExternalIds: string[]) { async function requireAdminSession() { const session = await getAuthSession(); - if (!session.address || !session.permissions?.canAdmin) { + if (!canUseAdminAccess(session)) { throw new Error("Admin access required"); } @@ -790,6 +791,8 @@ export async function syncQuarterTransactions(formData: FormData) { throwIfStepFailed(status, "proposals"); status = await syncQuarterMembershipStep({ quarterId, runId: status.runId }); throwIfStepFailed(status, "membership"); + status = await syncQuarterBalancesStep({ quarterId, runId: status.runId }); + throwIfStepFailed(status, "balances"); status = await finalizeQuarterSyncStep({ quarterId, runId: status.runId, @@ -827,6 +830,8 @@ function throwIfStepFailed(status: QuarterSyncStatus, step: string) { ? status.proposalsError : step === "membership" ? status.membershipError + : step === "balances" + ? status.balancesError : status.finalizeError; if (status.overallStatus === "failed" && error) { @@ -988,6 +993,44 @@ export async function syncQuarterMembershipStep({ } } +export async function syncQuarterBalancesStep({ + quarterId, + runId, +}: { + quarterId: string; + runId: string; +}) { + await requireAdminSession(); + + const priorStatus = await getQuarterSyncStatus(quarterId); + if (priorStatus?.membershipStatus !== "success") { + throw new Error("Sync membership activity before quarter balances"); + } + + const quarter = await getQuarterById(quarterId); + + await markQuarterSyncStepRunning({ quarterId, runId, step: "balances" }); + + try { + await syncQuarterBalances(quarter); + const status = await markQuarterSyncStepSuccess({ + quarterId, + runId, + step: "balances", + }); + + revalidateQuarterSyncPaths(quarterId); + return status; + } catch (error) { + return markQuarterSyncStepFailed({ + error: getErrorMessage(error), + quarterId, + runId, + step: "balances", + }); + } +} + export async function finalizeQuarterSyncStep({ quarterId, runId, @@ -1003,7 +1046,8 @@ export async function finalizeQuarterSyncStep({ if ( priorStatus?.transactionsStatus !== "success" || priorStatus.proposalsStatus !== "success" || - priorStatus.membershipStatus !== "success" + priorStatus.membershipStatus !== "success" || + priorStatus.balancesStatus !== "success" ) { throw new Error("Finish each sync step before finalizing"); } diff --git a/src/app/admin/quarters/[id]/transactions/page.tsx b/src/app/admin/quarters/[id]/transactions/page.tsx index 9dad2a3..51afb34 100644 --- a/src/app/admin/quarters/[id]/transactions/page.tsx +++ b/src/app/admin/quarters/[id]/transactions/page.tsx @@ -3,6 +3,7 @@ import { AlertTriangle, BadgeCheck, CircleDollarSign, + Download, Pencil, ExternalLink, FileText, @@ -36,6 +37,13 @@ import { buildQuarterWorkflowSteps, getQuarterSyncStatus, } from "@/lib/quarter-sync"; +import { isQuarterExportReady } from "@/lib/quarter-export-readiness"; +import { + listQuarterBalanceRows, + summarizeQuarterBalanceRows, + type QuarterBalanceRow, + type QuarterAccountBalanceSummary, +} from "@/lib/quarter-balances"; import { getCategoryLabel, IMPORTED_TRANSFER_CLASSIFICATION_CATEGORIES, @@ -110,6 +118,13 @@ function formatCurrency(value: string | null) { }).format(Number(value)); } +function formatCurrencyNumber(value: number) { + return new Intl.NumberFormat("en-US", { + currency: "USD", + style: "currency", + }).format(value); +} + function formatUsdAmount(value: string) { const numericValue = Number(value); @@ -117,7 +132,9 @@ function formatUsdAmount(value: string) { } function isStableAssetSymbol(symbol: string) { - return ["USDC", "XDAI", "WXDAI"].includes(symbol.toUpperCase()); + return ["DAI", "DKUSD", "USDC", "XDAI", "WXDAI"].includes( + symbol.toUpperCase(), + ); } function getDefaultUsdAmount(transfer: TreasuryTransferClassificationView) { @@ -158,6 +175,177 @@ function formatDate(value: string) { }).format(new Date(`${value}T00:00:00.000Z`)); } +function QuarterBalancesPanel({ + balances, + rows, +}: { + balances: QuarterAccountBalanceSummary[]; + rows: QuarterBalanceRow[]; +}) { + if (balances.length === 0) { + return null; + } + + const rowsByAccount = new Map(); + + for (const row of rows) { + const key = `${row.chainId}:${row.accountAddress.toLowerCase()}`; + const accountRows = rowsByAccount.get(key) ?? []; + + accountRows.push(row); + rowsByAccount.set(key, accountRows); + } + + const totalBalance = balances.reduce( + (total, balance) => ({ + closingUsd: total.closingUsd + balance.closingUsd, + netChangeUsd: total.netChangeUsd + balance.netChangeUsd, + openingUsd: total.openingUsd + balance.openingUsd, + }), + { closingUsd: 0, netChangeUsd: 0, openingUsd: 0 }, + ); + + return ( +
+
+
+

Balances

+

Quarter Balances

+
+ + {balances.length} account{balances.length === 1 ? "" : "s"} + +
+
+
+
+

Total

+

+ {balances.length} account{balances.length === 1 ? "" : "s"} +

+
+
+

Opening

+

+ {formatCurrencyNumber(totalBalance.openingUsd)} +

+
+
+

Closing

+

+ {formatCurrencyNumber(totalBalance.closingUsd)} +

+
+
+

Net Change

+

+ {formatCurrencyNumber(totalBalance.netChangeUsd)} +

+
+
+ {balances.map((balance) => { + const accountRows = + rowsByAccount.get( + `${balance.chainId}:${balance.accountAddress.toLowerCase()}`, + ) ?? []; + const assetSymbols = [...new Set(accountRows.map((row) => row.symbol))]; + + return ( +
+ +
+

{balance.accountName}

+

+ {formatAddress(balance.accountAddress)} +

+
+
+

Opening

+

+ {formatCurrencyNumber(balance.openingUsd)} +

+
+
+

Closing

+

+ {formatCurrencyNumber(balance.closingUsd)} +

+
+
+

+ Net Change +

+

+ {formatCurrencyNumber(balance.netChangeUsd)} +

+
+
+
+ + + + + + + + + + + + {assetSymbols.map((symbol) => { + const opening = accountRows.find( + (row) => + row.symbol === symbol && row.boundary === "opening", + ); + const closing = accountRows.find( + (row) => + row.symbol === symbol && row.boundary === "closing", + ); + + return ( + + + + + + + + ); + })} + +
Asset + Opening Balance + + Closing Balance + + Opening USD + + Closing USD +
{symbol} + {opening ? formatTokenAmount(opening.balance) : "-"} + + {closing ? formatTokenAmount(closing.balance) : "-"} + + {opening + ? formatCurrencyNumber(Number(opening.usdValue)) + : "-"} + + {closing + ? formatCurrencyNumber(Number(closing.usdValue)) + : "-"} +
+
+
+ ); + })} +
+
+ ); +} + function formatTimestamp(value: string) { return new Intl.DateTimeFormat("en-US", { dateStyle: "medium", @@ -985,17 +1173,25 @@ export default async function QuarterTransactionsPage({ ); } - const [options, transfers, manualEntries, summary, quarterSyncStatus] = - await Promise.all([ - listClassificationOptions(), - listTreasuryTransferClassifications({ - quarter, - status: "all", - }), - listManualLedgerEntryClassifications({ quarterId: quarter.id }), - getQuarterClassificationSummary(quarter), - getQuarterSyncStatus(quarter.id), - ]); + const [ + options, + transfers, + manualEntries, + summary, + quarterSyncStatus, + balanceRows, + ] = await Promise.all([ + listClassificationOptions(), + listTreasuryTransferClassifications({ + quarter, + status: "all", + }), + listManualLedgerEntryClassifications({ quarterId: quarter.id }), + getQuarterClassificationSummary(quarter), + getQuarterSyncStatus(quarter.id), + listQuarterBalanceRows(quarter.id), + ]); + const balanceSummaries = summarizeQuarterBalanceRows(balanceRows); const toastSyncStatus = query.synced === "1" ? "complete" @@ -1012,6 +1208,11 @@ export default async function QuarterTransactionsPage({ }); const syncComplete = workflowSteps.find((step) => step.key === "sync")?.status === "complete"; + const canExport = isQuarterExportReady({ + ...quarter, + classificationSummary: summary, + syncStatus: quarterSyncStatus, + }); const reviewItems = [ ...manualEntries.map( (entry): QuarterReviewItem => ({ @@ -1059,18 +1260,29 @@ export default async function QuarterTransactionsPage({