UNPKG

@tomei/sso

Version:
78 lines 3.5 kB
"use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; Object.defineProperty(exports, "__esModule", { value: true }); exports.GroupPrivilege = void 0; const general_1 = require("@tomei/general"); const group_privilege_repository_1 = require("./group-privilege.repository"); class GroupPrivilege extends general_1.ObjectBase { get CreatedAt() { return this._CreatedAt; } get UpdatedAt() { return this._UpdatedAt; } get CreatedById() { return this._CreatedById; } get UpdatedById() { return this._UpdatedById; } constructor(GroupPrivilegeAttr) { super(); this.TableName = 'sso_GroupPrivilege'; this.ObjectType = 'GroupPrivilege'; if (GroupPrivilegeAttr) { this.GroupPrivilegeId = GroupPrivilegeAttr.GroupPrivilegeId; this.GroupCode = GroupPrivilegeAttr.GroupCode; this.SystemPrivilegeId = GroupPrivilegeAttr.SystemPrivilegeId; this.Status = GroupPrivilegeAttr.Status; this._CreatedAt = GroupPrivilegeAttr.CreatedAt; this._UpdatedAt = GroupPrivilegeAttr.UpdatedAt; this._CreatedById = GroupPrivilegeAttr.CreatedById; this._UpdatedById = GroupPrivilegeAttr.UpdatedById; } } setAttributes(GroupPrivilegeAttr) { this.GroupPrivilegeId = GroupPrivilegeAttr.GroupPrivilegeId; this.GroupCode = GroupPrivilegeAttr.GroupCode; this.SystemPrivilegeId = GroupPrivilegeAttr.SystemPrivilegeId; this.Status = GroupPrivilegeAttr.Status; this._CreatedAt = GroupPrivilegeAttr.CreatedAt; this._UpdatedAt = GroupPrivilegeAttr.UpdatedAt; this._CreatedById = GroupPrivilegeAttr.CreatedById; this._UpdatedById = GroupPrivilegeAttr.UpdatedById; } static init(dbTransaction, GroupPrivilegeId) { return __awaiter(this, void 0, void 0, function* () { try { if (GroupPrivilegeId) { const GroupPrivilegeAttr = yield this._Repository.findOne({ where: { GroupPrivilegeId }, transaction: dbTransaction, }); if (GroupPrivilegeAttr) { return new GroupPrivilege(GroupPrivilegeAttr.get({ plain: true })); } else { throw new general_1.ClassError('GroupPrivilege', 'GroupPrivilegeErrMsg00', 'GroupPrivilege not found'); } } return new GroupPrivilege(); } catch (error) { throw error; } }); } } exports.GroupPrivilege = GroupPrivilege; GroupPrivilege._Repository = new group_privilege_repository_1.GroupPrivilegeRepository(); //# sourceMappingURL=group-privilege.js.map