-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* new design login,signup,dashboard,startup page is done * page design has done for 1st phase and need refactorization * unused import removed * routing almost done * Main container margin padding. cart border,color resolve almost * re arranged * form submitting going on * form submission ndone * # api created for budget, category, wallet. # in frontend cin budget and wallet page ids type has changed * # api created for budget, category, wallet. # in frontend cin budget and wallet page ids type has changed issue fixes #57, #58, #56, #59, #55 (#70)
- Loading branch information
Showing
70 changed files
with
7,611 additions
and
984 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
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 |
---|---|---|
@@ -1,31 +1,22 @@ | ||
import { Prop, Schema, SchemaFactory } from "@nestjs/mongoose"; | ||
import { Document, Types } from "mongoose"; | ||
import * as moment from "moment"; | ||
|
||
|
||
const month = moment().format("MMMM"); | ||
import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose'; | ||
import { Document, Types } from 'mongoose'; | ||
|
||
@Schema() | ||
export class Budget extends Document { | ||
@Prop() | ||
budget_item: string; | ||
budget_title: string; | ||
|
||
@Prop() | ||
budget_amount: number; | ||
|
||
amount: number; | ||
|
||
@Prop({ type: String, default: month }) | ||
budget_month: string; | ||
@Prop({ type: Types.ObjectId, ref: 'Wallet' }) | ||
wallet_id: Types.ObjectId; | ||
|
||
@Prop({ type: Date, default: Date.now() }) | ||
budget_time: Date; | ||
@Prop({ type: Types.ObjectId, ref: 'Category' }) | ||
category_id: Types.ObjectId; | ||
|
||
@Prop({ type: Types.ObjectId, ref: "User" }) | ||
userId: Types.ObjectId; | ||
|
||
@Prop({ type: Types.ObjectId, ref: "Category" }) | ||
categoryId: Types.ObjectId; | ||
@Prop() | ||
user_id: string; | ||
} | ||
|
||
|
||
export const BudgetSchema = SchemaFactory.createForClass(Budget); |
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
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 |
---|---|---|
@@ -1,31 +1,18 @@ | ||
import { | ||
IsDateString, | ||
IsEmpty, | ||
IsNotEmpty, | ||
IsNumber, | ||
IsString | ||
} from "class-validator"; | ||
import { IsArray, IsEmpty, IsNumber, IsString } from 'class-validator'; | ||
|
||
export class CreateBudgetDto { | ||
@IsString() | ||
budget_item: string; | ||
budget_title: string; | ||
|
||
@IsNumber() | ||
budget_amount: number; | ||
amount: number; | ||
|
||
@IsString() | ||
budget_month: string; | ||
wallet_id; | ||
|
||
@IsDateString() | ||
budget_time: Date; | ||
@IsArray() | ||
category_id: string; | ||
|
||
@IsEmpty() | ||
userId: any; | ||
|
||
@IsEmpty() | ||
categoryId: string; | ||
|
||
@IsNotEmpty() | ||
@IsString() | ||
category: string; | ||
user_id: string; | ||
} |
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 |
---|---|---|
@@ -1,21 +1,19 @@ | ||
import { IsOptional, IsString, IsNumber, IsDate } from "class-validator"; | ||
import { IsNumber, IsOptional, IsString } from 'class-validator'; | ||
|
||
export class UpdateBudgetDto { | ||
@IsOptional() | ||
@IsString() | ||
budget_item?: string; | ||
budget_title?: string; | ||
|
||
@IsOptional() | ||
@IsNumber() | ||
budget_amount?: number; | ||
amount?: number; | ||
|
||
@IsOptional() | ||
@IsString() | ||
budget_month?: string; | ||
wallet_id?: string; | ||
|
||
@IsOptional() | ||
@IsDate() | ||
budget_time?: Date; | ||
|
||
|
||
@IsString() | ||
category_id?: string; | ||
} |
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 |
---|---|---|
@@ -1,4 +1,20 @@ | ||
import { Controller } from '@nestjs/common'; | ||
import { Controller, Get, Req, Res } from '@nestjs/common'; | ||
import { CategoryService } from './category.service'; | ||
import { CustomRequest } from '../middleware/Auth.middleware'; | ||
import { Response } from 'express'; | ||
|
||
@Controller('category') | ||
export class CategoryController {} | ||
export class CategoryController { | ||
constructor(private readonly categoryService: CategoryService) {} | ||
@Get() | ||
async getAllCategory(@Req() req: CustomRequest, @Res() res: Response) { | ||
try { | ||
return await this.categoryService.getAllCategory(); | ||
} catch (e) { | ||
res.json({ | ||
status: 500, | ||
message: e.message, | ||
}); | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -1,7 +1,14 @@ | ||
import { Module } from '@nestjs/common'; | ||
import { CategoryService } from './category.service'; | ||
import { CategoryController } from './category.controller'; | ||
import { MongooseModule } from '@nestjs/mongoose'; | ||
import { CategorySchema } from './category.schema'; | ||
|
||
@Module({ | ||
providers: [CategoryService] | ||
imports: [ | ||
MongooseModule.forFeature([{ name: 'Category', schema: CategorySchema }]), | ||
], | ||
controllers: [CategoryController], | ||
providers: [CategoryService], | ||
}) | ||
export class CategoryModule {} |
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
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 |
---|---|---|
@@ -1,4 +1,20 @@ | ||
import { Injectable } from '@nestjs/common'; | ||
import { HttpStatus, Injectable } from '@nestjs/common'; | ||
import { InjectModel } from '@nestjs/mongoose'; | ||
import { Model } from 'mongoose'; | ||
import { Category } from './category.schema'; | ||
|
||
@Injectable() | ||
export class CategoryService {} | ||
export class CategoryService { | ||
constructor( | ||
@InjectModel(Category.name) private categoryModel: Model<Category>, | ||
) {} | ||
|
||
async getAllCategory() { | ||
try { | ||
const categories = await this.categoryModel.find(); | ||
return { data: categories, status: HttpStatus.OK }; | ||
} catch (e) { | ||
throw new Error(e.message); | ||
} | ||
} | ||
} |
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,26 @@ | ||
export const result = [ | ||
{ | ||
_id: 1, | ||
income_source: 'Social bank', | ||
income_amount: 5000, | ||
income_month: 'January', | ||
}, | ||
{ | ||
_id: 2, | ||
income_source: 'Islamic bank', | ||
income_amount: 8000, | ||
income_month: 'January', | ||
}, | ||
{ | ||
_id: 3, | ||
income_source: 'Bangladesh', | ||
income_amount: 25000, | ||
income_month: 'January', | ||
}, | ||
{ | ||
_id: 4, | ||
income_source: 'Business', | ||
income_amount: 15000, | ||
income_month: 'January', | ||
}, | ||
]; |
Oops, something went wrong.