This repository has been archived by the owner on Sep 20, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 195
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Shop admin updates * Shop updates * Lint * Deployer * Lint
- Loading branch information
Showing
27 changed files
with
706 additions
and
228 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
46 changes: 46 additions & 0 deletions
46
dapps/shop/backend/data/migrations/20200507190719-addExternalPayments.js
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,46 @@ | ||
module.exports = { | ||
up: (queryInterface, Sequelize) => { | ||
return queryInterface.sequelize.transaction(() => { | ||
return Promise.all([ | ||
queryInterface.createTable('external_payments', { | ||
id: { | ||
type: Sequelize.INTEGER, | ||
autoIncrement: true, | ||
primaryKey: true | ||
}, | ||
created_at: Sequelize.DATE, | ||
updated_at: Sequelize.DATE, | ||
external_id: Sequelize.STRING, | ||
order_id: Sequelize.STRING, | ||
data: Sequelize.TEXT, | ||
payment_at: Sequelize.DATE, | ||
amount: Sequelize.INTEGER, | ||
fee: Sequelize.INTEGER, | ||
net: Sequelize.INTEGER | ||
}), | ||
queryInterface.createTable('external_orders', { | ||
id: { | ||
type: Sequelize.INTEGER, | ||
autoIncrement: true, | ||
primaryKey: true | ||
}, | ||
created_at: Sequelize.DATE, | ||
updated_at: Sequelize.DATE, | ||
ordered_at: Sequelize.DATE, | ||
external_id: Sequelize.STRING, | ||
order_id: Sequelize.STRING, | ||
data: Sequelize.TEXT, | ||
amount: Sequelize.INTEGER | ||
}) | ||
]) | ||
}) | ||
}, | ||
down: queryInterface => { | ||
return queryInterface.sequelize.transaction(() => { | ||
return Promise.all([ | ||
queryInterface.dropTable('external_payments'), | ||
queryInterface.dropTable('external_orders') | ||
]) | ||
}) | ||
} | ||
} |
51 changes: 51 additions & 0 deletions
51
dapps/shop/backend/data/shop-templates/affiliate/config.json
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,51 @@ | ||
{ | ||
"title": "Affiliate Store", | ||
"fullTitle": "Affiliate Store", | ||
"byline": "", | ||
"logo": "", | ||
"css": "", | ||
"isAffiliate": true, | ||
"footer": "© 2019 <a href=\"https://www.originprotocol.com\">Origin Protocol</a>. <span class=\"ml-1\">Learn more about this decentralized e-commerce store <a class=\"ul\" href=\"https://medium.com/originprotocol/built-on-origin-a-decentralized-shopify-alternative-888adc4198b0\">here</a>.</span>", | ||
"backendAuthToken": "affiliate", | ||
|
||
"supportEmail": "My Store <[email protected]>", | ||
"emailSubject": "Your Order", | ||
"twitter": "", | ||
"medium": "", | ||
"instagram": "", | ||
"facebook": "", | ||
|
||
"stripe": false, | ||
"beta": true, | ||
"discountCodes": true, | ||
|
||
"pgpPublicKey": "-----BEGIN PGP PUBLIC KEY BLOCK-----\n\nXXXX\n-----END PGP PUBLIC KEY BLOCK-----\n", | ||
"contentCDN": "", | ||
"contentHash": "", | ||
"stripeKey": "", | ||
|
||
"networks": { | ||
"1": { | ||
"marketplaceContract": "0x698ff47b84837d3971118a369c570172ee7e54c2", | ||
"listingId": "1-001-XXX", | ||
"affiliate": "", | ||
"arbitrator": "", | ||
"backend": "http://0.0.0.0:3000", | ||
"ipfsGateway": "https://ipfs.originprotocol.com", | ||
"ipfsApi": "https://ipfs.originprotocol.com" | ||
}, | ||
"4": { | ||
"marketplaceContract": "0x3d608cce08819351ada81fc1550841ebc10686fd", | ||
"listingId": "4-001-XXX", | ||
"backend": "https://example.herokuapp.com", | ||
"ipfsGateway": "https://ipfs.staging.originprotocol.com", | ||
"ipfsApi": "https://ipfs.staging.originprotocol.com" | ||
}, | ||
"999": { | ||
"listingId": "999-001-01", | ||
"backend": "http://0.0.0.0:3000", | ||
"ipfsGateway": "http://localhost:8080", | ||
"ipfsApi": "http://localhost:5002" | ||
} | ||
} | ||
} |
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,31 @@ | ||
module.exports = (sequelize, DataTypes) => { | ||
const ExternalOrder = sequelize.define( | ||
'ExternalOrder', | ||
{ | ||
id: { | ||
type: DataTypes.INTEGER, | ||
unique: true, | ||
primaryKey: true | ||
}, | ||
created_at: DataTypes.DATE, | ||
updated_at: DataTypes.DATE, | ||
external_id: DataTypes.STRING, | ||
order_id: DataTypes.STRING, | ||
data: DataTypes.TEXT, | ||
payment_at: DataTypes.DATE, | ||
amount: DataTypes.INTEGER, | ||
fee: DataTypes.INTEGER, | ||
net: DataTypes.INTEGER | ||
}, | ||
{ | ||
underscored: true, | ||
tableName: 'external_orders' | ||
} | ||
) | ||
|
||
ExternalOrder.associate = function(models) { | ||
ExternalOrder.belongsTo(models.Order, { as: 'externalOrders', foreignKey: 'orderId' }) | ||
} | ||
|
||
return ExternalOrder | ||
} |
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,32 @@ | ||
module.exports = (sequelize, DataTypes) => { | ||
const ExternalPayment = sequelize.define( | ||
'ExternalPayment', | ||
{ | ||
id: { | ||
type: DataTypes.INTEGER, | ||
unique: true, | ||
primaryKey: true | ||
}, | ||
created_at: DataTypes.DATE, | ||
updated_at: DataTypes.DATE, | ||
ordered_at: DataTypes.DATE, | ||
external_id: DataTypes.STRING, | ||
order_id: DataTypes.STRING, | ||
data: DataTypes.TEXT, | ||
amount: DataTypes.INTEGER | ||
}, | ||
{ | ||
underscored: true, | ||
tableName: 'external_payments' | ||
} | ||
) | ||
|
||
ExternalPayment.associate = function(models) { | ||
ExternalPayment.belongsTo(models.Order, { | ||
as: 'externalPayments', | ||
foreignKey: 'orderId' | ||
}) | ||
} | ||
|
||
return ExternalPayment | ||
} |
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
Oops, something went wrong.