Skip to content

Instantly share code, notes, and snippets.

@stdray
Created March 26, 2015 22:18
Show Gist options
  • Select an option

  • Save stdray/2091cfb97c294fea0ac3 to your computer and use it in GitHub Desktop.

Select an option

Save stdray/2091cfb97c294fea0ac3 to your computer and use it in GitHub Desktop.
#region Notifications
[Overloads(src, zfcs_notificationEFType
, zfcs_notificationEPType
, zfcs_notificationISMType
, zfcs_notificationISOType
, zfcs_notificationOKDType
, zfcs_notificationOKOUType
, zfcs_notificationOKType
, zfcs_notificationPOType
, zfcs_notificationZakAType
, zfcs_notificationZakKDType
, zfcs_notificationZakKOUType
, zfcs_notificationZakKType
, zfcs_notificationZKBIType
, zfcs_notificationZKType
, zfcs_notificationZPType)]
public notificationBase(src: zfcs_notificationEPType) : TenderType
{
entity() <-
{
Attachments =
from attach in src.attachments
select attachment(attach);
IdentityInfo <-
{
TenderIdentity = src.purchaseNumber;
}
MainInfo <-
{
DirectDeal = nullable(TenderTypeMainInfoDirectDeal.Demand);
Name = src.purchaseObjectInfo;
PlacingWay <-
{
Code = src.placingWay.code;
Name = src.placingWay.name;
}
PurchaseType = nullable(TenderTypeMainInfoPurchaseType.OOS_44);
}
PublishInfo <-
{
Date = date(src.docPublishDate);
ModificationInfo = src.modification?.info; //todo: нужен ли какой-то более сложный тип для ModificationInfo?
Url = src.href;
}
StateInfo <-
{
State = TenderTypeStateInfoState.Published;
StatePublishDate = date(src.docPublishDate);
}
}
}
[Overloads(src, zfcs_notificationEFType
, zfcs_notificationEPType
, zfcs_notificationOKDType
, zfcs_notificationOKOUType
, zfcs_notificationOKType
, zfcs_notificationPOType
, zfcs_notificationZakAType
, zfcs_notificationZakKDType
, zfcs_notificationZakKOUType
, zfcs_notificationZakKType
, zfcs_notificationZKType
, zfcs_notificationZPType)]
public notificationBaseWithTwoOrgs(src : zfcs_notificationEFType) : TenderType
{
notificationBase(src) <-
{
def resp = src.purchaseResponsible;
def respOrg = person(resp.responsibleOrg, collection resp.responsibleInfo);
def specOrg = person(resp.specializedOrg, null);
Organizers = collection { respOrg; specOrg }
OrganizersExtendedRoles = collection { extendedRole(respOrg, resp.responsibleRole); extendedRole(specOrg, null) }
}
}
[Overloads(src, zfcs_notificationISMType
, zfcs_notificationISOType
, zfcs_notificationZKBIType)]
public notificationBaseWithOneOrg(src : zfcs_notificationISOType) : TenderType
{
notificationBase(src) <-
{
def resp = src.purchaseResponsible;
def respOrg = person(resp.responsibleOrg, null);
Organizers = collection respOrg;
OrganizersExtendedRoles = collection extendedRole(respOrg, resp.responsibleRole);
}
}
public zfcs_notificationEFType(src : zfcs_notificationEFType) : TenderType
{
notificationBaseWithTwoOrgs(src) <<-
{
MainInfo <-
{
ElectronicTradePlace <-
{
Code = src.ETP?.code;
Name = src.ETP?.name;
Url = src.ETP?.url;
}
}
}
}
public zfcs_notificationEPType(src : zfcs_notificationEPType) : TenderType
{
notificationBaseWithTwoOrgs(src)
}
public zfcs_notificationISMType(src : zfcs_notificationISMType) : TenderType
{
notificationBaseWithOneOrg(src)
}
public zfcs_notificationISOType(src : zfcs_notificationISOType) : TenderType
{
notificationBaseWithOneOrg(src)
}
public zfcs_notificationOKDType(src : zfcs_notificationOKDType) : TenderType
{
notificationBaseWithTwoOrgs(src);
}
public zfcs_notificationOKOUType(src : zfcs_notificationOKOUType) : TenderType
{
notificationBaseWithTwoOrgs(src)
}
public zfcs_notificationOKType(src : zfcs_notificationOKType) : TenderType
{
notificationBaseWithTwoOrgs(src)
}
public zfcs_notificationPOType(src : zfcs_notificationPOType) : TenderType
{
notificationBaseWithTwoOrgs(src)
}
public zfcs_notificationZakAType(src : zfcs_notificationZakAType) : TenderType
{
notificationBaseWithTwoOrgs(src)
}
public zfcs_notificationZakKDType(src : zfcs_notificationZakKDType) : TenderType
{
notificationBaseWithTwoOrgs(src)
}
public zfcs_notificationZakKOUType(src : zfcs_notificationZakKOUType) : TenderType
{
notificationBaseWithTwoOrgs(src)
}
public zfcs_notificationZakKType(src : zfcs_notificationZakKType) : TenderType
{
notificationBaseWithTwoOrgs(src)
}
public zfcs_notificationZKBIType(src : zfcs_notificationZKBIType) : TenderType
{
notificationBaseWithOneOrg(src)
}
public zfcs_notificationZKType(src : zfcs_notificationZKType) : TenderType
{
notificationBaseWithTwoOrgs(src)
}
public zfcs_notificationZPType(src : zfcs_notificationZPType) : TenderType
{
notificationBaseWithTwoOrgs(src)
}
#endregion
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment