# orchy-base-code7

> Configures, sets up database models and implements CRUD methods.

Latest version **1.3.6** (published 2021-03-30) · MIT license · 0 weekly downloads

## Install

```sh
npm install orchy-base-code7
pnpm add orchy-base-code7
yarn add orchy-base-code7
bun add orchy-base-code7
```

Provides the command `orchy-base-code7`.

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.3.6 |
| Published | 2021-03-30 |
| First published | 2021-02-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 107.1 KB |
| Known vulnerabilities | 0 (+3 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Davi Silva |
| Maintainers | davi-code7 |
| Keywords | orchy-base, database, database configuration |

## Links

- npm: https://www.npmjs.com/package/orchy-base-code7
- Repository: https://github.com/davi-code7/orchy-base
- Homepage: https://github.com/davi-code7/orchy-base/#readme
- Issues: https://github.com/davi-code7/orchy-base/issues
- npm.io page: https://npm.io/package/orchy-base-code7

## Dependencies (5)

- [pg](https://npm.io/package/pg.md) ^8.5.1
- [dotenv](https://npm.io/package/dotenv.md) ^8.2.0
- [mongoose](https://npm.io/package/mongoose.md) ^5.11.15
- [pg-hstore](https://npm.io/package/pg-hstore.md) ^2.3.3
- [sequelize](https://npm.io/package/sequelize.md) ^6.5.0

## Alternatives

- [jsforce](https://npm.io/package/jsforce.md) — 851.2K weekly downloads
- [react-native-qrcode-svg](https://npm.io/package/react-native-qrcode-svg.md) — 693.5K weekly downloads
- [@salesforce/plugin-data](https://npm.io/package/@salesforce/plugin-data.md) — 394.9K weekly downloads
- [@backstage/plugin-search-common](https://npm.io/package/@backstage/plugin-search-common.md) — 308.5K weekly downloads
- [@chain-registry/types](https://npm.io/package/@chain-registry/types.md) — 38.4K weekly downloads

## Recent versions

- 1.3.6 (latest) — 2021-03-30
- 1.3.5 — 2021-03-30
- 1.3.4 — 2021-03-30
- 1.3.3 — 2021-03-30
- 1.3.2 — 2021-03-30
- 1.3.1 — 2021-03-30
- 1.3.0 — 2021-03-30
- 1.2.4 — 2021-03-24
- 1.2.3 — 2021-03-24
- 1.2.2 — 2021-03-24
- 1.2.1 — 2021-03-24
- 1.2.0 — 2021-03-24
- 1.1.2 — 2021-03-22
- 1.1.1 — 2021-03-22
- 1.1.0 — 2021-02-12
- … 5 more at https://npm.io/package/orchy-base-code7/versions

## README

# Orchy Base

Orchy Base is an ORM (sequelize, mongoose) wrapper that simplifies the CRUD development. By centralizing all the main features of an ORM in one place.

This node package was build with the microservice architecture in mind, so it is a fit when the software architecture requires a lot of database configuration around all the microservices.

## Installation

Before using the Orchy Base some configuration is required.

### Set up the environment variable

Create an environment variable file `.env` for development purpose.

```
NODE_ENV=development OR staging OR production

ORCHYBASE_POSTGRES_DATABASE=DATABASE
ORCHYBASE_POSTGRES_USERNAME=USERNAME
ORCHYBASE_POSTGRES_PASSWORD=PASSWORD
ORCHYBASE_POSTGRES_HOST=HOST

ORCHYBASE_MONGO_URI=MONGODB_URI
```

## Usage

To properly use the node package simply instantiate a new object.

```javascript
const orchybase = new OrchyBase();
```

### Available methods and its parameters

createLoad() returns a object with created information

```javascript
const newLoad = await orchyBase.createLoad({
  id_flow: STRING
  id_load: BIGINT,
  id_org: STRING,
  register: NUMBER,
  active: BOOLEAN,
  created_at: DATE,
  updated_at: NULL OR DATE,
});
```

createQueue() returns a object with created information

```javascript
const newQueue = await orchyBase.createQueue({
  id_load: NUMBER,
  id_queue: BIGINT,
  schedule: DATE,
  status: NUMBER,
  created_at: DATE,
  updated_at: NULL OR DATE,
});
```

createContact() returns a object with created information

```javascript
const newContact = await orchyBase.createContact({
  id_contact: BIGINT,
  id_load: NUMBER,
  name: STRING,
  key: STRING,
  created_at: DATE,
  updated_at: NULL OR DATE,
});
```

createContactData() returns a object with created information

```javascript
const newContactData = await orchyBase.createContactData({
  id_contact_data: BIGINT,
  id_contact: NUMBER,
  data_type: NUMBER,
  contact_data: STRING,
  status: NUMBER,
  created_at: DATE,
  updated_at: NULL OR DATE,
});
```

createLoadInfo() returns a object with created information

```javascript
const newLoadInfo = await orchyBase.createLoadInfo({
  id_flow: STRING,
  id_load: STRING,
  id_org: STRING,
  start: DATE,
  finish: DATE,
  schedule: DATE,
  contacts: STRING,
  telephones: STRING,
  telephones_ddd: [STRING],
  email: STRING,
  created_at: DATE,
  updated_at: NULL OR DATE,
});
```

createLoadStatus() returns a object with created information

```javascript
const newLoadStatus = await orchyBase.createLoadStatus({
  id_flow: STRING;
  id_load: STRING;
  id_org: STRING;
  start: DATE;
  finish: DATE;
  total: STRING;
  contact_total: STRING;
  telephone_total: STRING;
  email_total: STRING;
  contact_processed: STRING;
  telephone_processed: STRING;
  email_processed: STRING;
  created_at: DATE;
  updated_at: NULL OR DATE;
});
```

createQueueContact() returns a object with created information

```javascript
const newQueueContact = await orchyBase.createQueueContact({
  id_contact_data: NUMBER;
  schedule: NUMBER;
  event_type: STRING;
  data_type: STRING;
  contact_data: STRING;
  status: NUMBER;
  created_at: NUMBER;
  updated_at: NULL OR NUMBER;
});
```

---
_Source: https://npm.io/package/orchy-base-code7 · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
