-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: [438] Set Financial Report as invalid only if the organization c…
…ompleted some of the data
- Loading branch information
1 parent
1695b2d
commit 00e3789
Showing
8 changed files
with
93 additions
and
31 deletions.
There are no files selected for viewing
41 changes: 41 additions & 0 deletions
41
backend/src/migrations/1725518140608-AllowTotalAndEmployeesToBeNull.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import { MigrationInterface, QueryRunner } from 'typeorm'; | ||
|
||
export class AllowTotalAndEmployeesToBeNull1725518140608 | ||
implements MigrationInterface | ||
{ | ||
name = 'AllowTotalAndEmployeesToBeNull1725518140608'; | ||
|
||
/** | ||
* Allow Total and Employees to be null to better reflect if the user has not completed the financials or is just the default value | ||
*/ | ||
|
||
public async up(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query( | ||
`ALTER TABLE "organization_financial" ALTER COLUMN "number_of_employees" DROP NOT NULL`, | ||
); | ||
await queryRunner.query( | ||
`ALTER TABLE "organization_financial" ALTER COLUMN "number_of_employees" DROP DEFAULT`, | ||
); | ||
await queryRunner.query( | ||
`ALTER TABLE "organization_financial" ALTER COLUMN "total" DROP NOT NULL`, | ||
); | ||
await queryRunner.query( | ||
`ALTER TABLE "organization_financial" ALTER COLUMN "total" DROP DEFAULT`, | ||
); | ||
} | ||
|
||
public async down(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query( | ||
`ALTER TABLE "organization_financial" ALTER COLUMN "total" SET DEFAULT '0'`, | ||
); | ||
await queryRunner.query( | ||
`ALTER TABLE "organization_financial" ALTER COLUMN "total" SET NOT NULL`, | ||
); | ||
await queryRunner.query( | ||
`ALTER TABLE "organization_financial" ALTER COLUMN "number_of_employees" SET DEFAULT '0'`, | ||
); | ||
await queryRunner.query( | ||
`ALTER TABLE "organization_financial" ALTER COLUMN "number_of_employees" SET NOT NULL`, | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters