package com.yuchen.saas.park.service.service.door.communication.domain.card;

import com.yuchen.saas.park.service.service.door.communication.domain.CommandParameter;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Positive;
import java.util.Map;

@Data
@AllArgsConstructor(staticName = "of")
@NoArgsConstructor
public class AddCardParameter implements CommandParameter {
    @Positive
    private long userId;
    @NotBlank
    private String no;

    @Override
    public Map<@NotBlank String, Object> encoding() {
        return Map.of(
          "employeeNo", userId,
          "cardNo", no,
          "cardType", 1, // 固定为普通卡：1
          "leaderCard", ""
        );
    }
}
