Skip to content

Commit

Permalink
Merge branch 'development' of github.com:olasunkanmi-SE/restaurant in…
Browse files Browse the repository at this point in the history
…to development
  • Loading branch information
olasunkanmi-SE committed Nov 12, 2023
2 parents 0a091da + fa05846 commit b969d63
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
12 changes: 11 additions & 1 deletion backend/src/order_statuses/order_status.entity.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Entity, Result } from 'src/domain';
import { Audit, Entity, Result } from 'src/domain';
import { IOrderStatuses } from './order_status_entity.interface';
import { Types } from 'mongoose';

Expand All @@ -7,12 +7,14 @@ export class OrderStatus extends Entity<IOrderStatuses> implements IOrderStatuse
_name: string;
_code: string;
_description?: string;
_audit: Audit;
constructor(id: Types.ObjectId, props: IOrderStatuses) {
super(id);
this._isActive = props.isActive;
this._name = props.name;
this._code = props.code;
this._description = props.description;
this._audit = props.audit;
}

get isActive(): boolean {
Expand Down Expand Up @@ -47,6 +49,14 @@ export class OrderStatus extends Entity<IOrderStatuses> implements IOrderStatuse
this._description = description;
}

get audit(): Audit {
return this._audit;
}

set audit(audit: Audit) {
this._audit = audit;
}

static create(props: IOrderStatuses, id?: Types.ObjectId) {
return Result.ok(new OrderStatus(id, props)).getValue();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Audit } from 'src/domain';

export interface IOrderStatuses {
isActive: boolean;
name: string;
Expand Down

0 comments on commit b969d63

Please sign in to comment.