Files
kvitt/android/data/schemas/se.hagstedt.kvitt.data.db.KvittDatabase/2.json
T
jacobh2 a8f91ee6ea K2: card purchases on Android (Room 2, card cycle, :feature:cards S-23 to S-27)
- :core:model model/Cards.kt per SPEC §14.2.4 "Changes in v0.35"; ContractTest covers the card wire values.
- :domain matchCardPurchase (§14.5.8), passing match_card_purchase.json (17 cases) in VectorTest.
- :data Room version 2 (card_connections, card_purchases, card_sync_state, MIGRATION_1_2 with its test,
  2.json exported); DTOs for E-36 to E-44 round-tripping K1's examples; the card cycle (E-44 push of
  pending link changes, E-40 pull) after each household cycle and after refresh; CardRepositoryImpl with
  CP-9 prefill, CP-10 matches, offline-first link/unlink/ignore; a local expense delete unlinks.
- :core:fakes FakeCardRepository and fakes/cards scenarios for every state of S-23 to S-27.
- :feature:cards S-23 (sheet and "Välj en annan utgift"), S-24, S-25 (Custom Tab, E-38 every 2 s while
  resumed, return link), S-26 (disconnect dialog), S-27, CardArt with the SJ Prio picture and the drawn
  fallback; 135 goldens and state-holder tests.
- :feature:expense S-7 cardPurchaseId prefill and link on save, S-8 "Från kortköp" line;
  :feature:account S-5 "Från kortköp"; :feature:settings S-13 "Anslut kort".
- :core:design KvittDestination.Cards with credit_card and nav_cards (four destinations, D-172); the
  bar's labels shrink to fit at large font scales. :app routes, kvitt://cards/connected, bindings.
- docs/ux/strings.csv: the card keys of §13.3 plus K2's additions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TQd3pEP9UeN2uifbHknQ7B
2026-10-24 16:51:12 +02:00

1233 lines
38 KiB
JSON

