1
- use crate :: service:: contact_service:: LightIdentityPublicDataWithAddress ;
1
+ use crate :: service:: contact_service:: { ContactType , LightIdentityPublicDataWithAddress } ;
2
2
use crate :: service:: identity_service:: IdentityType ;
3
3
use crate :: service:: {
4
4
bill_service:: LightBitcreditBillToReturn ,
@@ -13,6 +13,18 @@ use serde::{Deserialize, Serialize};
13
13
use std:: fmt;
14
14
use utoipa:: ToSchema ;
15
15
16
+ /// A dummy response type signaling success of a request
17
+ #[ derive( Debug , Serialize , ToSchema ) ]
18
+ pub struct SuccessResponse {
19
+ pub success : bool ,
20
+ }
21
+
22
+ impl SuccessResponse {
23
+ pub fn new ( ) -> Self {
24
+ Self { success : true }
25
+ }
26
+ }
27
+
16
28
#[ derive( Debug , Serialize , ToSchema ) ]
17
29
pub struct EndorsementsResponse {
18
30
pub endorsements : Vec < Endorsement > ,
@@ -450,3 +462,68 @@ pub struct SeedPhrase {
450
462
/// The seed phrase of the current private key
451
463
pub seed_phrase : String ,
452
464
}
465
+
466
+ // Company
467
+ #[ derive( Debug , Serialize , Deserialize , Clone ) ]
468
+ pub struct CreateCompanyPayload {
469
+ pub name : String ,
470
+ pub country_of_registration : String ,
471
+ pub city_of_registration : String ,
472
+ #[ serde( flatten) ]
473
+ pub postal_address : PostalAddress ,
474
+ pub email : String ,
475
+ pub registration_number : String ,
476
+ pub registration_date : String ,
477
+ pub proof_of_registration_file_upload_id : Option < String > ,
478
+ pub logo_file_upload_id : Option < String > ,
479
+ }
480
+
481
+ #[ derive( Debug , Serialize , Deserialize , Clone ) ]
482
+ pub struct EditCompanyPayload {
483
+ pub id : String ,
484
+ pub name : Option < String > ,
485
+ pub email : Option < String > ,
486
+ #[ serde( flatten) ]
487
+ pub postal_address : OptionalPostalAddress ,
488
+ pub logo_file_upload_id : Option < String > ,
489
+ }
490
+
491
+ #[ derive( Debug , Serialize , Deserialize , Clone ) ]
492
+ pub struct AddSignatoryPayload {
493
+ pub id : String ,
494
+ pub signatory_node_id : String ,
495
+ }
496
+
497
+ #[ derive( Debug , Serialize , Deserialize , Clone ) ]
498
+ pub struct RemoveSignatoryPayload {
499
+ pub id : String ,
500
+ pub signatory_node_id : String ,
501
+ }
502
+
503
+ #[ derive( Debug , Serialize , Deserialize , Clone ) ]
504
+ pub struct ListSignatoriesResponse {
505
+ pub signatories : Vec < SignatoryResponse > ,
506
+ }
507
+
508
+ #[ derive( Debug , Serialize , Deserialize , Clone ) ]
509
+ pub struct SignatoryResponse {
510
+ #[ serde( rename = "type" ) ]
511
+ pub t : ContactType ,
512
+ pub node_id : String ,
513
+ pub name : String ,
514
+ #[ serde( flatten) ]
515
+ pub postal_address : PostalAddress ,
516
+ pub avatar_file : Option < File > ,
517
+ }
518
+
519
+ impl From < Contact > for SignatoryResponse {
520
+ fn from ( value : Contact ) -> Self {
521
+ Self {
522
+ t : value. t ,
523
+ node_id : value. node_id ,
524
+ name : value. name ,
525
+ postal_address : value. postal_address ,
526
+ avatar_file : value. avatar_file ,
527
+ }
528
+ }
529
+ }
0 commit comments