2016-05-20 16:31:53 +00:00
|
|
|
|
/**
|
|
|
|
|
* Определения и сервисы процессинга.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
include "base.thrift"
|
|
|
|
|
include "domain.thrift"
|
2016-09-23 20:54:14 +00:00
|
|
|
|
include "user_interaction.thrift"
|
2016-05-20 16:31:53 +00:00
|
|
|
|
|
2016-06-16 15:07:06 +00:00
|
|
|
|
namespace java com.rbkmoney.damsel.payment_processing
|
|
|
|
|
namespace erlang payproc
|
|
|
|
|
|
2016-05-20 16:31:53 +00:00
|
|
|
|
/* Interface clients */
|
|
|
|
|
|
|
|
|
|
typedef base.ID UserID
|
|
|
|
|
|
|
|
|
|
struct UserInfo {
|
|
|
|
|
1: required UserID id
|
2017-01-13 11:44:56 +00:00
|
|
|
|
2: required UserType type
|
2016-05-20 16:31:53 +00:00
|
|
|
|
}
|
|
|
|
|
|
2017-01-13 11:44:56 +00:00
|
|
|
|
/* Временная замена ролям пользователей для разграничения доступа в HG */
|
|
|
|
|
union UserType {
|
|
|
|
|
1: InternalUser internal_user
|
|
|
|
|
2: ExternalUser external_user
|
|
|
|
|
3: ServiceUser service_user
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct InternalUser {}
|
|
|
|
|
|
|
|
|
|
struct ExternalUser {}
|
|
|
|
|
|
|
|
|
|
struct ServiceUser {}
|
|
|
|
|
|
2016-05-20 16:31:53 +00:00
|
|
|
|
/* Invoices */
|
|
|
|
|
|
|
|
|
|
struct InvoiceState {
|
|
|
|
|
1: required domain.Invoice invoice
|
|
|
|
|
2: required list<domain.InvoicePayment> payments = []
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Events */
|
|
|
|
|
|
2016-06-16 15:07:06 +00:00
|
|
|
|
/**
|
|
|
|
|
* Событие, атомарный фрагмент истории бизнес-объекта, например инвойса.
|
|
|
|
|
*/
|
2016-05-20 16:31:53 +00:00
|
|
|
|
struct Event {
|
2016-06-16 15:07:06 +00:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Идентификатор события.
|
|
|
|
|
* Монотонно возрастающее целочисленное значение, таким образом на множестве
|
|
|
|
|
* событий задаётся отношение полного порядка (total order).
|
|
|
|
|
*/
|
2016-06-21 15:45:09 +00:00
|
|
|
|
1: required base.EventID id
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Время создания события.
|
|
|
|
|
*/
|
|
|
|
|
2: required base.Timestamp created_at
|
2016-06-16 15:07:06 +00:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Идентификатор бизнес-объекта, источника события.
|
|
|
|
|
*/
|
2016-06-21 15:45:09 +00:00
|
|
|
|
3: required EventSource source
|
2016-06-16 15:07:06 +00:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Номер события в последовательности событий от указанного источника.
|
|
|
|
|
*
|
|
|
|
|
* Номер первого события от источника всегда равен `1`, то есть `sequence`
|
|
|
|
|
* принимает значения из диапазона `[1; 2^31)`
|
|
|
|
|
*/
|
2016-06-21 15:45:09 +00:00
|
|
|
|
4: required i32 sequence
|
2016-06-16 15:07:06 +00:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Содержание события.
|
|
|
|
|
*/
|
2016-06-21 15:45:09 +00:00
|
|
|
|
5: required EventPayload payload
|
2016-06-16 15:07:06 +00:00
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Источник события, идентификатор бизнес-объекта, который породил его в
|
|
|
|
|
* процессе выполнения определённого бизнес-процесса.
|
|
|
|
|
*/
|
|
|
|
|
union EventSource {
|
|
|
|
|
/** Идентификатор инвойса, который породил событие. */
|
|
|
|
|
1: domain.InvoiceID invoice
|
2016-08-11 11:07:40 +00:00
|
|
|
|
/** Идентификатор участника, который породил событие. */
|
|
|
|
|
2: domain.PartyID party
|
2016-05-20 16:31:53 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
typedef list<Event> Events
|
|
|
|
|
|
2016-06-16 15:07:06 +00:00
|
|
|
|
/**
|
|
|
|
|
* Один из возможных вариантов содержания события.
|
|
|
|
|
*/
|
|
|
|
|
union EventPayload {
|
|
|
|
|
/** Некоторое событие, порождённое инвойсом. */
|
|
|
|
|
1: InvoiceEvent invoice_event
|
2016-08-10 12:06:59 +00:00
|
|
|
|
/** Некоторое событие, порождённое участником. */
|
|
|
|
|
2: PartyEvent party_event
|
2016-06-16 15:07:06 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Один из возможных вариантов события, порождённого инвойсом.
|
|
|
|
|
*/
|
|
|
|
|
union InvoiceEvent {
|
|
|
|
|
1: InvoiceCreated invoice_created
|
|
|
|
|
2: InvoiceStatusChanged invoice_status_changed
|
|
|
|
|
3: InvoicePaymentEvent invoice_payment_event
|
2016-05-20 16:31:53 +00:00
|
|
|
|
}
|
|
|
|
|
|
2016-06-16 15:07:06 +00:00
|
|
|
|
/**
|
|
|
|
|
* Один из возможных вариантов события, порождённого платежом по инвойсу.
|
|
|
|
|
*/
|
|
|
|
|
union InvoicePaymentEvent {
|
2017-06-15 16:24:35 +00:00
|
|
|
|
1: InvoicePaymentStarted invoice_payment_started
|
|
|
|
|
2: InvoicePaymentBound invoice_payment_bound
|
|
|
|
|
3: InvoicePaymentStatusChanged invoice_payment_status_changed
|
2016-09-23 20:54:14 +00:00
|
|
|
|
4: InvoicePaymentInteractionRequested invoice_payment_interaction_requested
|
2017-06-15 16:24:35 +00:00
|
|
|
|
6: InvoicePaymentAdjustmentEvent invoice_payment_adjustment_event
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Один из возможных вариантов события, порождённого корректировкой платежа по инвойсу.
|
|
|
|
|
*/
|
|
|
|
|
union InvoicePaymentAdjustmentEvent {
|
|
|
|
|
1: InvoicePaymentAdjustmentCreated invoice_payment_adjustment_created
|
|
|
|
|
2: InvoicePaymentAdjustmentStatusChanged invoice_payment_adjustment_status_changed
|
2016-06-16 15:07:06 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Событие о создании нового инвойса.
|
|
|
|
|
*/
|
|
|
|
|
struct InvoiceCreated {
|
|
|
|
|
/** Данные созданного инвойса. */
|
2016-05-20 16:31:53 +00:00
|
|
|
|
1: required domain.Invoice invoice
|
|
|
|
|
}
|
|
|
|
|
|
2016-06-16 15:07:06 +00:00
|
|
|
|
/**
|
|
|
|
|
* Событие об изменении статуса инвойса.
|
|
|
|
|
*/
|
|
|
|
|
struct InvoiceStatusChanged {
|
|
|
|
|
/** Новый статус инвойса. */
|
|
|
|
|
1: required domain.InvoiceStatus status
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Событие об запуске платежа по инвойсу.
|
|
|
|
|
*/
|
|
|
|
|
struct InvoicePaymentStarted {
|
|
|
|
|
/** Данные запущенного платежа. */
|
|
|
|
|
1: required domain.InvoicePayment payment
|
2016-10-17 14:27:32 +00:00
|
|
|
|
/** Выбранный маршрут обработки платежа. */
|
|
|
|
|
2: optional domain.InvoicePaymentRoute route
|
|
|
|
|
/** Данные финансового взаимодействия. */
|
2016-12-14 11:09:57 +00:00
|
|
|
|
3: optional domain.FinalCashFlow cash_flow
|
2016-06-16 15:07:06 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Событие о том, что появилась связь между платежом по инвойсу и транзакцией
|
|
|
|
|
* у провайдера.
|
|
|
|
|
*/
|
|
|
|
|
struct InvoicePaymentBound {
|
|
|
|
|
/** Идентификатор платежа по инвойсу. */
|
|
|
|
|
1: required domain.InvoicePaymentID payment_id
|
|
|
|
|
/** Данные о связанной транзакции у провайдера. */
|
|
|
|
|
2: required domain.TransactionInfo trx
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2016-07-29 11:07:02 +00:00
|
|
|
|
* Событие об изменении статуса платежа по инвойсу.
|
2016-06-16 15:07:06 +00:00
|
|
|
|
*/
|
2016-07-29 11:07:02 +00:00
|
|
|
|
struct InvoicePaymentStatusChanged {
|
2016-06-16 15:07:06 +00:00
|
|
|
|
/** Идентификатор платежа по инвойсу. */
|
|
|
|
|
1: required domain.InvoicePaymentID payment_id
|
2016-07-29 11:07:02 +00:00
|
|
|
|
/** Статус платежа по инвойсу. */
|
|
|
|
|
2: required domain.InvoicePaymentStatus status
|
2016-05-20 16:31:53 +00:00
|
|
|
|
}
|
|
|
|
|
|
2016-09-23 20:54:14 +00:00
|
|
|
|
/**
|
|
|
|
|
* Событие об запросе взаимодействия с плательщиком.
|
|
|
|
|
*/
|
|
|
|
|
struct InvoicePaymentInteractionRequested {
|
|
|
|
|
/** Идентификатор платежа по инвойсу. */
|
|
|
|
|
1: required domain.InvoicePaymentID payment_id
|
|
|
|
|
/** Необходимое взаимодействие */
|
|
|
|
|
2: required user_interaction.UserInteraction interaction
|
|
|
|
|
}
|
|
|
|
|
|
2016-12-09 13:03:31 +00:00
|
|
|
|
/**
|
|
|
|
|
* Событие о прохождении инспекции
|
|
|
|
|
*/
|
|
|
|
|
struct InvoicePaymentInspected {
|
|
|
|
|
/** Идентификатор платежа по инвойсу. */
|
|
|
|
|
1: required domain.InvoicePaymentID payment_id
|
|
|
|
|
/** Результат инспекции */
|
|
|
|
|
2: required domain.RiskScore risk_score
|
|
|
|
|
}
|
|
|
|
|
|
2017-06-15 16:24:35 +00:00
|
|
|
|
/**
|
|
|
|
|
* Событие о создании корректировки платежа
|
|
|
|
|
*/
|
|
|
|
|
struct InvoicePaymentAdjustmentCreated {
|
|
|
|
|
1: required domain.InvoicePaymentID payment_id
|
|
|
|
|
2: required domain.InvoicePaymentAdjustment adjustment
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Событие об изменении статуса корректировки платежа
|
|
|
|
|
*/
|
|
|
|
|
struct InvoicePaymentAdjustmentStatusChanged {
|
|
|
|
|
1: required domain.InvoicePaymentID payment_id
|
|
|
|
|
2: required domain.InvoicePaymentAdjustmentID adjustment_id
|
|
|
|
|
3: required domain.InvoicePaymentAdjustmentStatus status
|
|
|
|
|
}
|
|
|
|
|
|
2016-06-16 15:07:06 +00:00
|
|
|
|
/**
|
|
|
|
|
* Диапазон для выборки событий.
|
|
|
|
|
*/
|
2016-05-20 16:31:53 +00:00
|
|
|
|
struct EventRange {
|
2016-06-16 15:07:06 +00:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Идентификатор события, за которым должны следовать попадающие в выборку
|
|
|
|
|
* события.
|
|
|
|
|
*
|
|
|
|
|
* Если `after` не указано, в выборку попадут события с начала истории; если
|
|
|
|
|
* указано, например, `42`, то в выборку попадут события, случившиеся _после_
|
|
|
|
|
* события `42`.
|
|
|
|
|
*/
|
2016-06-15 10:21:44 +00:00
|
|
|
|
1: optional base.EventID after
|
2016-06-16 15:07:06 +00:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Максимальное количество событий в выборке.
|
|
|
|
|
*
|
|
|
|
|
* В выборку может попасть количество событий, _не больше_ указанного в
|
|
|
|
|
* `limit`. Если в выборку попало событий _меньше_, чем значение `limit`,
|
|
|
|
|
* был достигнут конец текущей истории.
|
|
|
|
|
*
|
|
|
|
|
* _Допустимые значения_: неотрицательные числа
|
|
|
|
|
*/
|
2016-05-20 16:31:53 +00:00
|
|
|
|
2: required i32 limit
|
2016-06-16 15:07:06 +00:00
|
|
|
|
|
2016-05-20 16:31:53 +00:00
|
|
|
|
}
|
|
|
|
|
|
2016-06-16 15:07:06 +00:00
|
|
|
|
/* Invoicing service definitions */
|
2016-05-20 16:31:53 +00:00
|
|
|
|
|
|
|
|
|
struct InvoiceParams {
|
2016-10-13 13:16:41 +00:00
|
|
|
|
1: required PartyID party_id
|
|
|
|
|
2: required ShopID shop_id
|
2016-12-21 12:53:12 +00:00
|
|
|
|
3: required domain.InvoiceDetails details
|
2016-12-13 17:23:13 +00:00
|
|
|
|
4: required base.Timestamp due
|
|
|
|
|
5: required domain.Cash cost
|
|
|
|
|
6: required domain.InvoiceContext context
|
2016-05-20 16:31:53 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct InvoicePaymentParams {
|
|
|
|
|
1: required domain.Payer payer
|
|
|
|
|
}
|
|
|
|
|
|
2017-06-15 16:24:35 +00:00
|
|
|
|
/**
|
|
|
|
|
* Параметры создаваемой поправки к платежу.
|
|
|
|
|
*/
|
|
|
|
|
struct InvoicePaymentAdjustmentParams {
|
|
|
|
|
/** Ревизия, относительно которой необходимо пересчитать граф финансовых потоков. */
|
|
|
|
|
1: optional domain.DataRevision domain_revision
|
|
|
|
|
/** Причина, на основании которой создаётся поправка. */
|
|
|
|
|
2: required string reason
|
|
|
|
|
}
|
|
|
|
|
|
2016-10-13 13:16:41 +00:00
|
|
|
|
// Exceptions
|
|
|
|
|
|
|
|
|
|
// forward-declared
|
|
|
|
|
exception PartyNotFound {}
|
|
|
|
|
exception ShopNotFound {}
|
2017-03-03 17:24:31 +00:00
|
|
|
|
exception InvalidPartyStatus { 1: required InvalidStatus status }
|
|
|
|
|
exception InvalidShopStatus { 1: required InvalidStatus status }
|
2016-10-13 13:16:41 +00:00
|
|
|
|
|
2016-05-20 16:31:53 +00:00
|
|
|
|
exception InvalidUser {}
|
2017-06-15 16:24:35 +00:00
|
|
|
|
exception InvoiceNotFound {}
|
2016-05-26 12:06:07 +00:00
|
|
|
|
exception InvoicePaymentNotFound {}
|
2017-06-15 16:24:35 +00:00
|
|
|
|
exception InvoicePaymentAdjustmentNotFound {}
|
2016-05-20 16:31:53 +00:00
|
|
|
|
exception EventNotFound {}
|
2016-08-10 12:06:59 +00:00
|
|
|
|
|
|
|
|
|
exception InvoicePaymentPending {
|
|
|
|
|
1: required domain.InvoicePaymentID id
|
|
|
|
|
}
|
|
|
|
|
|
2017-06-15 16:24:35 +00:00
|
|
|
|
exception InvoicePaymentAdjustmentPending {
|
|
|
|
|
1: required domain.InvoicePaymentAdjustmentID id
|
|
|
|
|
}
|
|
|
|
|
|
2016-08-10 12:06:59 +00:00
|
|
|
|
exception InvalidInvoiceStatus {
|
|
|
|
|
1: required domain.InvoiceStatus status
|
|
|
|
|
}
|
2016-05-20 16:31:53 +00:00
|
|
|
|
|
2017-06-15 16:24:35 +00:00
|
|
|
|
exception InvalidPaymentStatus {
|
|
|
|
|
1: required domain.InvoicePaymentStatus status
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
exception InvalidPaymentAdjustmentStatus {
|
|
|
|
|
1: required domain.InvoicePaymentAdjustmentStatus status
|
|
|
|
|
}
|
|
|
|
|
|
2016-05-20 16:31:53 +00:00
|
|
|
|
service Invoicing {
|
|
|
|
|
|
2017-06-15 16:24:35 +00:00
|
|
|
|
InvoiceState Create (1: UserInfo user, 2: InvoiceParams params)
|
2016-10-13 13:16:41 +00:00
|
|
|
|
throws (
|
|
|
|
|
1: InvalidUser ex1,
|
|
|
|
|
2: base.InvalidRequest ex2,
|
|
|
|
|
3: PartyNotFound ex3,
|
2017-03-03 17:24:31 +00:00
|
|
|
|
4: ShopNotFound ex4,
|
|
|
|
|
5: InvalidPartyStatus ex5,
|
|
|
|
|
6: InvalidShopStatus ex6
|
2016-10-13 13:16:41 +00:00
|
|
|
|
)
|
2016-05-20 16:31:53 +00:00
|
|
|
|
|
|
|
|
|
InvoiceState Get (1: UserInfo user, 2: domain.InvoiceID id)
|
2016-10-13 13:16:41 +00:00
|
|
|
|
throws (
|
|
|
|
|
1: InvalidUser ex1,
|
2017-06-15 16:24:35 +00:00
|
|
|
|
2: InvoiceNotFound ex2
|
2016-10-13 13:16:41 +00:00
|
|
|
|
)
|
2016-05-20 16:31:53 +00:00
|
|
|
|
|
|
|
|
|
Events GetEvents (1: UserInfo user, 2: domain.InvoiceID id, 3: EventRange range)
|
2016-06-02 11:38:27 +00:00
|
|
|
|
throws (
|
|
|
|
|
1: InvalidUser ex1,
|
2017-06-15 16:24:35 +00:00
|
|
|
|
2: InvoiceNotFound ex2,
|
2016-06-02 11:38:27 +00:00
|
|
|
|
3: EventNotFound ex3,
|
|
|
|
|
4: base.InvalidRequest ex4
|
|
|
|
|
)
|
2016-05-20 16:31:53 +00:00
|
|
|
|
|
2017-06-15 16:24:35 +00:00
|
|
|
|
domain.InvoicePayment StartPayment (
|
2016-05-20 16:31:53 +00:00
|
|
|
|
1: UserInfo user,
|
|
|
|
|
2: domain.InvoiceID id,
|
|
|
|
|
3: InvoicePaymentParams params
|
|
|
|
|
)
|
2016-06-02 11:38:27 +00:00
|
|
|
|
throws (
|
|
|
|
|
1: InvalidUser ex1,
|
2017-06-15 16:24:35 +00:00
|
|
|
|
2: InvoiceNotFound ex2,
|
2016-06-02 11:38:27 +00:00
|
|
|
|
3: InvalidInvoiceStatus ex3,
|
|
|
|
|
4: InvoicePaymentPending ex4,
|
2017-03-03 17:24:31 +00:00
|
|
|
|
5: base.InvalidRequest ex5,
|
|
|
|
|
6: InvalidPartyStatus ex6,
|
|
|
|
|
7: InvalidShopStatus ex7
|
2016-06-02 11:38:27 +00:00
|
|
|
|
)
|
2016-05-20 16:31:53 +00:00
|
|
|
|
|
2016-10-13 13:16:41 +00:00
|
|
|
|
domain.InvoicePayment GetPayment (
|
|
|
|
|
1: UserInfo user,
|
|
|
|
|
2: domain.InvoiceID id,
|
|
|
|
|
3: domain.InvoicePaymentID payment_id
|
|
|
|
|
)
|
|
|
|
|
throws (
|
|
|
|
|
1: InvalidUser ex1,
|
2017-06-15 16:24:35 +00:00
|
|
|
|
2: InvoiceNotFound ex2,
|
2016-10-13 13:16:41 +00:00
|
|
|
|
3: InvoicePaymentNotFound ex3
|
|
|
|
|
)
|
2016-05-26 12:06:07 +00:00
|
|
|
|
|
2017-06-15 16:24:35 +00:00
|
|
|
|
/**
|
|
|
|
|
* Создать поправку к платежу.
|
|
|
|
|
*
|
|
|
|
|
* После создания поправку необходимо либо подтвердить, если её эффекты
|
|
|
|
|
* соответствуют ожиданиям, либо отклонить в противном случае (по аналогии с
|
|
|
|
|
* заявками).
|
|
|
|
|
* Пока созданная поправка ни подтверждена, ни отклонена, другую поправку
|
|
|
|
|
* создать невозможно.
|
|
|
|
|
*/
|
|
|
|
|
domain.InvoicePaymentAdjustment CreatePaymentAdjustment (
|
|
|
|
|
1: UserInfo user,
|
|
|
|
|
2: domain.InvoiceID id,
|
|
|
|
|
3: domain.InvoicePaymentID payment_id,
|
|
|
|
|
4: InvoicePaymentAdjustmentParams params
|
|
|
|
|
)
|
|
|
|
|
throws (
|
|
|
|
|
1: InvalidUser ex1,
|
|
|
|
|
2: InvoiceNotFound ex2,
|
|
|
|
|
3: InvoicePaymentNotFound ex3,
|
|
|
|
|
4: InvalidPaymentStatus ex4,
|
|
|
|
|
5: InvoicePaymentAdjustmentPending ex5
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
domain.InvoicePaymentAdjustment GetPaymentAdjustment (
|
|
|
|
|
1: UserInfo user,
|
|
|
|
|
2: domain.InvoiceID id,
|
|
|
|
|
3: domain.InvoicePaymentID payment_id
|
|
|
|
|
4: domain.InvoicePaymentAdjustmentID adjustment_id
|
|
|
|
|
)
|
|
|
|
|
throws (
|
|
|
|
|
1: InvalidUser ex1,
|
|
|
|
|
2: InvoiceNotFound ex2,
|
|
|
|
|
3: InvoicePaymentNotFound ex3,
|
|
|
|
|
4: InvoicePaymentAdjustmentNotFound ex4
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
void CapturePaymentAdjustment (
|
|
|
|
|
1: UserInfo user,
|
|
|
|
|
2: domain.InvoiceID id,
|
|
|
|
|
3: domain.InvoicePaymentID payment_id
|
|
|
|
|
4: domain.InvoicePaymentAdjustmentID adjustment_id
|
|
|
|
|
)
|
|
|
|
|
throws (
|
|
|
|
|
1: InvalidUser ex1,
|
|
|
|
|
2: InvoiceNotFound ex2,
|
|
|
|
|
3: InvoicePaymentNotFound ex3,
|
|
|
|
|
4: InvoicePaymentAdjustmentNotFound ex4,
|
|
|
|
|
5: InvalidPaymentAdjustmentStatus ex5
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
void CancelPaymentAdjustment (
|
|
|
|
|
1: UserInfo user
|
|
|
|
|
2: domain.InvoiceID id,
|
|
|
|
|
3: domain.InvoicePaymentID payment_id
|
|
|
|
|
4: domain.InvoicePaymentAdjustmentID adjustment_id
|
|
|
|
|
)
|
|
|
|
|
throws (
|
|
|
|
|
1: InvalidUser ex1,
|
|
|
|
|
2: InvoiceNotFound ex2,
|
|
|
|
|
3: InvoicePaymentNotFound ex3,
|
|
|
|
|
4: InvoicePaymentAdjustmentNotFound ex4,
|
|
|
|
|
5: InvalidPaymentAdjustmentStatus ex5
|
|
|
|
|
)
|
|
|
|
|
|
2016-05-20 16:31:53 +00:00
|
|
|
|
void Fulfill (1: UserInfo user, 2: domain.InvoiceID id, 3: string reason)
|
2016-10-13 13:16:41 +00:00
|
|
|
|
throws (
|
|
|
|
|
1: InvalidUser ex1,
|
2017-06-15 16:24:35 +00:00
|
|
|
|
2: InvoiceNotFound ex2,
|
2017-03-03 17:24:31 +00:00
|
|
|
|
3: InvalidInvoiceStatus ex3,
|
|
|
|
|
4: InvalidPartyStatus ex4,
|
|
|
|
|
5: InvalidShopStatus ex5
|
2016-10-13 13:16:41 +00:00
|
|
|
|
)
|
2016-05-20 16:31:53 +00:00
|
|
|
|
|
2016-06-21 15:45:09 +00:00
|
|
|
|
void Rescind (1: UserInfo user, 2: domain.InvoiceID id, 3: string reason)
|
2016-10-13 13:16:41 +00:00
|
|
|
|
throws (
|
|
|
|
|
1: InvalidUser ex1,
|
2017-06-15 16:24:35 +00:00
|
|
|
|
2: InvoiceNotFound ex2,
|
2016-10-13 13:16:41 +00:00
|
|
|
|
3: InvalidInvoiceStatus ex3,
|
2017-03-03 17:24:31 +00:00
|
|
|
|
4: InvoicePaymentPending ex4,
|
|
|
|
|
5: InvalidPartyStatus ex5,
|
|
|
|
|
6: InvalidShopStatus ex6
|
2016-10-13 13:16:41 +00:00
|
|
|
|
)
|
2016-05-20 16:31:53 +00:00
|
|
|
|
|
|
|
|
|
}
|
2016-06-16 15:07:06 +00:00
|
|
|
|
|
2016-08-10 12:06:59 +00:00
|
|
|
|
/* Party management service definitions */
|
|
|
|
|
|
|
|
|
|
// Types
|
|
|
|
|
|
|
|
|
|
typedef domain.PartyID PartyID
|
|
|
|
|
typedef domain.ShopID ShopID
|
|
|
|
|
|
2017-01-17 13:12:35 +00:00
|
|
|
|
struct PartyParams {
|
|
|
|
|
1: required domain.PartyContactInfo contact_info
|
|
|
|
|
}
|
|
|
|
|
|
2017-01-20 09:16:31 +00:00
|
|
|
|
struct PayoutToolParams {
|
2016-12-09 12:05:35 +00:00
|
|
|
|
1: required domain.CurrencyRef currency
|
2017-01-20 09:16:31 +00:00
|
|
|
|
2: required domain.PayoutToolInfo tool_info
|
2016-08-10 12:06:59 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct ShopParams {
|
2017-03-06 11:27:08 +00:00
|
|
|
|
1: optional domain.CategoryRef category
|
2016-08-10 12:06:59 +00:00
|
|
|
|
2: required domain.ShopDetails details
|
2016-12-09 12:05:35 +00:00
|
|
|
|
3: required domain.ContractID contract_id
|
2017-01-20 09:16:31 +00:00
|
|
|
|
4: required domain.PayoutToolID payout_tool_id
|
2017-02-01 13:22:27 +00:00
|
|
|
|
5: optional domain.Proxy proxy
|
2016-12-09 12:05:35 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct ContractParams {
|
|
|
|
|
1: required domain.Contractor contractor
|
2016-12-12 16:12:03 +00:00
|
|
|
|
2: optional domain.ContractTemplateRef template
|
2017-01-20 09:16:31 +00:00
|
|
|
|
3: required PayoutToolParams payout_tool_params
|
2016-12-09 12:05:35 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct ContractAdjustmentParams {
|
|
|
|
|
1: required domain.ContractTemplateRef template
|
2016-08-10 12:06:59 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
union PartyModification {
|
|
|
|
|
1: domain.Blocking blocking
|
|
|
|
|
2: domain.Suspension suspension
|
2016-12-09 12:05:35 +00:00
|
|
|
|
3: domain.Contract contract_creation
|
|
|
|
|
4: ContractModificationUnit contract_modification
|
|
|
|
|
5: domain.Shop shop_creation
|
|
|
|
|
6: ShopModificationUnit shop_modification
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct ContractModificationUnit {
|
|
|
|
|
1: required domain.ContractID id
|
|
|
|
|
2: required ContractModification modification
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
union ContractModification {
|
|
|
|
|
1: ContractTermination termination
|
|
|
|
|
2: domain.ContractAdjustment adjustment_creation
|
2017-01-20 09:16:31 +00:00
|
|
|
|
3: domain.PayoutTool payout_tool_creation
|
|
|
|
|
4: domain.LegalAgreement legal_agreement_binding
|
2016-12-09 12:05:35 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct ContractTermination {
|
|
|
|
|
1: required base.Timestamp terminated_at
|
|
|
|
|
2: optional string reason
|
2016-08-10 12:06:59 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
typedef list<PartyModification> PartyChangeset
|
|
|
|
|
|
|
|
|
|
struct ShopModificationUnit {
|
|
|
|
|
1: required ShopID id
|
2016-12-09 12:05:35 +00:00
|
|
|
|
2: required ShopModification modification
|
2016-08-10 12:06:59 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
union ShopModification {
|
|
|
|
|
1: domain.Blocking blocking
|
|
|
|
|
2: domain.Suspension suspension
|
|
|
|
|
3: ShopUpdate update
|
2016-12-14 11:09:57 +00:00
|
|
|
|
4: ShopAccountCreated account_created
|
2016-08-10 12:06:59 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct ShopUpdate {
|
2016-10-13 16:33:13 +00:00
|
|
|
|
1: optional domain.CategoryRef category
|
2016-08-10 12:06:59 +00:00
|
|
|
|
2: optional domain.ShopDetails details
|
2016-12-09 12:05:35 +00:00
|
|
|
|
3: optional domain.ContractID contract_id
|
2017-01-20 09:16:31 +00:00
|
|
|
|
4: optional domain.PayoutToolID payout_tool_id
|
2017-01-13 14:24:47 +00:00
|
|
|
|
5: optional domain.Proxy proxy
|
2016-08-10 12:06:59 +00:00
|
|
|
|
}
|
|
|
|
|
|
2017-01-13 14:24:47 +00:00
|
|
|
|
struct ShopAccountCreated {
|
|
|
|
|
1: required domain.ShopAccount account
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Claims
|
|
|
|
|
|
2017-01-20 09:16:31 +00:00
|
|
|
|
typedef i64 ClaimID
|
2016-08-10 12:06:59 +00:00
|
|
|
|
|
|
|
|
|
struct Claim {
|
|
|
|
|
1: required ClaimID id
|
|
|
|
|
2: required ClaimStatus status
|
|
|
|
|
3: required PartyChangeset changeset
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
union ClaimStatus {
|
|
|
|
|
1: ClaimPending pending
|
2016-09-09 10:11:33 +00:00
|
|
|
|
2: ClaimAccepted accepted
|
|
|
|
|
3: ClaimDenied denied
|
|
|
|
|
4: ClaimRevoked revoked
|
2016-08-10 12:06:59 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct ClaimPending {}
|
|
|
|
|
|
|
|
|
|
struct ClaimAccepted {
|
2016-12-09 12:05:35 +00:00
|
|
|
|
1: required base.Timestamp accepted_at
|
2016-08-10 12:06:59 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct ClaimDenied {
|
|
|
|
|
1: required string reason
|
|
|
|
|
}
|
|
|
|
|
|
2016-09-09 10:11:33 +00:00
|
|
|
|
struct ClaimRevoked {
|
|
|
|
|
1: required string reason
|
|
|
|
|
}
|
|
|
|
|
|
2016-08-10 12:06:59 +00:00
|
|
|
|
struct ClaimResult {
|
|
|
|
|
1: required ClaimID id
|
|
|
|
|
2: required ClaimStatus status
|
|
|
|
|
}
|
|
|
|
|
|
2016-12-14 11:09:57 +00:00
|
|
|
|
struct AccountState {
|
2016-10-10 15:36:37 +00:00
|
|
|
|
1: required domain.AccountID account_id
|
|
|
|
|
2: required domain.Amount own_amount
|
|
|
|
|
3: required domain.Amount available_amount
|
|
|
|
|
4: required domain.Currency currency
|
|
|
|
|
}
|
|
|
|
|
|
2016-08-10 12:06:59 +00:00
|
|
|
|
// Events
|
|
|
|
|
|
|
|
|
|
union PartyEvent {
|
2016-12-09 12:05:35 +00:00
|
|
|
|
1: domain.Party party_created
|
|
|
|
|
2: Claim claim_created
|
2016-08-10 12:06:59 +00:00
|
|
|
|
3: ClaimStatusChanged claim_status_changed
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct ClaimStatusChanged {
|
|
|
|
|
1: required ClaimID id
|
|
|
|
|
2: required ClaimStatus status
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Exceptions
|
|
|
|
|
|
|
|
|
|
exception PartyExists {}
|
2017-06-16 15:38:35 +00:00
|
|
|
|
exception PartyNotExistsYet {}
|
2016-08-10 12:06:59 +00:00
|
|
|
|
exception ClaimNotFound {}
|
2017-01-20 09:16:31 +00:00
|
|
|
|
exception ContractNotFound {}
|
|
|
|
|
exception InvalidContractStatus { 1: required domain.ContractStatus status }
|
|
|
|
|
exception PayoutToolNotFound {}
|
|
|
|
|
|
2016-08-10 12:06:59 +00:00
|
|
|
|
|
|
|
|
|
exception InvalidClaimStatus {
|
|
|
|
|
1: required ClaimStatus status
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
union InvalidStatus {
|
|
|
|
|
1: domain.Blocking blocking
|
|
|
|
|
2: domain.Suspension suspension
|
|
|
|
|
}
|
|
|
|
|
|
2016-10-14 19:03:43 +00:00
|
|
|
|
exception AccountNotFound {}
|
2016-10-10 15:36:37 +00:00
|
|
|
|
|
2017-01-11 14:33:44 +00:00
|
|
|
|
exception ShopAccountNotFound {}
|
2016-10-10 15:36:37 +00:00
|
|
|
|
|
2016-08-10 12:06:59 +00:00
|
|
|
|
// Service
|
|
|
|
|
|
|
|
|
|
service PartyManagement {
|
|
|
|
|
|
2017-01-17 13:12:35 +00:00
|
|
|
|
void Create (1: UserInfo user, 2: PartyID party_id, 3: PartyParams params)
|
2016-08-10 12:06:59 +00:00
|
|
|
|
throws (1: InvalidUser ex1, 2: PartyExists ex2)
|
|
|
|
|
|
2016-12-09 12:05:35 +00:00
|
|
|
|
domain.Party Get (1: UserInfo user, 2: PartyID party_id)
|
2016-08-10 12:06:59 +00:00
|
|
|
|
throws (1: InvalidUser ex1, 2: PartyNotFound ex2)
|
|
|
|
|
|
2017-06-16 11:59:04 +00:00
|
|
|
|
domain.Party Checkout (1: UserInfo user, 2: PartyID party_id, 3: base.Timestamp timestamp)
|
2017-06-16 15:38:35 +00:00
|
|
|
|
throws (1: InvalidUser ex1, 2: PartyNotFound ex2, 3: PartyNotExistsYet ex3)
|
2017-06-16 11:59:04 +00:00
|
|
|
|
|
2016-12-09 12:05:35 +00:00
|
|
|
|
ClaimResult CreateContract (1: UserInfo user, 2: PartyID party_id, 3: ContractParams params)
|
|
|
|
|
throws (
|
|
|
|
|
1: InvalidUser ex1,
|
|
|
|
|
2: PartyNotFound ex2,
|
|
|
|
|
3: InvalidPartyStatus ex3,
|
|
|
|
|
4: base.InvalidRequest ex4
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
domain.Contract GetContract (1: UserInfo user, 2: PartyID party_id, 3: domain.ContractID contract_id)
|
|
|
|
|
throws (
|
|
|
|
|
1: InvalidUser ex1,
|
|
|
|
|
2: PartyNotFound ex2,
|
|
|
|
|
3: ContractNotFound ex3
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
ClaimResult TerminateContract (1: UserInfo user, 2: PartyID party_id, 3: domain.ContractID contract_id, 4: string reason)
|
|
|
|
|
throws (
|
|
|
|
|
1: InvalidUser ex1,
|
|
|
|
|
2: PartyNotFound ex2,
|
|
|
|
|
3: ContractNotFound ex3,
|
2017-01-20 09:16:31 +00:00
|
|
|
|
4: InvalidContractStatus ex4,
|
|
|
|
|
5: base.InvalidRequest ex5
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
ClaimResult BindContractLegalAgreemnet (
|
|
|
|
|
1: UserInfo user,
|
|
|
|
|
2: PartyID party_id,
|
|
|
|
|
3: domain.ContractID contract_id,
|
|
|
|
|
4: domain.LegalAgreement legal_agreement
|
|
|
|
|
)
|
|
|
|
|
throws (
|
|
|
|
|
1: InvalidUser ex1,
|
|
|
|
|
2: PartyNotFound ex2,
|
|
|
|
|
3: ContractNotFound ex3,
|
|
|
|
|
4: InvalidContractStatus ex4,
|
|
|
|
|
5: InvalidPartyStatus ex5,
|
|
|
|
|
6: base.InvalidRequest ex6
|
2016-12-09 12:05:35 +00:00
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
ClaimResult CreateContractAdjustment (
|
|
|
|
|
1: UserInfo user,
|
|
|
|
|
2: PartyID party_id,
|
|
|
|
|
3: domain.ContractID contract_id,
|
|
|
|
|
4: ContractAdjustmentParams params
|
|
|
|
|
)
|
|
|
|
|
throws (
|
|
|
|
|
1: InvalidUser ex1,
|
|
|
|
|
2: PartyNotFound ex2,
|
|
|
|
|
3: ContractNotFound ex3,
|
2017-01-20 09:16:31 +00:00
|
|
|
|
4: InvalidContractStatus ex4,
|
|
|
|
|
5: InvalidPartyStatus ex5,
|
|
|
|
|
6: base.InvalidRequest ex6
|
2016-12-09 12:05:35 +00:00
|
|
|
|
)
|
|
|
|
|
|
2017-01-20 09:16:31 +00:00
|
|
|
|
ClaimResult CreatePayoutTool (
|
|
|
|
|
1: UserInfo user,
|
|
|
|
|
2: PartyID party_id,
|
|
|
|
|
3: domain.ContractID contract_id,
|
|
|
|
|
4: PayoutToolParams params
|
|
|
|
|
)
|
2016-12-09 12:05:35 +00:00
|
|
|
|
throws (
|
|
|
|
|
1: InvalidUser ex1,
|
|
|
|
|
2: PartyNotFound ex2,
|
|
|
|
|
3: InvalidPartyStatus ex3,
|
2017-01-20 09:16:31 +00:00
|
|
|
|
4: ContractNotFound ex4,
|
|
|
|
|
5: InvalidContractStatus ex5,
|
|
|
|
|
6: base.InvalidRequest ex6
|
2016-12-09 12:05:35 +00:00
|
|
|
|
)
|
|
|
|
|
|
2016-08-10 12:06:59 +00:00
|
|
|
|
ClaimResult CreateShop (1: UserInfo user, 2: PartyID party_id, 3: ShopParams params)
|
|
|
|
|
throws (
|
|
|
|
|
1: InvalidUser ex1,
|
|
|
|
|
2: PartyNotFound ex2,
|
|
|
|
|
3: InvalidPartyStatus ex3,
|
2017-01-20 09:16:31 +00:00
|
|
|
|
5: ContractNotFound ex5,
|
|
|
|
|
6: InvalidContractStatus ex6,
|
|
|
|
|
7: PayoutToolNotFound ex7,
|
2016-08-10 12:06:59 +00:00
|
|
|
|
4: base.InvalidRequest ex4
|
|
|
|
|
)
|
|
|
|
|
|
2016-12-09 12:05:35 +00:00
|
|
|
|
domain.Shop GetShop (1: UserInfo user, 2: PartyID party_id, 3: ShopID id)
|
2016-08-10 12:06:59 +00:00
|
|
|
|
throws (1: InvalidUser ex1, 2: PartyNotFound ex2, 3: ShopNotFound ex3)
|
|
|
|
|
|
|
|
|
|
ClaimResult UpdateShop (1: UserInfo user, 2: PartyID party_id, 3: ShopID id, 4: ShopUpdate update)
|
|
|
|
|
throws (
|
|
|
|
|
1: InvalidUser ex1,
|
|
|
|
|
2: PartyNotFound ex2,
|
|
|
|
|
3: ShopNotFound ex3,
|
|
|
|
|
4: InvalidPartyStatus ex4,
|
|
|
|
|
5: InvalidShopStatus ex5,
|
2017-01-20 09:16:31 +00:00
|
|
|
|
7: ContractNotFound ex7,
|
|
|
|
|
8: InvalidContractStatus ex8,
|
|
|
|
|
9: PayoutToolNotFound ex9,
|
2016-08-10 12:06:59 +00:00
|
|
|
|
6: base.InvalidRequest ex6
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
/* Claims */
|
|
|
|
|
|
|
|
|
|
Claim GetClaim (1: UserInfo user, 2: PartyID party_id, 3: ClaimID id)
|
|
|
|
|
throws (1: InvalidUser ex1, 2: PartyNotFound ex2, 3: ClaimNotFound ex3)
|
|
|
|
|
|
|
|
|
|
Claim GetPendingClaim (1: UserInfo user, 2: PartyID party_id)
|
|
|
|
|
throws (1: InvalidUser ex1, 2: PartyNotFound ex2, 3: ClaimNotFound ex3)
|
|
|
|
|
|
|
|
|
|
void AcceptClaim (1: UserInfo user, 2: PartyID party_id, 3: ClaimID id)
|
|
|
|
|
throws (
|
|
|
|
|
1: InvalidUser ex1,
|
|
|
|
|
2: PartyNotFound ex2,
|
|
|
|
|
3: ClaimNotFound ex3,
|
|
|
|
|
4: InvalidClaimStatus ex4
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
void DenyClaim (1: UserInfo user, 2: PartyID party_id, 3: ClaimID id, 4: string reason)
|
|
|
|
|
throws (
|
|
|
|
|
1: InvalidUser ex1,
|
|
|
|
|
2: PartyNotFound ex2,
|
|
|
|
|
3: ClaimNotFound ex3,
|
|
|
|
|
4: InvalidClaimStatus ex4
|
|
|
|
|
)
|
|
|
|
|
|
2016-09-09 10:11:33 +00:00
|
|
|
|
void RevokeClaim (1: UserInfo user, 2: PartyID party_id, 3: ClaimID id, 4: string reason)
|
|
|
|
|
throws (
|
|
|
|
|
1: InvalidUser ex1,
|
|
|
|
|
2: PartyNotFound ex2,
|
|
|
|
|
3: InvalidPartyStatus ex3,
|
|
|
|
|
4: ClaimNotFound ex4,
|
|
|
|
|
5: InvalidClaimStatus ex5
|
|
|
|
|
)
|
|
|
|
|
|
2016-08-10 12:06:59 +00:00
|
|
|
|
/* Party blocking / suspension */
|
|
|
|
|
|
|
|
|
|
ClaimResult Suspend (1: UserInfo user, 2: PartyID party_id)
|
|
|
|
|
throws (1: InvalidUser ex1, 2: PartyNotFound ex2, 3: InvalidPartyStatus ex3)
|
|
|
|
|
|
|
|
|
|
ClaimResult Activate (1: UserInfo user, 2: PartyID party_id)
|
|
|
|
|
throws (1: InvalidUser ex1, 2: PartyNotFound ex2, 3: InvalidPartyStatus ex3)
|
|
|
|
|
|
|
|
|
|
ClaimResult Block (1: UserInfo user, 2: PartyID party_id, 3: string reason)
|
|
|
|
|
throws (1: InvalidUser ex1, 2: PartyNotFound ex2, 3: InvalidPartyStatus ex3)
|
|
|
|
|
|
|
|
|
|
ClaimResult Unblock (1: UserInfo user, 2: PartyID party_id, 3: string reason)
|
|
|
|
|
throws (1: InvalidUser ex1, 2: PartyNotFound ex2, 3: InvalidPartyStatus ex3)
|
|
|
|
|
|
|
|
|
|
/* Shop blocking / suspension */
|
|
|
|
|
|
|
|
|
|
ClaimResult SuspendShop (1: UserInfo user, 2: PartyID party_id, 3: ShopID id)
|
|
|
|
|
throws (1: InvalidUser ex1, 2: PartyNotFound ex2, 3: ShopNotFound ex3, 4: InvalidShopStatus ex4)
|
|
|
|
|
|
|
|
|
|
ClaimResult ActivateShop (1: UserInfo user, 2: PartyID party_id, 3: ShopID id)
|
|
|
|
|
throws (1: InvalidUser ex1, 2: PartyNotFound ex2, 3: ShopNotFound ex3, 4: InvalidShopStatus ex4)
|
|
|
|
|
|
|
|
|
|
ClaimResult BlockShop (1: UserInfo user, 2: PartyID party_id, 3: ShopID id, 4: string reason)
|
|
|
|
|
throws (1: InvalidUser ex1, 2: PartyNotFound ex2, 3: ShopNotFound ex3, 4: InvalidShopStatus ex4)
|
|
|
|
|
|
|
|
|
|
ClaimResult UnblockShop (1: UserInfo user, 2: PartyID party_id, 3: ShopID id, 4: string reason)
|
|
|
|
|
throws (1: InvalidUser ex1, 2: PartyNotFound ex2, 3: ShopNotFound ex3, 4: InvalidShopStatus ex4)
|
|
|
|
|
|
|
|
|
|
/* Event polling */
|
|
|
|
|
|
|
|
|
|
Events GetEvents (1: UserInfo user, 2: domain.PartyID party_id, 3: EventRange range)
|
|
|
|
|
throws (
|
|
|
|
|
1: InvalidUser ex1,
|
|
|
|
|
2: PartyNotFound ex2,
|
|
|
|
|
3: EventNotFound ex3,
|
|
|
|
|
4: base.InvalidRequest ex4
|
|
|
|
|
)
|
|
|
|
|
|
2016-10-10 15:36:37 +00:00
|
|
|
|
/* Accounts */
|
|
|
|
|
|
2016-12-14 11:09:57 +00:00
|
|
|
|
domain.ShopAccount GetShopAccount (1: UserInfo user, 2: PartyID party_id, 3: ShopID shop_id)
|
2017-01-11 14:33:44 +00:00
|
|
|
|
throws (1: InvalidUser ex1, 2: PartyNotFound ex2, 3: ShopNotFound ex3, 4: ShopAccountNotFound ex4)
|
2016-12-14 11:09:57 +00:00
|
|
|
|
|
|
|
|
|
AccountState GetAccountState (1: UserInfo user, 2: PartyID party_id, 3: domain.AccountID account_id)
|
2016-10-10 15:36:37 +00:00
|
|
|
|
throws (1: InvalidUser ex1, 2: PartyNotFound ex2, 3: AccountNotFound ex3)
|
|
|
|
|
|
2016-08-10 12:06:59 +00:00
|
|
|
|
}
|
|
|
|
|
|
2016-06-16 15:07:06 +00:00
|
|
|
|
/* Event sink service definitions */
|
|
|
|
|
|
|
|
|
|
/** Исключение, сигнализирующее о том, что последнего события не существует. */
|
|
|
|
|
exception NoLastEvent {}
|
|
|
|
|
|
|
|
|
|
service EventSink {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Получить последовательный набор событий из истории системы, от более
|
|
|
|
|
* ранних к более поздним, из диапазона, заданного `range`. Результат
|
|
|
|
|
* выполнения запроса может содержать от `0` до `range.limit` событий.
|
|
|
|
|
*
|
|
|
|
|
* Если в `range.after` указан идентификатор неизвестного события, то есть
|
|
|
|
|
* события, не наблюдаемого клиентом ранее в известной ему истории,
|
|
|
|
|
* бросится исключение `EventNotFound`.
|
|
|
|
|
*/
|
|
|
|
|
Events GetEvents (1: EventRange range)
|
|
|
|
|
throws (1: EventNotFound ex1, 2: base.InvalidRequest ex2)
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Получить идентификатор наиболее позднего известного на момент исполнения
|
|
|
|
|
* запроса события.
|
|
|
|
|
*/
|
|
|
|
|
base.EventID GetLastEventID ()
|
|
|
|
|
throws (1: NoLastEvent ex1)
|
|
|
|
|
|
|
|
|
|
}
|