Skip to content

Commit

Permalink
feat: Add ability to archive completed goals and other improvements (#…
Browse files Browse the repository at this point in the history
…119)

Commits:
* Update database schema and and add initial layout
* Add archived goal item card
* Replace deposit button with archive is goal is completed
* Implement goal archive screen and functionality
* Add missing translations and some cleanup
---------
Signed-off-by: starry-shivam <[email protected]>
  • Loading branch information
starry-shivam authored May 8, 2024
1 parent 19b309d commit e731f44
Show file tree
Hide file tree
Showing 42 changed files with 1,824 additions and 422 deletions.
4 changes: 2 additions & 2 deletions .idea/deploymentTargetSelector.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

190 changes: 190 additions & 0 deletions app/schemas/com.starry.greenstash.database.core.AppDatabase/6.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,190 @@
{
"formatVersion": 1,
"database": {
"version": 6,
"identityHash": "b16df1594b1494e7947402d9e7a822da",
"entities": [
{
"tableName": "saving_goal",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`title` TEXT NOT NULL, `targetAmount` REAL NOT NULL, `deadline` TEXT NOT NULL, `goalImage` BLOB, `additionalNotes` TEXT NOT NULL, `priority` INTEGER NOT NULL DEFAULT 2, `reminder` INTEGER NOT NULL DEFAULT false, `goalIconId` TEXT DEFAULT 'Image', `archived` INTEGER NOT NULL DEFAULT false, `goalId` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL)",
"fields": [
{
"fieldPath": "title",
"columnName": "title",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "targetAmount",
"columnName": "targetAmount",
"affinity": "REAL",
"notNull": true
},
{
"fieldPath": "deadline",
"columnName": "deadline",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "goalImage",
"columnName": "goalImage",
"affinity": "BLOB",
"notNull": false
},
{
"fieldPath": "additionalNotes",
"columnName": "additionalNotes",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "priority",
"columnName": "priority",
"affinity": "INTEGER",
"notNull": true,
"defaultValue": "2"
},
{
"fieldPath": "reminder",
"columnName": "reminder",
"affinity": "INTEGER",
"notNull": true,
"defaultValue": "false"
},
{
"fieldPath": "goalIconId",
"columnName": "goalIconId",
"affinity": "TEXT",
"notNull": false,
"defaultValue": "'Image'"
},
{
"fieldPath": "archived",
"columnName": "archived",
"affinity": "INTEGER",
"notNull": true,
"defaultValue": "false"
},
{
"fieldPath": "goalId",
"columnName": "goalId",
"affinity": "INTEGER",
"notNull": true
}
],
"primaryKey": {
"autoGenerate": true,
"columnNames": [
"goalId"
]
},
"indices": [],
"foreignKeys": []
},
{
"tableName": "transaction",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`ownerGoalId` INTEGER NOT NULL, `type` INTEGER NOT NULL, `timeStamp` INTEGER NOT NULL, `amount` REAL NOT NULL, `notes` TEXT NOT NULL, `transactionId` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, FOREIGN KEY(`ownerGoalId`) REFERENCES `saving_goal`(`goalId`) ON UPDATE NO ACTION ON DELETE CASCADE )",
"fields": [
{
"fieldPath": "ownerGoalId",
"columnName": "ownerGoalId",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "type",
"columnName": "type",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "timeStamp",
"columnName": "timeStamp",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "amount",
"columnName": "amount",
"affinity": "REAL",
"notNull": true
},
{
"fieldPath": "notes",
"columnName": "notes",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "transactionId",
"columnName": "transactionId",
"affinity": "INTEGER",
"notNull": true
}
],
"primaryKey": {
"autoGenerate": true,
"columnNames": [
"transactionId"
]
},
"indices": [
{
"name": "index_transaction_ownerGoalId",
"unique": false,
"columnNames": [
"ownerGoalId"
],
"orders": [],
"createSql": "CREATE INDEX IF NOT EXISTS `index_transaction_ownerGoalId` ON `${TABLE_NAME}` (`ownerGoalId`)"
}
],
"foreignKeys": [
{
"table": "saving_goal",
"onDelete": "CASCADE",
"onUpdate": "NO ACTION",
"columns": [
"ownerGoalId"
],
"referencedColumns": [
"goalId"
]
}
]
},
{
"tableName": "widget_data",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`appWidgetId` INTEGER NOT NULL, `goalId` INTEGER NOT NULL, PRIMARY KEY(`appWidgetId`))",
"fields": [
{
"fieldPath": "appWidgetId",
"columnName": "appWidgetId",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "goalId",
"columnName": "goalId",
"affinity": "INTEGER",
"notNull": true
}
],
"primaryKey": {
"autoGenerate": false,
"columnNames": [
"appWidgetId"
]
},
"indices": [],
"foreignKeys": []
}
],
"views": [],
"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, 'b16df1594b1494e7947402d9e7a822da')"
]
}
}
190 changes: 190 additions & 0 deletions app/schemas/com.starry.greenstash.database.core.AppDatabase/7.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,190 @@
{
"formatVersion": 1,
"database": {
"version": 7,
"identityHash": "ee83f4215d1464f23a88d9e4f44a2300",
"entities": [
{
"tableName": "saving_goal",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`title` TEXT NOT NULL, `targetAmount` REAL NOT NULL, `deadline` TEXT NOT NULL, `goalImage` BLOB, `additionalNotes` TEXT NOT NULL, `priority` INTEGER NOT NULL DEFAULT 2, `reminder` INTEGER NOT NULL DEFAULT 0, `goalIconId` TEXT DEFAULT 'Image', `archived` INTEGER NOT NULL DEFAULT 0, `goalId` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL)",
"fields": [
{
"fieldPath": "title",
"columnName": "title",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "targetAmount",
"columnName": "targetAmount",
"affinity": "REAL",
"notNull": true
},
{
"fieldPath": "deadline",
"columnName": "deadline",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "goalImage",
"columnName": "goalImage",
"affinity": "BLOB",
"notNull": false
},
{
"fieldPath": "additionalNotes",
"columnName": "additionalNotes",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "priority",
"columnName": "priority",
"affinity": "INTEGER",
"notNull": true,
"defaultValue": "2"
},
{
"fieldPath": "reminder",
"columnName": "reminder",
"affinity": "INTEGER",
"notNull": true,
"defaultValue": "0"
},
{
"fieldPath": "goalIconId",
"columnName": "goalIconId",
"affinity": "TEXT",
"notNull": false,
"defaultValue": "'Image'"
},
{
"fieldPath": "archived",
"columnName": "archived",
"affinity": "INTEGER",
"notNull": true,
"defaultValue": "0"
},
{
"fieldPath": "goalId",
"columnName": "goalId",
"affinity": "INTEGER",
"notNull": true
}
],
"primaryKey": {
"autoGenerate": true,
"columnNames": [
"goalId"
]
},
"indices": [],
"foreignKeys": []
},
{
"tableName": "transaction",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`ownerGoalId` INTEGER NOT NULL, `type` INTEGER NOT NULL, `timeStamp` INTEGER NOT NULL, `amount` REAL NOT NULL, `notes` TEXT NOT NULL, `transactionId` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, FOREIGN KEY(`ownerGoalId`) REFERENCES `saving_goal`(`goalId`) ON UPDATE NO ACTION ON DELETE CASCADE )",
"fields": [
{
"fieldPath": "ownerGoalId",
"columnName": "ownerGoalId",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "type",
"columnName": "type",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "timeStamp",
"columnName": "timeStamp",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "amount",
"columnName": "amount",
"affinity": "REAL",
"notNull": true
},
{
"fieldPath": "notes",
"columnName": "notes",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "transactionId",
"columnName": "transactionId",
"affinity": "INTEGER",
"notNull": true
}
],
"primaryKey": {
"autoGenerate": true,
"columnNames": [
"transactionId"
]
},
"indices": [
{
"name": "index_transaction_ownerGoalId",
"unique": false,
"columnNames": [
"ownerGoalId"
],
"orders": [],
"createSql": "CREATE INDEX IF NOT EXISTS `index_transaction_ownerGoalId` ON `${TABLE_NAME}` (`ownerGoalId`)"
}
],
"foreignKeys": [
{
"table": "saving_goal",
"onDelete": "CASCADE",
"onUpdate": "NO ACTION",
"columns": [
"ownerGoalId"
],
"referencedColumns": [
"goalId"
]
}
]
},
{
"tableName": "widget_data",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`appWidgetId` INTEGER NOT NULL, `goalId` INTEGER NOT NULL, PRIMARY KEY(`appWidgetId`))",
"fields": [
{
"fieldPath": "appWidgetId",
"columnName": "appWidgetId",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "goalId",
"columnName": "goalId",
"affinity": "INTEGER",
"notNull": true
}
],
"primaryKey": {
"autoGenerate": false,
"columnNames": [
"appWidgetId"
]
},
"indices": [],
"foreignKeys": []
}
],
"views": [],
"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, 'ee83f4215d1464f23a88d9e4f44a2300')"
]
}
}
Loading

0 comments on commit e731f44

Please sign in to comment.