HG-246: add better support for 54FL (#184)

* add metadata to Party
* add interface for PartyMeta modification
* add cart with lines to invoice
This commit is contained in:
Evgeny Levenets 2017-08-03 13:48:31 +03:00 committed by GitHub
parent b9f872f3b1
commit 8c432f7f76
2 changed files with 41 additions and 0 deletions

View File

@ -3,6 +3,7 @@
*/
include "base.thrift"
include "msgpack.thrift"
namespace java com.rbkmoney.damsel.domain
namespace erlang domain
@ -79,6 +80,19 @@ struct Invoice {
struct InvoiceDetails {
1: required string product
2: optional string description
3: optional InvoiceCart cart
}
struct InvoiceCart {
1: required list<InvoiceLine> lines
}
struct InvoiceLine {
1: required string product
2: required i32 quantity
3: required Cash price
/* Taxes and other stuff goes here */
4: required map<string, msgpack.Value> metadata
}
struct InvoiceUnpaid {}
@ -254,6 +268,10 @@ struct Suspended {
typedef base.ID PartyID
typedef string PartyMetaNamespace
typedef msgpack.Value PartyMetaData
typedef map<PartyMetaNamespace, PartyMetaData> PartyMeta
/** Участник. */
struct Party {
1: required PartyID id

View File

@ -800,6 +800,8 @@ union PartyChange {
2: Claim claim_created
3: ClaimStatusChanged claim_status_changed
8: ClaimUpdated claim_updated
9: PartyMetaSet party_meta_set
10: domain.PartyMetaNamespace party_meta_removed
}
struct ShopBlocking {
@ -826,6 +828,11 @@ struct ClaimUpdated {
4: required base.Timestamp updated_at
}
struct PartyMetaSet {
1: required domain.PartyMetaNamespace ns
2: required domain.PartyMetaData data
}
// Exceptions
exception PartyExists {}
@ -874,6 +881,8 @@ exception AccountNotFound {}
exception ShopAccountNotFound {}
exception PartyMetaNamespaceNotFound {}
// Service
service PartyManagement {
@ -901,6 +910,20 @@ service PartyManagement {
void Unblock (1: UserInfo user, 2: PartyID party_id, 3: string reason)
throws (1: InvalidUser ex1, 2: PartyNotFound ex2, 3: InvalidPartyStatus ex3)
/* Party Meta */
domain.PartyMeta GetMeta (1: UserInfo user, 2: PartyID party_id)
throws (1: InvalidUser ex1, 2: PartyNotFound ex2)
domain.PartyMetaData GetMetaData (1: UserInfo user, 2: PartyID party_id, 3: domain.PartyMetaNamespace ns)
throws (1: InvalidUser ex1, 2: PartyNotFound ex2, 3: PartyMetaNamespaceNotFound ex3)
void SetMetaData (1: UserInfo user, 2: PartyID party_id, 3: domain.PartyMetaNamespace ns, 4: domain.PartyMetaData data)
throws (1: InvalidUser ex1, 2: PartyNotFound ex2)
void RemoveMetaData (1: UserInfo user, 2: PartyID party_id, 3: domain.PartyMetaNamespace ns)
throws (1: InvalidUser ex1, 2: PartyNotFound ex2, 3: PartyMetaNamespaceNotFound ex3)
/* Contract */
domain.Contract GetContract (1: UserInfo user, 2: PartyID party_id, 3: domain.ContractID contract_id)