diff --git a/app/src/database/migrations/1735633836694-replace-presence-type-with-remote-column.ts b/app/src/database/migrations/1735633836694-replace-presence-type-with-remote-column.ts index 3dd175a..a88c16f 100644 --- a/app/src/database/migrations/1735633836694-replace-presence-type-with-remote-column.ts +++ b/app/src/database/migrations/1735633836694-replace-presence-type-with-remote-column.ts @@ -2,6 +2,11 @@ import { MigrationInterface, QueryRunner, TableColumn } from "typeorm"; export class ReplacePresenceTypeWithRemoteColumn1735633836694 implements MigrationInterface { public async up(queryRunner: QueryRunner): Promise { + /* + * 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"); diff --git a/app/src/entities/presence/presence.model.ts b/app/src/entities/presence/presence.model.ts index f8b9e7b..4d46771 100644 --- a/app/src/entities/presence/presence.model.ts +++ b/app/src/entities/presence/presence.model.ts @@ -15,6 +15,13 @@ export class Presence { @PrimaryColumn({ type: "date" }) date: string; + /** + * Indicates whether user is working remotely or at office. + * + * This field should be always considered when handling presences – if there + * are no offices added to Kaiku, the `office` field will always be empty + * rendering using it alone for logic unreliable. + */ @Column({ name: "remote", type: "boolean", nullable: false, default: false }) remote: boolean;