{
"formatVersion": 1,
"database": {
"version": 2,
"identityHash": "b6530112027f347b0de64eab87fdb779",
"entities": [
{
"tableName": "users",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `role` TEXT NOT NULL, `display_name` TEXT NOT NULL, `picture_version` INTEGER, `created_at` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `server_version` INTEGER NOT NULL, `local_updated_at` INTEGER NOT NULL, PRIMARY KEY(`id`))",
"fields": [
{
"fieldPath": "id",
"columnName": "id",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "role",
"columnName": "role",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "displayName",
"columnName": "display_name",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "pictureVersion",
"columnName": "picture_version",
"affinity": "INTEGER"
},
{
"fieldPath": "createdAt",
"columnName": "created_at",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "updatedAt",
"columnName": "updated_at",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "serverVersion",
"columnName": "server_version",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "localUpdatedAt",
"columnName": "local_updated_at",
"affinity": "INTEGER",
"notNull": true
}
],
"primaryKey": {
"autoGenerate": false,
"columnNames": [
"id"
]
}
},
{
"tableName": "accounts",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `name` TEXT NOT NULL, `created_by_user_id` TEXT NOT NULL, `created_at` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `archived_at` TEXT, `deleted_at` TEXT, `server_version` INTEGER NOT NULL, `local_updated_at` INTEGER NOT NULL, PRIMARY KEY(`id`))",
"fields": [
{
"fieldPath": "id",
"columnName": "id",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "name",
"columnName": "name",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "createdByUserId",
"columnName": "created_by_user_id",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "createdAt",
"columnName": "created_at",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "updatedAt",
"columnName": "updated_at",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "archivedAt",
"columnName": "archived_at",
"affinity": "TEXT"
},
{
"fieldPath": "deletedAt",
"columnName": "deleted_at",
"affinity": "TEXT"
},
{
"fieldPath": "serverVersion",
"columnName": "server_version",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "localUpdatedAt",
"columnName": "local_updated_at",
"affinity": "INTEGER",
"notNull": true
}
],
"primaryKey": {
"autoGenerate": false,
"columnNames": [
"id"
]
},
"indices": [
{
"name": "index_accounts_created_at",
"unique": false,
"columnNames": [
"created_at"
],
"orders": [],
"createSql": "CREATE INDEX IF NOT EXISTS `index_accounts_created_at` ON `${TABLE_NAME}` (`created_at`)"
}
]
},
{
"tableName": "account_default_shares",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`account_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `share_bp` INTEGER NOT NULL, PRIMARY KEY(`account_id`, `user_id`))",
"fields": [
{
"fieldPath": "accountId",
"columnName": "account_id",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "userId",
"columnName": "user_id",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "shareBp",
"columnName": "share_bp",
"affinity": "INTEGER",
"notNull": true
}
],
"primaryKey": {
"autoGenerate": false,
"columnNames": [
"account_id",
"user_id"
]
}
},
{
"tableName": "categories",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `default_key` TEXT, `name` TEXT, `icon` TEXT NOT NULL, `color` TEXT NOT NULL, `sort_order` INTEGER NOT NULL, `created_at` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `archived_at` TEXT, `deleted_at` TEXT, `server_version` INTEGER NOT NULL, `local_updated_at` INTEGER NOT NULL, PRIMARY KEY(`id`))",
"fields": [
{
"fieldPath": "id",
"columnName": "id",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "defaultKey",
"columnName": "default_key",
"affinity": "TEXT"
},
{
"fieldPath": "name",
"columnName": "name",
"affinity": "TEXT"
},
{
"fieldPath": "icon",
"columnName": "icon",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "color",
"columnName": "color",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "sortOrder",
"columnName": "sort_order",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "createdAt",
"columnName": "created_at",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "updatedAt",
"columnName": "updated_at",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "archivedAt",
"columnName": "archived_at",
"affinity": "TEXT"
},
{
"fieldPath": "deletedAt",
"columnName": "deleted_at",
"affinity": "TEXT"
},
{
"fieldPath": "serverVersion",
"columnName": "server_version",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "localUpdatedAt",
"columnName": "local_updated_at",
"affinity": "INTEGER",
"notNull": true
}
],
"primaryKey": {
"autoGenerate": false,
"columnNames": [
"id"
]
}
},
{
"tableName": "recurring_templates",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `account_id` TEXT NOT NULL, `category_id` TEXT NOT NULL, `amount_ore` INTEGER NOT NULL, `description` TEXT NOT NULL, `notes` TEXT NOT NULL, `payer_user_id` TEXT NOT NULL, `split_mode` TEXT NOT NULL, `day_of_month` INTEGER NOT NULL, `start_period` TEXT NOT NULL, `end_period` TEXT, `paused` INTEGER NOT NULL, `last_generated_period` TEXT, `created_by_user_id` TEXT NOT NULL, `updated_by_user_id` TEXT NOT NULL, `created_at` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `deleted_at` TEXT, `server_version` INTEGER NOT NULL, `next_occurrence_date` TEXT, `local_updated_at` INTEGER NOT NULL, PRIMARY KEY(`id`))",
"fields": [
{
"fieldPath": "id",
"columnName": "id",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "accountId",
"columnName": "account_id",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "categoryId",
"columnName": "category_id",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "amountOre",
"columnName": "amount_ore",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "description",
"columnName": "description",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "notes",
"columnName": "notes",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "payerUserId",
"columnName": "payer_user_id",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "splitMode",
"columnName": "split_mode",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "dayOfMonth",
"columnName": "day_of_month",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "startPeriod",
"columnName": "start_period",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "endPeriod",
"columnName": "end_period",
"affinity": "TEXT"
},
{
"fieldPath": "paused",
"columnName": "paused",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "lastGeneratedPeriod",
"columnName": "last_generated_period",
"affinity": "TEXT"
},
{
"fieldPath": "createdByUserId",
"columnName": "created_by_user_id",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "updatedByUserId",
"columnName": "updated_by_user_id",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "createdAt",
"columnName": "created_at",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "updatedAt",
"columnName": "updated_at",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "deletedAt",
"columnName": "deleted_at",
"affinity": "TEXT"
},
{
"fieldPath": "serverVersion",
"columnName": "server_version",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "nextOccurrenceDate",
"columnName": "next_occurrence_date",
"affinity": "TEXT"
},
{
"fieldPath": "localUpdatedAt",
"columnName": "local_updated_at",
"affinity": "INTEGER",
"notNull": true
}
],
"primaryKey": {
"autoGenerate": false,
"columnNames": [
"id"
]
},
"indices": [
{
"name": "index_recurring_templates_account_id",
"unique": false,
"columnNames": [
"account_id"
],
"orders": [],
"createSql": "CREATE INDEX IF NOT EXISTS `index_recurring_templates_account_id` ON `${TABLE_NAME}` (`account_id`)"
}
]
},
{
"tableName": "recurring_template_splits",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`template_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `share_bp` INTEGER, `share_ore` INTEGER, PRIMARY KEY(`template_id`, `user_id`))",
"fields": [
{
"fieldPath": "templateId",
"columnName": "template_id",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "userId",
"columnName": "user_id",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "shareBp",
"columnName": "share_bp",
"affinity": "INTEGER"
},
{
"fieldPath": "shareOre",
"columnName": "share_ore",
"affinity": "INTEGER"
}
],
"primaryKey": {
"autoGenerate": false,
"columnNames": [
"template_id",
"user_id"
]
}
},
{
"tableName": "expenses",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `account_id` TEXT NOT NULL, `category_id` TEXT NOT NULL, `amount_ore` INTEGER NOT NULL, `description` TEXT NOT NULL, `notes` TEXT NOT NULL, `expense_date` TEXT NOT NULL, `payer_user_id` TEXT NOT NULL, `split_mode` TEXT NOT NULL, `recurring_template_id` TEXT, `recurring_period` TEXT, `created_by_user_id` TEXT, `updated_by_user_id` TEXT, `created_at` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `deleted_at` TEXT, `server_version` INTEGER, `pending` INTEGER NOT NULL, `pending_mutation_id` TEXT, `local_updated_at` INTEGER NOT NULL, PRIMARY KEY(`id`))",
"fields": [
{
"fieldPath": "id",
"columnName": "id",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "accountId",
"columnName": "account_id",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "categoryId",
"columnName": "category_id",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "amountOre",
"columnName": "amount_ore",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "description",
"columnName": "description",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "notes",
"columnName": "notes",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "expenseDate",
"columnName": "expense_date",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "payerUserId",
"columnName": "payer_user_id",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "splitMode",
"columnName": "split_mode",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "recurringTemplateId",
"columnName": "recurring_template_id",
"affinity": "TEXT"
},
{
"fieldPath": "recurringPeriod",
"columnName": "recurring_period",
"affinity": "TEXT"
},
{
"fieldPath": "createdByUserId",
"columnName": "created_by_user_id",
"affinity": "TEXT"
},
{
"fieldPath": "updatedByUserId",
"columnName": "updated_by_user_id",
"affinity": "TEXT"
},
{
"fieldPath": "createdAt",
"columnName": "created_at",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "updatedAt",
"columnName": "updated_at",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "deletedAt",
"columnName": "deleted_at",
"affinity": "TEXT"
},
{
"fieldPath": "serverVersion",
"columnName": "server_version",
"affinity": "INTEGER"
},
{
"fieldPath": "pending",
"columnName": "pending",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "pendingMutationId",
"columnName": "pending_mutation_id",
"affinity": "TEXT"
},
{
"fieldPath": "localUpdatedAt",
"columnName": "local_updated_at",
"affinity": "INTEGER",
"notNull": true
}
],
"primaryKey": {
"autoGenerate": false,
"columnNames": [
"id"
]
},
"indices": [
{
"name": "index_expenses_account_id",
"unique": false,
"columnNames": [
"account_id"
],
"orders": [],
"createSql": "CREATE INDEX IF NOT EXISTS `index_expenses_account_id` ON `${TABLE_NAME}` (`account_id`)"
},
{
"name": "index_expenses_expense_date",
"unique": false,
"columnNames": [
"expense_date"
],
"orders": [],
"createSql": "CREATE INDEX IF NOT EXISTS `index_expenses_expense_date` ON `${TABLE_NAME}` (`expense_date`)"
},
{
"name": "index_expenses_pending",
"unique": false,
"columnNames": [
"pending"
],
"orders": [],
"createSql": "CREATE INDEX IF NOT EXISTS `index_expenses_pending` ON `${TABLE_NAME}` (`pending`)"
}
]
},
{
"tableName": "expense_splits",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`expense_id` TEXT NOT NULL, `user_id` TEXT NOT NULL, `share_ore` INTEGER NOT NULL, `share_bp` INTEGER, PRIMARY KEY(`expense_id`, `user_id`))",
"fields": [
{
"fieldPath": "expenseId",
"columnName": "expense_id",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "userId",
"columnName": "user_id",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "shareOre",
"columnName": "share_ore",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "shareBp",
"columnName": "share_bp",
"affinity": "INTEGER"
}
],
"primaryKey": {
"autoGenerate": false,
"columnNames": [
"expense_id",
"user_id"
]
}
},
{
"tableName": "settlements",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `from_user_id` TEXT NOT NULL, `to_user_id` TEXT NOT NULL, `amount_ore` INTEGER NOT NULL, `settlement_date` TEXT NOT NULL, `note` TEXT NOT NULL, `created_by_user_id` TEXT, `updated_by_user_id` TEXT, `created_at` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `deleted_at` TEXT, `server_version` INTEGER, `pending` INTEGER NOT NULL, `pending_mutation_id` TEXT, `local_updated_at` INTEGER NOT NULL, PRIMARY KEY(`id`))",
"fields": [
{
"fieldPath": "id",
"columnName": "id",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "fromUserId",
"columnName": "from_user_id",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "toUserId",
"columnName": "to_user_id",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "amountOre",
"columnName": "amount_ore",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "settlementDate",
"columnName": "settlement_date",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "note",
"columnName": "note",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "createdByUserId",
"columnName": "created_by_user_id",
"affinity": "TEXT"
},
{
"fieldPath": "updatedByUserId",
"columnName": "updated_by_user_id",
"affinity": "TEXT"
},
{
"fieldPath": "createdAt",
"columnName": "created_at",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "updatedAt",
"columnName": "updated_at",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "deletedAt",
"columnName": "deleted_at",
"affinity": "TEXT"
},
{
"fieldPath": "serverVersion",
"columnName": "server_version",
"affinity": "INTEGER"
},
{
"fieldPath": "pending",
"columnName": "pending",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "pendingMutationId",
"columnName": "pending_mutation_id",
"affinity": "TEXT"
},
{
"fieldPath": "localUpdatedAt",
"columnName": "local_updated_at",
"affinity": "INTEGER",
"notNull": true
}
],
"primaryKey": {
"autoGenerate": false,
"columnNames": [
"id"
]
},
"indices": [
{
"name": "index_settlements_settlement_date",
"unique": false,
"columnNames": [
"settlement_date"
],
"orders": [],
"createSql": "CREATE INDEX IF NOT EXISTS `index_settlements_settlement_date` ON `${TABLE_NAME}` (`settlement_date`)"
},
{
"name": "index_settlements_pending",
"unique": false,
"columnNames": [
"pending"
],
"orders": [],
"createSql": "CREATE INDEX IF NOT EXISTS `index_settlements_pending` ON `${TABLE_NAME}` (`pending`)"
}
]
},
{
"tableName": "settlement_allocations",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`settlement_id` TEXT NOT NULL, `account_id` TEXT NOT NULL, `amount_ore` INTEGER NOT NULL, PRIMARY KEY(`settlement_id`, `account_id`))",
"fields": [
{
"fieldPath": "settlementId",
"columnName": "settlement_id",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "accountId",
"columnName": "account_id",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "amountOre",
"columnName": "amount_ore",
"affinity": "INTEGER",
"notNull": true
}
],
"primaryKey": {
"autoGenerate": false,
"columnNames": [
"settlement_id",
"account_id"
]
},
"indices": [
{
"name": "index_settlement_allocations_account_id",
"unique": false,
"columnNames": [
"account_id"
],
"orders": [],
"createSql": "CREATE INDEX IF NOT EXISTS `index_settlement_allocations_account_id` ON `${TABLE_NAME}` (`account_id`)"
}
]
},
{
"tableName": "card_connections",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `provider_id` TEXT NOT NULL, `status` TEXT NOT NULL, `history_days` INTEGER NOT NULL, `valid_until` TEXT, `last_fetch_at` TEXT, `last_fetch_error` TEXT, `created_at` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `card_version` INTEGER NOT NULL, `local_updated_at` INTEGER NOT NULL, PRIMARY KEY(`id`))",
"fields": [
{
"fieldPath": "id",
"columnName": "id",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "providerId",
"columnName": "provider_id",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "status",
"columnName": "status",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "historyDays",
"columnName": "history_days",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "validUntil",
"columnName": "valid_until",
"affinity": "TEXT"
},
{
"fieldPath": "lastFetchAt",
"columnName": "last_fetch_at",
"affinity": "TEXT"
},
{
"fieldPath": "lastFetchError",
"columnName": "last_fetch_error",
"affinity": "TEXT"
},
{
"fieldPath": "createdAt",
"columnName": "created_at",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "updatedAt",
"columnName": "updated_at",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "cardVersion",
"columnName": "card_version",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "localUpdatedAt",
"columnName": "local_updated_at",
"affinity": "INTEGER",
"notNull": true
}
],
"primaryKey": {
"autoGenerate": false,
"columnNames": [
"id"
]
}
},
{
"tableName": "card_purchases",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `connection_id` TEXT NOT NULL, `status` TEXT NOT NULL, `direction` TEXT NOT NULL, `purchase_date` TEXT NOT NULL, `booking_date` TEXT, `amount_ore` INTEGER, `original_amount` TEXT, `original_currency` TEXT, `merchant` TEXT NOT NULL, `expense_id` TEXT, `ignored` INTEGER NOT NULL, `created_at` TEXT NOT NULL, `updated_at` TEXT NOT NULL, `deleted_at` TEXT, `card_version` INTEGER NOT NULL, `pending` INTEGER NOT NULL, `local_updated_at` INTEGER NOT NULL, PRIMARY KEY(`id`))",
"fields": [
{
"fieldPath": "id",
"columnName": "id",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "connectionId",
"columnName": "connection_id",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "status",
"columnName": "status",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "direction",
"columnName": "direction",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "purchaseDate",
"columnName": "purchase_date",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "bookingDate",
"columnName": "booking_date",
"affinity": "TEXT"
},
{
"fieldPath": "amountOre",
"columnName": "amount_ore",
"affinity": "INTEGER"
},
{
"fieldPath": "originalAmount",
"columnName": "original_amount",
"affinity": "TEXT"
},
{
"fieldPath": "originalCurrency",
"columnName": "original_currency",
"affinity": "TEXT"
},
{
"fieldPath": "merchant",
"columnName": "merchant",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "expenseId",
"columnName": "expense_id",
"affinity": "TEXT"
},
{
"fieldPath": "ignored",
"columnName": "ignored",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "createdAt",
"columnName": "created_at",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "updatedAt",
"columnName": "updated_at",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "deletedAt",
"columnName": "deleted_at",
"affinity": "TEXT"
},
{
"fieldPath": "cardVersion",
"columnName": "card_version",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "pending",
"columnName": "pending",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "localUpdatedAt",
"columnName": "local_updated_at",
"affinity": "INTEGER",
"notNull": true
}
],
"primaryKey": {
"autoGenerate": false,
"columnNames": [
"id"
]
},
"indices": [
{
"name": "index_card_purchases_purchase_date",
"unique": false,
"columnNames": [
"purchase_date"
],
"orders": [],
"createSql": "CREATE INDEX IF NOT EXISTS `index_card_purchases_purchase_date` ON `${TABLE_NAME}` (`purchase_date`)"
},
{
"name": "index_card_purchases_expense_id",
"unique": false,
"columnNames": [
"expense_id"
],
"orders": [],
"createSql": "CREATE INDEX IF NOT EXISTS `index_card_purchases_expense_id` ON `${TABLE_NAME}` (`expense_id`)"
},
{
"name": "index_card_purchases_pending",
"unique": false,
"columnNames": [
"pending"
],
"orders": [],
"createSql": "CREATE INDEX IF NOT EXISTS `index_card_purchases_pending` ON `${TABLE_NAME}` (`pending`)"
}
]
},
{
"tableName": "audit_log",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `entity_type` TEXT NOT NULL, `entity_id` TEXT NOT NULL, `action` TEXT NOT NULL, `source` TEXT NOT NULL, `actor_user_id` TEXT NOT NULL, `client_at` TEXT NOT NULL, `server_at` TEXT NOT NULL, `changes` TEXT NOT NULL, `server_version` INTEGER NOT NULL, PRIMARY KEY(`id`))",
"fields": [
{
"fieldPath": "id",
"columnName": "id",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "entityType",
"columnName": "entity_type",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "entityId",
"columnName": "entity_id",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "action",
"columnName": "action",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "source",
"columnName": "source",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "actorUserId",
"columnName": "actor_user_id",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "clientAt",
"columnName": "client_at",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "serverAt",
"columnName": "server_at",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "changes",
"columnName": "changes",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "serverVersion",
"columnName": "server_version",
"affinity": "INTEGER",
"notNull": true
}
],
"primaryKey": {
"autoGenerate": false,
"columnNames": [
"id"
]
},
"indices": [
{
"name": "index_audit_log_entity_type_entity_id",
"unique": false,
"columnNames": [
"entity_type",
"entity_id"
],
"orders": [],
"createSql": "CREATE INDEX IF NOT EXISTS `index_audit_log_entity_type_entity_id` ON `${TABLE_NAME}` (`entity_type`, `entity_id`)"
}
]
},
{
"tableName": "sync_state",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER NOT NULL, `cursor` INTEGER NOT NULL, `epoch` TEXT, `last_success_at` TEXT, `last_attempt_at` TEXT, `last_error_code` TEXT, `clock_skew` INTEGER NOT NULL, PRIMARY KEY(`id`))",
"fields": [
{
"fieldPath": "id",
"columnName": "id",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "cursor",
"columnName": "cursor",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "epoch",
"columnName": "epoch",
"affinity": "TEXT"
},
{
"fieldPath": "lastSuccessAt",
"columnName": "last_success_at",
"affinity": "TEXT"
},
{
"fieldPath": "lastAttemptAt",
"columnName": "last_attempt_at",
"affinity": "TEXT"
},
{
"fieldPath": "lastErrorCode",
"columnName": "last_error_code",
"affinity": "TEXT"
},
{
"fieldPath": "clockSkew",
"columnName": "clock_skew",
"affinity": "INTEGER",
"notNull": true
}
],
"primaryKey": {
"autoGenerate": false,
"columnNames": [
"id"
]
}
},
{
"tableName": "card_sync_state",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER NOT NULL, `cursor` INTEGER NOT NULL, `last_success_at` TEXT, PRIMARY KEY(`id`))",
"fields": [
{
"fieldPath": "id",
"columnName": "id",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "cursor",
"columnName": "cursor",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "lastSuccessAt",
"columnName": "last_success_at",
"affinity": "TEXT"
}
],
"primaryKey": {
"autoGenerate": false,
"columnNames": [
"id"
]
}
},
{
"tableName": "sync_rejections",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`mutation_id` TEXT NOT NULL, `entity_type` TEXT NOT NULL, `entity_id` TEXT NOT NULL, `reason` TEXT NOT NULL, `message` TEXT NOT NULL, `rejected_payload` TEXT NOT NULL, `server_current` TEXT, `rejected_at` TEXT NOT NULL, `dismissed` INTEGER NOT NULL, PRIMARY KEY(`mutation_id`))",
"fields": [
{
"fieldPath": "mutationId",
"columnName": "mutation_id",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "entityType",
"columnName": "entity_type",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "entityId",
"columnName": "entity_id",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "reason",
"columnName": "reason",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "message",
"columnName": "message",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "rejectedPayload",
"columnName": "rejected_payload",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "serverCurrent",
"columnName": "server_current",
"affinity": "TEXT"
},
{
"fieldPath": "rejectedAt",
"columnName": "rejected_at",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "dismissed",
"columnName": "dismissed",
"affinity": "INTEGER",
"notNull": true
}
],
"primaryKey": {
"autoGenerate": false,
"columnNames": [
"mutation_id"
]
}
}
],
"setupQueries": [
"CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)",
"INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, 'b6530112027f347b0de64eab87fdb779')"
]
}
}