@chevre/domain 28.0.0-alpha.32 → 28.0.0-alpha.34

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,4 @@
1
1
  import type { Connection } from 'mongoose';
2
- import { factory } from '../factory';
3
2
  import { IModel } from './mongoose/schemas/accountTitle';
4
3
  /**
5
4
  * 科目リポジトリ
@@ -7,20 +6,6 @@ import { IModel } from './mongoose/schemas/accountTitle';
7
6
  export declare class AccountTitleRepo {
8
7
  readonly accountTitleModel: IModel;
9
8
  constructor(connection: Connection);
10
- deleteByProject(params: {
11
- project: {
12
- id: string;
13
- };
14
- }): Promise<void>;
15
- getCursor(conditions: any, projection: any): import("mongoose").Cursor<import("mongoose").Document<unknown, Record<string, never>, factory.accountTitle.IAccountTitle, import("./mongoose/virtuals").IVirtuals, {}> & factory.accountTitle.IAccountTitle & {
16
- _id: import("mongoose").Types.ObjectId;
17
- } & {
18
- __v: number;
19
- }, import("mongoose").QueryOptions<factory.accountTitle.IAccountTitle>, (import("mongoose").Document<unknown, Record<string, never>, factory.accountTitle.IAccountTitle, import("./mongoose/virtuals").IVirtuals, {}> & factory.accountTitle.IAccountTitle & {
20
- _id: import("mongoose").Types.ObjectId;
21
- } & {
22
- __v: number;
23
- }) | null>;
24
9
  unsetUnnecessaryFields(params: {
25
10
  filter: any;
26
11
  $unset: any;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.AccountTitleRepo = void 0;
4
- const factory_1 = require("../factory");
4
+ // import { factory } from '../factory';
5
5
  const accountTitle_1 = require("./mongoose/schemas/accountTitle");
6
6
  /**
7
7
  * 科目リポジトリ
@@ -11,17 +11,11 @@ class AccountTitleRepo {
11
11
  constructor(connection) {
12
12
  this.accountTitleModel = connection.model(accountTitle_1.modelName, (0, accountTitle_1.createSchema)());
13
13
  }
14
- async deleteByProject(params) {
15
- await this.accountTitleModel.deleteMany({
16
- 'project.id': { $exists: true, $eq: params.project.id }
17
- })
18
- .exec();
19
- }
20
- getCursor(conditions, projection) {
21
- return this.accountTitleModel.find(conditions, projection)
22
- .sort({ codeValue: factory_1.factory.sortType.Descending })
23
- .cursor();
24
- }
14
+ // public getCursor(conditions: any, projection: any) { // eslint-disable-line @typescript-eslint/no-explicit-any
15
+ // return this.accountTitleModel.find(conditions, projection)
16
+ // .sort({ codeValue: factory.sortType.Descending })
17
+ // .cursor();
18
+ // }
25
19
  async unsetUnnecessaryFields(params) {
26
20
  return this.accountTitleModel.updateMany(params.filter, { $unset: params.$unset }, { timestamps: false })
27
21
  .exec();
@@ -0,0 +1,33 @@
1
+ import type { Connection } from 'mongoose';
2
+ import { factory } from '../factory';
3
+ type IFindParams = Pick<factory.accountTitle.ISearchConditions, 'codeValue' | 'limit' | 'name' | 'page' | 'project' | 'sort'>;
4
+ /**
5
+ * 科目分類管理リポジトリ
6
+ */
7
+ export declare class AdminAccountTitleCategoryRepo {
8
+ private readonly accountTitleModel;
9
+ constructor(connection: Connection);
10
+ findAccountTitleCategorAsNotification(params: {
11
+ id: string;
12
+ projectId: string;
13
+ }): Promise<Pick<factory.accountTitle.IAccountTitle, 'codeValue' | 'hasCategoryCode' | 'name' | 'project' | 'typeOf'> & {
14
+ id: string;
15
+ }>;
16
+ deleteAccountTitleCategoriesByProject(params: {
17
+ project: {
18
+ id: string;
19
+ };
20
+ }): Promise<void>;
21
+ addAccountTitleCategory(params: Pick<factory.accountTitle.IAccountTitle, 'codeValue' | 'name' | 'project'>): Promise<{
22
+ id: string;
23
+ }>;
24
+ updateAccountTitleCategory(params: Pick<factory.accountTitle.IAccountTitle, 'codeValue' | 'name' | 'project'>): Promise<{
25
+ id: string;
26
+ }>;
27
+ findAccountTitleCategories(params: IFindParams): Promise<Pick<factory.accountTitle.IAccountTitle, 'codeValue' | 'name' | 'project' | 'typeOf'>[]>;
28
+ deleteAccountTitleCategoryByCodeValue(params: {
29
+ projectId: string;
30
+ codeValue: string;
31
+ }): Promise<void>;
32
+ }
33
+ export {};
@@ -0,0 +1,125 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AdminAccountTitleCategoryRepo = void 0;
4
+ const factory_1 = require("../factory");
5
+ const settings_1 = require("../settings");
6
+ const accountTitle_1 = require("./mongoose/schemas/accountTitle");
7
+ function createFilterQueries(params) {
8
+ const conditions = [];
9
+ const projectIdEq = params.project?.id?.$eq;
10
+ if (typeof projectIdEq === 'string') {
11
+ conditions.push({ 'project.id': { $eq: projectIdEq } });
12
+ }
13
+ if (typeof params.codeValue === 'string') {
14
+ conditions.push({ codeValue: { $exists: true, $regex: new RegExp(params.codeValue) } });
15
+ }
16
+ else {
17
+ const codeValueEq = params.codeValue?.$eq;
18
+ if (typeof codeValueEq === 'string') {
19
+ conditions.push({ codeValue: { $exists: true, $eq: codeValueEq } });
20
+ }
21
+ }
22
+ const nameRegex = params.name;
23
+ if (typeof nameRegex === 'string') {
24
+ conditions.push({ name: { $exists: true, $regex: new RegExp(nameRegex) } });
25
+ }
26
+ return conditions;
27
+ }
28
+ /**
29
+ * 科目分類管理リポジトリ
30
+ */
31
+ class AdminAccountTitleCategoryRepo {
32
+ accountTitleModel;
33
+ constructor(connection) {
34
+ this.accountTitleModel = connection.model(accountTitle_1.modelName, (0, accountTitle_1.createSchema)());
35
+ }
36
+ async findAccountTitleCategorAsNotification(params) {
37
+ const { id, projectId } = params;
38
+ const doc = await this.accountTitleModel.findOne({
39
+ _id: { $eq: id },
40
+ 'project.id': { $eq: projectId }
41
+ }, {
42
+ _id: 0,
43
+ id: { $toString: '$_id' },
44
+ codeValue: 1,
45
+ hasCategoryCode: 1,
46
+ name: 1,
47
+ project: 1,
48
+ typeOf: 1
49
+ })
50
+ .lean()
51
+ .exec();
52
+ if (doc === null) {
53
+ throw new factory_1.factory.errors.NotFound('AccountTitleCategory');
54
+ }
55
+ return doc;
56
+ }
57
+ async deleteAccountTitleCategoriesByProject(params) {
58
+ await this.accountTitleModel.deleteMany({
59
+ 'project.id': { $exists: true, $eq: params.project.id }
60
+ })
61
+ .exec();
62
+ }
63
+ async addAccountTitleCategory(params) {
64
+ const { codeValue, name, project } = params;
65
+ const creatingAccountTitle = {
66
+ codeValue,
67
+ hasCategoryCode: [],
68
+ name,
69
+ project,
70
+ typeOf: 'AccountTitle'
71
+ };
72
+ const doc = await this.accountTitleModel.create(creatingAccountTitle);
73
+ return { id: doc.id };
74
+ }
75
+ async updateAccountTitleCategory(params) {
76
+ const { codeValue, name, project } = params;
77
+ const doc = await this.accountTitleModel.findOneAndUpdate({
78
+ 'project.id': { $eq: project.id },
79
+ codeValue: { $eq: codeValue }
80
+ }, {
81
+ $set: { name }
82
+ }, {
83
+ new: true,
84
+ projection: { _id: 1 }
85
+ })
86
+ .exec();
87
+ if (doc === null) {
88
+ throw new factory_1.factory.errors.NotFound(accountTitle_1.modelName);
89
+ }
90
+ return { id: doc.id };
91
+ }
92
+ async findAccountTitleCategories(params) {
93
+ const query = this.accountTitleModel.find({ $and: createFilterQueries(params) }, {
94
+ _id: 0,
95
+ codeValue: 1,
96
+ name: 1,
97
+ project: 1,
98
+ typeOf: 1
99
+ });
100
+ if (typeof params.limit === 'number' && typeof params.page === 'number') {
101
+ query.limit(params.limit)
102
+ .skip(params.limit * (params.page - 1));
103
+ }
104
+ if (typeof params.sort?.codeValue === 'number') {
105
+ query.sort({ params: params.sort.codeValue });
106
+ }
107
+ return query.setOptions({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
108
+ .lean()
109
+ .exec();
110
+ }
111
+ async deleteAccountTitleCategoryByCodeValue(params) {
112
+ const { projectId, codeValue } = params;
113
+ await this.accountTitleModel.findOneAndDelete({
114
+ 'project.id': { $eq: projectId },
115
+ codeValue: { $eq: codeValue }
116
+ })
117
+ .exec()
118
+ .then((doc) => {
119
+ if (doc === null) {
120
+ throw new factory_1.factory.errors.NotFound(accountTitle_1.modelName);
121
+ }
122
+ });
123
+ }
124
+ }
125
+ exports.AdminAccountTitleCategoryRepo = AdminAccountTitleCategoryRepo;
@@ -1,7 +1,7 @@
1
1
  import { IndexDefinition, IndexOptions, Model, Schema, SchemaDefinition } from 'mongoose';
2
2
  import { IVirtuals } from '../virtuals';
3
3
  import { factory } from '../../../factory';
4
- type IDocType = factory.accountTitle.IAccountTitle;
4
+ type IDocType = Pick<factory.accountTitle.IAccountTitle, 'additionalProperty' | 'codeValue' | 'hasCategoryCode' | 'name' | 'project' | 'typeOf'>;
5
5
  type IModel = Model<IDocType, Record<string, never>, Record<string, never>, IVirtuals>;
6
6
  type ISchemaDefinition = SchemaDefinition<IDocType>;
7
7
  type ISchema = Schema<IDocType, IModel, Record<string, never>, Record<string, never>, IVirtuals, Record<string, never>, ISchemaDefinition, IDocType>;
@@ -8,18 +8,15 @@ const settings_1 = require("../../../settings");
8
8
  const modelName = 'AccountTitle';
9
9
  exports.modelName = modelName;
10
10
  const schemaDefinition = {
11
- project: mongoose_1.SchemaTypes.Mixed,
12
- typeOf: {
13
- type: String,
14
- required: true
15
- },
16
- codeValue: String,
11
+ project: { type: mongoose_1.SchemaTypes.Mixed, required: true },
12
+ typeOf: { type: String, required: true },
13
+ codeValue: { type: String, required: true },
17
14
  name: String,
18
- inCodeSet: mongoose_1.SchemaTypes.Mixed,
19
15
  hasCategoryCode: mongoose_1.SchemaTypes.Mixed,
20
- inDefinedTermSet: mongoose_1.SchemaTypes.Mixed,
21
- hasDefinedTerm: mongoose_1.SchemaTypes.Mixed,
22
16
  additionalProperty: mongoose_1.SchemaTypes.Mixed
17
+ // inCodeSet: SchemaTypes.Mixed, // discontinue(2026-10-16~)
18
+ // inDefinedTermSet: SchemaTypes.Mixed, // discontinue(2026-10-16~)
19
+ // hasDefinedTerm: SchemaTypes.Mixed, // discontinue(2026-10-16~)
23
20
  };
24
21
  const schemaOptions = {
25
22
  autoIndex: settings_1.MONGO_AUTO_INDEX,
@@ -98,24 +95,23 @@ const indexes = [
98
95
  'hasCategoryCode.codeValue': { $exists: true }
99
96
  }
100
97
  }
101
- ]
98
+ ],
99
+ // 'hasCategoryCode.hasCategoryCode.codeValue': null のインデックスが作成されてうまくいかない
100
+ // [
101
+ // {
102
+ // 'project.id': 1,
103
+ // 'hasCategoryCode.hasCategoryCode.codeValue': 1
104
+ // },
105
+ // {
106
+ // name: 'uniqueAccountTitleCode',
107
+ // unique: true,
108
+ // partialFilterExpression: {
109
+ // 'hasCategoryCode.hasCategoryCode.codeValue': { $exists: true }
110
+ // }
111
+ // }
112
+ // ]
102
113
  ];
