Created
May 3, 2021 03:28
-
-
Save ktutnik/551a66c0d274585e55ec57625bde8ece to your computer and use it in GitHub Desktop.
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
@genericController(c => { | |
c.mutators().authorize("ShopOwner", "Staff") | |
}) | |
@Entity() | |
export class Product { | |
@PrimaryGeneratedColumn() | |
id: number; | |
@val.required() | |
@Column() | |
name: string; | |
@authorize.read("ShopOwner", "Staff") | |
@Column() | |
basePrice: number; | |
@authorize.write("ShopOwner") | |
@Column() | |
price: number; | |
@authorize.readonly() | |
@CreateDateColumn() | |
createdOn:Date | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment