mirror of
https://github.com/Nikolay-Shirokov/cc-1c-skills.git
synced 2026-07-15 23:35:17 +03:00
feat(meta-compile): тип реквизита Time (только время) (v1.33)
Реквизит типа Время (DateFractions=Time) компилятор писал <v8:Type>Time</> (fallback) вместо xs:dateTime + DateQualifiers/DateFractions=Time. Всплыло на Catalog.Календари (ВремяНачала/ВремяОкончания). Ветка Date/DateTime обобщена на Date|DateTime|Time (структура одна, различается лишь DateFractions); + русский синоним Время→Time. Декомпилятор уже отдавал Time (InnerText DateFractions) → не менялся (v0.22). Календари acc+erp → match. Регресс 47/47 ps1+py, ps1↔py identical. spec §3.2/§3.3, кейс catalog-mixed-types (+Time/DateTime). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
# meta-compile v1.32 — Compile 1C metadata object from JSON
|
# meta-compile v1.33 — Compile 1C metadata object from JSON
|
||||||
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
|
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
|
||||||
param(
|
param(
|
||||||
[Parameter(Mandatory)]
|
[Parameter(Mandatory)]
|
||||||
@@ -427,6 +427,8 @@ $script:typeSynonyms["строка"] = "String"
|
|||||||
$script:typeSynonyms["булево"] = "Boolean"
|
$script:typeSynonyms["булево"] = "Boolean"
|
||||||
$script:typeSynonyms["дата"] = "Date"
|
$script:typeSynonyms["дата"] = "Date"
|
||||||
$script:typeSynonyms["датавремя"]= "DateTime"
|
$script:typeSynonyms["датавремя"]= "DateTime"
|
||||||
|
$script:typeSynonyms["время"] = "Time"
|
||||||
|
$script:typeSynonyms["time"] = "Time"
|
||||||
$script:typeSynonyms["number"] = "Number"
|
$script:typeSynonyms["number"] = "Number"
|
||||||
$script:typeSynonyms["string"] = "String"
|
$script:typeSynonyms["string"] = "String"
|
||||||
$script:typeSynonyms["boolean"] = "Boolean"
|
$script:typeSynonyms["boolean"] = "Boolean"
|
||||||
@@ -546,18 +548,11 @@ function Emit-TypeContent {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
# Date / DateTime
|
# Date / DateTime / Time — общая структура xs:dateTime + DateFractions (различаются лишь составом).
|
||||||
if ($typeStr -eq "Date") {
|
if ($typeStr -match '^(Date|DateTime|Time)$') {
|
||||||
X "$indent<v8:Type>xs:dateTime</v8:Type>"
|
X "$indent<v8:Type>xs:dateTime</v8:Type>"
|
||||||
X "$indent<v8:DateQualifiers>"
|
X "$indent<v8:DateQualifiers>"
|
||||||
X "$indent`t<v8:DateFractions>Date</v8:DateFractions>"
|
X "$indent`t<v8:DateFractions>$typeStr</v8:DateFractions>"
|
||||||
X "$indent</v8:DateQualifiers>"
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if ($typeStr -eq "DateTime") {
|
|
||||||
X "$indent<v8:Type>xs:dateTime</v8:Type>"
|
|
||||||
X "$indent<v8:DateQualifiers>"
|
|
||||||
X "$indent`t<v8:DateFractions>DateTime</v8:DateFractions>"
|
|
||||||
X "$indent</v8:DateQualifiers>"
|
X "$indent</v8:DateQualifiers>"
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# meta-compile v1.32 — Compile 1C metadata object from JSON
|
# meta-compile v1.33 — Compile 1C metadata object from JSON
|
||||||
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
|
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
@@ -477,6 +477,8 @@ type_synonyms = {
|
|||||||
'булево': 'Boolean',
|
'булево': 'Boolean',
|
||||||
'дата': 'Date',
|
'дата': 'Date',
|
||||||
'датавремя': 'DateTime',
|
'датавремя': 'DateTime',
|
||||||
|
'время': 'Time',
|
||||||
|
'time': 'Time',
|
||||||
'number': 'Number',
|
'number': 'Number',
|
||||||
'string': 'String',
|
'string': 'String',
|
||||||
'boolean': 'Boolean',
|
'boolean': 'Boolean',
|
||||||
@@ -584,17 +586,11 @@ def emit_type_content(indent, type_str):
|
|||||||
X(f'{indent}\t<v8:AllowedSign>{sign}</v8:AllowedSign>')
|
X(f'{indent}\t<v8:AllowedSign>{sign}</v8:AllowedSign>')
|
||||||
X(f'{indent}</v8:NumberQualifiers>')
|
X(f'{indent}</v8:NumberQualifiers>')
|
||||||
return
|
return
|
||||||
# Date / DateTime
|
# Date / DateTime / Time — общая структура xs:dateTime + DateFractions (различаются лишь составом).
|
||||||
if type_str == 'Date':
|
if type_str in ('Date', 'DateTime', 'Time'):
|
||||||
X(f'{indent}<v8:Type>xs:dateTime</v8:Type>')
|
X(f'{indent}<v8:Type>xs:dateTime</v8:Type>')
|
||||||
X(f'{indent}<v8:DateQualifiers>')
|
X(f'{indent}<v8:DateQualifiers>')
|
||||||
X(f'{indent}\t<v8:DateFractions>Date</v8:DateFractions>')
|
X(f'{indent}\t<v8:DateFractions>{type_str}</v8:DateFractions>')
|
||||||
X(f'{indent}</v8:DateQualifiers>')
|
|
||||||
return
|
|
||||||
if type_str == 'DateTime':
|
|
||||||
X(f'{indent}<v8:Type>xs:dateTime</v8:Type>')
|
|
||||||
X(f'{indent}<v8:DateQualifiers>')
|
|
||||||
X(f'{indent}\t<v8:DateFractions>DateTime</v8:DateFractions>')
|
|
||||||
X(f'{indent}</v8:DateQualifiers>')
|
X(f'{indent}</v8:DateQualifiers>')
|
||||||
return
|
return
|
||||||
# TypeSet — тип-множество: ОпределяемыйТип (DefinedType) ИЛИ Характеристика ПВХ (Characteristic).
|
# TypeSet — тип-множество: ОпределяемыйТип (DefinedType) ИЛИ Характеристика ПВХ (Characteristic).
|
||||||
|
|||||||
@@ -66,6 +66,7 @@ JSON DSL для описания объектов метаданных конф
|
|||||||
| `Boolean` | `xs:boolean` |
|
| `Boolean` | `xs:boolean` |
|
||||||
| `Date` | `xs:dateTime` + DateFractions=Date |
|
| `Date` | `xs:dateTime` + DateFractions=Date |
|
||||||
| `DateTime` | `xs:dateTime` + DateFractions=DateTime |
|
| `DateTime` | `xs:dateTime` + DateFractions=DateTime |
|
||||||
|
| `Time` | `xs:dateTime` + DateFractions=Time (только время) |
|
||||||
| `ValueStorage` | `v8:ValueStorage` (ХранилищеЗначения) |
|
| `ValueStorage` | `v8:ValueStorage` (ХранилищеЗначения) |
|
||||||
| `UUID` | `v8:UUID` (УникальныйИдентификатор) |
|
| `UUID` | `v8:UUID` (УникальныйИдентификатор) |
|
||||||
|
|
||||||
@@ -104,6 +105,7 @@ JSON DSL для описания объектов метаданных конф
|
|||||||
| `Булево` | `Boolean` |
|
| `Булево` | `Boolean` |
|
||||||
| `Дата` | `Date` |
|
| `Дата` | `Date` |
|
||||||
| `ДатаВремя` | `DateTime` |
|
| `ДатаВремя` | `DateTime` |
|
||||||
|
| `Время` | `Time` |
|
||||||
| `СправочникСсылка.Xxx` | `CatalogRef.Xxx` |
|
| `СправочникСсылка.Xxx` | `CatalogRef.Xxx` |
|
||||||
| `ДокументСсылка.Xxx` | `DocumentRef.Xxx` |
|
| `ДокументСсылка.Xxx` | `DocumentRef.Xxx` |
|
||||||
| `ПеречислениеСсылка.Xxx` | `EnumRef.Xxx` |
|
| `ПеречислениеСсылка.Xxx` | `EnumRef.Xxx` |
|
||||||
|
|||||||
@@ -7,6 +7,8 @@
|
|||||||
"attributes": [
|
"attributes": [
|
||||||
"ИНН: String(12)",
|
"ИНН: String(12)",
|
||||||
"ДатаРегистрации: Date",
|
"ДатаРегистрации: Date",
|
||||||
|
"ВремяПриема: Time",
|
||||||
|
"МоментСоздания: DateTime",
|
||||||
"Активен: Boolean",
|
"Активен: Boolean",
|
||||||
"СуммаДоговора: Number(15,2)",
|
"СуммаДоговора: Number(15,2)",
|
||||||
"Ответственный: CatalogRef.ФизическиеЛица",
|
"Ответственный: CatalogRef.ФизическиеЛица",
|
||||||
|
|||||||
+91
-5
@@ -175,6 +175,92 @@
|
|||||||
</Properties>
|
</Properties>
|
||||||
</Attribute>
|
</Attribute>
|
||||||
<Attribute uuid="UUID-014">
|
<Attribute uuid="UUID-014">
|
||||||
|
<Properties>
|
||||||
|
<Name>ВремяПриема</Name>
|
||||||
|
<Synonym>
|
||||||
|
<v8:item>
|
||||||
|
<v8:lang>ru</v8:lang>
|
||||||
|
<v8:content>Время приема</v8:content>
|
||||||
|
</v8:item>
|
||||||
|
</Synonym>
|
||||||
|
<Comment/>
|
||||||
|
<Type>
|
||||||
|
<v8:Type>xs:dateTime</v8:Type>
|
||||||
|
<v8:DateQualifiers>
|
||||||
|
<v8:DateFractions>Time</v8:DateFractions>
|
||||||
|
</v8:DateQualifiers>
|
||||||
|
</Type>
|
||||||
|
<PasswordMode>false</PasswordMode>
|
||||||
|
<Format/>
|
||||||
|
<EditFormat/>
|
||||||
|
<ToolTip/>
|
||||||
|
<MarkNegatives>false</MarkNegatives>
|
||||||
|
<Mask/>
|
||||||
|
<MultiLine>false</MultiLine>
|
||||||
|
<ExtendedEdit>false</ExtendedEdit>
|
||||||
|
<MinValue xsi:nil="true"/>
|
||||||
|
<MaxValue xsi:nil="true"/>
|
||||||
|
<FillFromFillingValue>false</FillFromFillingValue>
|
||||||
|
<FillValue xsi:nil="true"/>
|
||||||
|
<FillChecking>DontCheck</FillChecking>
|
||||||
|
<ChoiceFoldersAndItems>Items</ChoiceFoldersAndItems>
|
||||||
|
<ChoiceParameterLinks/>
|
||||||
|
<ChoiceParameters/>
|
||||||
|
<QuickChoice>Auto</QuickChoice>
|
||||||
|
<CreateOnInput>Auto</CreateOnInput>
|
||||||
|
<ChoiceForm/>
|
||||||
|
<LinkByType/>
|
||||||
|
<ChoiceHistoryOnInput>Auto</ChoiceHistoryOnInput>
|
||||||
|
<Use>ForItem</Use>
|
||||||
|
<Indexing>DontIndex</Indexing>
|
||||||
|
<FullTextSearch>Use</FullTextSearch>
|
||||||
|
<DataHistory>Use</DataHistory>
|
||||||
|
</Properties>
|
||||||
|
</Attribute>
|
||||||
|
<Attribute uuid="UUID-015">
|
||||||
|
<Properties>
|
||||||
|
<Name>МоментСоздания</Name>
|
||||||
|
<Synonym>
|
||||||
|
<v8:item>
|
||||||
|
<v8:lang>ru</v8:lang>
|
||||||
|
<v8:content>Момент создания</v8:content>
|
||||||
|
</v8:item>
|
||||||
|
</Synonym>
|
||||||
|
<Comment/>
|
||||||
|
<Type>
|
||||||
|
<v8:Type>xs:dateTime</v8:Type>
|
||||||
|
<v8:DateQualifiers>
|
||||||
|
<v8:DateFractions>DateTime</v8:DateFractions>
|
||||||
|
</v8:DateQualifiers>
|
||||||
|
</Type>
|
||||||
|
<PasswordMode>false</PasswordMode>
|
||||||
|
<Format/>
|
||||||
|
<EditFormat/>
|
||||||
|
<ToolTip/>
|
||||||
|
<MarkNegatives>false</MarkNegatives>
|
||||||
|
<Mask/>
|
||||||
|
<MultiLine>false</MultiLine>
|
||||||
|
<ExtendedEdit>false</ExtendedEdit>
|
||||||
|
<MinValue xsi:nil="true"/>
|
||||||
|
<MaxValue xsi:nil="true"/>
|
||||||
|
<FillFromFillingValue>false</FillFromFillingValue>
|
||||||
|
<FillValue xsi:nil="true"/>
|
||||||
|
<FillChecking>DontCheck</FillChecking>
|
||||||
|
<ChoiceFoldersAndItems>Items</ChoiceFoldersAndItems>
|
||||||
|
<ChoiceParameterLinks/>
|
||||||
|
<ChoiceParameters/>
|
||||||
|
<QuickChoice>Auto</QuickChoice>
|
||||||
|
<CreateOnInput>Auto</CreateOnInput>
|
||||||
|
<ChoiceForm/>
|
||||||
|
<LinkByType/>
|
||||||
|
<ChoiceHistoryOnInput>Auto</ChoiceHistoryOnInput>
|
||||||
|
<Use>ForItem</Use>
|
||||||
|
<Indexing>DontIndex</Indexing>
|
||||||
|
<FullTextSearch>Use</FullTextSearch>
|
||||||
|
<DataHistory>Use</DataHistory>
|
||||||
|
</Properties>
|
||||||
|
</Attribute>
|
||||||
|
<Attribute uuid="UUID-016">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Name>Активен</Name>
|
<Name>Активен</Name>
|
||||||
<Synonym>
|
<Synonym>
|
||||||
@@ -214,7 +300,7 @@
|
|||||||
<DataHistory>Use</DataHistory>
|
<DataHistory>Use</DataHistory>
|
||||||
</Properties>
|
</Properties>
|
||||||
</Attribute>
|
</Attribute>
|
||||||
<Attribute uuid="UUID-015">
|
<Attribute uuid="UUID-017">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Name>СуммаДоговора</Name>
|
<Name>СуммаДоговора</Name>
|
||||||
<Synonym>
|
<Synonym>
|
||||||
@@ -259,7 +345,7 @@
|
|||||||
<DataHistory>Use</DataHistory>
|
<DataHistory>Use</DataHistory>
|
||||||
</Properties>
|
</Properties>
|
||||||
</Attribute>
|
</Attribute>
|
||||||
<Attribute uuid="UUID-016">
|
<Attribute uuid="UUID-018">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Name>Ответственный</Name>
|
<Name>Ответственный</Name>
|
||||||
<Synonym>
|
<Synonym>
|
||||||
@@ -299,7 +385,7 @@
|
|||||||
<DataHistory>Use</DataHistory>
|
<DataHistory>Use</DataHistory>
|
||||||
</Properties>
|
</Properties>
|
||||||
</Attribute>
|
</Attribute>
|
||||||
<Attribute uuid="UUID-017">
|
<Attribute uuid="UUID-019">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Name>Статус</Name>
|
<Name>Статус</Name>
|
||||||
<Synonym>
|
<Synonym>
|
||||||
@@ -339,7 +425,7 @@
|
|||||||
<DataHistory>Use</DataHistory>
|
<DataHistory>Use</DataHistory>
|
||||||
</Properties>
|
</Properties>
|
||||||
</Attribute>
|
</Attribute>
|
||||||
<Attribute uuid="UUID-018">
|
<Attribute uuid="UUID-020">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Name>Вложение</Name>
|
<Name>Вложение</Name>
|
||||||
<Synonym>
|
<Synonym>
|
||||||
@@ -379,7 +465,7 @@
|
|||||||
<DataHistory>Use</DataHistory>
|
<DataHistory>Use</DataHistory>
|
||||||
</Properties>
|
</Properties>
|
||||||
</Attribute>
|
</Attribute>
|
||||||
<Attribute uuid="UUID-019">
|
<Attribute uuid="UUID-021">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Name>Идентификатор</Name>
|
<Name>Идентификатор</Name>
|
||||||
<Synonym>
|
<Synonym>
|
||||||
|
|||||||
Reference in New Issue
Block a user