Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
be90889
LED-65 docs: define commodity domain model and update ADR references
gorushkin Jul 15, 2026
ff70bc1
Merge pull request #247 from gorushkin:LED-65-define-commodity-domain…
gorushkin Jul 15, 2026
73236e1
LED-109 feat(commodities): add commodity domain primitives and valida…
gorushkin Jul 15, 2026
4b8b6f5
LED-109 refactor(commodities): update commodity domain types and vali…
gorushkin Jul 15, 2026
5940644
Merge pull request #248 from gorushkin:LED-109-add-commodity-domain-p…
gorushkin Jul 15, 2026
736858e
LED-66 feat(commodities): add commodities schema and update exports
gorushkin Jul 16, 2026
c0ed759
LED-66 feat(accounts): add commodity support to account creation and …
gorushkin Jul 17, 2026
a1b7df3
LED-66 chore(husky): update pre-commit to include tests
gorushkin Jul 17, 2026
2c04f6a
LED-66 feat(accounts): implement commodity schema migration for accou…
gorushkin Jul 17, 2026
3150977
LED-66 feat(transactions): add commodityId to transaction entity and …
gorushkin Jul 22, 2026
fe67fe4
LED-66 refactor(accounts): remove currency references from account ha…
gorushkin Jul 23, 2026
acb7bd0
LED-66 feat(database): implement commodity schema migration and remov…
gorushkin Jul 23, 2026
e87ef38
LED-66 docs(database): update database schema documentation for commo…
gorushkin Jul 23, 2026
8d525e1
LED-66 refactor(types): remove isSystem from AccountCreateDTO and upd…
gorushkin Jul 23, 2026
865671d
LED-66 feat(database): add commodity schema and update related entities
gorushkin Jul 23, 2026
9c4eb65
LED-66 feat(transactions): add update transaction use case and relate…
gorushkin Jul 23, 2026
a55de6e
Merge pull request #249 from gorushkin:LED-66-commodity-schema-migrat…
gorushkin Jul 23, 2026
fead770
LED-67 feat(commodities): implement CRUD operations for commodity rep…
gorushkin Jul 23, 2026
7086de2
LED-67 test(commodities): add tests for create and update commodity m…
gorushkin Jul 23, 2026
afd6884
Merge pull request #250 from gorushkin:LED-67-commodity-persistence-r…
gorushkin Jul 23, 2026
5e08428
LED-69 feat(accounts): implement repository-enforced commodity refere…
gorushkin Jul 23, 2026
0865751
LED-69 feat(accounts): implement account creation with commodity refe…
gorushkin Jul 23, 2026
195f04c
Merge pull request #251 from gorushkin:LED-69-commodity-reference-val…
gorushkin Jul 23, 2026
d611a99
LED-70 refactor(accounts): update test descriptions and variable name…
gorushkin Jul 23, 2026
fe319d5
Merge pull request #252 from gorushkin:LED-70-close-superseded-curren…
gorushkin Jul 23, 2026
8e71d8e
LED-68 feat(accounts): add isTombstone handling in account creation a…
gorushkin Jul 23, 2026
b8b1592
Merge pull request #253 from gorushkin:LED-68-account-immutable-commo…
gorushkin Jul 23, 2026
3f2b6e2
LED-110 feat(commodities): add createCommodityUseCase
gorushkin Jul 23, 2026
9f30fca
LED-110 feat(commodities): implement CRUD operations for commodities
gorushkin Jul 26, 2026
2210b2f
LED-110 feat(commodities): add query status handling in getAll operat…
gorushkin Jul 26, 2026
210a57f
LED-110 feat(commodities): implement archive and update use cases wit…
gorushkin Jul 26, 2026
d0f7b29
LED-110 feat(accounts, commodities): update create methods to include…
gorushkin Jul 27, 2026
44295ca
Merge pull request #254 from gorushkin:LED-110-add-commodity-use-case…
gorushkin Jul 27, 2026
cd6c422
LED-111 feat(docs): update transaction commodity references in docume…
gorushkin Jul 27, 2026
ac9fb4b
Merge pull request #255 from gorushkin:LED-111-transaction-commodity-…
gorushkin Jul 27, 2026
11cc344
LED-115 feat(accounts): prevent updates to tombstoned accounts
gorushkin Jul 27, 2026
6085a02
Merge pull request #256 from gorushkin:LED-115-prevent-tombstoned-acc…
gorushkin Jul 27, 2026
5657914
LED-116 feat(accounts, commodities): unify soft delete naming in repo…
gorushkin Jul 27, 2026
7bc8c55
LED-116 chore(frontend): reset app to placeholder
gorushkin Jul 27, 2026
b9278a4
LED-116 chore: clean up code changes sections
gorushkin Jul 27, 2026
f76be08
Merge pull request #257 from gorushkin:LED-116-unify-soft-delete-naming
gorushkin Jul 27, 2026
66b66e2
Merge pull request #258 from gorushkin:LED-116-frontend-placeholder-r…
gorushkin Jul 27, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pnpm --filter backend check
pnpm --filter backend check && pnpm --filter backend test
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
CREATE TABLE `accounts` (
`commodity_id` text NOT NULL,
`created_at` text NOT NULL,
`currency` text NOT NULL,
`current_cleared_balance_local` text NOT NULL,
`description` text NOT NULL,
`id` text PRIMARY KEY NOT NULL,
Expand All @@ -11,13 +11,14 @@ CREATE TABLE `accounts` (
`type` text NOT NULL,
`updated_at` text NOT NULL,
`user_id` text NOT NULL,
FOREIGN KEY (`commodity_id`) REFERENCES `commodities`(`id`) ON UPDATE no action ON DELETE no action,
FOREIGN KEY (`user_id`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE cascade
);
--> statement-breakpoint
CREATE UNIQUE INDEX `user_id_name_unique_idx` ON `accounts` (`user_id`,`name`);--> statement-breakpoint
CREATE TABLE `transactions` (
`commodity_id` text NOT NULL,
`created_at` text NOT NULL,
`currency` text NOT NULL,
`description` text NOT NULL,
`id` text PRIMARY KEY NOT NULL,
`is_tombstone` integer NOT NULL,
Expand All @@ -26,16 +27,11 @@ CREATE TABLE `transactions` (
`updated_at` text NOT NULL,
`user_id` text NOT NULL,
`version` integer NOT NULL,
FOREIGN KEY (`commodity_id`) REFERENCES `commodities`(`id`) ON UPDATE no action ON DELETE no action,
FOREIGN KEY (`user_id`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE cascade
);
--> statement-breakpoint
CREATE INDEX `idx_transactions_user_date` ON `transactions` (`user_id`,`transaction_date`);--> statement-breakpoint
CREATE TABLE `currencies` (
`code` text PRIMARY KEY NOT NULL,
`name` text NOT NULL,
`symbol` text NOT NULL
);
--> statement-breakpoint
CREATE TABLE `operations` (
`account_id` text NOT NULL,
`amount` text NOT NULL,
Expand Down Expand Up @@ -67,10 +63,23 @@ CREATE TABLE `users` (
--> statement-breakpoint
CREATE UNIQUE INDEX `users_email_unique` ON `users` (`email`);--> statement-breakpoint
CREATE TABLE `settings` (
`base_currency` text DEFAULT 'RUB' NOT NULL,
`created_at` text NOT NULL,
`updated_at` text NOT NULL,
`user_id` text NOT NULL,
FOREIGN KEY (`base_currency`) REFERENCES `currencies`(`code`) ON UPDATE no action ON DELETE no action,
FOREIGN KEY (`user_id`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE no action
);
--> statement-breakpoint
CREATE TABLE `commodities` (
`code` text NOT NULL,
`created_at` text NOT NULL,
`id` text PRIMARY KEY NOT NULL,
`is_tombstone` integer NOT NULL,
`name` text NOT NULL,
`precision` integer NOT NULL,
`symbol` text,
`updated_at` text NOT NULL,
`user_id` text NOT NULL,
FOREIGN KEY (`user_id`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE cascade
);
--> statement-breakpoint
CREATE UNIQUE INDEX `commodities_user_id_code_unique_idx` ON `commodities` (`user_id`,`code`);
184 changes: 127 additions & 57 deletions apps/backend/drizzle/meta/0000_snapshot.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
{
"version": "6",
"dialect": "sqlite",
"id": "b3626041-a73e-4294-b580-3c53764e0f43",
"id": "59edadf8-a69b-4dbb-a24a-828a220d6559",
"prevId": "00000000-0000-0000-0000-000000000000",
"tables": {
"accounts": {
"name": "accounts",
"columns": {
"created_at": {
"name": "created_at",
"commodity_id": {
"name": "commodity_id",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"currency": {
"name": "currency",
"created_at": {
"name": "created_at",
"type": "text",
"primaryKey": false,
"notNull": true,
Expand Down Expand Up @@ -103,6 +103,19 @@
}
},
"foreignKeys": {
"accounts_commodity_id_commodities_id_fk": {
"name": "accounts_commodity_id_commodities_id_fk",
"tableFrom": "accounts",
"tableTo": "commodities",
"columnsFrom": [
"commodity_id"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"accounts_user_id_users_id_fk": {
"name": "accounts_user_id_users_id_fk",
"tableFrom": "accounts",
Expand All @@ -124,15 +137,15 @@
"transactions": {
"name": "transactions",
"columns": {
"created_at": {
"name": "created_at",
"commodity_id": {
"name": "commodity_id",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"currency": {
"name": "currency",
"created_at": {
"name": "created_at",
"type": "text",
"primaryKey": false,
"notNull": true,
Expand Down Expand Up @@ -206,6 +219,19 @@
}
},
"foreignKeys": {
"transactions_commodity_id_commodities_id_fk": {
"name": "transactions_commodity_id_commodities_id_fk",
"tableFrom": "transactions",
"tableTo": "commodities",
"columnsFrom": [
"commodity_id"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"transactions_user_id_users_id_fk": {
"name": "transactions_user_id_users_id_fk",
"tableFrom": "transactions",
Expand All @@ -224,37 +250,6 @@
"uniqueConstraints": {},
"checkConstraints": {}
},
"currencies": {
"name": "currencies",
"columns": {
"code": {
"name": "code",
"type": "text",
"primaryKey": true,
"notNull": true,
"autoincrement": false
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"symbol": {
"name": "symbol",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"checkConstraints": {}
},
"operations": {
"name": "operations",
"columns": {
Expand Down Expand Up @@ -467,14 +462,6 @@
"settings": {
"name": "settings",
"columns": {
"base_currency": {
"name": "base_currency",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": "'RUB'"
},
"created_at": {
"name": "created_at",
"type": "text",
Expand All @@ -499,30 +486,113 @@
},
"indexes": {},
"foreignKeys": {
"settings_base_currency_currencies_code_fk": {
"name": "settings_base_currency_currencies_code_fk",
"settings_user_id_users_id_fk": {
"name": "settings_user_id_users_id_fk",
"tableFrom": "settings",
"tableTo": "currencies",
"tableTo": "users",
"columnsFrom": [
"base_currency"
"user_id"
],
"columnsTo": [
"code"
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"checkConstraints": {}
},
"commodities": {
"name": "commodities",
"columns": {
"code": {
"name": "code",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"settings_user_id_users_id_fk": {
"name": "settings_user_id_users_id_fk",
"tableFrom": "settings",
"created_at": {
"name": "created_at",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true,
"autoincrement": false
},
"is_tombstone": {
"name": "is_tombstone",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"precision": {
"name": "precision",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"symbol": {
"name": "symbol",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"updated_at": {
"name": "updated_at",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"user_id": {
"name": "user_id",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
}
},
"indexes": {
"commodities_user_id_code_unique_idx": {
"name": "commodities_user_id_code_unique_idx",
"columns": [
"user_id",
"code"
],
"isUnique": true
}
},
"foreignKeys": {
"commodities_user_id_users_id_fk": {
"name": "commodities_user_id_users_id_fk",
"tableFrom": "commodities",
"tableTo": "users",
"columnsFrom": [
"user_id"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onDelete": "cascade",
"onUpdate": "no action"
}
},
Expand Down
4 changes: 2 additions & 2 deletions apps/backend/drizzle/meta/_journal.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
{
"idx": 0,
"version": "6",
"when": 1776091943739,
"tag": "0000_keen_gertrude_yorkes",
"when": 1784803897112,
"tag": "0000_careful_dust",
"breakpoints": true
}
]
Expand Down
1 change: 0 additions & 1 deletion apps/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
"db:delete:all": "pnpm db:delete && pnpm db:migrations:delete",
"db:full-reset": "pnpm db:delete:all && pnpm db:generate && pnpm db:migrate",
"testDB": "tsx src/db/test-db.ts",
"seed:currencies": "tsx src/db/scripts/currenciesSeed.ts",
"db:reset": "pnpm db:delete && pnpm db:migrate",
"lint": "eslint .",
"lint:fix": "eslint . --fix",
Expand Down
13 changes: 0 additions & 13 deletions apps/backend/src/application/dto/currency.dto.ts

This file was deleted.

1 change: 0 additions & 1 deletion apps/backend/src/application/dto/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
export * from './transaction.dto';
export * from './operation.dto';
export * from './currency.dto';
export * from './user.dto';
Loading
Loading