fix(tochka): allow saving credential with empty customerCode/accountCode
User flow: paste JWT -> save -> «Проверить» fetches customers list -> fill customerCode/accountId from that list. Required min(1) blocked this. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -10,7 +10,9 @@ const ENV = ['sandbox', 'prod'] as const;
|
||||
const CredentialUpsert = z.object({
|
||||
environment: z.enum(ENV),
|
||||
jwt: z.string().min(5),
|
||||
customerCode: z.string().min(1).max(100),
|
||||
// customerCode/accountCode можно оставить пустыми и заполнить после «Проверить»:
|
||||
// тестовый запрос к /open-banking/v1.0/customers вернёт реальные коды.
|
||||
customerCode: z.preprocess((v) => (typeof v === 'string' ? v.trim() : v), z.string().max(100).default('')),
|
||||
accountCode: optionalText(100),
|
||||
bankAccountId: z.string().uuid().nullable(),
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user