---
# System prepended metadata

title: Form Distribution

---

# Form Distribution

## Data Model
### FormDistribution
- Id
- FormId
- StartTime: `datetime`
- CreatedBy: `UserId`
- CreatedAt: `datetime`
- UpdatedBy: `UserId`
- UpdateAt: `datetime`
- ApprovedBy: `UserId`
    - [TODO]: Rename `ApprovedBy` to `AuditedBy` to support both (Approval and Rejection)
- ApprovedAt: `datetime`
- IsActive: `bool`
- ApprovalStatus: `Pending(0), Approved(1), Rejected(2)`
    -  Dev Default: `Internal: Approved, External: Approved`
    - MCIT Default: `Internal: Approved, External: Pending`
- Type: `Internal(0), External(1)`
- InternalTargets: `Departments(0), Users(1)`
- Departments: `Table [DistributionId, DepartmentName]`
- Users: `Table [DistributionId, UserId]`
- Channels: `Table <FormDistributionChannels>`
- Status: [Computed Property]`Disabled(0), Pending(1), Active(2), Expired(3), Rejected(4)`
- Channel: [tmp Computed Property] `Single Channel` `Channels.FirstOrDefault()`
### FormDistributionChannels
- Id
- DistributionId
- Template: `string(HTML)` 
- ExternalTatgets: `string(comma sperated)`
    - Internal: `Null`
    - External: `Required`
- Channel:
    - Dev: `Email(0)`
    - MCIT: `Email(0), SMS(1), WhatsApp(2)`

## UI 
### Admin Form Distribution Requests (MCIT)
#### Operations
- View Details (Page)
- Approve (Popup Yes,No)
- Reject (Popup Yes,No)

#### List (Order, Paging, NoFilter)
- FormName
- CreatedBy
- StartTime
- Type
- **... operations**

### User Form Distribution
#### Operations
- Add (Page)
- View Details (Page)
- Edit (Page)
- Delete (Popup Yes,No)
- Activate (Popup Yes,No)
- DeActivate (Popup Yes,No)

#### List (Order, Paging, NoFilter)
- StartTime
- Type
- Status
- Target
- **... operations**