---
# System prepended metadata

title: API Contract for BackOffice Role ADMIN

---

# API Contract for BackOffice Role ADMIN

## Common Type 

### Class type

```typescript=
enum ClassType {
    VIDEO = 'video',
    PHYSICAL = 'physical',
    ONLINE = 'online'
}
```

### Popularity

```typescript=
enum Popularity {
    NEWEST = 'newest',
    MOST_POPULAR = 'most_popular',
    HIGH_RATES = 'high_rates',
    TRENDING = 'trending'
}
```
## Dashboard

### Get First Dashboard

Menampilkan Dashboard yang terbaru atau yang difiturkan
**Response type**
```typescript=
interface Dashboard {
    itemSold:number
    netsales:number
    order:number
    charsDasboard:{
        name:string
        categories:['feb','march'] //month or anything
        data:[10,11] // data in each month
    }
    general:{
        all:number
        publish:number
        free:number
        paid:number
        pending:number
    }
}
```

Respon: 
* jika kosong = send status code `204`
* jika terisi = return `Dashboard`
* possible error = `500`


### Get tab Users
Menampilkan data Tab Users pada Dashboard yang terbaru atau yang difiturkan
**Response type**

```typescript=
interface DashbaordUsers{
    all:{
        total:number
        chart:[
            {
                name:string, //example active, not active, student, or business
                categories:['feb','march'], //month or anything
                data:[10,11]
            }
            // add more if there are more data
        ]
    }
    instructure:{
        total:number
        chart:[
            {
                name:string, //example active, not active, student, or business
                categories:['feb','march'], //month or anything
                data:[10,11]
            }
            // add more if there are more data
        ]
    }
    student:{
        total:number
        chart:[
            {
                name:string, //example active, not active, student, or business
                categories:['feb','march'], //month or anything
                data:[10,11]
            }
            // add more if there are more data
        ]
    }
    business:{
        total:number
        chart:[
            {
                name:string, //example active, not active, student, or business
                categories:['feb','march'], //month or anything
                data:[10,11]
            }
            // add more if there are more data
        ]
    }
}
```
Respon: 
* jika kosong = send status code `204`
* jika terisi = return `DashbaordUsers`
* possible error = `500`

### get Tab Classes
Menampilkan data Tab Classes pada Dashboard yang terbaru atau yang difiturkan
**Response type**

```typescript=
interface DashboardClasses{
    all:number
    published:number
    active:number
    failedClass:number
    free:number
    paid:number
    pending:number
    
}
```
Respon: 
* jika kosong = send status code `204`
* jika terisi = return `DashboardClasses`
* possible error = `500`

### get Tab Order
Menampilkan data Tab Order pada Dashboard yang terbaru atau yang difiturkan
**Response type**

```typescript=
interface DashboardOrder{
    all:{
        total:number //total of data in chart
        cost:number
        isUp:boolean //true if its up false if itsDown
        chart:{
            name:string
            categories:['feb','march'] // its month or anything
            data:[10,11]
        }
    }
    instructure:{
        total:number //total of data in chart
        cost:number
        isUp:boolean //true if its up false if itsDown
        chart:{
            name:string
            categories:['feb','march'] // its month or anything
            data:[10,11]
        }
    }
    student:{
        total:number //total of data in chart
        cost:number
        isUp:boolean //true if its up false if itsDown
        chart:{
            name:string
            categories:['feb','march'] // its month or anything
            data:[10,11]
        }
    }
    business:{
        total:number //total of data in chart
        cost:number
        isUp:boolean //true if its up false if itsDown
        chart:{
            name:string
            categories:['feb','march'] // its month or anything
            data:[10,11]
        }
    }
    
}
```
Respon: 
* jika kosong = send status code `204`
* jika terisi = return `DashboardOrder`
* possible error = `500`

## Generic Data for Class

### Class List
```typescript=
interface ClassList {
    id:number
    title:string
    classType:string
    totalStudents:string
    price:string
    categories:string[]
    status:string
}
```

### Detail Class

#### Tab Overview
```typescript=
interface Overview {
    instructor:string
    coInstructure:string[]
    classOverview:{
        title:string
        mainCategory:string
        secondaryCategory:string[]
        tags:string[]
        classType:string
        classDescription:string
    }
    extraInformation:{
        numberOfSession:string[]
        durationOfEachSession:string[]
        requirements:string[]
        targetAudiance:[
            {
                title:string,
                content:string
            }
        ]
    }
}

```

#### Tab Settings
```typescript=
interface Settings {
    regular:{
        minStudent:number,
        externalLink:string,
        language:string,
    },
    schedule:{
        zoomLink:string
        scheduleLink:string
        time:date|string
        // if type class physical class
        mapsLink:string
    }
}
```

#### Tab Price
```typescript=
interface Price {
    title:string
    price:string
    description:string
}
```

#### Tab Lesson

#### Lesson 
digunakan untuk input data
```typescript=
interface LessonList {
    lessonTitle:string
    description:string
    file:any
    lessonContent:string
    videoLink:string
}
```

##### Lesson List
digunakan saat ngeget lesson list
```typescript=
interface LessonList {
    id:number
    lessonTitle:string
    description:string
    file:string
}
```

#### Tab Thumbnail
```typescript=
interface Thumbnail {
    thumbnailImg:any
    classGalery:[
        {
           galeryImg:any
        }
    ]
    youtubeLink:any
}
```

#### Tab Certificate

##### Certificate
digunakan saat input certificate
```typescript=
interface Certificate {
	title:string
	backgroundCertificate:any
	couseName:string
	studentName:string
	startDate:string
	startEnd:string
	currentTime:date|string
}
```

##### Certificate List
digunakan pada saat get list certificate
```typescript=
interface CertificateList {
    id
	studentName
	status
	validFrom
	validTo	
}
```

#### Tab Students

##### List Student
digunakan ngeget list student
```typescript=
interface List Students {
	id:number
	name:string
	email:string
	progress:string
	status:string
}
```

## Generic Data for Blog

### Blog
```typescript=
interface Blog {
    title:string
    blogCategories:string
    tags:string[]
    blogContent:string
    blogThumbnail:string
}
```

### Blog List
```typescript=
interface ListBlog {
    id:string
    image:string
    title:string
    author:stirng
    category:string
    tags:string[]
    date:date|string
}
```

### Blog Published
```typescript=
interface ListBlogPublished extends ListBlog
```

### Blog Draft
```typescript=
interface ListBlogDraft extends ListBlog
```

## Generic Data Review and Ratings

### Review and Ratings List

``` typescript=
interface ReviewAndRatingList {
    id:number
    author:string
    className:string
    instructor:string
    ratings:number // 1 - 5
    date:date|string
}
```

### Reply Review And Ratings

``` typescript=
interface ReplyReviewAndRating {
    className:string
    instructor:string
    author:string
    role:string
    ratings:number // 1-5
    date:date|string
    comment:[
        {
            from:string,
            to:string,
            messageL:string
        }
   ]
}
```

## Generic Data for Our Team

### Our Team
``` typescript=
interface OurTeam {
    name:string
    position:string
    description:string
    contactInformation {
        linkedInURL:string
        email:string
    }
    photo:any
}
```

### Our Team List
```typescript=
interface OurTeamList {
    id:number
    name:string
    position:string
    description:string
}
```

## Users

### Users
```typescript=
interface Users {
    username:string
    email:string
    firstName:string
    lastName:string
    website:string
    role:string
    password:string
    profilePicture:any
}
```

### Edit Users
```typescript=
interface EditUsers {
    username:string
    email:string
    firstName:string
    lastName:string
    website:string
    role:string
    password:string
    profilePicture:any
    praventPassword:boolean
    status:string
}
```

### List Users
```typescript=
interface ListUsers {
    id:number
    username:string
    name:string
    role:string
    amount:string
    status:string
    email:string
    createdAccount:date|string
    lastActive:date|string
}
```

## Generic Data for Coupon

### Coupon add or edit
```typescript=
interdace Coupon {
    addCoupon:{
        couponName:string
        description
        tags:string[]
    }
    couponDate:{
        discountType:string
        couponAmount:string
        counponExpiredDate:date|string
        minimumSpend:number
        maximumSpend:number
        individualUseOnly:boolen
        exculudeSaleItem:boolean
        course:string
        excludeCourse:string
        category:string
        excludeCategory:string
        allowedEmail:string
        limitUser:number
        limitCoupon:number
    }

}
```

### List Coupon
```typescript=
    id:number
    code:string
    couponType:string
    couponAmount:string
    usageOrLimit:number|string
    description:string
```

## Generic Data for Instructure

### Detail Instructure
``` typescript=
interface DetailInstructure{
    fullName:string
    picture:string
    name:string
    mail:string
    role:string
    country:string
    phone:string
    web:string
    status:string
    linkedin:string
    facebook:string
    instagram:string
    youtube:string
    experiance:{
        relevantExperiance:string
        reasonToBecomeInstructure:string
        trainingExperiance:string
        relevantIndustrieExperiance:string
    }
    expertise:{
        areasExpertise:string
        jobTitle:string
        purposedClassOverview:string
    }
}
```

### List Instructure

```typescript=
interface ListInstructure{
    id:number
    picture:string
    name:string
    email:string
    status:string
}
```


## Public Landing Page

### Get latest (featured) course
Menampilkan course yang terbaru atau yang difiturkan
**Response type**
```typescript=
interface LatestCourse extends CourseCard {
    minimum_student: number
    registered_student: number
}
```

Respon: 
* jika kosong = send status code `204`
* jika terisi = return `LatestCourse`
* possible error = `500`

### Get trending course
Menampilkan course yang sedang trending (populer) belakangan ini

**Response type**: `CourseCard`

Respon: 
* jika kosong = send status code `204` atau return `[]`
* jika terisi = return `CourseCard[]`
* possible error = `500`

### Get course by type
Menampilkan course berdasarkan `ClassType`

**Response type**: `CourseCard`

Respon: 
* jika kosong = send status code `204` atau return `[]`
* jika terisi = return `CourseCard[]`
* possible error = `500`
