---
# System prepended metadata

title: Untitled

---

## Requirement Server IPMS 

### Environtment Server
- [ ] OS Centos 7
- [ ] Database Postgres versi 12
- [ ] Node Js lts versi v16.17.0
- [ ] npm versi v8.15
- [ ] pm2 
- [ ] FW backend NestJs
- [ ] FE ReactJs


sudo yum install -y nodejs
sudo yum install gcc-c++ make
curl -sL https://dl.yarnpkg.com/rpm/yarn.repo | sudo tee /etc/yum.repos.d/yarn.repo
sudo yum install yarn


## Database

- check database
```base=
sudo su - postgres 

/list

/c ipms
```
- password = 'YourStrongPassword'


```typescript=
// response api default
{
    status: false, // true/false
    message: 'success', // string message
    data: '' // data any
}
```

## notes
```
tipe data column default
- :decimal precesion: 12, scale: 3
```

## Table 
### projects
- id, :int
- code, :string
- name, :string
- customer_name, :string
- contact_name, :string (contact person)
- department_id, :int, ref :departments
- assign_to, :int ref :employees (reference to employee_id)
- project_manager, :int ref :employees (reference to employee_id)
- solution_team, :int ref :employees (reference to employee_id)
- priority, :int (enum Moderate, xxx)
- value, :float (Project value)
- start_date, :date
- end_date, :date
- duration, :int
- duration_type, :enum(Days, Months, Years)
- termin_count, :int
- termin_current, :int
- status, :int enum(On Progress, Pending, Close)
- created_at,
- updated_at,
- deleted_at,

### project_cost_of_goods
- id, :int
- project_id, :int
- delivery_pip, :decimal
- pid, :decimal
- at_cost, :decimal
- created_at,
- updated_at,
- deleted_at,


### project_profit_margin => Gross Profit Mergin After Negotiation
- id, :int
- project_id, :int
- profit_margin, :decimal precesion: 12, scale: 3
- profit_margin_percentage, :decimal precesion: 2, scale: 1
- incentive, :decimal precesion: 12, scale: 3
- created_at,
- updated_at,
- deleted_at,


### project_revenue
- id, :int
- project_id, :int
- otc, :decimal
- mrc, :decimal
- duration
- created_at,
- updated_at,
- deleted_at,


### project_terms
- id, :int
- project_id, :int
- termin, :int
- due_date, date
- status, int / enum(0: upcoming, 1: overdue, 2: current, 3: done, 4: cancelled )
- value, :decimal
- penalty, :decimal
- net, :decimal
- created_at,
- updated_at,
- deleted_at,


### documents
- id, :int
- document_type_id, :int => document_types
- name, :string
- size, :decimal
- status :int / enum(0:draft, 1:done, 2:Unfinished)
- entity_id, :int
- entity_type, :string
- user_id, (uploaded by)
- created_at,
- updated_at,
- deleted_at,

### document_types
- id, :int
- name, :string
- created_at,
- updated_at,
- deleted_at,

### activity_logs
- id, :int
- entity_id, :int 
- entity_type, :string
- user_id, int reference to users
- title, :string
- created_at,
- updated_at,
- deleted_at,

### vendors
- id, :int
- name, :string
- legal_name, :string
- created_at,
- updated_at,
- deleted_at,

### 
project_budget_summaries,
