Skip to content

Commit

Permalink
Merge pull request #32 from Advanced-computer-lab-2024/backend/rashee…
Browse files Browse the repository at this point in the history
…datia/CategoryCRUD

Adjusted Category in Activity from string to CategoryType
  • Loading branch information
RasheedAtia authored Oct 6, 2024
2 parents 1890430 + 798c639 commit 0b7a233
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion backend/src/database/models/activity.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { locationSchema } from './location.model';
import { ActivityType } from '../../types/Activity.types';
import { ValidationException } from '../../exceptions/ValidationException';
import { getTagIds } from './tag.model';
import { CategoryType } from '../../types/Category.types';

const activitySchema = new Schema(
{
Expand All @@ -24,7 +25,7 @@ const activitySchema = new Schema(
min: 0,
},
category: {
type: String,
type: Schema.Types.ObjectId,
required: true,
},
tags: {
Expand Down
5 changes: 3 additions & 2 deletions backend/src/types/Activity.types.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import { LocationType } from './Location.types';
import { TagType } from './Tag.types';
import { CategoryType } from './Category.types';

export interface ActivityType {
date: string;
time: string;
location: LocationType;
price: number;
category: string;
category: CategoryType;
tags: TagType[];
specialDiscounts?: Number;
specialDiscounts: Number;
bookingOpen: boolean;
}

Expand Down

0 comments on commit 0b7a233

Please sign in to comment.