github.com/companieshouse/insolvency-api@v0.0.0-20231024103413-440c973d9e9b/models/data_entities.go (about)

     1  package models
     2  
     3  import "go.mongodb.org/mongo-driver/bson/primitive"
     4  
     5  // InsolvencyResourceDao contains the meta-data for the insolvency resource in Mongo
     6  type InsolvencyResourceDao struct {
     7  	ID            primitive.ObjectID         `bson:"_id"`
     8  	TransactionID string                     `bson:"transaction_id"`
     9  	Etag          string                     `bson:"etag"`
    10  	Kind          string                     `bson:"kind"`
    11  	Data          InsolvencyResourceDaoData  `bson:"data"`
    12  	Links         InsolvencyResourceLinksDao `bson:"links"`
    13  }
    14  
    15  // InsolvencyResourceDaoData contains the data for the insolvency resource in Mongo
    16  type InsolvencyResourceDaoData struct {
    17  	CompanyNumber      string                         `bson:"company_number"`
    18  	CaseType           string                         `bson:"case_type"`
    19  	CompanyName        string                         `bson:"company_name"`
    20  	Practitioners      []PractitionerResourceDao      `bson:"practitioners,omitempty"`
    21  	Attachments        []AttachmentResourceDao        `bson:"attachments,omitempty"`
    22  	Resolution         *ResolutionResourceDao         `bson:"resolution,omitempty"`
    23  	StatementOfAffairs *StatementOfAffairsResourceDao `bson:"statement-of-affairs,omitempty"`
    24  	ProgressReport     *ProgressReportResourceDao     `bson:"progress-report,omitempty"`
    25  }
    26  
    27  // InsolvencyResourceLinksDao contains the links for the insolvency resource
    28  type InsolvencyResourceLinksDao struct {
    29  	Self             string `bson:"self"`
    30  	Transaction      string `bson:"transaction"`
    31  	ValidationStatus string `bson:"validation_status"`
    32  }
    33  
    34  // PractitionerResourceDao contains the data for the practitioner resource in Mongo
    35  type PractitionerResourceDao struct {
    36  	ID              string                       `bson:"id"`
    37  	IPCode          string                       `bson:"ip_code"`
    38  	FirstName       string                       `bson:"first_name"`
    39  	LastName        string                       `bson:"last_name"`
    40  	TelephoneNumber string                       `bson:"telephone_number,omitempty"`
    41  	Email           string                       `bson:"email,omitempty"`
    42  	Address         AddressResourceDao           `bson:"address"`
    43  	Role            string                       `bson:"role"`
    44  	Links           PractitionerResourceLinksDao `bson:"links"`
    45  	Appointment     *AppointmentResourceDao      `bson:"appointment,omitempty"`
    46  }
    47  
    48  // AppointmentResourceDao contains the appointment data for a practitioner
    49  type AppointmentResourceDao struct {
    50  	AppointedOn string                      `bson:"appointed_on,omitempty"`
    51  	MadeBy      string                      `bson:"made_by,omitempty"`
    52  	Links       AppointmentResourceLinksDao `bson:"links,omitempty"`
    53  }
    54  
    55  // AppointmentResourceLinksDao contains the Links data for an appointment
    56  type AppointmentResourceLinksDao struct {
    57  	Self string `bson:"self,omitempty"`
    58  }
    59  
    60  // AddressResourceDao contains the data for any addresses in Mongo
    61  type AddressResourceDao struct {
    62  	Premises     string `bson:"premises"`
    63  	AddressLine1 string `bson:"address_line_1"`
    64  	AddressLine2 string `bson:"address_line_2"`
    65  	Country      string `bson:"country"`
    66  	Locality     string `bson:"locality"`
    67  	Region       string `bson:"region"`
    68  	PostalCode   string `bson:"postal_code"`
    69  	POBox        string `bson:"po_box"`
    70  }
    71  
    72  // PractitionerResourceLinksDao contains the Links data for a practitioner
    73  type PractitionerResourceLinksDao struct {
    74  	Self string `bson:"self"`
    75  }
    76  
    77  // AttachmentResourceDao contains the data for the attachment DB resource
    78  type AttachmentResourceDao struct {
    79  	ID     string                     `bson:"id"`
    80  	Type   string                     `bson:"type"`
    81  	Status string                     `bson:"status"`
    82  	Links  AttachmentResourceLinksDao `bson:"links"`
    83  }
    84  
    85  // AttachmentResourceLinksDao contains the Links data for an attachment
    86  type AttachmentResourceLinksDao struct {
    87  	Self     string `bson:"self"`
    88  	Download string `bson:"download"`
    89  }
    90  
    91  // ResolutionResourceDao contains the data for the resolution DB resource
    92  type ResolutionResourceDao struct {
    93  	Etag             string                     `bson:"etag"`
    94  	Kind             string                     `bson:"kind"`
    95  	DateOfResolution string                     `bson:"date_of_resolution"`
    96  	Attachments      []string                   `bson:"attachments"`
    97  	Links            ResolutionResourceLinksDao `bson:"links"`
    98  }
    99  
   100  // ResolutionResourceLinksDao contains the Links data for a resolution
   101  type ResolutionResourceLinksDao struct {
   102  	Self string `bson:"self,omitempty"`
   103  }
   104  
   105  // StatementOfAffairsResourceDao contains the data for the statement of affairs DB resource
   106  type StatementOfAffairsResourceDao struct {
   107  	Etag          string                             `bson:"etag"`
   108  	Kind          string                             `bson:"kind"`
   109  	StatementDate string                             `bson:"statement_date"`
   110  	Attachments   []string                           `bson:"attachments"`
   111  	Links         StatementOfAffairsResourceLinksDao `bson:"links"`
   112  }
   113  
   114  // StatementOfAffairsResourceLinksDao contains the Links data for a statement of affairs
   115  type StatementOfAffairsResourceLinksDao struct {
   116  	Self string `bson:"self,omitempty"`
   117  }
   118  
   119  type ProgressReportResourceDao struct {
   120  	FromDate    string                         `bson:"from_date"`
   121  	ToDate      string                         `bson:"to_date"`
   122  	Attachments []string                       `bson:"attachments"`
   123  	Etag        string                         `bson:"etag"`
   124  	Kind        string                         `bson:"kind"`
   125  	Links       ProgressReportResourceLinksDao `bson:"links"`
   126  }
   127  
   128  type ProgressReportResourceLinksDao struct {
   129  	Self string `bson:"self,omitempty"`
   130  }