/**
 *
 * @description Mongoose schema types
 * * source : https://mongoosejs.com/docs/6.x/docs/typescript.html
 */

import { Document } from 'mongoose';

// users docs
export interface IUserSchema extends Document {
    username: string,
    password: string,
    accountType: string,
    token: {
        value: string,
        expiresAt: number
    },
    settings: {
        appName: string,
        gymName: string,
        email: string,
        phone: string,
        address: string,
        showLogo: boolean,
        logo: string,
        currencySymbol: string,
    }
}
// members docs
export interface IMemberSchema extends Document {
    firstName: string,
    lastName: string,
    email: string,
    phone: string,
    address: string,
    registerAt: string,
    registerAt_unix: number,
    payMonth: number,
    services: {
        serviceID: string,
        serviceName: string,
    }[],
    planUpdatedAt: string,
    planUpdatedAt_unix: number,
    planDelay: number,
    planDelay_unix: number,
    planExpAt: string,
    planExpAt_unix: number,
    active: boolean,
    gendre: 'm' | 'w',
    bodyState: {
        startBodyForm: 'weak' | 'graceful' | 'middle' | 'midhuge' | 'huge',
        currentBodyForm: 'weak' | 'graceful' | 'middle' | 'midhuge' | 'huge',
        startWeight: number,
        currentWeight: number,
    }
}
// services docs
export interface IServicesSchema extends Document {
    name: string,
    description: string,
    price: number,
    status: string,// active or deactivate
    totalSubscribers: number,
}
// workers doc
export interface IWorkersSchema extends Document {
    firstName: string,
    lastName: string,
    jobType: string,
    monthlySalary: string,
    gendre: string,
    phone: string,
    email: string,
    address: string,
}
// products docs
export interface IProductsSchema extends Document {
    name: string,
    description: string,
    price: number,
    quantity: number,
}
// statistics docs
export interface IStatisticsSchema extends Document {
    listsTracking : {
        thisWeek : {
            'year': number,
            'month': number,
            'week': number,
            'days': {
                'sat': {
                    'totalMembers': number,
                    'totalActiveSubs': number,
                    'totalUnActiveSubs': number,
                    'totalMansMembers': number,
                    'totalGirlsMembers': number,
                },
                'sun': {
                    'totalMembers': number,
                    'totalActiveSubs': number,
                    'totalUnActiveSubs': number,
                    'totalMansMembers': number,
                    'totalGirlsMembers': number,
                },
                'mon': {
                    'totalMembers': number,
                    'totalActiveSubs': number,
                    'totalUnActiveSubs': number,
                    'totalMansMembers': number,
                    'totalGirlsMembers': number,
                },
                'tue': {
                    'totalMembers': number,
                    'totalActiveSubs': number,
                    'totalUnActiveSubs': number,
                    'totalMansMembers': number,
                    'totalGirlsMembers': number,
                },
                'wed': {
                    'totalMembers': number,
                    'totalActiveSubs': number,
                    'totalUnActiveSubs': number,
                    'totalMansMembers': number,
                    'totalGirlsMembers': number,
                },
                'thu': {
                    'totalMembers': number,
                    'totalActiveSubs': number,
                    'totalUnActiveSubs': number,
                    'totalMansMembers': number,
                    'totalGirlsMembers': number,
                },
                'fri': {
                    'totalMembers': number,
                    'totalActiveSubs': number,
                    'totalUnActiveSubs': number,
                    'totalMansMembers': number,
                    'totalGirlsMembers': number,
                }
            }
        },
        months : {
            'year': number,
            'month': number,
            'weeks': {
                'week': number,
                'days': {
                    'sat': {
                        'totalMembers': number,
                        'totalActiveSubs': number,
                        'totalUnActiveSubs': number,
                        'totalMansMembers': number,
                        'totalGirlsMembers': number,
                    },
                    'sun': {
                        'totalMembers': number,
                        'totalActiveSubs': number,
                        'totalUnActiveSubs': number,
                        'totalMansMembers': number,
                        'totalGirlsMembers': number,
                    },
                    'mon': {
                        'totalMembers': number,
                        'totalActiveSubs': number,
                        'totalUnActiveSubs': number,
                        'totalMansMembers': number,
                        'totalGirlsMembers': number,
                    },
                    'tue': {
                        'totalMembers': number,
                        'totalActiveSubs': number,
                        'totalUnActiveSubs': number,
                        'totalMansMembers': number,
                        'totalGirlsMembers': number,
                    },
                    'wed': {
                        'totalMembers': number,
                        'totalActiveSubs': number,
                        'totalUnActiveSubs': number,
                        'totalMansMembers': number,
                        'totalGirlsMembers': number,
                    },
                    'thu': {
                        'totalMembers': number,
                        'totalActiveSubs': number,
                        'totalUnActiveSubs': number,
                        'totalMansMembers': number,
                        'totalGirlsMembers': number,
                    },
                    'fri': {
                        'totalMembers': number,
                        'totalActiveSubs': number,
                        'totalUnActiveSubs': number,
                        'totalMansMembers': number,
                        'totalGirlsMembers': number,
                    }
                }[]
            }[]
        }[],
        years : {
            'year': number,
            'months': {
                'month': number,
                'weeks': {
                    'week': number,
                    'days': {
                        'sat': {
                            'totalMembers': number,
                            'totalActiveSubs': number,
                            'totalUnActiveSubs': number,
                            'totalMansMembers': number,
                            'totalGirlsMembers': number,
                        },
                        'sun': {
                            'totalMembers': number,
                            'totalActiveSubs': number,
                            'totalUnActiveSubs': number,
                            'totalMansMembers': number,
                            'totalGirlsMembers': number,
                        },
                        'mon': {
                            'totalMembers': number,
                            'totalActiveSubs': number,
                            'totalUnActiveSubs': number,
                            'totalMansMembers': number,
                            'totalGirlsMembers': number,
                        },
                        'tue': {
                            'totalMembers': number,
                            'totalActiveSubs': number,
                            'totalUnActiveSubs': number,
                            'totalMansMembers': number,
                            'totalGirlsMembers': number,
                        },
                        'wed': {
                            'totalMembers': number,
                            'totalActiveSubs': number,
                            'totalUnActiveSubs': number,
                            'totalMansMembers': number,
                            'totalGirlsMembers': number,
                        },
                        'thu': {
                            'totalMembers': number,
                            'totalActiveSubs': number,
                            'totalUnActiveSubs': number,
                            'totalMansMembers': number,
                            'totalGirlsMembers': number,
                        },
                        'fri': {
                            'totalMembers': number,
                            'totalActiveSubs': number,
                            'totalUnActiveSubs': number,
                            'totalMansMembers': number,
                            'totalGirlsMembers': number,
                        }
                    }[]
                }[]
            }[]
        }[]
    },
    totalIncome: number,
    totalOutcome: number,
}
// equipments docs
export interface IEquipmentSchema extends Document {
    name: string,
    description: string,
    addedAt: number,
    quantity: number,
    sallerName: string,
    sallerAddress: string,
    sallerPhone: string,
    singlePrice: number,
}
// expenses docs
export interface IExpenseSchema extends Document {
    name: string,
    description: string,
    amount: number,
    addedAt: number,
}
// expenses docs
export interface IIncomeSchema extends Document {
    name: string,
    description: string,
    amount: number,
    addedAt: number,
}