@goweekdays/core 2.15.8 → 2.15.10

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @goweekdays/core
2
2
 
3
+ ## 2.15.10
4
+
5
+ ### Patch Changes
6
+
7
+ - 555842e: Asset management initial release
8
+
9
+ ## 2.15.9
10
+
11
+ ### Patch Changes
12
+
13
+ - fcf8414: Add asset item unique index
14
+
3
15
  ## 2.15.8
4
16
 
5
17
  ### Patch Changes
package/dist/index.d.ts CHANGED
@@ -2230,6 +2230,7 @@ type TAssetItem = {
2230
2230
  _id?: ObjectId;
2231
2231
  orgId: ObjectId | string;
2232
2232
  name: string;
2233
+ normalizedName?: string;
2233
2234
  description?: string;
2234
2235
  assetCategory: TAssetItemCategory;
2235
2236
  assetClass: TAssetItemClass;
@@ -2260,15 +2261,28 @@ type TAssetItem = {
2260
2261
  updatedAt?: Date | string;
2261
2262
  deletedAt?: Date | string;
2262
2263
  };
2264
+ type TAssetItemUpdate = Pick<TAssetItem, "description" | "brand" | "sku" | "price" | "categoryId" | "categoryName" | "subcategoryId" | "subcategoryName" | "categoryPath" | "isPublic" | "updatedAt"> & {
2265
+ name?: string;
2266
+ assetCategory?: TAssetItemCategory;
2267
+ assetClass?: TAssetItemClass;
2268
+ trackingType?: TAssetItemTrackingType;
2269
+ departmentId?: ObjectId | string;
2270
+ departmentName?: string;
2271
+ tags?: {
2272
+ id: string;
2273
+ name: string;
2274
+ }[];
2275
+ unit?: string;
2276
+ };
2263
2277
  declare const schemaAssetItem: Joi.ObjectSchema<any>;
2264
2278
  declare const schemaAssetItemCreate: Joi.ObjectSchema<any>;
2265
- declare const schemaAssetItemUpdate: Joi.ObjectSchema<any>;
2279
+ declare const schemaAssetItemUpdate: Joi.ObjectSchema<TAssetItemUpdate>;
2266
2280
  declare function modelAssetItem(data: TAssetItem): TAssetItem;
2267
2281
 
2268
2282
  declare function useAssetItemRepo(): {
2269
2283
  createIndexes: () => Promise<void>;
2270
2284
  add: (value: TAssetItem, session?: ClientSession) => Promise<ObjectId>;
2271
- getAll: ({ search, page, limit, status, assetCategory, trackingType, purpose, departmentId, categoryId, subcategoryId, brand, tags, }?: {
2285
+ getAll: ({ search, page, limit, status, assetCategory, trackingType, purpose, departmentId, categoryId, subcategoryId, brand, tags, isPublic, }?: {
2272
2286
  search?: string | undefined;
2273
2287
  page?: number | undefined;
2274
2288
  limit?: number | undefined;
@@ -2281,9 +2295,10 @@ declare function useAssetItemRepo(): {
2281
2295
  subcategoryId?: string | undefined;
2282
2296
  brand?: string | undefined;
2283
2297
  tags?: string[] | undefined;
2298
+ isPublic?: boolean | undefined;
2284
2299
  }) => Promise<Record<string, any>>;
2285
2300
  getById: (id: string) => Promise<TAssetItem>;
2286
- updateById: (id: string, value: Partial<TAssetItem>) => Promise<mongodb.WithId<bson.Document>>;
2301
+ updateById: (id: string, value: TAssetItemUpdate) => Promise<mongodb.WithId<bson.Document>>;
2287
2302
  incrementQuantity: (id: string, amount: number, session?: ClientSession) => Promise<mongodb.WithId<bson.Document>>;
2288
2303
  deleteById: (id: string) => Promise<mongodb.WithId<bson.Document>>;
2289
2304
  };
@@ -2295,6 +2310,8 @@ declare function useAssetItemService(): {
2295
2310
  name: string;
2296
2311
  }[];
2297
2312
  } & Omit<TAssetItem, "tags">) => Promise<bson.ObjectId>;
2313
+ makePublic: (id: string, value: boolean) => Promise<string>;
2314
+ deleteById: (id: string) => Promise<string>;
2298
2315
  };
2299
2316
 
2300
2317
  declare function useAssetItemController(): {
@@ -2302,6 +2319,7 @@ declare function useAssetItemController(): {
2302
2319
  getAll: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2303
2320
  getById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2304
2321
  updateById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2322
+ makePublic: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2305
2323
  deleteById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2306
2324
  };
2307
2325
 
@@ -2333,6 +2351,7 @@ declare function useAssetUnitRepo(): {
2333
2351
  }) => Promise<Record<string, any>>;
2334
2352
  getById: (id: string) => Promise<TAssetUnit>;
2335
2353
  updateById: (id: string, value: Partial<TAssetUnit>, session?: ClientSession) => Promise<mongodb.WithId<bson.Document>>;
2354
+ countByItemId: (itemId: string) => Promise<number>;
2336
2355
  countByItemIdAndStatus: (itemId: string, status: string) => Promise<number>;
2337
2356
  };
2338
2357
 
@@ -2378,6 +2397,7 @@ declare function useStockMovementRepo(): {
2378
2397
  limit?: number | undefined;
2379
2398
  }) => Promise<Record<string, any>>;
2380
2399
  getById: (id: string) => Promise<TStockMovement>;
2400
+ countByItemId: (itemId: string) => Promise<number>;
2381
2401
  };
2382
2402
 
2383
2403
  declare function useStockMovementService(): {
@@ -2555,4 +2575,4 @@ declare const XENDIT_BASE_URL: string;
2555
2575
  declare const DOMAIN: string;
2556
2576
  declare const APP_ORG: string;
2557
2577
 
2558
- export { ACCESS_TOKEN_EXPIRY, ACCESS_TOKEN_SECRET, APP_ACCOUNT, APP_MAIN, APP_ORG, DEFAULT_JOB_STATUS_SETUP, DEFAULT_USER_EMAIL, DEFAULT_USER_FIRST_NAME, DEFAULT_USER_LAST_NAME, DEFAULT_USER_PASSWORD, DOMAIN, JournalStatuses, MAILER_EMAIL, MAILER_PASSWORD, MAILER_TRANSPORT_HOST, MAILER_TRANSPORT_PORT, MAILER_TRANSPORT_SECURE, MBuilding, MBuildingUnit, MFile, MONGO_DB, MONGO_URI, PAYPAL_API_URL, PAYPAL_CLIENT_ID, PAYPAL_CLIENT_SECRET, PAYPAL_WEBHOOK_ID, PORT, PaypalWebhookHeaders, REDIS_HOST, REDIS_PASSWORD, REDIS_PORT, REFRESH_TOKEN_EXPIRY, REFRESH_TOKEN_SECRET, SECRET_KEY, SPACES_ACCESS_KEY, SPACES_BUCKET, SPACES_ENDPOINT, SPACES_REGION, SPACES_SECRET_KEY, TAccountBalance, TApp, TAssetItem, TAssetItemCategory, TAssetItemClass, TAssetItemPurpose, TAssetItemStatus, TAssetItemTrackingType, TAssetUnit, TAssetUnitStatus, TBuilding, TBuildingUnit, TBusinessProfile, TBusinessProfileTaxType, TCategoryLevel, TCategoryNode, TCategoryType, TChartOfAccount, TChartOfAccountControlType, TChartOfAccountNormalBalance, TChartOfAccountStatus, TChartOfAccountType, TCounter, TCustomer, TFile, TJobApplication, TJobApplicationMetadata, TJobPost, TJobProfile, TJobProfileAward, TJobProfileCert, TJobProfileEdu, TJobProfileGroup, TJobProfileLang, TJobProfileMilitaryExp, TJobProfilePatent, TJobProfilePublication, TJobProfileSkill, TJobProfileWorkExp, TJobStatusSetup, TJobStatusTrans, TJobSummary, TJobSummaryMetadata, TJournal, TJournalLine, TJournalLineStatus, TJournalStatus, TJournalTransaction, TJournalTransactionAccount, TJournalType, TLedgerBill, TMember, TOption, TOrg, TPermission, TPermissionGroup, TPlan, TPromo, TRole, TStockMovement, TStockMovementReferenceType, TStockMovementType, TSubscribe, TSubscription, TSubscriptionTransaction, TTag, TTax, TUser, TVerification, TVerificationMetadata, VERIFICATION_FORGET_PASSWORD_DURATION, VERIFICATION_USER_INVITE_DURATION, XENDIT_BASE_URL, XENDIT_SECRET_KEY, assetItemCategories, assetItemClasses, assetItemPurposes, assetItemStatuses, assetItemTrackingTypes, assetUnitStatuses, buildCategoryPath, categoryLevels, chartOfAccountControlTypes, chartOfAccountNormalBalances, chartOfAccountStatuses, chartOfAccountTypes, currencies, customerStatuses, isDev, jobApplicationStatuses, journalLineStatuses, journalTypes, ledgerBillStatuses, ledgerBillTypes, modelAccountBalance, modelApp, modelAssetItem, modelAssetUnit, modelBusinessProfile, modelCategoryNode, modelChartOfAccount, modelCustomer, modelJobApplication, modelJobPost, modelJobProfile, modelJobProfileCert, modelJobProfileEdu, modelJobProfileLang, modelJobProfileSkill, modelJobProfileWorkExp, modelJobStatusSetup, modelJobStatusTrans, modelJobSummary, modelJournal, modelJournalLine, modelJournalTransaction, modelLedgerBill, modelMember, modelOption, modelOrg, modelPermission, modelPermissionGroup, modelPlan, modelPromo, modelRole, modelStockMovement, modelSubscription, modelSubscriptionTransaction, modelTag, modelTax, modelUser, modelVerification, normalizeName, schemaAccountBalance, schemaApp, schemaAppUpdate, schemaAssetItem, schemaAssetItemCreate, schemaAssetItemUpdate, schemaAssetUnit, schemaAssetUnitUpdate, schemaAward, schemaBuilding, schemaBuildingUnit, schemaBusinessProfile, schemaBusinessProfileBusinessName, schemaBusinessProfileCurrentFiscalYear, schemaBusinessProfileFiscalYear, schemaBusinessProfileRDOCode, schemaBusinessProfileRegisteredAddress, schemaBusinessProfileTIN, schemaBusinessProfileTradeName, schemaCategoryGetAll, schemaCategoryNodeCreate, schemaCategoryNodeStd, schemaCategoryNodeUpdate, schemaCertification, schemaChartOfAccountBase, schemaChartOfAccountStd, schemaChartOfAccountUpdate, schemaCustomer, schemaCustomerUpdate, schemaEducation, schemaGroup, schemaInviteMember, schemaJobApplication, schemaJobPost, schemaJobPostUpdate, schemaJobProfile, schemaJobProfileAdditionalInfo, schemaJobProfileCert, schemaJobProfileCertDel, schemaJobProfileContactInfo, schemaJobProfileEdu, schemaJobProfileEduDel, schemaJobProfileLang, schemaJobProfileLangDel, schemaJobProfilePersonalInfo, schemaJobProfileSkill, schemaJobProfileSkillDel, schemaJobProfileSummary, schemaJobProfileWorkExp, schemaJobProfileWorkExpDel, schemaJobStatusSetup, schemaJobStatusSetupUpdate, schemaJobStatusTrans, schemaJobSummary, schemaJobSummaryInc, schemaJournalCtrl, schemaJournalCtrlUpdate, schemaJournalGetAll, schemaJournalLineBase, schemaJournalLineCtrl, schemaJournalLineCtrlUpdate, schemaJournalLineRepo, schemaJournalRepo, schemaJournalRepoUpdate, schemaJournalTransactionAccount, schemaJournalTransactionCtrl, schemaJournalTransactionCtrlUpdate, schemaJournalTransactionGetAll, schemaJournalTransactionRepo, schemaLanguage, schemaLedgerBill, schemaLedgerBillingSummary, schemaMember, schemaMemberRole, schemaMemberStatus, schemaMilitaryExp, schemaOption, schemaOrg, schemaOrgAdd, schemaOrgPilot, schemaOrgUpdate, schemaPatent, schemaPermission, schemaPermissionGroup, schemaPermissionGroupUpdate, schemaPermissionUpdate, schemaPlan, schemaPromo, schemaPublication, schemaRole, schemaRoleUpdate, schemaSkill, schemaStockMovement, schemaSubscribe, schemaSubscription, schemaSubscriptionCompute, schemaSubscriptionPromoCode, schemaSubscriptionSeats, schemaSubscriptionTransaction, schemaSubscriptionUpdate, schemaTagCreate, schemaTagStd, schemaTagUpdate, schemaTax, schemaTaxUpdate, schemaUpdateOptions, schemaUser, schemaVerification, schemaVerificationOrgInvite, schemaWorkExp, stockMovementReferenceTypes, stockMovementTypes, taxDirections, taxTypes, transactionSchema, useAccountBalanceRepo, useAppController, useAppRepo, useAppService, useAssetItemController, useAssetItemRepo, useAssetItemService, useAssetUnitController, useAssetUnitRepo, useAuthController, useAuthService, useBuildingController, useBuildingRepo, useBuildingService, useBuildingUnitController, useBuildingUnitRepo, useBuildingUnitService, useBusinessProfileCtrl, useBusinessProfileRepo, useCategoryController, useCategoryRepo, useCategoryService, useChartOfAccountController, useChartOfAccountRepo, useCounterModel, useCounterRepo, useCustomerCtrl, useCustomerRepo, useFileController, useFileRepo, useFileService, useGitHubService, useJobApplicationController, useJobApplicationRepo, useJobPostController, useJobPostRepo, useJobPostService, useJobProfileCtrl, useJobProfileRepo, useJobStatusConfigController, useJobStatusConfigRepo, useJobSummaryCtrl, useJobSummaryRepo, useJobSummarySvc, useJournalController, useJournalLineController, useJournalLineRepo, useJournalRepo, useJournalService, useJournalTransactionController, useJournalTransactionRepo, useJournalTransactionService, useLedgerBillingController, useLedgerBillingRepo, useMemberController, useMemberRepo, useOptionCtrl, useOptionRepo, useOrgController, useOrgRepo, useOrgService, usePaypalService, usePermissionController, usePermissionGroupController, usePermissionGroupRepo, usePermissionGroupService, usePermissionRepo, usePermissionService, usePlanController, usePlanRepo, usePlanService, usePromoController, usePromoRepo, usePromoUsageRepo, useRoleController, useRoleRepo, useRoleService, useStockMovementController, useStockMovementRepo, useStockMovementService, useSubscriptionController, useSubscriptionRepo, useSubscriptionService, useSubscriptionTransactionController, useSubscriptionTransactionRepo, useTagController, useTagRepo, useTagService, useTaxController, useTaxRepo, useUserController, useUserRepo, useUserService, useUtilController, useVerificationController, useVerificationRepo, useVerificationService };
2578
+ export { ACCESS_TOKEN_EXPIRY, ACCESS_TOKEN_SECRET, APP_ACCOUNT, APP_MAIN, APP_ORG, DEFAULT_JOB_STATUS_SETUP, DEFAULT_USER_EMAIL, DEFAULT_USER_FIRST_NAME, DEFAULT_USER_LAST_NAME, DEFAULT_USER_PASSWORD, DOMAIN, JournalStatuses, MAILER_EMAIL, MAILER_PASSWORD, MAILER_TRANSPORT_HOST, MAILER_TRANSPORT_PORT, MAILER_TRANSPORT_SECURE, MBuilding, MBuildingUnit, MFile, MONGO_DB, MONGO_URI, PAYPAL_API_URL, PAYPAL_CLIENT_ID, PAYPAL_CLIENT_SECRET, PAYPAL_WEBHOOK_ID, PORT, PaypalWebhookHeaders, REDIS_HOST, REDIS_PASSWORD, REDIS_PORT, REFRESH_TOKEN_EXPIRY, REFRESH_TOKEN_SECRET, SECRET_KEY, SPACES_ACCESS_KEY, SPACES_BUCKET, SPACES_ENDPOINT, SPACES_REGION, SPACES_SECRET_KEY, TAccountBalance, TApp, TAssetItem, TAssetItemCategory, TAssetItemClass, TAssetItemPurpose, TAssetItemStatus, TAssetItemTrackingType, TAssetItemUpdate, TAssetUnit, TAssetUnitStatus, TBuilding, TBuildingUnit, TBusinessProfile, TBusinessProfileTaxType, TCategoryLevel, TCategoryNode, TCategoryType, TChartOfAccount, TChartOfAccountControlType, TChartOfAccountNormalBalance, TChartOfAccountStatus, TChartOfAccountType, TCounter, TCustomer, TFile, TJobApplication, TJobApplicationMetadata, TJobPost, TJobProfile, TJobProfileAward, TJobProfileCert, TJobProfileEdu, TJobProfileGroup, TJobProfileLang, TJobProfileMilitaryExp, TJobProfilePatent, TJobProfilePublication, TJobProfileSkill, TJobProfileWorkExp, TJobStatusSetup, TJobStatusTrans, TJobSummary, TJobSummaryMetadata, TJournal, TJournalLine, TJournalLineStatus, TJournalStatus, TJournalTransaction, TJournalTransactionAccount, TJournalType, TLedgerBill, TMember, TOption, TOrg, TPermission, TPermissionGroup, TPlan, TPromo, TRole, TStockMovement, TStockMovementReferenceType, TStockMovementType, TSubscribe, TSubscription, TSubscriptionTransaction, TTag, TTax, TUser, TVerification, TVerificationMetadata, VERIFICATION_FORGET_PASSWORD_DURATION, VERIFICATION_USER_INVITE_DURATION, XENDIT_BASE_URL, XENDIT_SECRET_KEY, assetItemCategories, assetItemClasses, assetItemPurposes, assetItemStatuses, assetItemTrackingTypes, assetUnitStatuses, buildCategoryPath, categoryLevels, chartOfAccountControlTypes, chartOfAccountNormalBalances, chartOfAccountStatuses, chartOfAccountTypes, currencies, customerStatuses, isDev, jobApplicationStatuses, journalLineStatuses, journalTypes, ledgerBillStatuses, ledgerBillTypes, modelAccountBalance, modelApp, modelAssetItem, modelAssetUnit, modelBusinessProfile, modelCategoryNode, modelChartOfAccount, modelCustomer, modelJobApplication, modelJobPost, modelJobProfile, modelJobProfileCert, modelJobProfileEdu, modelJobProfileLang, modelJobProfileSkill, modelJobProfileWorkExp, modelJobStatusSetup, modelJobStatusTrans, modelJobSummary, modelJournal, modelJournalLine, modelJournalTransaction, modelLedgerBill, modelMember, modelOption, modelOrg, modelPermission, modelPermissionGroup, modelPlan, modelPromo, modelRole, modelStockMovement, modelSubscription, modelSubscriptionTransaction, modelTag, modelTax, modelUser, modelVerification, normalizeName, schemaAccountBalance, schemaApp, schemaAppUpdate, schemaAssetItem, schemaAssetItemCreate, schemaAssetItemUpdate, schemaAssetUnit, schemaAssetUnitUpdate, schemaAward, schemaBuilding, schemaBuildingUnit, schemaBusinessProfile, schemaBusinessProfileBusinessName, schemaBusinessProfileCurrentFiscalYear, schemaBusinessProfileFiscalYear, schemaBusinessProfileRDOCode, schemaBusinessProfileRegisteredAddress, schemaBusinessProfileTIN, schemaBusinessProfileTradeName, schemaCategoryGetAll, schemaCategoryNodeCreate, schemaCategoryNodeStd, schemaCategoryNodeUpdate, schemaCertification, schemaChartOfAccountBase, schemaChartOfAccountStd, schemaChartOfAccountUpdate, schemaCustomer, schemaCustomerUpdate, schemaEducation, schemaGroup, schemaInviteMember, schemaJobApplication, schemaJobPost, schemaJobPostUpdate, schemaJobProfile, schemaJobProfileAdditionalInfo, schemaJobProfileCert, schemaJobProfileCertDel, schemaJobProfileContactInfo, schemaJobProfileEdu, schemaJobProfileEduDel, schemaJobProfileLang, schemaJobProfileLangDel, schemaJobProfilePersonalInfo, schemaJobProfileSkill, schemaJobProfileSkillDel, schemaJobProfileSummary, schemaJobProfileWorkExp, schemaJobProfileWorkExpDel, schemaJobStatusSetup, schemaJobStatusSetupUpdate, schemaJobStatusTrans, schemaJobSummary, schemaJobSummaryInc, schemaJournalCtrl, schemaJournalCtrlUpdate, schemaJournalGetAll, schemaJournalLineBase, schemaJournalLineCtrl, schemaJournalLineCtrlUpdate, schemaJournalLineRepo, schemaJournalRepo, schemaJournalRepoUpdate, schemaJournalTransactionAccount, schemaJournalTransactionCtrl, schemaJournalTransactionCtrlUpdate, schemaJournalTransactionGetAll, schemaJournalTransactionRepo, schemaLanguage, schemaLedgerBill, schemaLedgerBillingSummary, schemaMember, schemaMemberRole, schemaMemberStatus, schemaMilitaryExp, schemaOption, schemaOrg, schemaOrgAdd, schemaOrgPilot, schemaOrgUpdate, schemaPatent, schemaPermission, schemaPermissionGroup, schemaPermissionGroupUpdate, schemaPermissionUpdate, schemaPlan, schemaPromo, schemaPublication, schemaRole, schemaRoleUpdate, schemaSkill, schemaStockMovement, schemaSubscribe, schemaSubscription, schemaSubscriptionCompute, schemaSubscriptionPromoCode, schemaSubscriptionSeats, schemaSubscriptionTransaction, schemaSubscriptionUpdate, schemaTagCreate, schemaTagStd, schemaTagUpdate, schemaTax, schemaTaxUpdate, schemaUpdateOptions, schemaUser, schemaVerification, schemaVerificationOrgInvite, schemaWorkExp, stockMovementReferenceTypes, stockMovementTypes, taxDirections, taxTypes, transactionSchema, useAccountBalanceRepo, useAppController, useAppRepo, useAppService, useAssetItemController, useAssetItemRepo, useAssetItemService, useAssetUnitController, useAssetUnitRepo, useAuthController, useAuthService, useBuildingController, useBuildingRepo, useBuildingService, useBuildingUnitController, useBuildingUnitRepo, useBuildingUnitService, useBusinessProfileCtrl, useBusinessProfileRepo, useCategoryController, useCategoryRepo, useCategoryService, useChartOfAccountController, useChartOfAccountRepo, useCounterModel, useCounterRepo, useCustomerCtrl, useCustomerRepo, useFileController, useFileRepo, useFileService, useGitHubService, useJobApplicationController, useJobApplicationRepo, useJobPostController, useJobPostRepo, useJobPostService, useJobProfileCtrl, useJobProfileRepo, useJobStatusConfigController, useJobStatusConfigRepo, useJobSummaryCtrl, useJobSummaryRepo, useJobSummarySvc, useJournalController, useJournalLineController, useJournalLineRepo, useJournalRepo, useJournalService, useJournalTransactionController, useJournalTransactionRepo, useJournalTransactionService, useLedgerBillingController, useLedgerBillingRepo, useMemberController, useMemberRepo, useOptionCtrl, useOptionRepo, useOrgController, useOrgRepo, useOrgService, usePaypalService, usePermissionController, usePermissionGroupController, usePermissionGroupRepo, usePermissionGroupService, usePermissionRepo, usePermissionService, usePlanController, usePlanRepo, usePlanService, usePromoController, usePromoRepo, usePromoUsageRepo, useRoleController, useRoleRepo, useRoleService, useStockMovementController, useStockMovementRepo, useStockMovementService, useSubscriptionController, useSubscriptionRepo, useSubscriptionService, useSubscriptionTransactionController, useSubscriptionTransactionRepo, useTagController, useTagRepo, useTagService, useTaxController, useTaxRepo, useUserController, useUserRepo, useUserService, useUtilController, useVerificationController, useVerificationRepo, useVerificationService };