diff --git a/README.md b/README.md index cab3c08..76507d5 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/src/models/bank-account.ts b/src/models/bank-account.ts new file mode 100644 index 0000000..132bea9 --- /dev/null +++ b/src/models/bank-account.ts @@ -0,0 +1,3 @@ +export default class BankAccount{ + +} \ No newline at end of file diff --git a/src/models/bank.ts b/src/models/bank.ts new file mode 100644 index 0000000..59227b6 --- /dev/null +++ b/src/models/bank.ts @@ -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; + } +} diff --git a/src/models/user.ts b/src/models/user.ts new file mode 100644 index 0000000..e27325c --- /dev/null +++ b/src/models/user.ts @@ -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; + } +} diff --git a/src/services/GlobalRegistry.ts b/src/services/GlobalRegistry.ts new file mode 100644 index 0000000..a7499f4 --- /dev/null +++ b/src/services/GlobalRegistry.ts @@ -0,0 +1,3 @@ +export default class GlobalRegistry{ + static clear(){} +} \ No newline at end of file diff --git a/src/services/TransactionService.ts b/src/services/TransactionService.ts new file mode 100644 index 0000000..aa3a48c --- /dev/null +++ b/src/services/TransactionService.ts @@ -0,0 +1,3 @@ +export default class TransactionService{ + +} \ No newline at end of file diff --git a/src/types/Common.ts b/src/types/Common.ts new file mode 100644 index 0000000..8eec73e --- /dev/null +++ b/src/types/Common.ts @@ -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; +export type UserDeatails = Record; +export type BanksDeatails = Record; +export type BankAccountsDeatails = Record;