Skip to content

Commit

Permalink
Add some comments
Browse files Browse the repository at this point in the history
  • Loading branch information
joonashak committed Jan 2, 2025
1 parent f3b0c9e commit c5d2c05
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ 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");
Expand Down
7 changes: 7 additions & 0 deletions app/src/entities/presence/presence.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit c5d2c05

Please sign in to comment.