@fye/mongoose-models
v5.0.0
Published
## Installation
Downloads
353
Keywords
Readme
mongoose-models
Installation
npm i @twec/mongoose-models
Usage
const models = require('@twec/mongoose-models`);
const instance = new models.OrderFeedback({...})
or
const { OrderFeedback } = require('@twec/mongoose-models`);
const instance = new OrderFeedback({...})
Available Models
OrderFeedback
| Field | Type | Required | Default |
| :---------------- | :-----: | :------: | :------ |
| reference
| string | ✓ | |
| purchaseOrderId
| string | ✓ | |
| sentToOMS
| boolean | | |
| sentToCustomer
| boolean | | |
| errorCode
| string | | |
| errorMessage
| string | | |
OrderCancel
inherits fields from OrderFeedback
| Field | Type | Required | Default |
| :---------------- | :-----: | :------: | :------ |
| cancelledAt
| date | | |
| reference
| string | ✓ | |
| purchaseOrderId
| string | ✓ | |
| sentToOMS
| boolean | | |
| sentToCustomer
| boolean | | |
| errorCode
| string | | |
| errorMessage
| string | | |
ItemShipment
inherits fields from OrderFeedback
| Field | Type | Required | Default |
| :--------------- | :--------: | :------: | :------- |
| shippedAt
| date | ✓ | Date.now |
| items
| [schema] | | |
| carrier
| string | | |
| trackingNumber
| string | ✓ | |
| expenses
| [schema] | | |
Items Schema
| Field | Type | Required | Min | Max | Default |
| :--------- | :-----: | :------: | :-: | :--: | :-----: |
| itemId
| string | ✓ | | | |
| quantity
| number | ✓ | 0 | 9999 | |
| cost
| number | | | | |
| isUsed
| boolean | | | | false |
Expense Schema
| Field | Type | Required | Enum | Min |
| :------- | :----: | :------: | :------------------: | :-: |
| type
| string | ✓ | handling
,freight
| |
| amount
| number | ✓ | | 0 |
ItemConfirmation
inherits fields from OrderFeedback
| Field | Type | Required | Default | Min | Max |
| :------------ | :----: | :------: | :--------: | :-: | :--: |
| confirmedAt
| date | ✓ | Date.now
| | |
| itemId
| string | ✓ | | | |
| quantity
| number | ✓ | | 0 | 9999 |
ItemCancel
inherits fields from OrderFeedback
| Field | Type | Required | Default | Min | Max |
| :------------ | :----: | :------: | :--------: | :-: | :--: |
| cancelledAt
| date | ✓ | Date.now
| | |
| itemId
| string | ✓ | | | |
| quantity
| number | ✓ | | 0 | 9999 |
ItemBackorder
inherits fields from OrderFeedback
| Field | Type | Required | Default | Min | Max |
| :-------------- | :----: | :------: | :--------: | :-: | :--: |
| backorderedAt
| date | ✓ | Date.now
| | |
| itemId
| string | ✓ | | | |
| quantity
| number | ✓ | | 0 | 9999 |