How to use the forest-express-sequelize.collection function in forest-express-sequelize

To help you get started, we’ve selected a few forest-express-sequelize examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ForestAdmin / forest-live-demo-lumber / forest / legal-docs.js View on Github external
const Liana = require('forest-express-sequelize');
const models = require('../models');

Liana.collection('legal_docs', {
  fields: [{
    field: 'id',
    type: 'String'
  }, {
    field: 'url',
    type: 'String',
    widget: 'link',
    isReadOnly: true
  }, {
    field: 'last_modified',
    type: 'Date',
    isReadOnly: true
  }, {
    field: 'size',
    type: 'String',
    isReadOnly: true
github opencollective / opencollective-api / server / forest / Collective.js View on Github external
import Liana from 'forest-express-sequelize';

Liana.collection('Collective', {
  actions: [
    {
      name: 'Delete collective and dependencies',
      fields: [
        {
          field: 'Confirmation',
          type: 'Boolean',
          description:
            'You are about to delete this collective and all its dependencies (Members, Unpaid Expenses, Tiers, Payment Methods). Check this box to proceed.',
          isRequired: true,
        },
      ],
    },
  ],
});
github opencollective / opencollective-api / server / forest / Subscription.js View on Github external
import Liana from 'forest-express-sequelize';

Liana.collection('Subscription', {
  actions: [
    {
      name: 'Cancel subscription',
    },
    {
      name: 'Activate subscription',
    },
  ],
});
github ForestAdmin / forest-live-demo-lumber / forest / companies.js View on Github external
const Liana = require('forest-express-sequelize');

Liana.collection('companies', {
	actions: [{ 
		name: 'Upload Legal Docs',
		type: 'single',
		fields: [{
			field: 'Certificate of Incorporation',
			description: 'The legal document relating to the formation of a company or corporation.',
			type: 'File',
			isRequired: true
		}, {
			field: 'Proof of address',
			description: '(Electricity, Gas, Water, Internet, Landline & Mobile Phone Invoice / Payment Schedule) no older than 3 months of the legal representative of your company',
			type: 'File',
			isRequired: true
		}, {
			field: 'Company bank statement',
			description: 'PDF including company name as well as IBAN',
github ForestAdmin / forest-live-demo-lumber / forest / customers.js View on Github external
const Liana = require('forest-express-sequelize');
const models = require('../models/');
const _ = require('lodash');

Liana.collection('customers', {
  actions: [{
    name: 'Generate invoice',
    download: true
  }, {
    name: 'Charge credit card',
    type: 'single',
    fields: [{
      field: 'amount',
      isRequired: true,
      description: 'The amount (USD) to charge the credit card. Example: 42.50',
      type: 'Number'
    }, {
      field: 'description',
      isRequired: true,
      description: 'Explain the reason why you want to charge manually the customer here',
      type: 'String'
github opencollective / opencollective-api / server / forest / User.js View on Github external
import Liana from 'forest-express-sequelize';

Liana.collection('User', {
  fields: [
    {
      field: 'fullname',
      type: 'String',
      get: object => {
        return `${object.firstName || ''} ${object.lastName || ''}`.trim();
      },
    },
  ],
  actions: [
    {
      name: 'Delete user and dependencies',
      fields: [
        {
          field: 'Confirmation',
          type: 'Boolean',