fix: clarify signature reporting status

This commit is contained in:
hectorzhao
2026-07-13 10:16:12 +08:00
parent 551edfd8ca
commit 344b2afe3b
13 changed files with 140 additions and 26 deletions
+5 -1
View File
@@ -255,12 +255,16 @@ export class DictionariesService {
}
createDrainageField(data: CreateDrainageFieldDto) {
const code = data.code?.trim();
if (!code || !/^[A-Za-z0-9]+$/.test(code)) {
throw new BadRequestException('code must contain only Arabic numerals and English letters');
}
if (!['string', 'image', 'file'].includes(data.fieldType)) {
throw new BadRequestException('fieldType must be string, image or file');
}
return this.prisma.drainageField.create({
data: {
code: data.code,
code,
name: data.name,
fieldType: data.fieldType,
required: data.required ?? false,