UNPKG

@tomei/sso

Version:
81 lines 3.43 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.GroupSystemAccess = void 0; const general_1 = require("@tomei/general"); const group_system_access_repository_1 = require("./group-system-access.repository"); class GroupSystemAccess extends general_1.ObjectBase { get CreatedAt() { return this._CreatedAt; } set CreatedAt(CreatedAt) { this._CreatedAt = CreatedAt; } get UpdatedAt() { return this._UpdatedAt; } set UpdatedAt(UpdatedAt) { this._UpdatedAt = UpdatedAt; } get CreatedById() { return this._CreatedById; } set CreatedById(CreatedById) { this._CreatedById = CreatedById; } get UpdatedById() { return this._UpdatedById; } set UpdatedById(UpdatedById) { this._UpdatedById = UpdatedById; } constructor(groupSystemAccessAttr) { super(); this.ObjectType = 'GroupSystemAccess'; this.TableName = 'sso_GroupSystemAccess'; if (groupSystemAccessAttr) { this.GroupSystemAccessId = groupSystemAccessAttr.GroupSystemAccessId; this.GroupCode = groupSystemAccessAttr.GroupCode; this.SystemCode = groupSystemAccessAttr.SystemCode; this.Status = groupSystemAccessAttr.Status; this._CreatedById = groupSystemAccessAttr.CreatedById; this._CreatedAt = groupSystemAccessAttr.CreatedAt; this._UpdatedById = groupSystemAccessAttr.UpdatedById; this._UpdatedAt = groupSystemAccessAttr.UpdatedAt; } } static init(dbTransaction, GroupSystemAccessId) { return __awaiter(this, void 0, void 0, function* () { try { const groupSystemAccess = new GroupSystemAccess(); if (GroupSystemAccessId) { const groupSystemAccess = yield this._Repository.findOne({ where: { GroupSystemAccessId }, transaction: dbTransaction, }); if (groupSystemAccess) { return new GroupSystemAccess(groupSystemAccess.get({ plain: true })); } else { throw new general_1.ClassError('groupSystemAccess', 'groupSystemAccessErrMsg00', 'groupSystemAccess not found'); } } return groupSystemAccess; } catch (error) { throw error; } }); } } exports.GroupSystemAccess = GroupSystemAccess; GroupSystemAccess._Repository = new group_system_access_repository_1.GroupSystemAccessRepository(); //# sourceMappingURL=group-system-access.js.map