Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[![Review Assignment Due Date](https://classroom.github.com/assets/deadline-readme-button-22041afd0340ce965d47ae6ef1cefeee28c7c493a6346c4f15d667ab976d596c.svg)](https://classroom.github.com/a/W3nV4mdD)
# Banking management

## Overview
Expand Down
3 changes: 3 additions & 0 deletions src/models/bank-account.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default class BankAccount{

}
25 changes: 25 additions & 0 deletions src/models/bank.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
let globalBankId=0;
import { BankOptions } from "@/types/Common";

export default class Bank {
private bankId:string
private accounts:string[]
private isNegativeAlloed:boolean

constructor(bankId:string,options?:BankOptions){
this.bankId=bankId
this.isNegativeAlloed=options?.isNegativeAllowed ?? false;
this.accounts=[];
}

public static create(options?:BankOptions){
return new Bank((globalBankId++)+ "" ,options);
}
public createAccount(val:number){
return this;
}

public getId(){
return this.bankId;
}
}
18 changes: 18 additions & 0 deletions src/models/user.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
export default class User {
userName: string;
bankaAcs: string[];
userId: string;

constructor(name: string, bankAcs: string[]) {
this.userName = name;
this.bankaAcs = bankAcs;
}

static create(name: string, bandAcs: string[]) {
return new User(name, bandAcs);
}

getId() {
return this.userId;
}
}
3 changes: 3 additions & 0 deletions src/services/GlobalRegistry.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default class GlobalRegistry{
static clear(){}
}
3 changes: 3 additions & 0 deletions src/services/TransactionService.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default class TransactionService{

}
14 changes: 14 additions & 0 deletions src/types/Common.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import Bank from "@/models/bank";
import BankAccount from "@/models/bank-account";
import User from "@/models/user";

export type BankOptions = {
isNegativeAllowed?: boolean;
};
export type BankAccountId = string;
export type UserId = string;
export type BankId = string;
export type UserAccountsDeatails = Record<string, string[]>;
export type UserDeatails = Record<string, User>;
export type BanksDeatails = Record<string, Bank>;
export type BankAccountsDeatails = Record<string, BankAccount>;
Loading