package com.muyu.domain;

import com.baomidou.mybatisplus.annotation.TableId;
import com.muyu.domain.req.FaultCodeAddReq;
import com.muyu.domain.req.FirmPermissionAddReq;
import com.muyu.domain.req.FirmPermissionUpdReq;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;

/**
 * 企业权限
 * @Author：weiran
 * @Package：com.muyu.domain
 * @Project：cloud-server-8
 * @name：FirmPermission
 * @Date：2024/10/7 9:13
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@SuperBuilder
public class FirmPermission {

    /**
     * 企业权限Id
     */
    @TableId(value = "permission_id")
    private Long permissionId;

    /**
     * 权限等级
     */
    private String permissionLevel;

    /**
     * 车辆数目
     */
    private Integer carNumber;

    /**
     * 车辆类型数目
     */
    private Integer carTypeNumber;


    public static FirmPermission addfirmpermission(FirmPermissionAddReq firmPermissionAddReq){
        return FirmPermission.builder()
                .permissionLevel(firmPermissionAddReq.getPermissionLevel())
                .carNumber(firmPermissionAddReq.getCarNumber())
                .carTypeNumber(firmPermissionAddReq.getCarTypeNumber())
                .build();
    }

    public static FirmPermission updfirmpermission(FirmPermissionUpdReq firmPermissionUpdReq){
        return FirmPermission.builder()
                .permissionId(firmPermissionUpdReq.getPermissionId())
                .permissionLevel(firmPermissionUpdReq.getPermissionLevel())
                .carNumber(firmPermissionUpdReq.getCarNumber())
                .carTypeNumber(firmPermissionUpdReq.getCarTypeNumber())
                .build();
    }


}
