diff --git a/CHANGELOG.md b/CHANGELOG.md index 8dc28dcd3..cfc95d387 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Added a blog post: _Hacktoberfest 2025_ +### Changed + +- Removed the deprecated `ITEM` activity type + ## 2.202.0 - 2025-09-26 ### Added diff --git a/apps/api/src/app/import/import.service.ts b/apps/api/src/app/import/import.service.ts index a96200261..82231d237 100644 --- a/apps/api/src/app/import/import.service.ts +++ b/apps/api/src/app/import/import.service.ts @@ -718,12 +718,6 @@ export class ImportService { index, { currency, dataSource, symbol, type } ] of activitiesDto.entries()) { - if (type === 'ITEM') { - throw new Error( - `activities.${index}.type ("${type}") is deprecated, please use "BUY" instead` - ); - } - if (!dataSources.includes(dataSource)) { throw new Error( `activities.${index}.dataSource ("${dataSource}") is not valid` diff --git a/prisma/migrations/20250926182138_removed_item_from_type/migration.sql b/prisma/migrations/20250926182138_removed_item_from_type/migration.sql new file mode 100644 index 000000000..756158973 --- /dev/null +++ b/prisma/migrations/20250926182138_removed_item_from_type/migration.sql @@ -0,0 +1,8 @@ +-- AlterEnum +BEGIN; +CREATE TYPE "public"."Type_new" AS ENUM ('BUY', 'DIVIDEND', 'FEE', 'INTEREST', 'LIABILITY', 'SELL'); +ALTER TABLE "public"."Order" ALTER COLUMN "type" TYPE "public"."Type_new" USING ("type"::text::"public"."Type_new"); +ALTER TYPE "public"."Type" RENAME TO "Type_old"; +ALTER TYPE "public"."Type_new" RENAME TO "Type"; +DROP TYPE "public"."Type_old"; +COMMIT; diff --git a/prisma/schema.prisma b/prisma/schema.prisma index 7a3c613ca..72ec79008 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -349,7 +349,6 @@ enum Type { DIVIDEND FEE INTEREST - ITEM LIABILITY SELL } diff --git a/test/import/not-ok/invalid-type-deprecated.json b/test/import/not-ok/invalid-type-deprecated.json deleted file mode 100644 index 77572df85..000000000 --- a/test/import/not-ok/invalid-type-deprecated.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "meta": { - "date": "2023-02-05T00:00:00.000Z", - "version": "dev" - }, - "activities": [ - { - "accountId": null, - "comment": null, - "fee": 0, - "quantity": 1, - "type": "ITEM", - "unitPrice": 500000, - "currency": "USD", - "dataSource": "MANUAL", - "date": "2022-01-01T00:00:00.000Z", - "symbol": "Penthouse Apartment" - } - ] -}