Skip to content

Commit

Permalink
issue #10: initial commit and scaffolding of functions
Browse files Browse the repository at this point in the history
  • Loading branch information
algoflows committed Mar 1, 2022
1 parent 83b0cdb commit 56ddc4a
Show file tree
Hide file tree
Showing 8 changed files with 169 additions and 0 deletions.
13 changes: 13 additions & 0 deletions lib/resources/Customers/Contests.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
'use strict';

const AifiResource = require('../../AifiResource');
const aifiMethod = AifiResource.method;

module.exports = AifiResource.extend({
path: 'customers/v2/contests',

create: aifiMethod({
method: 'POST',
path: '',
}),
});
13 changes: 13 additions & 0 deletions lib/resources/Customers/Customers.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
'use strict';

const AifiResource = require('../../AifiResource');
const aifiMethod = AifiResource.method;

module.exports = AifiResource.extend({
path: 'customers/v2/customers',

create: aifiMethod({
method: 'POST',
path: '',
}),
});
38 changes: 38 additions & 0 deletions lib/resources/Customers/EntryCodes.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
'use strict';

const AifiResource = require('../../AifiResource');
const aifiMethod = AifiResource.method;

module.exports = AifiResource.extend({
path: 'customers/v2/entry-codes',

create: aifiMethod({
method: 'POST',
path: '',
}),

retrieve: aifiMethod({
method: 'GET',
path: '/{customerId}',
}),

list: aifiMethod({
method: 'GET',
path: '',
}),

update: aifiMethod({
method: 'PATCH',
path: '/{customerId}',
}),

remoteRegister: aifiMethod({
method: 'POST',
path: '/remote-register',
}),

createEntryCode: aifiMethod({
method: 'POST',
path: '/{customerId}/entry-codes',
}),
});
33 changes: 33 additions & 0 deletions lib/resources/Customers/Orders.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
'use strict';

const AifiResource = require('../../AifiResource');
const aifiMethod = AifiResource.method;

module.exports = AifiResource.extend({
path: 'customers/v2/orders',

list: aifiMethod({
method: 'GET',
path: '',
}),

retrieve: aifiMethod({
method: 'GET',
path: '/{orderId}',
}),

payment: aifiMethod({
method: 'POST',
path: '/{orderId}/payment',
}),

listDraft: aifiMethod({
method: 'PATCH',
path: 'draft',
}),

retreiveDraft: aifiMethod({
method: 'POST',
path: '/draft/{draftOrderID}',
}),
});
23 changes: 23 additions & 0 deletions lib/resources/Customers/PasswordReset.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
'use strict';

const AifiResource = require('../../AifiResource');
const aifiMethod = AifiResource.method;

module.exports = AifiResource.extend({
path: 'customers/v2/password-reset',

reset: aifiMethod({
method: 'POST',
path: '',
}),

set: aifiMethod({
method: 'PATCH',
path: '',
}),

verify: aifiMethod({
method: 'GET',
path: '/verify',
}),
});
13 changes: 13 additions & 0 deletions lib/resources/Customers/Payments.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
'use strict';

const AifiResource = require('../../AifiResource');
const aifiMethod = AifiResource.method;

module.exports = AifiResource.extend({
path: 'customers/v2/payments',

create: aifiMethod({
method: 'GET',
path: '/methods/initialize',
}),
});
13 changes: 13 additions & 0 deletions lib/resources/Customers/Products.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
'use strict';

const AifiResource = require('../../AifiResource');
const aifiMethod = AifiResource.method;

module.exports = AifiResource.extend({
path: 'customers/v2/products',

retrieve: aifiMethod({
method: 'GET',
path: '',
}),
});
23 changes: 23 additions & 0 deletions lib/resources/Customers/Sessions.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
'use strict';

const AifiResource = require('../../AifiResource');
const aifiMethod = AifiResource.method;

module.exports = AifiResource.extend({
path: 'customers/v2/sessions',

loginSession: aifiMethod({
method: 'POST',
path: '',
}),

deleteSessoin: aifiMethod({
method: 'DELETE',
path: '/{customerId}',
}),

refreshSession: aifiMethod({
method: 'POST',
path: '/refresh',
}),
});

0 comments on commit 56ddc4a

Please sign in to comment.