إنّ إتاحة إنشاء عقود إيجار اختيارية. وهي تنطبق على الشركاء المهتمين بتنفيذ هذه الوظيفة. يُرجى التواصل مع "مركز الإجراءات" لتحديد الأهلية قبل البدء.
إنشاء عقد الإيجار هو الخطوة الأولى عند إنشاء حجز مع إمكانية استخدام ميزة "عقد الإيجار". يتأكّد نظام الشريك الخلفي من أنّ الفترة الزمنية المطلوبة للموعد صالحة ومتاحة. داخليًا، يضع الشريك حجزًا مؤقتًا للفتحة المطلوبة، ويتم إعداد هذا الحجز لينتهي تلقائيًا في lease_expiration_time. يُسمح للخادم الخلفي بتعديل lease_expiration_time، مثلاً إذا كان وقت الإيجار المطلوب طويلاً بشكل مفرط. يتم عرض عقد الإيجار الذي تم إنشاؤه للعميل. بعد ذلك، يطلب العميل إنشاء حجز للإيجار.
إذا تعذّر إنشاء عقد إيجار بسبب أي خطأ في منطق العمل التجاري، يجب تضمين الخطأ في الرد. راجِع مقالة تعذُّر الحجز للحصول على معلومات مفصّلة.
الطلب
CreateLeaseRequest
القيمة المعروضة
CreateLeaseResponse
المتطلبات:
- يجب أن ينشئ الخلفية لدى الشريك lease_id ويتم ضبطه في CreateLeaseResponse.
- يجب ضبط lease_expiration_time في CreateLeaseResponse.
- إذا تم تحديد حقل الموارد في CreateLeaseRequest، يجب ضبطه في CreateLeaseResponse، ويجب أن يتطابق مع CreateLeaseRequest.
- يجب ضبط جميع الحقول الأخرى في CreateLeaseResponse لتتطابق مع CreateLeaseRequest.
رموز الخطأ الأساسية في gRPC
INVALID_ARGUMENT(معرّف التاجر أو معرّف الخدمة أو مواصفات وقت الحجز غير صالحة)
// Request to create a [ext.maps.booking.partner.v2.Lease] for a slot in the // inventory. The expiration time in the returned Lease may be modified by the // backend, e.g. if the requested lease period is too long. message CreateLeaseRequest { option features.(pb.java).nest_in_file_class = YES; // The lease to be created with information about the appointment slot // (required) Lease lease = 1; } // Response for the [ext.maps.booking.partner.v2.CreateLease] RPC with the // created [ext.maps.booking.partner.v2.Lease] message CreateLeaseResponse { option features.(pb.java).nest_in_file_class = YES; // The created [ext.maps.booking.partner.v2.Lease] (required) Lease lease = 1; // If creating a lease fails, this field should reflect the business logic // error (e.g., slot has become unavailable) and lease field is expected to be // unset. (required if failure occurs) BookingFailure booking_failure = 2; }