unified code verification service

This commit is contained in:
Stephan D
2026-02-10 01:55:33 +01:00
parent 76c3bfdea9
commit 7f540671c1
120 changed files with 1863 additions and 1394 deletions

View File

@@ -0,0 +1,29 @@
import 'package:json_annotation/json_annotation.dart';
part 'response.g.dart';
@JsonSerializable()
class VerificationResponse {
@JsonKey(name: 'ttl_seconds', defaultValue: 0)
final int ttlSeconds;
@JsonKey(name: 'cooldown_seconds', defaultValue: 0)
final int cooldownSeconds;
@JsonKey(defaultValue: '')
final String destination;
final String idempotencyKey;
const VerificationResponse({
required this.ttlSeconds,
required this.cooldownSeconds,
required this.destination,
required this.idempotencyKey,
});
Duration get cooldownDuration => Duration(seconds: cooldownSeconds);
Duration get ttlDuration => Duration(seconds: ttlSeconds);
factory VerificationResponse.fromJson(Map<String, dynamic> json) => _$VerificationResponseFromJson(json);
Map<String, dynamic> toJson() => _$VerificationResponseToJson(this);
}