Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import {
- ModelAttribute,
- NameAttribute,
- TypeAttribute,
- IdAttribute,
- BelongsToType,
- DateTimeType,
- NonEmptyStringType,
- EmailStringType,
- PhoneStringType,
- BooleanType,
- exposeApi,
- } from "@carrier-io/orm";
- @ModelAttribute("user")
- export class UserModel {
- @NameAttribute("id")
- @TypeAttribute(new IdType())
- @IdAttribute()
- id;
- @NameAttribute("companyId")
- @TypeAttribute(new BelongsToType(() => CompanyModel))
- company;
- @NameAttribute("createdAt")
- @TypeAttribute(new DateTimeType())
- createdAt;
- @NameAttribute("updatedAt")
- @TypeAttribute(new DateTimeType())
- updatedAt;
- @NameAttribute("disabled")
- @TypeAttribute(new BooleanType())
- disabled;
- @NameAttribute("firstName")
- @TypeAttribute(new NonEmptyStringType())
- firstName;
- @NameAttribute("lastName")
- @TypeAttribute(new NonEmptyStringType())
- lastName;
- @NameAttribute('email')
- @TypeAttribute(new EmailStringType())
- email;
- @NameAttribute('phone')
- @TypeAttribute(new PhoneStringType())
- phone;
- @NameAttribute("status")
- @TypeAttribute(new NonEmptyStringType({ optional: true }))
- status;
- }
- exposeApi(UserModel);
Add Comment
Please, Sign In to add comment