Modifications for updating business and private contacts

This commit is contained in:
Sergei Tsõganov 2022-03-29 10:39:26 +03:00
parent 4afd32ebff
commit eb64b3aca4
10 changed files with 159 additions and 163 deletions

View file

@ -1,10 +0,0 @@
builder.extension do
builder.tag!('changePoll:changeData',
'xmlns:changePoll' => Xsd::Schema.filename(for_prefix: 'changePoll', for_version: '1.0')) do
builder.tag!('changePoll:operation', action.operation)
builder.tag!('changePoll:date', action.created_at.utc.xmlschema)
builder.tag!('changePoll:svTRID', action.id)
builder.tag!('changePoll:who', action.user)
builder.tag!('changePoll:reason', 'Auto-update according to official data') if action.bulk_action?
end
end

View file

@ -0,0 +1,18 @@
builder.extension do
builder.tag!('changePoll:changeData',
'xmlns:changePoll' => Xsd::Schema.filename(for_prefix: 'changePoll',
for_version: '1.0')) do
case type
when 'action'
builder.tag!('changePoll:operation', obj.operation)
builder.tag!('changePoll:date', obj.created_at.utc.xmlschema)
builder.tag!('changePoll:svTRID', obj.id)
builder.tag!('changePoll:who', obj.user)
if obj.bulk_action?
builder.tag!('changePoll:reason', 'Auto-update according to official data')
end
when 'state'
builder.tag!('changePoll:operation', obj)
end
end
end

View file

@ -29,18 +29,15 @@ xml.epp_head do
if @notification.action || @notification.registry_lock?
if @notification.registry_lock?
state = @notification.text.include?('unlocked') ? 'unlock' : 'lock'
xml.extension do
xml.tag!('changePoll:changeData',
'xmlns:changePoll': Xsd::Schema.filename(for_prefix: 'changePoll')) do
xml.tag!('changePoll:operation', state)
end
end
render(partial: 'epp/poll/extension',
locals: { builder: xml,
obj: state,
type: 'state' })
else
render(partial: 'epp/poll/action',
locals: {
builder: xml,
action: @notification.action,
})
render(partial: 'epp/poll/extension',
locals: { builder: xml,
obj: @notification.action,
type: 'action' })
end
end