-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from LucaFinancial/chore/merge-conflicts-1-0-7
chore: merge
- Loading branch information
Showing
14 changed files
with
153 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,38 @@ | ||
const path = require("path"); | ||
const path = require('path'); | ||
|
||
const srcPath = path.join(__dirname, "..", "src"); | ||
const examplesSrc = path.join(srcPath, "examples"); | ||
const indexSrc = path.join(srcPath, "index.js"); | ||
const schemasSrc = path.join(srcPath, "schemas"); | ||
const validatorsSrc = path.join(srcPath, "validators.js"); | ||
const srcPath = path.join(__dirname, '..', 'src'); | ||
const constantsSrc = path.join(srcPath, 'constants.js'); | ||
const examplesSrc = path.join(srcPath, 'examples'); | ||
const indexSrc = path.join(srcPath, 'index.js'); | ||
const schemasSrc = path.join(srcPath, 'schemas'); | ||
const validatorSrc = path.join(srcPath, 'lucaValidator.js'); | ||
|
||
const distPath = path.join(__dirname, "..", "dist"); | ||
const distPath = path.join(__dirname, '..', 'dist'); | ||
|
||
const cjsPath = path.join(distPath, "cjs"); | ||
const cjsExamplesDst = path.join(cjsPath, "examples"); | ||
const cjsSchemasDst = path.join(cjsPath, "schemas"); | ||
const cjsPath = path.join(distPath, 'cjs'); | ||
const cjsExamplesDst = path.join(cjsPath, 'examples'); | ||
const cjsSchemasDst = path.join(cjsPath, 'schemas'); | ||
|
||
const esmPath = path.join(distPath, "esm"); | ||
const esmIndexDst = path.join(esmPath, "index.js"); | ||
const esmSchemasDst = path.join(esmPath, "schemas"); | ||
const esmValidatorsDst = path.join(esmPath, "validators.js"); | ||
const esmPath = path.join(distPath, 'esm'); | ||
const esmConstantsDst = path.join(esmPath, 'constants.js'); | ||
const esmIndexDst = path.join(esmPath, 'index.js'); | ||
const esmSchemasDst = path.join(esmPath, 'schemas'); | ||
const esmValidatorDst = path.join(esmPath, 'lucaValidator.js'); | ||
|
||
module.exports = { | ||
distPath, | ||
cjsPath, | ||
esmPath, | ||
cjsExamplesDst, | ||
cjsSchemasDst, | ||
esmConstantsDst, | ||
esmIndexDst, | ||
esmValidatorsDst, | ||
esmValidatorDst, | ||
esmSchemasDst, | ||
srcPath, | ||
constantsSrc, | ||
examplesSrc, | ||
indexSrc, | ||
schemasSrc, | ||
validatorsSrc, | ||
validatorSrc | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
const TransactionStateEnum = Object.freeze({ | ||
PLANNED: 'PLANNED', | ||
SCHEDULED: 'SCHEDULED', | ||
PENDING: 'PENDING', | ||
COMPLETED: 'COMPLETED', | ||
CANCELLED: 'CANCELLED', | ||
FAILED: 'FAILED', | ||
DISPUTED: 'DISPUTED', | ||
REFUNDED: 'REFUNDED', | ||
TENTATIVE: 'TENTATIVE', | ||
UPCOMING: 'UPCOMING', | ||
DELETED: 'DELETED' | ||
}); | ||
|
||
const CategoryTypeEnum = Object.freeze({ | ||
DEFAULT: 'DEFAULT', | ||
MODIFIED: 'MODIFIED', | ||
CUSTOM: 'CUSTOM' | ||
}); | ||
|
||
const EntityTypeEnum = Object.freeze({ | ||
ACCOUNT: 'ACCOUNT', | ||
RETAILER: 'RETAILER', | ||
BUSINESS: 'BUSINESS', | ||
INDIVIDUAL: 'INDIVIDUAL', | ||
UTILITY: 'UTILITY', | ||
GOVERNMENT: 'GOVERNMENT' | ||
}); | ||
|
||
const EntityStatusEnum = Object.freeze({ | ||
ACTIVE: 'ACTIVE', | ||
INACTIVE: 'INACTIVE', | ||
SUSPENDED: 'SUSPENDED', | ||
DELETED: 'DELETED', | ||
CLOSED: 'CLOSED' | ||
}); | ||
|
||
const RepeatedTransactionFrequencyEnum = Object.freeze({ | ||
DAY: 'DAY', | ||
WEEK: 'WEEK', | ||
MONTH: 'MONTH', | ||
YEAR: 'YEAR' | ||
}); | ||
|
||
const RepeatedTransactionStateEnum = Object.freeze({ | ||
ACTIVE: 'ACTIVE', | ||
PAUSED: 'PAUSED', | ||
COMPLETED: 'COMPLETED', | ||
CANCELLED: 'CANCELLED' | ||
}); | ||
|
||
const RepeatedTransactionOccurrenceStatusEnum = Object.freeze({ | ||
MODIFIED: 'MODIFIED', | ||
DELETED: 'DELETED' | ||
}); | ||
|
||
const constants = { | ||
TransactionStateEnum, | ||
CategoryTypeEnum, | ||
EntityTypeEnum, | ||
EntityStatusEnum, | ||
RepeatedTransactionFrequencyEnum, | ||
RepeatedTransactionStateEnum, | ||
RepeatedTransactionOccurrenceStatusEnum | ||
}; | ||
|
||
export default constants; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
import constants from './constants'; | ||
import lucaValidator from './lucaValidator'; | ||
import schemas from './schemas'; | ||
import validators from './validators'; | ||
|
||
export { schemas, validators }; | ||
export { constants, lucaValidator, schemas }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import Ajv2020 from 'ajv/dist/2020'; | ||
import addFormats from 'ajv-formats'; | ||
|
||
import schemas from './schemas'; | ||
|
||
const lucaValidator = new Ajv2020(); | ||
addFormats(lucaValidator); | ||
|
||
Object.entries(schemas).forEach(([key, schema]) => { | ||
if (!lucaValidator.validateSchema(schema)) { | ||
console.error(`Invalid schema: ${key}`); | ||
console.error(lucaValidator.errors); | ||
} else { | ||
lucaValidator.addSchema(schema, key); | ||
} | ||
}); | ||
|
||
export default lucaValidator; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.