-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #27 from funidata/presence-model-rework
Presence model rework
- Loading branch information
Showing
8 changed files
with
44 additions
and
21 deletions.
There are no files selected for viewing
7 changes: 6 additions & 1 deletion
7
app/src/database/migrations/1726035621508-create-presence-table.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
21 changes: 21 additions & 0 deletions
21
app/src/database/migrations/1735633836694-replace-presence-type-with-remote-column.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,21 @@ | ||
import { MigrationInterface, QueryRunner, TableColumn } from "typeorm"; | ||
|
||
export class ReplacePresenceTypeWithRemoteColumn1735633836694 implements MigrationInterface { | ||
public async up(queryRunner: QueryRunner): Promise<void> { | ||
/* | ||
* N.B.: Values are not migrated from `type` to `remote` because Kaiku is | ||
* not running anywhere yet and the default value of `remote`, while | ||
* sometimes incorrect, will not break anything. | ||
*/ | ||
const table = await queryRunner.getTable("presence"); | ||
|
||
await queryRunner.dropColumn(table, "type"); | ||
|
||
await queryRunner.addColumn( | ||
table, | ||
new TableColumn({ name: "remote", type: "boolean", isNullable: false, default: false }), | ||
); | ||
} | ||
|
||
public async down(): Promise<void> {} | ||
} |
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 |
---|---|---|
@@ -1,10 +1,8 @@ | ||
import { PresenceType } from "../presence.model"; | ||
|
||
export type PresenceFilter = { | ||
date?: string; | ||
startDate?: string; | ||
endDate?: string; | ||
officeId?: string; | ||
type?: PresenceType; | ||
remote?: boolean; | ||
userGroup?: string; | ||
}; |
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