103
114
  exports.indexes = indexes;
104
- // 'hasCategoryCode.hasCategoryCode.codeValue': null のインデックスは作成されてうまくいかないので保留
105
- // schema.index(
106
- // {
107
- // 'project.id': 1,
108
- // 'hasCategoryCode.hasCategoryCode.codeValue': 1
109
- // },
110
- // {
111
- // name: 'uniqueHasCategoryCodeHasCategoryCodeCodeValue',
112
- // unique: true,
113
- // partialFilterExpression: {
114
- // 'project.id': { $exists: true },
115
- // 'hasCategoryCode.hasCategoryCode.codeValue': { $exists: true }
116
- // }
117
- // }
118
- // );
119
115
  /**
120
116
  * 勘定科目スキーマ
121
117
  */
@@ -21,6 +21,7 @@ import type { OrderActionRepo } from './repo/action/order';
21
21
  import type { ConfirmActionRepo } from './repo/action/confirm';
22
22
  import type { AsyncActionRepo } from './repo/asyncAction';
23
23
  import type { AdditionalPropertyRepo } from './repo/additionalProperty';
24
+ import type { AdminAccountTitleCategoryRepo } from './repo/adminAccountTitleCategory';
24
25
  import type { AdminAccountingReportRepo } from './repo/adminAccountingReport';
