Skip to content
This repository has been archived by the owner on Sep 12, 2023. It is now read-only.

Commit

Permalink
types(back-end): separate transaction object types
Browse files Browse the repository at this point in the history
  • Loading branch information
KennethTrecy committed Sep 12, 2022
1 parent 3e7f57f commit c9fa45d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 5 additions & 0 deletions common_back-end/types/dependent.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { Transaction } from "sequelize"

export interface TransactionObject { transaction?: Transaction }

export interface LockedTransactionObject extends TransactionObject { lock?: boolean }
6 changes: 4 additions & 2 deletions database/managers/helpers/transaction_manager.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { Transaction } from "sequelize"

import type { TransactionObject, LockedTransactionObject } from "$!/types/dependent"

import Log from "$!/singletons/log"
import Database from "%/data_source/database"
import DatabaseError from "$!/errors/database"
Expand All @@ -24,7 +26,7 @@ export default class {
}
}

get transactionObject(): { transaction?: Transaction } {
get transactionObject(): TransactionObject {
if (this.hasDestroyed || !this.isPermitted) {
return {}
}
Expand All @@ -33,7 +35,7 @@ export default class {
}
}

get lockedTransactionObject(): { lock?: boolean, transaction?: Transaction } {
get lockedTransactionObject(): LockedTransactionObject {
if (this.hasDestroyed || !this.isPermitted) {
return {}
}
Expand Down

0 comments on commit c9fa45d

Please sign in to comment.