Skip to content

Commit

Permalink
Merge pull request #324 from mojaloop/mbp-633-638-lookup
Browse files Browse the repository at this point in the history
mbp-633-638 Add interface, types, errors and aggregate for lookup phase
  • Loading branch information
vijayg10 authored Jul 1, 2022
2 parents 5b95759 + 782d8e6 commit cf97be4
Show file tree
Hide file tree
Showing 19 changed files with 3,003 additions and 23 deletions.
69 changes: 69 additions & 0 deletions modules/command-handler/src/application/errors.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
/*****
License
--------------
Copyright © 2017 Bill & Melinda Gates Foundation
The Mojaloop files are made available by the Bill & Melinda Gates Foundation under the Apache License, Version 2.0 (the "License") and you may not use these files except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, the Mojaloop files are distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Contributors
--------------
This is the official list (alphabetical ordering) of the Mojaloop project contributors for this file.
Names of the original copyright holders (individuals or organizations)
should be listed with a '*' in the first column. People who have
contributed from an organization can be listed under the organization
that actually holds the copyright for their contributions (see the
Gates Foundation organization for an example). Those individuals should have
their names indented and be marked with a '-'. Email address can be added
optionally within square brackets <email>.
* Gates Foundation
- Name Surname <[email protected]>
* Modusbox
- Shashikant Hirugade <[email protected]>
- Juan Correa <[email protected]>
--------------
******/

"use strict";

// Invalid Errors
export class InvalidBulkTransactionEntityIdTypeError extends Error {}
export class InvalidBulkTransactionEntityHomeTransactionIDTypeError extends Error {}
export class InvalidBulkTransactionEntityRequestTypeError extends Error {}
export class InvalidBulkTransactionEntityIndividualTransferTypeError extends Error {}
export class InvalidBulkTransactionEntityStatusTypeError extends Error {}
export class InvalidBulkTransactionEntityBulkBatchTypeError extends Error {}
export class InvalidBulkTransactionEntityPartyLookupTotalCountTypeError extends Error {}
export class InvalidBulkTransactionEntityPartyLookupSuccessCountTypeError extends Error {}
export class InvalidBulkTransactionEntityPartyLookupFailedCountTypeError extends Error {}
export class InvalidBulkTransactionEntityBulkQuotesTotalCountTypeError extends Error {}
export class InvalidBulkTransactionEntityBulkQuotesSuccessCountTypeError extends Error {}
export class InvalidBulkTransactionEntityBulkQuotesFailCountTypeError extends Error {}
export class InvalidBulkTransactionEntityBulkTransferTotalCountTypeError extends Error {}
export class InvalidBulkTransactionEntityBulkTransferSuccessCountTypeError extends Error {}
export class InvalidBulkTransactionEntityBulkTransferFailCountTypeError extends Error {}

// Repo.
export class UnableToInitRepoError extends Error {}

// Item already exists.
export class BulkTransactionEntityAlreadyExistsError extends Error {}
// No such item.
export class NoSuchBulkTransactionEntityError extends Error {}
// Stores.
export class UnableToStoreBulkTransactionEntityError extends Error {}
// Gets.
export class UnableToGetBulkTransactionEntityError extends Error {}
export class UnableToGetBulkTransactionEntitiesError extends Error {}
// Updates.
export class UnableToUpdateBulkTransactionEntityError extends Error {}
// Deletes.
export class UnableToDeleteBulkTransactionEntityError extends Error {}
export class UnableToDeleteBulkTransactionEntitiesError extends Error {}

// Others

Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
/*****
License
--------------
Copyright © 2017 Bill & Melinda Gates Foundation
The Mojaloop files are made available by the Bill & Melinda Gates Foundation under the Apache License, Version 2.0 (the "License") and you may not use these files except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, the Mojaloop files are distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Contributors
--------------
This is the official list (alphabetical ordering) of the Mojaloop project contributors for this file.
Names of the original copyright holders (individuals or organizations)
should be listed with a '*' in the first column. People who have
contributed from an organization can be listed under the organization
that actually holds the copyright for their contributions (see the
Gates Foundation organization for an example). Those individuals should have
their names indented and be marked with a '-'. Email address can be added
optionally within square brackets <email>.
* Gates Foundation
- Name Surname <[email protected]>
* Modusbox
- Shashikant Hirugade <[email protected]>
- Juan Correa <[email protected]>
--------------
******/

"use strict";

import {IBulkTransactionEntity, IBulkTransferRequest, IIndividualTransfers, IBulkBatch} from "@mojaloop/sdk-scheme-adapter-public-types-lib"; // TODO: mbp-638

export interface IBulkTransactionEntityRepo {
init(): Promise<void>;
destroy(): Promise<void>;
// BulkTransactionEntity
bulkTransactionEntityExists(bulkTransactionEntityId: string): Promise<boolean>;
storeBulkTransactionEntity(bulkTransactionEntity: IBulkTransactionEntity): Promise<void>;
getBulkTransactionEntity(bulkTransactionEntityId: string): Promise<IBulkTransactionEntity | null>;
updateBulkTransactionEntity(bulkTransactionEntity: IBulkTransactionEntity): Promise<void>; // TODO: return value;
deleteBulkTransactionEntity(bulkTransactionEntityId: string): Promise<void>;
deleteBulkTransactionEntities(): Promise<void>;
// BulkTransferRequest
bulkTransferRequestExists(bulkTransferRequestId: string): Promise<boolean>;
storeBulkTransferRequest(bulkTransferRequest: IBulkTransferRequest): Promise<void>;
getBulkTransferRequest(bulkTransferRequestId: string): Promise<IBulkTransferRequest | null>;
updateBulkTransferRequest(bulkTransferRequest: IBulkTransferRequest): Promise<void>; // TODO: return value;
deleteBulkTransferRequest(bulkTransferRequestId: string): Promise<void>;
deleteBulkTransferRequests(): Promise<void>;
// IndividualTransfers
individualTransfersExists(individualTransfersId: string): Promise<boolean>;
storeIndividualTransfers(individualTransfers: IIndividualTransfers): Promise<void>;
getIndividualTransfers(individualTransfersId: string): Promise<IIndividualTransfers | null>;
updateIndividualTransfers(individualTransfers: IIndividualTransfers): Promise<void>; // TODO: return value;
deleteIndividualTransfers(individualTransfersId: string): Promise<void>;
deleteMultipleIndividualTransfers(): Promise<void>;
// BulkBatch
bulkBatchExists(bulkBatchId: string): Promise<boolean>;
storeBulkBatch(bulkBatch: IBulkBatch): Promise<void>;
getBulkBatch(bulkBatchId: string): Promise<IBulkBatch | null>;
updateBulkBatch(bulkBatch: IBulkBatch): Promise<void>; // TODO: return value;
deleteBulkBatch(bulkBatchId: string): Promise<void>;
deleteBulkBatches(): Promise<void>;
}
Loading

0 comments on commit cf97be4

Please sign in to comment.