fix(sn): align business form limits with standardized database
This commit is contained in:
@@ -379,6 +379,10 @@ export function CtyFldngPrvtnBizFormPage({ id }: { id?: string }) {
|
||||
type,
|
||||
]: (typeof BASIC_FIELDS)[number]) => {
|
||||
const fieldId = `cty-fldng-basic-${key}`;
|
||||
// SN 표준 DB 길이와 입력 한계를 맞추되 API 필드명은 유지한다.
|
||||
const standardMaxLengths: Partial<Record<string, number>> = {
|
||||
bizCd: 10, bizNm: 200, drareaNm: 100, drndstNm: 100, sggNm: 40, picNm: 100,
|
||||
};
|
||||
const suggestionOptions =
|
||||
key === "dsgnType"
|
||||
? cityDesignationTypeOptions
|
||||
@@ -401,6 +405,7 @@ export function CtyFldngPrvtnBizFormPage({ id }: { id?: string }) {
|
||||
<Input
|
||||
id={fieldId}
|
||||
className="w-full !text-[1.3rem]"
|
||||
maxLength={standardMaxLengths[key]}
|
||||
type={type === "date" ? "date" : type}
|
||||
list={suggestionListId}
|
||||
value={String(form[key] ?? "")}
|
||||
|
||||
@@ -226,6 +226,9 @@ export function ObsltPplFormPage({ id }: { id?: string }) {
|
||||
if (!form.bizSe) nextErrors.bizSe = "사업구분은 필수입니다.";
|
||||
if (!form.bizCd.trim()) nextErrors.bizCd = "사업코드는 필수입니다.";
|
||||
if (!form.bizNm.trim()) nextErrors.bizNm = "사업명은 필수입니다.";
|
||||
// 사업코드 표준 도메인은 VARCHAR(10), 사업명은 VARCHAR(200)이다.
|
||||
if (form.bizCd.length > 10) nextErrors.bizCd = "사업코드는 10자 이하여야 합니다.";
|
||||
if (form.bizNm.length > 200) nextErrors.bizNm = "사업명은 200자 이하여야 합니다.";
|
||||
if (!form.ctpvNm.trim() || ctpvCd === "0")
|
||||
nextErrors.region = "시도는 필수입니다.";
|
||||
[...NUMBER_KEYS].forEach((key) => {
|
||||
@@ -364,7 +367,7 @@ export function ObsltPplFormPage({ id }: { id?: string }) {
|
||||
className="w-full !text-[1.3rem]"
|
||||
type={field.type === "number" ? "number" : "text"}
|
||||
step={field.type === "number" ? "any" : undefined}
|
||||
maxLength={DATE_KEYS.has(field.key) ? 10 : undefined}
|
||||
maxLength={DATE_KEYS.has(field.key) || field.key === "bizCd" ? 10 : field.key === "bizNm" ? 200 : undefined}
|
||||
list={suggestionListId}
|
||||
value={form[field.key]}
|
||||
placeholder={field.placeholder}
|
||||
|
||||
Reference in New Issue
Block a user