Skip to content
This repository has been archived by the owner on Sep 21, 2022. It is now read-only.

Commit

Permalink
Merge pull request #7 from reactioncommerce/feat-black-box-surcharges
Browse files Browse the repository at this point in the history
feat: allow applied order surcharges to have any shape
  • Loading branch information
kieckhafer authored Apr 28, 2020
2 parents 47a6f34 + 5b4e179 commit da3ee36
Showing 1 changed file with 2 additions and 53 deletions.
55 changes: 2 additions & 53 deletions src/simpleSchemas.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,58 +165,6 @@ export const OrderAddress = new SimpleSchema({
}
});

/**
* @name SurchargeMessagesByLanguage
* @memberof Schemas
* @type {SimpleSchema}
* @property {String} content optional
* @property {String} language optional
*/
const SurchargeMessagesByLanguage = new SimpleSchema({
content: String,
language: String
});

/**
* @name AppliedSurcharge
* @memberof Schemas
* @type {SimpleSchema}
* @property {String} _id
* @property {Money} amount
* @property {String} cartId optional
* @property {String} fulfillmentGroupId optional
* @property {String} messagesByLanguage optional
* @property {String} reason optional
* @property {String} surchargeId optional
*/
const AppliedSurcharge = new SimpleSchema({
"_id": String,
"amount": Number,
"cartId": {
type: String,
optional: true
},
"fulfillmentGroupId": {
type: String,
optional: true
},
/*
* Message is used as a client message to let customers know why this surcharge might apply
* It can be saved in various languages
*/
"messagesByLanguage": {
type: Array,
optional: true
},
"messagesByLanguage.$": {
type: SurchargeMessagesByLanguage
},
"surchargeId": {
type: String,
optional: true
}
});

/**
* @name ShippingParcel
* @memberof Schemas
Expand Down Expand Up @@ -1146,7 +1094,8 @@ export const Order = new SimpleSchema({
optional: true
},
"surcharges.$": {
type: AppliedSurcharge
type: Object,
blackbox: true
},
"totalItemQuantity": {
type: SimpleSchema.Integer,
Expand Down

0 comments on commit da3ee36

Please sign in to comment.