-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement UpdateSessionOperation in dynamo-agnostic way
- Loading branch information
1 parent
45dd941
commit f20d33f
Showing
3 changed files
with
121 additions
and
0 deletions.
There are no files selected for viewing
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
23 changes: 23 additions & 0 deletions
23
...rc/functions/common/session/updateOperations/BiometricTokenIssued/BiometricTokenIssued.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,23 @@ | ||
import { | ||
SessionState, | ||
UpdateSessionOperation, | ||
} from "../UpdateSessionOperation"; | ||
import { DocumentType } from "../../../../types/document"; | ||
|
||
export class BiometricTokenIssued implements UpdateSessionOperation { | ||
constructor( | ||
private readonly documentType: DocumentType, | ||
private readonly opaqueId: string, | ||
) {} | ||
|
||
readonly targetState = SessionState.BIOMETRIC_TOKEN_ISSUED; | ||
|
||
readonly eligibleStartingStates = [SessionState.AUTH_SESSION_CREATED]; | ||
|
||
getFieldUpdates() { | ||
return { | ||
documentType: this.documentType, | ||
opaqueId: this.opaqueId, | ||
}; | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
backend-api/src/functions/common/session/updateOperations/UpdateSessionOperation.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,9 @@ | ||
import { SessionState } from "../session"; | ||
|
||
type SessionFieldValue = string | number; | ||
|
||
export interface UpdateSessionOperation { | ||
readonly targetState: SessionState; | ||
readonly eligibleStartingStates: SessionState[]; | ||
getFieldUpdates(): Record<string, SessionFieldValue>; | ||
} |