import { Injectable } from '@angular/core';
import { StorageService } from '../shared/services/storage.service';

@Injectable(
    { providedIn: 'root' }
)
export class CredentialService {

    private porOrgacode!: string;
    private userId!: string;
    private userType!: string;
    private password!: string;
    private token!: string;
    private userHomevac!: string;
    private permission: any[] = [];

    constructor(private storageService: StorageService){

    }

    getToken(): string {
        return this.token;
    }

    setToken(token: string) {
        this.token = token;
    }

    getPorOrgacode(): string {
        return this.porOrgacode;
    }

    setPorOrgacode(porOrgacode: string) {
        this.porOrgacode = porOrgacode
    }

    getUserId(): string {
        return this.userId
    }

    setUserId(userId: string) {
        this.userId = userId;
    }

    getUserType(): string {
        return this.userType
    }

    setUserType(userType: string) {
        this.userType = userType;
    }

    getPassword(): string {
        return this.password;
    }

    setPassword(password: string) {
        this.password = password;
    }

    getPermission(): any[] {
        return this.permission;
    }

    setPermission(permission: any[]) {
        this.permission = permission;
    }
    

    resetService() {
        this.setPorOrgacode("");
        this.setUserId("");
        this.setUserType("");
        this.setPassword("");
        this.setToken("");
        this.setPermission([]);
    }

}