@goweekdays/core 2.15.0 → 2.15.1

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,11 @@
1
1
  # @goweekdays/core
2
2
 
3
+ ## 2.15.1
4
+
5
+ ### Patch Changes
6
+
7
+ - dc2d90e: Follow up update for journal transaction configuration
8
+
3
9
  ## 2.15.0
4
10
 
5
11
  ### Minor Changes
package/dist/index.d.ts CHANGED
@@ -1966,7 +1966,8 @@ type TJournal = {
1966
1966
  id: string;
1967
1967
  org: ObjectId | string;
1968
1968
  type: TJournalType;
1969
- transaction: string;
1969
+ transaction: ObjectId | string;
1970
+ transactionName: string;
1970
1971
  invoiceNumber?: string;
1971
1972
  customer?: ObjectId | string;
1972
1973
  customerName?: string;
@@ -2008,6 +2009,7 @@ declare function useJournalRepo(): {
2008
2009
  updateById: (_id: string | ObjectId, options: Partial<TJournal>, session?: ClientSession) => Promise<string>;
2009
2010
  deleteById: (_id: string | ObjectId, session?: ClientSession) => Promise<string>;
2010
2011
  updateStatusById: (_id: string | ObjectId, status: string, session?: ClientSession) => Promise<string>;
2012
+ existsByTransactionId: (org: string | ObjectId, transactionId: string | ObjectId) => Promise<boolean>;
2011
2013
  };
2012
2014
 
2013
2015
  type TJournalLineStatus = "draft" | "posted" | "voided";
@@ -2025,6 +2027,7 @@ type TJournalLine = {
2025
2027
  credit: number;
2026
2028
  postReference?: string;
2027
2029
  particulars: string;
2030
+ balance?: number;
2028
2031
  status: TJournalLineStatus;
2029
2032
  createdAt?: Date | string;
2030
2033
  updatedAt?: Date | string;
@@ -2069,6 +2072,7 @@ declare function useJournalLineRepo(): {
2069
2072
  getById: (_id: string | ObjectId) => Promise<TJournalLine | null>;
2070
2073
  getByEntry: (journalEntry: string | ObjectId) => Promise<TJournalLine[]>;
2071
2074
  updateById: (_id: string | ObjectId, options: Pick<TJournalLine, "account" | "accountName" | "debit" | "credit">, session?: ClientSession) => Promise<string>;
2075
+ updateBalanceById: (_id: string | ObjectId, balance: number, session?: ClientSession) => Promise<void>;
2072
2076
  deleteById: (_id: string | ObjectId, session?: ClientSession) => Promise<string>;
2073
2077
  updateStatusByJournal: (journalEntry: string | ObjectId, status: TJournalLineStatus, session?: ClientSession) => Promise<string>;
2074
2078
  };
@@ -2078,6 +2082,64 @@ declare function useJournalLineController(): {
2078
2082
  getById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2079
2083
  };
2080
2084
 
2085
+ type TJournalTransactionAccount = {
2086
+ title: string;
2087
+ value: ObjectId | string;
2088
+ };
2089
+ type TJournalTransaction = {
2090
+ _id?: ObjectId;
2091
+ org: ObjectId | string;
2092
+ type: string;
2093
+ code: string;
2094
+ title: string;
2095
+ debits: TJournalTransactionAccount[];
2096
+ credits: TJournalTransactionAccount[];
2097
+ template: boolean;
2098
+ description?: string;
2099
+ createdBy: ObjectId | string;
2100
+ createdByName?: string;
2101
+ createdAt: Date | string;
2102
+ updatedAt: Date | string;
2103
+ };
2104
+ declare const schemaJournalTransactionAccount: Joi.ObjectSchema<any>;
2105
+ declare const schemaJournalTransactionCtrl: Joi.ObjectSchema<any>;
2106
+ declare const schemaJournalTransactionCtrlUpdate: Joi.ObjectSchema<any>;
2107
+ declare const schemaJournalTransactionRepo: Joi.ObjectSchema<any>;
2108
+ declare const schemaJournalTransactionGetAll: Joi.ObjectSchema<any>;
2109
+ declare function modelJournalTransaction(data: TJournalTransaction): TJournalTransaction;
2110
+
2111
+ declare function useJournalTransactionRepo(): {
2112
+ createIndexes: () => Promise<void>;
2113
+ add: (value: TJournalTransaction, session?: ClientSession) => Promise<ObjectId>;
2114
+ getAll: (options: {
2115
+ org: ObjectId | string;
2116
+ type?: string;
2117
+ search?: string;
2118
+ page?: number;
2119
+ limit?: number;
2120
+ }) => Promise<Record<string, any>>;
2121
+ getByOrgTypeId: (options: {
2122
+ org: string | ObjectId;
2123
+ type: string;
2124
+ _id: string | ObjectId;
2125
+ }) => Promise<TJournalTransaction | null>;
2126
+ updateById: (_id: string | ObjectId, options: Partial<TJournalTransaction>, session?: ClientSession) => Promise<string>;
2127
+ deleteById: (_id: string | ObjectId, session?: ClientSession) => Promise<string>;
2128
+ };
2129
+
2130
+ declare function useJournalTransactionService(): {
2131
+ add: (value: TJournalTransaction) => Promise<bson.ObjectId>;
2132
+ updateById: (org: string, type: string, _id: string, options: Partial<TJournalTransaction>) => Promise<string>;
2133
+ };
2134
+
2135
+ declare function useJournalTransactionController(): {
2136
+ add: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2137
+ getAll: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2138
+ getByOrgTypeId: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2139
+ updateById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2140
+ deleteById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2141
+ };
2142
+
2081
2143
  declare const customerStatuses: string[];
2082
2144
  type TCustomer = {
2083
2145
  _id?: ObjectId;
@@ -2170,4 +2232,4 @@ declare const XENDIT_BASE_URL: string;
2170
2232
  declare const DOMAIN: string;
2171
2233
  declare const APP_ORG: string;
2172
2234
 
2173
- 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, TBuilding, TBuildingUnit, TBusinessProfile, TBusinessProfileTaxType, 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, TJournalType, TLedgerBill, TMember, TOption, TOrg, TPermission, TPermissionGroup, TPlan, TPromo, TRole, TSubscribe, TSubscription, TSubscriptionTransaction, TTax, TUser, TVerification, TVerificationMetadata, VERIFICATION_FORGET_PASSWORD_DURATION, VERIFICATION_USER_INVITE_DURATION, XENDIT_BASE_URL, XENDIT_SECRET_KEY, chartOfAccountControlTypes, chartOfAccountNormalBalances, chartOfAccountStatuses, chartOfAccountTypes, currencies, customerStatuses, isDev, jobApplicationStatuses, journalLineStatuses, journalTypes, ledgerBillStatuses, ledgerBillTypes, modelAccountBalance, modelApp, modelBusinessProfile, modelChartOfAccount, modelCustomer, modelJobApplication, modelJobPost, modelJobProfile, modelJobProfileCert, modelJobProfileEdu, modelJobProfileLang, modelJobProfileSkill, modelJobProfileWorkExp, modelJobStatusSetup, modelJobStatusTrans, modelJobSummary, modelJournal, modelJournalLine, modelLedgerBill, modelMember, modelOption, modelOrg, modelPermission, modelPermissionGroup, modelPlan, modelPromo, modelRole, modelSubscription, modelSubscriptionTransaction, modelTax, modelUser, modelVerification, schemaAccountBalance, schemaApp, schemaAppUpdate, schemaAward, schemaBuilding, schemaBuildingUnit, schemaBusinessProfile, schemaBusinessProfileBusinessName, schemaBusinessProfileCurrentFiscalYear, schemaBusinessProfileFiscalYear, schemaBusinessProfileRDOCode, schemaBusinessProfileRegisteredAddress, schemaBusinessProfileTIN, schemaBusinessProfileTradeName, 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, schemaLanguage, schemaLedgerBill, schemaLedgerBillingSummary, schemaMember, schemaMemberRole, schemaMemberStatus, schemaMilitaryExp, schemaOption, schemaOrg, schemaOrgAdd, schemaOrgPilot, schemaOrgUpdate, schemaPatent, schemaPermission, schemaPermissionGroup, schemaPermissionGroupUpdate, schemaPermissionUpdate, schemaPlan, schemaPromo, schemaPublication, schemaRole, schemaRoleUpdate, schemaSkill, schemaSubscribe, schemaSubscription, schemaSubscriptionCompute, schemaSubscriptionPromoCode, schemaSubscriptionSeats, schemaSubscriptionTransaction, schemaSubscriptionUpdate, schemaTax, schemaTaxUpdate, schemaUpdateOptions, schemaUser, schemaVerification, schemaVerificationOrgInvite, schemaWorkExp, taxDirections, taxTypes, transactionSchema, useAccountBalanceRepo, useAppController, useAppRepo, useAppService, useAuthController, useAuthService, useBuildingController, useBuildingRepo, useBuildingService, useBuildingUnitController, useBuildingUnitRepo, useBuildingUnitService, useBusinessProfileCtrl, useBusinessProfileRepo, 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, 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, useSubscriptionController, useSubscriptionRepo, useSubscriptionService, useSubscriptionTransactionController, useSubscriptionTransactionRepo, useTaxController, useTaxRepo, useUserController, useUserRepo, useUserService, useUtilController, useVerificationController, useVerificationRepo, useVerificationService };
2235
+ 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, TBuilding, TBuildingUnit, TBusinessProfile, TBusinessProfileTaxType, 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, TSubscribe, TSubscription, TSubscriptionTransaction, TTax, TUser, TVerification, TVerificationMetadata, VERIFICATION_FORGET_PASSWORD_DURATION, VERIFICATION_USER_INVITE_DURATION, XENDIT_BASE_URL, XENDIT_SECRET_KEY, chartOfAccountControlTypes, chartOfAccountNormalBalances, chartOfAccountStatuses, chartOfAccountTypes, currencies, customerStatuses, isDev, jobApplicationStatuses, journalLineStatuses, journalTypes, ledgerBillStatuses, ledgerBillTypes, modelAccountBalance, modelApp, modelBusinessProfile, 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, modelSubscription, modelSubscriptionTransaction, modelTax, modelUser, modelVerification, schemaAccountBalance, schemaApp, schemaAppUpdate, schemaAward, schemaBuilding, schemaBuildingUnit, schemaBusinessProfile, schemaBusinessProfileBusinessName, schemaBusinessProfileCurrentFiscalYear, schemaBusinessProfileFiscalYear, schemaBusinessProfileRDOCode, schemaBusinessProfileRegisteredAddress, schemaBusinessProfileTIN, schemaBusinessProfileTradeName, 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, schemaSubscribe, schemaSubscription, schemaSubscriptionCompute, schemaSubscriptionPromoCode, schemaSubscriptionSeats, schemaSubscriptionTransaction, schemaSubscriptionUpdate, schemaTax, schemaTaxUpdate, schemaUpdateOptions, schemaUser, schemaVerification, schemaVerificationOrgInvite, schemaWorkExp, taxDirections, taxTypes, transactionSchema, useAccountBalanceRepo, useAppController, useAppRepo, useAppService, useAuthController, useAuthService, useBuildingController, useBuildingRepo, useBuildingService, useBuildingUnitController, useBuildingUnitRepo, useBuildingUnitService, useBusinessProfileCtrl, useBusinessProfileRepo, 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, useSubscriptionController, useSubscriptionRepo, useSubscriptionService, useSubscriptionTransactionController, useSubscriptionTransactionRepo, useTaxController, useTaxRepo, useUserController, useUserRepo, useUserService, useUtilController, useVerificationController, useVerificationRepo, useVerificationService };