25
26
  import type { AdminAcceptedOfferRepo } from './repo/adminAcceptedOffer';
26
27
  import type { AdminActionRepo } from './repo/adminAction';
@@ -199,6 +200,10 @@ export type AdditionalProperty = AdditionalPropertyRepo;
199
200
  export declare namespace AdditionalProperty {
200
201
  function createInstance(...params: ConstructorParameters<typeof AdditionalPropertyRepo>): Promise<AdditionalPropertyRepo>;
201
202
  }
203
+ export type AdminAccountTitleCategory = AdminAccountTitleCategoryRepo;
204
+ export declare namespace AdminAccountTitleCategory {
205
+ function createInstance(...params: ConstructorParameters<typeof AdminAccountTitleCategoryRepo>): Promise<AdminAccountTitleCategoryRepo>;
206
+ }
202
207
  export type AdminAccountingReport = AdminAccountingReportRepo;
203
208
  export declare namespace AdminAccountingReport {
204
209
  function createInstance(...params: ConstructorParameters<typeof AdminAccountingReportRepo>): Promise<AdminAccountingReportRepo>;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MerchantReturnPolicy = exports.MemberProgram = exports.Member = exports.Issuer = exports.IdentityProvider = exports.Identity = exports.EventSeries = exports.EventSellerMakesOffer = exports.EventOffer = exports.Event = exports.EmailMessage = exports.CustomerType = exports.Customer = exports.Credentials = exports.CreativeWork = exports.ConfirmationNumber = exports.Authorization = exports.CategoryCode = exports.assetTransaction = exports.AssetTransaction = exports.Aggregation = exports.AggregateReservation = exports.AggregateOrder = exports.AggregateOffer = exports.AggregateEvent = exports.AggregateAssetTransaction = exports.AggregateTransaction = exports.AggregateTask = exports.AggregateScheduledTask = exports.AggregateUseAction = exports.AggregateCheckMovieTicketAction = exports.AggregateAction = exports.AdminTransaction = exports.AdminTask = exports.AdminScheduledTask = exports.AdminPendingReservation = exports.AdminPaymentServiceChannel = exports.AdminEventSeries = exports.AdminEvent = exports.AdminAsyncAction = exports.AdminAssetTransaction = exports.AdminCheckMovieTicketAction = exports.AdminAction = exports.AdminAcceptedOffer = exports.AdminAccountingReport = exports.AdditionalProperty = exports.action = exports.AccountTitle = exports.AccountingReport = exports.AcceptedOffer = void 0;
4
- exports.WebSite = exports.rateLimit = exports.TransactionProcess = exports.TransactionNumber = exports.transaction = exports.Transaction = exports.Ticket = exports.AsyncAction = exports.TaskDelayed = exports.Task = exports.ScheduledTask = exports.StockHolder = exports.setting = exports.Setting = exports.ServiceAvailableHour = exports.SellerReturnPolicy = exports.SellerPaymentAccepted = exports.SellerMakesOffer = exports.Seller = exports.Schedule = exports.Role = exports.ReserveInterface = exports.Reservation = exports.ProjectMakesOffer = exports.Project = exports.ProductHasOfferCatalog = exports.Product = exports.PriceSpecification = exports.PotentialAction = exports.place = exports.Person = exports.PendingReservation = exports.PaymentServiceProvider = exports.PaymentService = exports.Passport = exports.OrderNumber = exports.OrderInTransaction = exports.Order = exports.Offer = exports.OfferItemCondition = exports.OfferCatalogItem = exports.OfferCatalog = exports.NoteAboutOrder = exports.Note = exports.MovieTicketType = exports.Message = void 0;
3
+ exports.MemberProgram = exports.Member = exports.Issuer = exports.IdentityProvider = exports.Identity = exports.EventSeries = exports.EventSellerMakesOffer = exports.EventOffer = exports.Event = exports.EmailMessage = exports.CustomerType = exports.Customer = exports.Credentials = exports.CreativeWork = exports.ConfirmationNumber = exports.Authorization = exports.CategoryCode = exports.assetTransaction = exports.AssetTransaction = exports.Aggregation = exports.AggregateReservation = exports.AggregateOrder = exports.AggregateOffer = exports.AggregateEvent = exports.AggregateAssetTransaction = exports.AggregateTransaction = exports.AggregateTask = exports.AggregateScheduledTask = exports.AggregateUseAction = exports.AggregateCheckMovieTicketAction = exports.AggregateAction = exports.AdminTransaction = exports.AdminTask = exports.AdminScheduledTask = exports.AdminPendingReservation = exports.AdminPaymentServiceChannel = exports.AdminEventSeries = exports.AdminEvent = exports.AdminAsyncAction = exports.AdminAssetTransaction = exports.AdminCheckMovieTicketAction = exports.AdminAction = exports.AdminAcceptedOffer = exports.AdminAccountingReport = exports.AdminAccountTitleCategory = exports.AdditionalProperty = exports.action = exports.AccountTitle = exports.AccountingReport = exports.AcceptedOffer = void 0;
4
+ exports.WebSite = exports.rateLimit = exports.TransactionProcess = exports.TransactionNumber = exports.transaction = exports.Transaction = exports.Ticket = exports.AsyncAction = exports.TaskDelayed = exports.Task = exports.ScheduledTask = exports.StockHolder = exports.setting = exports.Setting = exports.ServiceAvailableHour = exports.SellerReturnPolicy = exports.SellerPaymentAccepted = exports.SellerMakesOffer = exports.Seller = exports.Schedule = exports.Role = exports.ReserveInterface = exports.Reservation = exports.ProjectMakesOffer = exports.Project = exports.ProductHasOfferCatalog = exports.Product = exports.PriceSpecification = exports.PotentialAction = exports.place = exports.Person = exports.PendingReservation = exports.PaymentServiceProvider = exports.PaymentService = exports.Passport = exports.OrderNumber = exports.OrderInTransaction = exports.Order = exports.Offer = exports.OfferItemCondition = exports.OfferCatalogItem = exports.OfferCatalog = exports.NoteAboutOrder = exports.Note = exports.MovieTicketType = exports.Message = exports.MerchantReturnPolicy = void 0;
5
5
  var AcceptedOffer;
6
6
  (function (AcceptedOffer) {
7
7
  let repo;
@@ -214,6 +214,17 @@ var AdditionalProperty;
214
214
  }
215
215
  AdditionalProperty.createInstance = createInstance;
216
216
  })(AdditionalProperty || (exports.AdditionalProperty = AdditionalProperty = {}));
