<?xml version="1.0" encoding="UTF-8"?>
<!-- Vestoris feed format "account" version 1.0. Generated from the data set definition; see https://vestoris.com/help/feeds/account -->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="urn:vestoris:feed:account:1.0" targetNamespace="urn:vestoris:feed:account:1.0" elementFormDefault="qualified" attributeFormDefault="unqualified" version="1.0">
  <xs:annotation><xs:documentation>Accounts. Accounts (funds) with their strategy, model, base currency, beneficial-owner group and status. The account code is the key. New accounts are visible to Admin, Compliance and Operations; grant others on Entitlements. Key: code.</xs:documentation></xs:annotation>
  <xs:element name="feed">
    <xs:annotation><xs:documentation>One file: the header attributes, then the records.</xs:documentation></xs:annotation>
    <xs:complexType>
      <xs:sequence>
        <xs:element name="record" type="Record" minOccurs="0" maxOccurs="unbounded"/>
      </xs:sequence>
      <xs:attribute name="businessDate" type="xs:date" use="required"><xs:annotation><xs:documentation>The business date the data is for (YYYY-MM-DD).</xs:documentation></xs:annotation></xs:attribute>
      <xs:attribute name="firm" use="required"><xs:annotation><xs:documentation>Your firm code, shown on Data › Feeds (e.g. F00012).</xs:documentation></xs:annotation><xs:simpleType><xs:restriction base="xs:string"><xs:pattern value="[A-Z][0-9]{5}"/></xs:restriction></xs:simpleType></xs:attribute>
      <xs:attribute name="source" use="optional"><xs:annotation><xs:documentation>Who produced the file (vendor or system name).</xs:documentation></xs:annotation><xs:simpleType><xs:restriction base="xs:string"><xs:maxLength value="80"/></xs:restriction></xs:simpleType></xs:attribute>
      <xs:attribute name="generated" type="xs:dateTime" use="required"><xs:annotation><xs:documentation>When the file was produced (UTC).</xs:documentation></xs:annotation></xs:attribute>
      <xs:attribute name="recordCount" type="xs:nonNegativeInteger" use="required"><xs:annotation><xs:documentation>The number of record elements. A file whose count does not match is refused (F004): it was probably cut short.</xs:documentation></xs:annotation></xs:attribute>
      <xs:attribute name="mode" use="optional" default="delta"><xs:annotation><xs:documentation>delta: only the records in the file change. full: the file is complete; records it does not list are inactivated, up to the feed's safety threshold.</xs:documentation></xs:annotation><xs:simpleType><xs:restriction base="xs:string"><xs:enumeration value="delta"/><xs:enumeration value="full"/></xs:restriction></xs:simpleType></xs:attribute>
    </xs:complexType>
  </xs:element>
  <xs:complexType name="Record">
    <xs:annotation><xs:documentation>One accounts record. Elements may appear in any order.</xs:documentation></xs:annotation>
    <xs:all>
      <xs:element name="code" minOccurs="1">
        <xs:annotation><xs:documentation>The account code. The key. A code: letters, digits, &quot;_&quot;, &quot;.&quot; or &quot;-&quot;, up to 20. Part of the key.</xs:documentation></xs:annotation>
        <xs:simpleType><xs:restriction base="xs:string"><xs:pattern value="[A-Z0-9][A-Z0-9_.\-]{0,19}"/></xs:restriction></xs:simpleType>
      </xs:element>
      <xs:element name="name" minOccurs="1">
        <xs:annotation><xs:documentation>The account&apos;s name. Text, up to 120 characters.</xs:documentation></xs:annotation>
        <xs:simpleType><xs:restriction base="xs:string"><xs:maxLength value="120"/></xs:restriction></xs:simpleType>
      </xs:element>
      <xs:element name="strategy" minOccurs="0">
        <xs:annotation><xs:documentation>Strategy or mandate in a few words. Text, up to 60 characters.</xs:documentation></xs:annotation>
        <xs:simpleType><xs:restriction base="xs:string"><xs:maxLength value="60"/></xs:restriction></xs:simpleType>
      </xs:element>
      <xs:element name="model" minOccurs="0">
        <xs:annotation><xs:documentation>The model portfolio (by name) the account follows. Text, up to 120 characters.</xs:documentation></xs:annotation>
        <xs:simpleType><xs:restriction base="xs:string"><xs:maxLength value="120"/></xs:restriction></xs:simpleType>
      </xs:element>
      <xs:element name="baseCurrency" minOccurs="0">
        <xs:annotation><xs:documentation>Base currency. An ISO 4217 currency code, e.g. USD.</xs:documentation></xs:annotation>
        <xs:simpleType><xs:restriction base="xs:string"><xs:pattern value="[A-Z]{3}"/></xs:restriction></xs:simpleType>
      </xs:element>
      <xs:element name="ownerGroup" minOccurs="0">
        <xs:annotation><xs:documentation>Beneficial-owner group: accounts of the same owner are checked together for wash sales. A code: letters, digits, &quot;_&quot;, &quot;.&quot; or &quot;-&quot;, up to 40.</xs:documentation></xs:annotation>
        <xs:simpleType><xs:restriction base="xs:string"><xs:pattern value="[A-Z0-9][A-Z0-9_.\-]{0,39}"/></xs:restriction></xs:simpleType>
      </xs:element>
      <xs:element name="lotMethod" minOccurs="0">
        <xs:annotation><xs:documentation>How sales choose tax lots. One of: fifo, specific.</xs:documentation></xs:annotation>
        <xs:simpleType><xs:restriction base="xs:string"><xs:enumeration value="fifo"/><xs:enumeration value="specific"/></xs:restriction></xs:simpleType>
      </xs:element>
      <xs:element name="status" minOccurs="0">
        <xs:annotation><xs:documentation>active or closed. One of: active, closed.</xs:documentation></xs:annotation>
        <xs:simpleType><xs:restriction base="xs:string"><xs:enumeration value="active"/><xs:enumeration value="closed"/></xs:restriction></xs:simpleType>
      </xs:element>
    </xs:all>
    <xs:attribute name="action" use="optional" default="upsert"><xs:annotation><xs:documentation>upsert (insert or update by key).</xs:documentation></xs:annotation><xs:simpleType><xs:restriction base="xs:string"><xs:enumeration value="upsert"/></xs:restriction></xs:simpleType></xs:attribute>
  </xs:complexType>
</xs:schema>
