Notes
Notes - notes.io |
makeExecutableSchema,
addMockFunctionsToSchema,
MockList
} from 'graphql-tools';
import casual from 'casual';
import typeDefs from './typedefs';
import { concat } from 'apollo-link';
import {
rows,
listFilter,
mandateHeaderDtls
} from './mock/manageList/listData';
/*
const resolvers = {
Query: {
testString: () => 'It works!',
login: (_, args) => {
console.log(args);
if (args.username === 'scb' && args.password === 'scb') {
return true;
} else return false;
},
},
};*/
const mocks = {
Query: () => ({
getDDABatch: async (root, { offset, limit }) => {
const result = await new Promise(resolve => {
setTimeout(() => {
resolve({
records: rows.slice(offset, offset + limit),
totalRecords: rows.length
});
}, 1000);
});
return result;
},
getMandateListFilterColumns: async () => {
const result = await new Promise(resolve => {
setTimeout(() => {
resolve({
transactionSuccess: true,
listFilter: listFilter
});
}, 1000);
});
return result;
},
getUDAData: async () => {
const result = await new Promise(resolve => {
setTimeout(() => {
resolve({
recordList: {
Payments: ['Payee', 'Payments'],
Reporting: ['Prior Day Account Statements']
}
});
}, 1000);
});
return result;
},
getProductSubProductConfig: async () => {
const result = await new Promise(resolve => {
setTimeout(() => {
resolve({
productSubProductList: [
{
product: 'Payments',
subProduct: [
'Payee',
'Payments',
'Payments Without Identifier',
'Payments with Multiple Files'
]
},
{
product: 'Collections',
subProduct: [
'Collections-DDI',
'Collections-DDI without Identifier',
'Collections-Mandate',
'Collections-Mandate without Identifier'
]
},
{
product: 'Reporting',
subProduct: ['Prior Day Account Statements']
},
{
product: 'Receivables Management (S2BR)',
subProduct: ['Buyer', 'Invoice', 'Receipt Sync']
}
]
});
}, 1000);
});
return result;
},
getFileMergeOptions: async () => {
const result = await new Promise(resolve => {
setTimeout(() => {
resolve({
fileMergeOptionsList: ['Indexed', 'Sequence']
});
}, 1000);
});
return result;
},
getFieldSeparatorItems: async () => {
const result = await new Promise(resolve => {
setTimeout(() => {
resolve({
fieldSeparatorList: ['Tab', 'Space']
});
}, 1000);
});
return result;
},
getFieldWrapperItems: async () => {
const result = await new Promise(resolve => {
setTimeout(() => {
resolve({
fieldWrapperList: ['"', "'"]
});
}, 1000);
});
return result;
},
getHeaderRecordValues: async () => {
const result = await new Promise(resolve => {
setTimeout(() => {
resolve({
headerRecordValueList: ['1', '2', '3', '4', '5']
});
}, 1000);
});
return result;
},
getTransactionRecordValues: async () => {
const result = await new Promise(resolve => {
setTimeout(() => {
resolve({
transactionRecordValueList: [
'1',
'2',
'3',
'4',getFileTypeValues
'5',
'6',
'7',
'8',
'9',
'10'
]
});
}, 1000);
});
return result;
},
getFileTypeValues: async () => {
const result = await new Promise(resolve => {
setTimeout(() => {
resolve({
fileTypeList: [
{ key: 'D', value: 'Delimited' },
{ key: 'F', value: 'Fixed Length' },
{ key: 'X', value: 'Excel File' }
]
});
}, 1000);
});
return result;
},
getCharacterEncodingFormats: async () => {
const result = await new Promise(resolve => {
setTimeout(() => {
resolve({
characterEncodingFormatList: [
'ASCII',
'Chinese Traditional (Big5)',
'Chinese Simplified (GB18030)',
'Japanese (Shift-JIS)',
'Thai',
'Unicode (UTF-8)'
]
});
}, 1000);
});
return result;
},
getRecordTypes: async () => {
const result = await new Promise(resolve => {
setTimeout(() => {
resolve({
recordTypeList: [
'Regulatory Details(China only)',
'Bank Account',
'Contact Person',
'Document Checklist(Thailand only)',
'FX Contract',
'Header',
'Invoice',
'Trailer'
]
});
}, 1000);
});
return result;
},
getCreateTemplateData: async () => {
const result = await new Promise(resolve => {
setTimeout(() => {
resolve({
optionSuccess: true,
optionData: [
{
label: 'Payee',
value: 0
},
{
label: 'Payments',
value: 1
},
{
label: 'Payment Without Identifier',
value: 2
}
]
});
}, 1000);
});
return result;
},
importUDADataTemplate: async () => {
const result = await new Promise(resolve => {
setTimeout(() => {
resolve({
uDADataTemplateList: [
{
headerRecordList: [
{
headerValues: [
'P',
'IBFT',
'ON',
'1128SD103',
'JNB',
'00188581102',
'Mahesh'
]
}
],
detailRecordList: [
{
detailValues: ['Q', 'IMPS', 'ON']
},
{
detailValues: ['R', 'IBFT', 'ON']
}
],
trailerRecordList: [
{
trailerValues: ['S', 'IBFT', 'ON']
},
{
trailerValues: ['T', 'IBFT', 'ON']
}
],
recType: 'Payment',
fileName: 'Testing'
},
{
detailRecordList: [
{
detailValues: ['Q', 'IMPS', 'ON']
},
{
detailValues: ['R', 'IBFT', 'ON']
}
],
headerRecordList: null,
trailerRecordList: null,
recType: 'Invoice',
fileName: 'test'
}
]
});
}, 1000);
});
return result;
},
saveUDADataTemplate: async () => {
const result = await new Promise(resolve => {
setTimeout(() => {
resolve({
GenericResponse: {
transactionSuccess: true
}
});
}, 1000);
});
return result;
},
getFieldsForRecordType: async () => {
const result = await new Promise(resolve => {
setTimeout(() => {
resolve([
{
fieldName: '*Beneficiary Name',
fieldType: 'Text',
length: 35,
mandatory: true
},
{
fieldName: '*Debit Account No',
fieldType: 'Text',
length: 34,
mandatory: true
},
{
fieldName: '*Payment Amount',
fieldType: 'Numeric',
length: 15,
mandatory: true
},
{
fieldName: '*Payment Currency',
fieldType: 'Text',
length: 3,
mandatory: true
},
{
fieldName: '*Payment Type',
fieldType: 'Text',
length: 4,
mandatory: true
},
{
fieldName: 'Payee Id',
fieldType: 'text',
length: 35,
mandatory: false
},
{
fieldName: 'Email Id',
fieldType: 'text',
length: 70,
mandatory: false
},
{
fieldName: 'Invoice Amount',
fieldType: 'Numeric',
length: 15,
mandatory: false
},
{
fieldName: 'Invoice Discription',
fieldType: 'text',
length: 75,
mandatory: false
}
]);
}, 1000);
});
return result;
},
getMandateBatchList: async (root, { getMandateBatchListRqst }) => {
const result = await new Promise(resolve => {
setTimeout(() => {
resolve({
transactionSuccess: true,
count: 24,
mandateHeaderDtls: mandateHeaderDtls,
listHeader: [],
prioritySort: []
});
}, 1000);
});
return result;
}
}),
GetDDIBatchWithCreditAccountsResponse: () => ({
creditAccounts: () => new MockList([1, 10])
}),
GetManageDDABatchDetailsResponse: () => ({
mandate: () => rows
}),
GetDDABatchResponse: () => ({
records: () => rows,
totalRecords: () => rows.length
}),
DDIBatch: () => ({
batchReference: () => casual.letter + casual.integer(10000, 99999)
}),
CreditAccount: () => ({
accountNickname: casual.first_name,
accountNumber: casual.integer(1000000000, 9999999999),
accountCurrency: casual.currency_symbol,
accountName: casual.company_name,
bankCode: casual.integer(10000, 99999),
countryCode: casual.country_code
})
};
const mockSchema = makeExecutableSchema({ typeDefs });
addMockFunctionsToSchema({ schema: mockSchema, mocks });
export default mockSchema;
|
Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...
With notes.io;
- * You can take a note from anywhere and any device with internet connection.
- * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
- * You can quickly share your contents without website, blog and e-mail.
- * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
- * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.
Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.
Easy: Notes.io doesn’t require installation. Just write and share note!
Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )
Free: Notes.io works for 12 years and has been free since the day it was started.
You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;
Email: [email protected]
Twitter: http://twitter.com/notesio
Instagram: http://instagram.com/notes.io
Facebook: http://facebook.com/notesio
Regards;
Notes.io Team