217
+ var AdminAccountTitleCategory;
218
+ (function (AdminAccountTitleCategory) {
219
+ let repo;
220
+ async function createInstance(...params) {
221
+ if (repo === undefined) {
222
+ repo = (await import('./repo/adminAccountTitleCategory.js')).AdminAccountTitleCategoryRepo;
223
+ }
224
+ return new repo(...params);
225
+ }
226
+ AdminAccountTitleCategory.createInstance = createInstance;
227
+ })(AdminAccountTitleCategory || (exports.AdminAccountTitleCategory = AdminAccountTitleCategory = {}));
217
228
  var AdminAccountingReport;
218
229
  (function (AdminAccountingReport) {
219
230
  let repo;
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * プロジェクトサービス
3
3
  */
4
- import type { AccountTitleRepo } from '../repo/accountTitle';
4
+ import type { AdminAccountTitleCategoryRepo } from '../repo/adminAccountTitleCategory';
5
5
  import type { AssetTransactionRepo } from '../repo/assetTransaction';
6
6
  import type { CategoryCodeRepo } from '../repo/categoryCode';
7
7
  import type { CreativeWorkRepo } from '../repo/creativeWork';
@@ -20,7 +20,7 @@ import type { SellerRepo } from '../repo/seller';
20
20
  export declare function deleteProject(params: {
21
21
  id: string;
22
22
  }): (repos: {
23
- accountTitle: AccountTitleRepo;
23
+ adminAccountTitleCategory: AdminAccountTitleCategoryRepo;
24
24
  categoryCode: CategoryCodeRepo;
25
25
  creativeWork: CreativeWorkRepo;
26
26
  adminEvent: AdminEventRepo;
@@ -40,7 +40,7 @@ export declare function deleteProject(params: {
40
40
  export declare function cleanUpDatabaseByProject(params: {
41
41
  id: string;
42
42
  }): (repos: {
43
- accountTitle: AccountTitleRepo;
43
+ adminAccountTitleCategory: AdminAccountTitleCategoryRepo;
44
44
  assetTransaction: AssetTransactionRepo;
45
45
  categoryCode: CategoryCodeRepo;
46
46
  creativeWork: CreativeWorkRepo;
@@ -12,7 +12,7 @@ function deleteProject(params) {
12
12
  function cleanUpDatabaseByProject(params) {
13
13
  return async (repos) => {
14
14
  // プロジェクトに所属する全データをリポジトリから削除する
15
- await repos.accountTitle.deleteByProject({ project: { id: params.id } });
15
+ await repos.adminAccountTitleCategory.deleteAccountTitleCategoriesByProject({ project: { id: params.id } });
16
16
  await repos.assetTransaction.deleteByProject({ project: { id: params.id } });
17
17
  await repos.categoryCode.deleteCategoryCodesByProject({ project: { id: params.id } });
18
18
  await repos.movieTicketType.deleteMovieTicketTypesByProject({ project: { id: params.id } });
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.call = call;
4
4
  const factory_1 = require("../../factory");
5
- const accountTitle_1 = require("../../repo/accountTitle");
5
+ const adminAccountTitleCategory_1 = require("../../repo/adminAccountTitleCategory");
6
6
  const aggregateOffer_1 = require("../../repo/aggregateOffer");
7
7
  const categoryCode_1 = require("../../repo/categoryCode");
8
8
  const creativeWork_1 = require("../../repo/creativeWork");
@@ -32,7 +32,7 @@ function call(params) {
32
32
  return async ({ connection }) => {
33
33
  const { data } = params;
34
34
  await onResourceUpdated(data)({
35
- accountTitle: new accountTitle_1.AccountTitleRepo(connection),
35
+ adminAccountTitleCategory: new adminAccountTitleCategory_1.AdminAccountTitleCategoryRepo(connection),
36
36
  aggregateOffer: new aggregateOffer_1.AggregateOfferRepo(connection),
37
37
  categoryCode: new categoryCode_1.CategoryCodeRepo(connection),
38
38
  creativeWork: new creativeWork_1.CreativeWorkRepo(connection),
@@ -576,26 +576,9 @@ function createInformAccountTitleTasks(params, setting) {
576
576
  }
577
577
  // const informResources = settings.onResourceUpdated.informResource;
578
578
  const informResources = setting?.onResourceUpdated?.informResource;
579
- const accountTitle = await repos.accountTitle.accountTitleModel.findOne({
580
- _id: { $eq: params.ids[0] },
581
- 'project.id': { $eq: params.project.id }
582
- }, {
583
- _id: 0,
584
- id: { $toString: '$_id' },
585
- additionalProperty: 1,
586
- codeValue: 1,
587
- hasCategoryCode: 1,
588
- name: 1,
589
- project: 1,
590
- typeOf: 1
591
- })
592
- .lean()
593
- .exec()
594
- .then((doc) => {
595
- if (doc === null) {
596
- throw new factory_1.factory.errors.NotFound(params.typeOf);
597
- }
598
- return doc;
579
+ const accountTitle = await repos.adminAccountTitleCategory.findAccountTitleCategorAsNotification({
580
+ id: params.ids[0],
581
+ projectId: params.project.id
599
582
  });
600
583
  const accountTitles4inform = [accountTitle];
601
584
  if (accountTitles4inform.length > 0) {
package/package.json CHANGED
@@ -88,5 +88,5 @@
88
88
  "postversion": "git push origin --tags",
89
89
  "prepublishOnly": "npm run clean && npm run build"
90
90
  },
91
- "version": "28.0.0-alpha.32"
91
+ "version": "28.0.0-alpha.34"
92
92
  }